diff --git a/app/assets/javascripts/tinymce/plugins/uploadimage/plugin.js b/app/assets/javascripts/tinymce/plugins/uploadimage/plugin.js index 860c63d..d816d5a 100644 --- a/app/assets/javascripts/tinymce/plugins/uploadimage/plugin.js +++ b/app/assets/javascripts/tinymce/plugins/uploadimage/plugin.js @@ -4,22 +4,22 @@ tinymce.create('tinymce.plugins.UploadImage', { UploadImage: function(ed, url) { var form, - iframe, - win, - throbber, - selected_class = '', - editor = ed; + iframe, + win, + throbber, + selectedClass = '', + editor = ed; function showDialog() { var classList = getClassList(); var body = [ - {type: 'iframe', url: 'javascript:void(0)'}, - {type: 'textbox', name: 'file', label: ed.translate('Choose an image'), subtype: 'file'}, - {type: 'textbox', name: 'alt', label: ed.translate('Image description')} + { type: 'iframe', url: 'javascript:void(0)' }, + { type: 'textbox', name: 'file', label: ed.translate('Choose an image'), subtype: 'file' }, + { type: 'textbox', name: 'alt', label: ed.translate('Image description') } ]; if (classList.length > 0) { - selected_class = classList[0].value; + selectedClass = classList[0].value; body = body.concat([ { type: 'listbox', @@ -27,47 +27,50 @@ label: ed.translate('Class'), values: classList, onSelect: function(e) { - selected_class = this.value(); + selectedClass = this.value(); } } ]); } body = body.concat([ - {type: 'container', classes: 'error', html: "
"}, + { type: 'container', classes: 'error', html: "
" }, // Trick TinyMCE to add a empty div that "preloads" the throbber image - {type: 'container', classes: 'throbber'} + { type: 'container', classes: 'throbber' } ]); - win = editor.windowManager.open({ - title: ed.translate('Insert an image from your computer'), - width: 520 + parseInt(editor.getLang('uploadimage.delta_width', 0), 10), - height: 180 + parseInt(editor.getLang('uploadimage.delta_height', 0), 10), - body: body, - buttons: [ - { - text: ed.translate('Insert'), - onclick: insertImage, - subtype: 'primary' - }, - { - text: ed.translate('Cancel'), - onclick: ed.windowManager.close - } - ], - }, { - plugin_url: url - }); + win = editor.windowManager.open( + { + title: ed.translate('Insert an image from your computer'), + width: 520 + parseInt(editor.getLang('uploadimage.delta_width', 0), 10), + height: 180 + parseInt(editor.getLang('uploadimage.delta_height', 0), 10), + body: body, + buttons: [ + { + text: ed.translate('Insert'), + onclick: insertImage, + subtype: 'primary' + }, + { + text: ed.translate('Cancel'), + onclick: ed.windowManager.close + } + ] + }, + { + plugin_url: url + } + ); /* WHY DO YOU HATE