Importation du code de ckeditor 4.3.4 en conservant les développements Plinn et en...
[ckeditor.git] / skins / ckeditor / plugins / liststyle / dialogs / liststyle.js
index d3af418..2b130e7 100644 (file)
@@ -1,7 +1,10 @@
-/*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
-For licensing, see LICENSE.html or http://ckeditor.com/license\r
-*/\r
-\r
-(function(){function a(e,f){var g;try{g=e.getSelection().getRanges()[0];}catch(h){return null;}g.shrink(CKEDITOR.SHRINK_TEXT);return g.getCommonAncestor().getAscendant(f,1);};var b=function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.is('li');},c={a:'lower-alpha',A:'upper-alpha',i:'lower-roman',I:'upper-roman',1:'decimal',disc:'disc',circle:'circle',square:'square'};function d(e,f){var g=e.lang.list;if(f=='bulletedListStyle')return{title:g.bulletedTitle,minWidth:300,minHeight:50,contents:[{id:'info',accessKey:'I',elements:[{type:'select',label:g.type,id:'type',align:'center',style:'width:150px',items:[[g.notset,''],[g.circle,'circle'],[g.disc,'disc'],[g.square,'square']],setup:function(i){var j=i.getStyle('list-style-type')||c[i.getAttribute('type')]||i.getAttribute('type')||'';this.setValue(j);},commit:function(i){var j=this.getValue();if(j)i.setStyle('list-style-type',j);else i.removeStyle('list-style-type');}}]}],onShow:function(){var i=this.getParentEditor(),j=a(i,'ul');j&&this.setupContent(j);},onOk:function(){var i=this.getParentEditor(),j=a(i,'ul');j&&this.commitContent(j);}};else if(f=='numberedListStyle'){var h=[[g.notset,''],[g.lowerRoman,'lower-roman'],[g.upperRoman,'upper-roman'],[g.lowerAlpha,'lower-alpha'],[g.upperAlpha,'upper-alpha'],[g.decimal,'decimal']];if(!CKEDITOR.env.ie||CKEDITOR.env.version>7)h.concat([[g.armenian,'armenian'],[g.decimalLeadingZero,'decimal-leading-zero'],[g.georgian,'georgian'],[g.lowerGreek,'lower-greek']]);return{title:g.numberedTitle,minWidth:300,minHeight:50,contents:[{id:'info',accessKey:'I',elements:[{type:'hbox',widths:['25%','75%'],children:[{label:g.start,type:'text',id:'start',validate:CKEDITOR.dialog.validate.integer(g.validateStartNumber),setup:function(i){var j=i.getFirst(b).getAttribute('value')||i.getAttribute('start')||1;j&&this.setValue(j);},commit:function(i){var j=i.getFirst(b),k=j.getAttribute('value')||i.getAttribute('start')||1;i.getFirst(b).removeAttribute('value');var l=parseInt(this.getValue(),10);if(isNaN(l))i.removeAttribute('start');else i.setAttribute('start',l);var m=j,n=k,o=isNaN(l)?1:l;while((m=m.getNext(b))&&n++){if(m.getAttribute('value')==n)m.setAttribute('value',o+n-k);}}},{type:'select',label:g.type,id:'type',style:'width: 100%;',items:h,setup:function(i){var j=i.getStyle('list-style-type')||c[i.getAttribute('type')]||i.getAttribute('type')||'';this.setValue(j);},commit:function(i){var j=this.getValue();if(j)i.setStyle('list-style-type',j);else i.removeStyle('list-style-type');}}]}]}],onShow:function(){var i=this.getParentEditor(),j=a(i,'ol');\r
-j&&this.setupContent(j);},onOk:function(){var i=this.getParentEditor(),j=a(i,'ol');j&&this.commitContent(j);}};}};CKEDITOR.dialog.add('numberedListStyle',function(e){return d(e,'numberedListStyle');});CKEDITOR.dialog.add('bulletedListStyle',function(e){return d(e,'bulletedListStyle');});})();\r
+/*
+ Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
+ For licensing, see LICENSE.md or http://ckeditor.com/license
+*/
+(function(){function d(c,d){var b;try{b=c.getSelection().getRanges()[0]}catch(f){return null}b.shrink(CKEDITOR.SHRINK_TEXT);return c.elementPath(b.getCommonAncestor()).contains(d,1)}function e(c,e){var b=c.lang.liststyle;if("bulletedListStyle"==e)return{title:b.bulletedTitle,minWidth:300,minHeight:50,contents:[{id:"info",accessKey:"I",elements:[{type:"select",label:b.type,id:"type",align:"center",style:"width:150px",items:[[b.notset,""],[b.circle,"circle"],[b.disc,"disc"],[b.square,"square"]],setup:function(a){this.setValue(a.getStyle("list-style-type")||
+h[a.getAttribute("type")]||a.getAttribute("type")||"")},commit:function(a){var b=this.getValue();b?a.setStyle("list-style-type",b):a.removeStyle("list-style-type")}}]}],onShow:function(){var a=this.getParentEditor();(a=d(a,"ul"))&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor();(a=d(a,"ul"))&&this.commitContent(a)}};if("numberedListStyle"==e){var g=[[b.notset,""],[b.lowerRoman,"lower-roman"],[b.upperRoman,"upper-roman"],[b.lowerAlpha,"lower-alpha"],[b.upperAlpha,"upper-alpha"],
+[b.decimal,"decimal"]];(!CKEDITOR.env.ie||7<CKEDITOR.env.version)&&g.concat([[b.armenian,"armenian"],[b.decimalLeadingZero,"decimal-leading-zero"],[b.georgian,"georgian"],[b.lowerGreek,"lower-greek"]]);return{title:b.numberedTitle,minWidth:300,minHeight:50,contents:[{id:"info",accessKey:"I",elements:[{type:"hbox",widths:["25%","75%"],children:[{label:b.start,type:"text",id:"start",validate:CKEDITOR.dialog.validate.integer(b.validateStartNumber),setup:function(a){this.setValue(a.getFirst(f).getAttribute("value")||
+a.getAttribute("start")||1)},commit:function(a){var b=a.getFirst(f),c=b.getAttribute("value")||a.getAttribute("start")||1;a.getFirst(f).removeAttribute("value");var d=parseInt(this.getValue(),10);isNaN(d)?a.removeAttribute("start"):a.setAttribute("start",d);a=b;b=c;for(d=isNaN(d)?1:d;(a=a.getNext(f))&&b++;)a.getAttribute("value")==b&&a.setAttribute("value",d+b-c)}},{type:"select",label:b.type,id:"type",style:"width: 100%;",items:g,setup:function(a){this.setValue(a.getStyle("list-style-type")||h[a.getAttribute("type")]||
+a.getAttribute("type")||"")},commit:function(a){var b=this.getValue();b?a.setStyle("list-style-type",b):a.removeStyle("list-style-type")}}]}]}],onShow:function(){var a=this.getParentEditor();(a=d(a,"ol"))&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor();(a=d(a,"ol"))&&this.commitContent(a)}}}}var f=function(c){return c.type==CKEDITOR.NODE_ELEMENT&&c.is("li")},h={a:"lower-alpha",A:"upper-alpha",i:"lower-roman",I:"upper-roman",1:"decimal",disc:"disc",circle:"circle",square:"square"};
+CKEDITOR.dialog.add("numberedListStyle",function(c){return e(c,"numberedListStyle")});CKEDITOR.dialog.add("bulletedListStyle",function(c){return e(c,"bulletedListStyle")})})();
\ No newline at end of file