diff --git a/modules/backend/formwidgets/richeditor/assets/js/build-min.js b/modules/backend/formwidgets/richeditor/assets/js/build-min.js index 10ee18bdd..608177556 100755 --- a/modules/backend/formwidgets/richeditor/assets/js/build-min.js +++ b/modules/backend/formwidgets/richeditor/assets/js/build-min.js @@ -11,31 +11,31 @@ editor.$win.trigger('scroll');} function toggle(){if(!isActive()){_on();} else{_off();} refresh(editor.$tb.find('.fr-command[data-cmd="fullscreen"]'));$(window).trigger('oc.updateUi')} -function refresh($btn){var active=isActive();$btn.toggleClass('fr-active',active);$btn.find('i').toggleClass('fa-expand',!active).toggleClass('fa-compress',active);} +function refresh($btn){var active=isActive();$btn.toggleClass('fr-active',active);$btn.find('> *').replaceWith(!active?editor.icon.create('fullscreen'):editor.icon.create('fullscreenCompress'));} function _init(){if(!editor.$wp)return false;editor.events.$on($(editor.o_win),'resize',function(){if(isActive()){_off();_on();}});editor.events.on('toolbar.hide',function(){if(isActive()&&editor.helpers.isMobile())return false;})} return{_init:_init,toggle:toggle,refresh:refresh,isActive:isActive}} $.FE.RegisterCommand('fullscreen',{title:'Fullscreen',undo:false,focus:false,forcedRefresh:true,callback:function(){this.fullscreen.toggle();},refresh:function($btn){this.fullscreen.refresh($btn);},plugin:'fullscreen'}) -$.FE.DefineIcon('fullscreen',{NAME:'expand'});}));(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof module==='object'&&module.exports){module.exports=function(root,jQuery){if(jQuery===undefined){if(typeof window!=='undefined'){jQuery=require('jquery');} +$.FE.DefineIcon('fullscreen',{NAME:'expand'});$.FE.DefineIcon('fullscreenCompress',{NAME:'compress'});}));(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof module==='object'&&module.exports){module.exports=function(root,jQuery){if(jQuery===undefined){if(typeof window!=='undefined'){jQuery=require('jquery');} else{jQuery=require('jquery')(root);}} factory(jQuery);return jQuery;};}else{factory(jQuery);}}(function($){'use strict';$.extend($.FE.DEFAULTS,{aceEditor:true,aceEditorOptions:{showLineNumbers:true,useSoftTabs:false,wrap:true,mode:'ace/mode/html',tabSize:2},codeBeautifierOptions:{end_with_newline:true,indent_inner_html:true,extra_liners:['p','h1','h2','h3','h4','h5','h6','blockquote','pre','ul','ol','table','dl'],brace_style:'expand',indent_char:'\t',indent_size:1,wrap_line_length:0}}) $.FE.PLUGINS.codeView=function(editor){var $html_area;var ace_editor;function isActive(){return editor.$box.hasClass('fr-code-view');} function get(){if(ace_editor){return ace_editor.getValue();}else{return $html_area.val();}} function _showText($btn){var html=get();editor.html.set(html);editor.$el.blur();editor.$tb.find(' > .fr-command').not($btn).removeClass('fr-disabled');$btn.removeClass('fr-active');editor.events.focus(true);editor.placeholder.refresh();editor.undo.saveStep();} -function _showHTML($btn,height){if(!$html_area)_initArea();if(!ace_editor&&editor.opts.aceEditor&&typeof ace!='undefined'){ace_editor=ace.edit($html_area.get(0));ace_editor.setOptions(editor.opts.aceEditorOptions);} -editor.undo.saveStep();editor.html.cleanEmptyTags();editor.html.cleanWhiteTags(true);if(editor.core.hasFocus()){if(!editor.core.isEmpty()){editor.selection.save();editor.$el.find('.fr-marker[data-type="true"]:first').replaceWith('F');editor.$el.find('.fr-marker[data-type="false"]:last').replaceWith('F');} -editor.$el.blur();} -var html=editor.html.get(false,true);editor.$el.find('span.fr-tmp').remove();html=html.replace(/F<\/span>/,'FROALA-SM');html=html.replace(/F<\/span>/,'FROALA-EM');if(editor.codeBeautifier){html=editor.codeBeautifier.run(html,editor.opts.codeBeautifierOptions);} +function _showHTML($btn){if(!$html_area)_initArea();if(!ace_editor&&editor.opts.aceEditor&&typeof ace!='undefined'){ace_editor=ace.edit($html_area.get(0));ace_editor.setOptions(editor.opts.aceEditorOptions);} +editor.undo.saveStep();editor.html.cleanEmptyTags();editor.html.cleanWhiteTags(true);if(editor.core.hasFocus()){if(!editor.core.isEmpty()){editor.selection.save();editor.$el.find('.fr-marker[data-type="true"]:first').replaceWith('F');editor.$el.find('.fr-marker[data-type="false"]:last').replaceWith('F');}} +var html=editor.html.get(false,true);editor.$el.find('span.fr-tmp').remove();if(editor.core.hasFocus())editor.$el.blur();html=html.replace(/F<\/span>/,'FROALA-SM');html=html.replace(/F<\/span>/,'FROALA-EM');if(editor.codeBeautifier){html=editor.codeBeautifier.run(html,editor.opts.codeBeautifierOptions);} var s_index;var e_index;if(ace_editor){s_index=html.indexOf('FROALA-SM');e_index=html.indexOf('FROALA-EM');if(s_index>e_index){s_index=e_index;} else{e_index=e_index-9;} html=html.replace(/FROALA-SM/g,'').replace(/FROALA-EM/g,'') var s_line=html.substring(0,s_index).length-html.substring(0,s_index).replace(/\n/g,'').length;var e_line=html.substring(0,e_index).length-html.substring(0,e_index).replace(/\n/g,'').length;s_index=html.substring(0,s_index).length-html.substring(0,html.substring(0,s_index).lastIndexOf('\n')+1).length;e_index=html.substring(0,e_index).length-html.substring(0,html.substring(0,e_index).lastIndexOf('\n')+1).length;ace_editor.$blockScrolling=Infinity ace_editor.getSession().setValue(html);ace_editor.focus();ace_editor.selection.moveCursorToPosition({row:s_line,column:s_index});ace_editor.selection.selectToPosition({row:e_line,column:e_index});ace_editor.resize();ace_editor.session.getUndoManager().reset();} -else{s_index=html.indexOf('FROALA-SM');e_index=html.indexOf('FROALA-EM')-9;$html_area.css('height',height);if(editor.opts.height||editor.opts.heightMax){$html_area.css('max-height',editor.opts.height||editor.opts.heightMax);} +else{s_index=html.indexOf('FROALA-SM');e_index=html.indexOf('FROALA-EM')-9;if(editor.opts.heightMin){$html_area.css('min-height',editor.opts.heightMin);} +if(editor.opts.height||editor.opts.heightMax){$html_area.css('max-height',editor.opts.height||editor.opts.heightMax);} $html_area.val(html.replace(/FROALA-SM/g,'').replace(/FROALA-EM/g,''));$html_area.focus();$html_area.get(0).setSelectionRange(s_index,e_index);} editor.$tb.find(' > .fr-command').not($btn).addClass('fr-disabled');$btn.addClass('fr-active');if(!editor.helpers.isMobile()&&editor.opts.toolbarInline){editor.toolbar.hide();}} -function toggle(val){if(typeof val=='undefined')val=!isActive();var $btn=editor.$tb.find('.fr-command[data-cmd="html"]');if(!val){editor.$box.toggleClass('fr-code-view',false);_showText($btn);}else{editor.popups.hideAll();var height=editor.$wp.outerHeight();editor.$box.toggleClass('fr-code-view',true);_showHTML($btn,height);}} -function _destroy(){if(isActive()){toggle(editor.$tb.find('button[data-cmd="html"]'));$html_area.val('').removeData().remove();} -if($back_button)$back_button.remove();} +function toggle(val){if(typeof val=='undefined')val=!isActive();var $btn=editor.$tb.find('.fr-command[data-cmd="html"]');if(!val){editor.$box.toggleClass('fr-code-view',false);_showText($btn);}else{editor.popups.hideAll();editor.$box.toggleClass('fr-code-view',true);_showHTML($btn);}} +function _destroy(){if(isActive()){toggle(editor.$tb.find('button[data-cmd="html"]'));} +$html_area.val('').removeData().remove();$html_area=null;if($back_button){$back_button.remove();$back_button=null;}} function _initArea(){$html_area=$('