diff --git a/.gitignore b/.gitignore index d6a0269..2685fea 100644 --- a/.gitignore +++ b/.gitignore @@ -72,6 +72,7 @@ brakeman.html /app/assets/stylesheets/email-example/* /app/assets/stylesheets/translations/* /app/assets/stylesheets/web-fonts/* +/app/assets/stylesheets/translations/* # Ignore test artifacts /config/locales/data/html_records/* diff --git a/Gemfile b/Gemfile index 60aeb12..db27375 100644 --- a/Gemfile +++ b/Gemfile @@ -13,14 +13,8 @@ else gem 'lingua_franca', :git => 'git://github.com/lingua-franca/lingua_franca.git' end -#if Dir.exists?('../lingua_franca_commit_and_deploy') -# gem 'lingua_franca_commit_and_deploy', :path => '../lingua_franca_commit_and_deploy' -#else -# gem 'lingua_franca_commit_and_deploy', :git => 'git://github.com/lingua-franca/lingua_franca_commit_and_deploy.git' -#end - gem 'tzinfo-data' -gem 'sass'#, '~> 3.4.13' +gem 'sass' gem 'sass-rails' if Dir.exists?('../bumbleberry') diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee deleted file mode 100644 index 8dc28be..0000000 --- a/app/assets/javascripts/application.js.coffee +++ /dev/null @@ -1,217 +0,0 @@ -#= require froala_editor.min.js - -# I18n - -'use strict' - -startSpinner = -> - $('#loading-spinner').show() - -stopSpinner = -> - $('#loading-spinner').fadeOut() - -# Turbolinks Spinner -document.addEventListener 'page:fetch', startSpinner -document.addEventListener 'page:receive', stopSpinner - -readURL = (input) -> - reader = null - if input.files && input.files[0] - reader = new FileReader() - reader.readAsDataURL input.files[0] - reader.onload = (e) -> - $(input).prev().attr('src', e.target.result) - -createOverlay = () -> - if $('#overlay').length > 0 - $('#overlay').remove() - $('body').append('
') - $('#overlay-dlg') - -setOverlayHTML = (html) -> - $('#overlay-inner').append('
' + html + '
'); - $('#overlay').removeAttr('class').click(destroyOverlay) - -destroyOverlay = () -> - $('#overlay').remove() - -selectA = (type, event, $emptyObj) -> - event.preventDefault() - # = $(this) - $overlay = createOverlay() - objs = [] - $('.' + type + '-select-field.added input.' + type + '-id').each () -> obj.push($(this).val()) - $.post window.location.href.replace(/^(.*\/)(.+?)$/, '$1non$2'), {added: objs}, - (html) -> - setOverlayHTML(html).addClass('' + type + '-select') - $('#select-' + type + '-list a').click (event) -> - event.preventDefault() - - $this = $(this) - $old_field = $emptyObj.closest('.field') - $field = $old_field.clone() - - oldID = parseInt($old_field.find('input[type="hidden"]').attr('name').match(/\[(\d+)\]\[id\]/)[1]) - newID = oldID + 1 - - $field.find('input.' + type + '-id').val($this.data().id) - $field.find('.' + type + 'name').html($this.find('.' + type + 'name').html()).before('') - $field.find('.select-' + type + '').remove() - $field.removeClass('new').addClass('added') - $old_field.html (i, html) -> - pregex = new RegExp('\\[' + oldID + '\\]', 'g'); - aregex = new RegExp('_' + oldID + '_', 'g'); - html.replace(pregex, '[' + newID + ']').replace(aregex, '_' + newID + '_') - $field.insertBefore($old_field) - $('a.select-' + type + '').click (event) -> selectA(type, event, $(this)) - - destroyOverlay() - return - , 'html' - -updateFormField = () -> - $form = $('form#new_registration_form_field') - $field_type = $form.find('#registration_form_field_field_type') - field_type = $field_type.val() - $form.find('.registration-form-field-field').hide() - $form.find('.registration-form-field-field.field-type-' + field_type).show() - -updateFormFieldForm = () -> - $('form #registration_form_field_field_type').change updateFormField - updateFormField() - $('form#new_registration_form_field').submit (event) -> - event.preventDefault() - $form = $(this) - serialized = $form.serialize() - $.post $form.attr('action'), serialized, - (json) -> - $form.replaceWith(json.form) - $('#registration-form-field-list').html(json.list) - updateFormFieldForm() - , 'json' -updateFormFieldList = () -> - $('#registration-form-field-list .add-form-field').click () -> - $.post 'form/add-field', {field: $(this).data().id}, - (json) -> - $('#conference-form').html(json.form) - $('#registration-form-field-list').html(json.list) - updateFormFieldList() - return - $('#conference-form .remove-form-field').click () -> - $.post 'form/remove-field', {field: $(this).data().id}, - (json) -> - $('#conference-form').html(json.form) - $('#registration-form-field-list').html(json.list) - updateFormFieldList() - return - -saveTranslation = ($td, $move_to, auto_translate) -> - val = '' - do_auto_translate = true - if typeof auto_translate == "undefined" || !auto_translate - val = $td.find('textarea').val() - do_auto_translate = false - key = $td.parent().data().key - params = {translationkey: key, translationvalue: val, translationlang: window.location.href.replace(/^.*\/(\w+)\/$/, '$1')} - if do_auto_translate - params['auto_translate'] = true - $.post '/translate/', params, - (json) -> - #console.log json - $td.html(json.translation) - if $td.parent().hasClass('not-exists') - $td.parent().removeClass('not-exists') - $td.parent().addClass('exists') - $('.translation-form').remove() - if typeof $move_to != "undefined" && $move_to - startTranslating $move_to - return - return - -stopTranslating = () -> $('.translation-form').remove() - -startTranslating = ($td) -> - stopTranslating() - value = if $td.parent().hasClass('not-exists') then '' else $td.html().trim() - $tr = $td.parent() - key = $tr.data().key - $td.append('