소스 검색

Fix bug in ckeditor when used in mode readonly

Laurent Destailleur 1 년 전
부모
커밋
c920428d84
2개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 2
      dev/dolibarr_changes.txt
  2. 1 1
      htdocs/includes/ckeditor/ckeditor/ckeditor.js

+ 7 - 2
dev/dolibarr_changes.txt

@@ -18,7 +18,7 @@ With
 
 
 
-CKEDITOR (4.6.2):
+CKEDITOR (4.22.1):
 -----------------
 * In ckeditor/ckeditor/contents.css
 Replace:
@@ -26,7 +26,12 @@ Replace:
 With
 	body { ... margin: 5px;
 
-
+* In ckeditor/ckeditor/ckeditor.js
+Replace:
+    d.items&&
+With
+    d&&d.items&&
+    
 
 ESCPOS:
 -------

+ 1 - 1
htdocs/includes/ckeditor/ckeditor/ckeditor.js

@@ -736,7 +736,7 @@ m)):g+="off";m=this.name||this.command;var h=null,t=this.icon;n=m;this.icon&&!/\
 " "+k.aria:"",titleJs:q.gecko&&!q.hc?"":(this.title||"").replace("'",""),hasArrow:"string"===typeof this.hasArrow&&this.hasArrow||(this.hasArrow?"true":"false"),keydownFn:x,focusFn:y,clickFn:l,style:CKEDITOR.skin.getIconStyle(h,"rtl"==a.lang.dir,t,this.iconOffset),arrowHtml:this.hasArrow?v.output():"",hasArrowAriaHtml:this.hasArrow?' aria-expanded\x3d"false"':"",toggleAriaHtml:this.isToggle?'aria-pressed\x3d"false"':""};w.output(g,b);if(this.onRender)this.onRender();return e},setState:function(a){if(this._.state==
 a)return!1;this._.state=a;var b=CKEDITOR.document.getById(this._.id);return b?(b.setState(a,"cke_button"),b.setAttribute("aria-disabled",a==CKEDITOR.TRISTATE_DISABLED),this.isToggle&&!this.hasArrow&&b.setAttribute("aria-pressed",a===CKEDITOR.TRISTATE_ON),!0):!1},getState:function(){return this._.state},toFeature:function(a){if(this._.feature)return this._.feature;var b=this;this.allowedContent||this.requiredContent||!this.command||(b=a.getCommand(this.command)||b);return this._.feature=b}};CKEDITOR.ui.prototype.addButton=
 function(a,b){this.add(a,CKEDITOR.UI_BUTTON,b)}})();(function(){function D(b){function d(){for(var a=f(),e=CKEDITOR.tools.clone(b.config.toolbarGroups)||v(b),n=0;n<e.length;n++){var g=e[n];if("/"!=g){"string"==typeof g&&(g=e[n]={name:g});var l,d=g.groups;if(d)for(var h=0;h<d.length;h++)l=d[h],(l=a[l])&&c(g,l);(l=a[g.name])&&c(g,l)}}return e}function f(){var a={},c,e,g;for(c in b.ui.items)e=b.ui.items[c],g=e.toolbar||"others",g=g.split(","),e=g[0],g=parseInt(g[1]||-1,10),a[e]||(a[e]=[]),a[e].push({name:c,order:g});for(e in a)a[e]=a[e].sort(function(a,
-b){return a.order==b.order?0:0>b.order?-1:0>a.order?1:a.order<b.order?-1:1});return a}function c(c,e){if(e.length){c.items?c.items.push(b.ui.create("-")):c.items=[];for(var d;d=e.shift();)d="string"==typeof d?d:d.name,a&&-1!=CKEDITOR.tools.indexOf(a,d)||(d=b.ui.create(d))&&b.addFeature(d)&&c.items.push(d)}}function h(a){var b=[],e,d,h;for(e=0;e<a.length;++e)d=a[e],h={},"/"==d?b.push(d):CKEDITOR.tools.isArray(d)?(c(h,CKEDITOR.tools.clone(d)),b.push(h)):d.items&&(c(h,CKEDITOR.tools.clone(d.items)),
+b){return a.order==b.order?0:0>b.order?-1:0>a.order?1:a.order<b.order?-1:1});return a}function c(c,e){if(e.length){c.items?c.items.push(b.ui.create("-")):c.items=[];for(var d;d=e.shift();)d="string"==typeof d?d:d.name,a&&-1!=CKEDITOR.tools.indexOf(a,d)||(d=b.ui.create(d))&&b.addFeature(d)&&c.items.push(d)}}function h(a){var b=[],e,d,h;for(e=0;e<a.length;++e)d=a[e],h={},"/"==d?b.push(d):CKEDITOR.tools.isArray(d)?(c(h,CKEDITOR.tools.clone(d)),b.push(h)):d&&d.items&&(c(h,CKEDITOR.tools.clone(d.items)),
 h.name=d.name,b.push(h));return b}var a=function(a){return a&&"string"===typeof a?a.split(","):a}(b.config.removeButtons),e=b.config.toolbar;"string"==typeof e&&(e=b.config["toolbar_"+e]);return b.toolbar=e?h(e):d()}function v(b){return b._.toolbarGroups||(b._.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},
 {name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var z=function(){this.toolbars=[]};z.prototype.focus=function(){for(var b=0,d;d=this.toolbars[b++];)for(var f=0,c;c=d.items[f++];)if(c.focus){c.focus();return}};var E={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(b){b.toolbox&&(CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){b.toolbox.focus()},100):b.toolbox.focus())}};
 CKEDITOR.plugins.add("toolbar",{requires:"button",init:function(b){var d,f=function(c,h){var a,e="rtl"==b.lang.dir,k=b.config.toolbarGroupCycling,q=e?37:39,e=e?39:37,k=void 0===k||k;switch(h){case 9:case CKEDITOR.SHIFT+9:for(;!a||!a.items.length;)if(a=9==h?(a?a.next:c.toolbar.next)||b.toolbox.toolbars[0]:(a?a.previous:c.toolbar.previous)||b.toolbox.toolbars[b.toolbox.toolbars.length-1],a.items.length)for(c=a.items[d?a.items.length-1:0];c&&!c.focus;)(c=d?c.previous:c.next)||(a=0);c&&c.focus();return!1;