JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-4.2_full
[ckeditor.git] / plugins / liststyle / dialogs / liststyle.js
index ef68dce..6dba713 100644 (file)
@@ -1,6 +1,10 @@
-/*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
-For licensing, see LICENSE.html or http://ckeditor.com/license\r
-*/\r
-\r
-(function(){function a(d,e){var f;try{f=d.getSelection().getRanges()[0];}catch(g){return null;}f.shrink(CKEDITOR.SHRINK_TEXT);return f.getCommonAncestor().getAscendant(e,true);};var b={a:'lower-alpha',A:'upper-alpha',i:'lower-roman',I:'upper-roman',1:'decimal',disc:'disc',circle:'circle',square:'square'};function c(d,e){if(e=='bulletedListStyle')return{title:d.lang.list.bulletedTitle,minWidth:300,minHeight:50,contents:[{elements:[{type:'select',label:d.lang.list.type,id:'type',style:'width: 150px; margin: auto;',items:[[d.lang.list.notset,''],[d.lang.list.circle,'circle'],[d.lang.list.disc,'disc'],[d.lang.list.square,'square']],setup:function(f){var g=f.getStyle('list-style-type')||b[f.getAttribute('type')]||f.getAttribute('type')||'';this.setValue(g);},commit:function(f){var g=this.getValue();if(g)f.setStyle('list-style-type',g);else f.removeStyle('list-style-type');}}]}],onShow:function(){var f=this.getParentEditor(),g=a(f,'ul');g&&this.setupContent(g);},onOk:function(){var f=this.getParentEditor(),g=a(f,'ul');g&&this.commitContent(g);}};else if(e=='numberedListStyle')return{title:d.lang.list.numberedTitle,minWidth:300,minHeight:50,contents:[{elements:[{type:'hbox',widths:['25%','75%'],children:[{label:d.lang.list.start,type:'text',id:'start',setup:function(f){var g=f.getAttribute('start')||1;g&&this.setValue(g);},commit:function(f){f.setAttribute('start',this.getValue());}},{type:'select',label:d.lang.list.type,id:'type',style:'width: 100%;',items:[[d.lang.list.notset,''],[d.lang.list.armenian,'armenian'],[d.lang.list.georgian,'georgian'],[d.lang.list.lowerRoman,'lower-roman'],[d.lang.list.upperRoman,'upper-roman'],[d.lang.list.lowerAlpha,'lower-alpha'],[d.lang.list.upperAlpha,'upper-alpha'],[d.lang.list.lowerGreek,'lower-greek'],[d.lang.list.decimal,'decimal'],[d.lang.list.decimalLeadingZero,'decimal-leading-zero']],setup:function(f){var g=f.getStyle('list-style-type')||b[f.getAttribute('type')]||f.getAttribute('type')||'';this.setValue(g);},commit:function(f){var g=this.getValue();if(g)f.setStyle('list-style-type',g);else f.removeStyle('list-style-type');}}]}]}],onShow:function(){var f=this.getParentEditor(),g=a(f,'ol');g&&this.setupContent(g);},onOk:function(){var f=this.getParentEditor(),g=a(f,'ol');g&&this.commitContent(g);}};};CKEDITOR.dialog.add('numberedListStyle',function(d){return c(d,'numberedListStyle');});CKEDITOR.dialog.add('bulletedListStyle',function(d){return c(d,'bulletedListStyle');});})();\r
+/*
+ Copyright (c) 2003-2013, 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