(js) Improve ckEditor directive

Fixes #3839
pull/225/head
Francis Lachapelle 2016-10-17 13:44:16 -04:00
parent 37089e15c1
commit aa124d3273
4 changed files with 8 additions and 4 deletions

1
NEWS
View File

@ -11,6 +11,7 @@ Bug fixes
- [web] respect SOGoSearchMinimumWordLength in contacts list editor
- [web] improved memory usage when importing very large address books
- [web] fixed progress indicator while importing cards or events and tasks
- [web] improved detection of changes in CKEditor (#3839)
- [core] only consider SMTP addresses for AD's proxyAddresses (#3842)

View File

@ -13,10 +13,10 @@
* (1) http://ckeditor.com/builder
* Visit online builder to build CKEditor from scratch.
*
* (2) http://ckeditor.com/builder/d1a53ec0e7a43d8268c53e7b86666b0e
* (2) http://ckeditor.com/builder/d97b6d42ea158d15ebe90da9451162c5
* Visit online builder to build CKEditor, starting with the same setup as before.
*
* (3) http://ckeditor.com/builder/download/d1a53ec0e7a43d8268c53e7b86666b0e
* (3) http://ckeditor.com/builder/download/d97b6d42ea158d15ebe90da9451162c5
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
*
* NOTE:
@ -77,6 +77,7 @@ var CKBUILDER_CONFIG = {
'listblock' : 1,
'menu' : 1,
'menubutton' : 1,
'onchange' : 1,
'panel' : 1,
'panelbutton' : 1,
'pastefromword' : 1,

View File

@ -60,7 +60,7 @@
}
ck = CKEDITOR.replace(elm[0], options);
ck.on('pasteState', function() {
ck.on('change', function() {
$scope.$apply(function() {
ngModel.$setViewValue(ck.getData());
});

View File

@ -975,4 +975,6 @@ e+a):a=c.docType+'\x3chtml dir\x3d"'+c.contentsLangDirection+'" lang\x3d"'+(c.co
c='\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"'+(CKEDITOR.env.ie?' defer\x3d"defer" ':"")+"\x3evar wasLoaded\x3d0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded\x3d1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"\x3c/script\x3e";CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(c+='\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');
h&&CKEDITOR.env.ie&&10>CKEDITOR.env.version&&(c+='\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');a=a.replace(/(?=\s*<\/(:?head)>)/,c);this.clearCustomData();this.clearListeners();b.fire("contentDomUnload");var k=this.getDocument();try{k.write(a)}catch(l){setTimeout(function(){k.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();a=this.editor;var f=a.config,b=f.fullPage,c=b&&a.docType,d=b&&a.xmlDeclaration,
e=this.getDocument(),b=b?e.getDocumentElement().getOuterHtml():e.getBody().getHtml();CKEDITOR.env.gecko&&f.enterMode!=CKEDITOR.ENTER_BR&&(b=b.replace(/<br>(?=\s*(:?$|<\/body>))/,""));b=a.dataProcessor.toDataFormat(b);d&&(b=d+"\n"+b);c&&(b=c+"\n"+b);return b},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:l.baseProto.focus.call(this)},detach:function(){var a=this.editor,f=a.document,b;try{b=a.window.getFrame()}catch(c){}l.baseProto.detach.call(this);this.clearCustomData();f.getDocumentElement().clearCustomData();
CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);b&&b.getParent()?(b.clearCustomData(),(a=b.removeCustomData("onResize"))&&a.removeListener(),b.remove()):CKEDITOR.warn("editor-destroy-iframe")}}})})();CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;CKEDITOR.config.plugins='dialogui,dialog,about,base64image,basicstyles,blockquote,button,clipboard,panelbutton,panel,floatpanel,colorbutton,colordialog,menu,contextmenu,div,enterkey,entities,fakeobjects,floatingspace,listblock,richcombo,font,format,image,indent,indentlist,justify,link,list,menubutton,pastefromword,pastetext,scayt,sourcearea,tab,table,tabletools,tableresize,toolbar,undo,wsc,wysiwygarea';CKEDITOR.config.skin='minimalist';(function() {var setIcons = function(icons, strip) {var path = CKEDITOR.getUrl( 'plugins/' + strip );icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ], bgsize : icons[ ++i ] };};if (CKEDITOR.env.hidpi) setIcons('about,0,,base64image,24,,bold,48,,italic,72,,strike,96,,subscript,120,,superscript,144,,underline,168,,blockquote,192,,copy-rtl,216,,copy,240,,cut-rtl,264,,cut,288,,paste-rtl,312,,paste,336,,bgcolor,360,,textcolor,384,,creatediv,408,,image,432,,indent-rtl,456,,indent,480,,outdent-rtl,504,,outdent,528,,justifyblock,552,,justifycenter,576,,justifyleft,600,,justifyright,624,,anchor-rtl,648,,anchor,672,,link,696,,unlink,720,,bulletedlist-rtl,744,,bulletedlist,768,,numberedlist-rtl,792,,numberedlist,816,,pastefromword-rtl,840,,pastefromword,864,,pastetext-rtl,888,,pastetext,912,,scayt,936,,source-rtl,960,,source,984,,table,1008,,redo-rtl,1032,,redo,1056,,undo-rtl,1080,,undo,1104,,spellchecker,1128,','icons_hidpi.png');else setIcons('about,0,auto,base64image,24,auto,bold,48,auto,italic,72,auto,strike,96,auto,subscript,120,auto,superscript,144,auto,underline,168,auto,blockquote,192,auto,copy-rtl,216,auto,copy,240,auto,cut-rtl,264,auto,cut,288,auto,paste-rtl,312,auto,paste,336,auto,bgcolor,360,auto,textcolor,384,auto,creatediv,408,auto,image,432,auto,indent-rtl,456,auto,indent,480,auto,outdent-rtl,504,auto,outdent,528,auto,justifyblock,552,auto,justifycenter,576,auto,justifyleft,600,auto,justifyright,624,auto,anchor-rtl,648,auto,anchor,672,auto,link,696,auto,unlink,720,auto,bulletedlist-rtl,744,auto,bulletedlist,768,auto,numberedlist-rtl,792,auto,numberedlist,816,auto,pastefromword-rtl,840,auto,pastefromword,864,auto,pastetext-rtl,888,auto,pastetext,912,auto,scayt,936,auto,source-rtl,960,auto,source,984,auto,table,1008,auto,redo-rtl,1032,auto,redo,1056,auto,undo-rtl,1080,auto,undo,1104,auto,spellchecker,1128,auto','icons.png');})();CKEDITOR.lang.languages={"ar":1,"ca":1,"cs":1,"sr":1,"cy":1,"da":1,"de":1,"en":1,"es":1,"eu":1,"fi":1,"fr":1,"hr":1,"hu":1,"is":1,"it":1,"lt":1,"mk":1,"nb":1,"nl":1,"no":1,"pl":1,"pt":1,"pt-br":1,"ru":1,"sk":1,"sl":1,"sv":1,"tr":1,"uk":1,"zh":1,"zh-cn":1};}());
CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);b&&b.getParent()?(b.clearCustomData(),(a=b.removeCustomData("onResize"))&&a.removeListener(),b.remove()):CKEDITOR.warn("editor-destroy-iframe")}}})})();CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;CKEDITOR.plugins.add("onchange",{init:function(a){function b(){a.readOnly||d||(d=setTimeout(function(){d=0;a.fire("change")},a.config.minimumChangeMilliseconds||100))}var d,g=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,f;a.on("destroy",function(){d&&clearTimeout(d);d=null});a.on("saveSnapshot",function(a){(!a.data||!a.data.contentOnly)&&b()});var e=a.getCommand("undo");e&&e.on("afterUndo",b);(e=a.getCommand("redo"))&&e.on("afterRedo",b);a.on("afterCommandExec",
function(a){"source"!=a.data.name&&!1!==a.data.command.canUndo&&b()});g&&(f=new g(function(){b()}),window.console&&window.console.log&&console.log("Detecting changes using MutationObservers"));a.on("contentDom",function(){if(f)var c=setInterval(function(){if(typeof a.document==="object"){f.observe(a.document.getBody().$,{attributes:true,childList:true,characterData:true});clearInterval(c)}},100);a.document.on("keydown",function(a){if(!a.data.$.ctrlKey&&!a.data.$.metaKey){a=a.data.$.keyCode;(a==8||
a==13||a==32||a>=46&&a<=90||a>=96&&a<=111||a>=186&&a<=222||a==229)&&b()}});a.document.on("drop",b);a.document.getBody().on("drop",b)});a.on("mode",function(){if(a.mode=="source"){var c=a.textarea||a._.editable;c.on("keydown",function(a){!a.data.$.ctrlKey&&!a.data.$.metaKey&&b()});c.on("drop",b);c.on("input",b);if(CKEDITOR.env.ie){c.on("cut",b);c.on("paste",b)}}})}});CKEDITOR.config.plugins='dialogui,dialog,about,base64image,basicstyles,blockquote,button,clipboard,panelbutton,panel,floatpanel,colorbutton,colordialog,menu,contextmenu,div,enterkey,entities,fakeobjects,floatingspace,listblock,richcombo,font,format,image,indent,indentlist,justify,link,list,menubutton,pastefromword,pastetext,scayt,sourcearea,tab,table,tabletools,tableresize,toolbar,undo,wsc,wysiwygarea,onchange';CKEDITOR.config.skin='minimalist';(function() {var setIcons = function(icons, strip) {var path = CKEDITOR.getUrl( 'plugins/' + strip );icons = icons.split( ',' );for ( var i = 0; i < icons.length; i++ )CKEDITOR.skin.icons[ icons[ i ] ] = { path: path, offset: -icons[ ++i ], bgsize : icons[ ++i ] };};if (CKEDITOR.env.hidpi) setIcons('about,0,,base64image,24,,bold,48,,italic,72,,strike,96,,subscript,120,,superscript,144,,underline,168,,blockquote,192,,copy-rtl,216,,copy,240,,cut-rtl,264,,cut,288,,paste-rtl,312,,paste,336,,bgcolor,360,,textcolor,384,,creatediv,408,,image,432,,indent-rtl,456,,indent,480,,outdent-rtl,504,,outdent,528,,justifyblock,552,,justifycenter,576,,justifyleft,600,,justifyright,624,,anchor-rtl,648,,anchor,672,,link,696,,unlink,720,,bulletedlist-rtl,744,,bulletedlist,768,,numberedlist-rtl,792,,numberedlist,816,,pastefromword-rtl,840,,pastefromword,864,,pastetext-rtl,888,,pastetext,912,,scayt,936,,source-rtl,960,,source,984,,table,1008,,redo-rtl,1032,,redo,1056,,undo-rtl,1080,,undo,1104,,spellchecker,1128,','icons_hidpi.png');else setIcons('about,0,auto,base64image,24,auto,bold,48,auto,italic,72,auto,strike,96,auto,subscript,120,auto,superscript,144,auto,underline,168,auto,blockquote,192,auto,copy-rtl,216,auto,copy,240,auto,cut-rtl,264,auto,cut,288,auto,paste-rtl,312,auto,paste,336,auto,bgcolor,360,auto,textcolor,384,auto,creatediv,408,auto,image,432,auto,indent-rtl,456,auto,indent,480,auto,outdent-rtl,504,auto,outdent,528,auto,justifyblock,552,auto,justifycenter,576,auto,justifyleft,600,auto,justifyright,624,auto,anchor-rtl,648,auto,anchor,672,auto,link,696,auto,unlink,720,auto,bulletedlist-rtl,744,auto,bulletedlist,768,auto,numberedlist-rtl,792,auto,numberedlist,816,auto,pastefromword-rtl,840,auto,pastefromword,864,auto,pastetext-rtl,888,auto,pastetext,912,auto,scayt,936,auto,source-rtl,960,auto,source,984,auto,table,1008,auto,redo-rtl,1032,auto,redo,1056,auto,undo-rtl,1080,auto,undo,1104,auto,spellchecker,1128,auto','icons.png');})();CKEDITOR.lang.languages={"ar":1,"ca":1,"cs":1,"cy":1,"da":1,"de":1,"en":1,"es":1,"eu":1,"fi":1,"fr":1,"hr":1,"hu":1,"is":1,"it":1,"lt":1,"mk":1,"nb":1,"nl":1,"no":1,"pl":1,"pt":1,"pt-br":1,"ru":1,"sk":1,"sl":1,"sr":1,"sv":1,"tr":1,"uk":1,"zh":1,"zh-cn":1};}());