effective_ckeditor 1.4.2 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/HOW_TO_UPGRADE_CKEDITOR.txt +0 -10
  3. data/app/assets/javascripts/ckeditor/build-config.js +51 -52
  4. data/app/assets/javascripts/ckeditor/ckeditor.js +23 -9
  5. data/app/assets/javascripts/ckeditor/lang/en.js +1 -1
  6. data/app/assets/javascripts/ckeditor/plugins/{footnotes/dialogs/footnotes.js → effective_references/dialogs/references.js} +37 -38
  7. data/app/assets/javascripts/ckeditor/plugins/{footnotes/icons/footnotes.png → effective_references/icons/effectivereferences.png} +0 -0
  8. data/app/assets/javascripts/ckeditor/plugins/effective_references/plugin.js +300 -0
  9. data/app/assets/javascripts/ckeditor/plugins/icons.png +0 -0
  10. data/app/assets/javascripts/ckeditor/plugins/icons_hidpi.png +0 -0
  11. data/app/assets/javascripts/ckeditor/plugins/oembed/LICENSE.md +21 -0
  12. data/app/assets/javascripts/ckeditor/plugins/oembed/README.md +201 -0
  13. data/app/assets/javascripts/ckeditor/plugins/oembed/libs/jquery.oembed.min.js +71 -0
  14. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor.css +1 -1
  15. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_gecko.css +1 -1
  16. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_ie.css +1 -1
  17. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_ie7.css +1 -1
  18. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_ie8.css +1 -1
  19. data/app/assets/javascripts/ckeditor/skins/moonocolor/editor_iequirks.css +1 -1
  20. data/app/assets/javascripts/ckeditor/skins/moonocolor/icons.png +0 -0
  21. data/app/assets/javascripts/ckeditor/skins/moonocolor/icons_hidpi.png +0 -0
  22. data/app/assets/javascripts/effective_ckeditor/config.js.coffee +4 -4
  23. data/lib/effective_ckeditor/version.rb +1 -1
  24. metadata +8 -6
  25. data/app/assets/javascripts/ckeditor/plugins/footnotes/plugin.js +0 -305
  26. data/app/assets/javascripts/ckeditor/plugins/tliyoutube/dialogs/tliyoutube.js +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 634f6c4a4c54685130e76c8a6cf45de59cd7970f
4
- data.tar.gz: 09a062e6c4cded2883bbcf0b3f7732c829db8b03
3
+ metadata.gz: 29cefd07b38fd6a0458159c1f7d196977ca9b143
4
+ data.tar.gz: e03c4f90cefd1259d4f28fa91aa3964036677208
5
5
  SHA512:
6
- metadata.gz: 816ddb4a2b57a75aafcc523446c0e44338af7d2850c662a2611f3323626875114937eb6ab666292e0312396f1f7f26932545156d42129e2fe48f0be5e114f2f5
7
- data.tar.gz: a3a749cddf4e0b48005fc42efcb490a61c04b99befb60c124af063e78732148d51130dda9a7dd66403f0bb043b0096727df1f36f2e90c32dd8f9791b29fb5ee2
6
+ metadata.gz: 968f46e67146402994a093b3f86207ea0b583088b2e8c4b07956c9f518d335507ff06d17207d9a09eb9d5ceb8e4a7ebf4f6f657270055122f1f15a5df9d56063
7
+ data.tar.gz: ac7292ed43b694eec95a7eb8645e223c26d15464109d559da239c4ea022634d8fe0b6d191d609db4265fa056fa6c1ce9ecbdc1eec93ed09b355c71ccdefe9b90
@@ -5,14 +5,4 @@
5
5
  5.) Language English
6
6
  6.) Optimized Source
7
7
  7.) Unzip the ckeditor.zip over the ./ckeditor/ directory
8
-
9
8
  8.) Delete the ./ckeditor/samples/ directory
10
-
11
- 9.) Do the following Search&Replaces on the ./ckeditor/plugins/tliyoutube/dialogs/tliyoutube.js file:
12
- - Inserisci filmato YouTube -> Insert YouTube video
13
- - Correggi e riprova! -> Please copy & paste the youtube URL from your browser's location bar.
14
- - Incolla qui l'URL del filmato da inserire -> URL to YouTube video (should start with http:// or https://):
15
- - URL invalido! deve essere simile a -> Invalid URL. Expecting something like:
16
-
17
- 10.) Do the following Search&Replaces on the ./ckeditor/ckeditor.js:
18
- - Inserisci filmato YouTube -> Insert YouTube video
@@ -1,53 +1,53 @@
1
- /**
2
- * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
3
- * For licensing, see LICENSE.md or http://ckeditor.com/license
4
- */
5
-
6
- /**
7
- * This file was added automatically by CKEditor builder.
8
- * You may re-use it at any time to build CKEditor again.
9
- *
10
- * If you would like to build CKEditor online again
11
- * (for example to upgrade), visit one the following links:
12
- *
13
- * (1) http://ckeditor.com/builder
14
- * Visit online builder to build CKEditor from scratch.
15
- *
16
- * (2) http://ckeditor.com/builder/6f3a471127697b0fcec36c6c243c9541
17
- * Visit online builder to build CKEditor, starting with the same setup as before.
18
- *
19
- * (3) http://ckeditor.com/builder/download/6f3a471127697b0fcec36c6c243c9541
20
- * Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
21
- *
22
- * NOTE:
23
- * This file is not used by CKEditor, you may remove it.
24
- * Changing this file will not change your CKEditor configuration.
25
- */
26
-
27
- var CKBUILDER_CONFIG = {
28
- skin: 'moonocolor',
29
- preset: 'basic',
30
- ignore: [
31
- '.bender',
32
- 'bender.js',
33
- 'bender-err.log',
34
- 'bender-out.log',
35
- 'dev',
36
- '.DS_Store',
37
- '.editorconfig',
38
- '.gitattributes',
39
- '.gitignore',
40
- 'gruntfile.js',
41
- '.idea',
42
- '.jscsrc',
43
- '.jshintignore',
44
- '.jshintrc',
45
- '.mailmap',
46
- 'node_modules',
47
- 'package.json',
48
- 'README.md',
49
- 'tests'
50
- ],
1
+ /**
2
+ * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or http://ckeditor.com/license
4
+ */
5
+
6
+ /**
7
+ * This file was added automatically by CKEditor builder.
8
+ * You may re-use it at any time to build CKEditor again.
9
+ *
10
+ * If you would like to build CKEditor online again
11
+ * (for example to upgrade), visit one the following links:
12
+ *
13
+ * (1) http://ckeditor.com/builder
14
+ * Visit online builder to build CKEditor from scratch.
15
+ *
16
+ * (2) http://ckeditor.com/builder/6c407072febb6d726bc55f008b63a673
17
+ * Visit online builder to build CKEditor, starting with the same setup as before.
18
+ *
19
+ * (3) http://ckeditor.com/builder/download/6c407072febb6d726bc55f008b63a673
20
+ * Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
21
+ *
22
+ * NOTE:
23
+ * This file is not used by CKEditor, you may remove it.
24
+ * Changing this file will not change your CKEditor configuration.
25
+ */
26
+
27
+ var CKBUILDER_CONFIG = {
28
+ skin: 'moonocolor',
29
+ preset: 'basic',
30
+ ignore: [
31
+ '.bender',
32
+ 'bender.js',
33
+ 'bender-err.log',
34
+ 'bender-out.log',
35
+ 'dev',
36
+ '.DS_Store',
37
+ '.editorconfig',
38
+ '.gitattributes',
39
+ '.gitignore',
40
+ 'gruntfile.js',
41
+ '.idea',
42
+ '.jscsrc',
43
+ '.jshintignore',
44
+ '.jshintrc',
45
+ '.mailmap',
46
+ 'node_modules',
47
+ 'package.json',
48
+ 'README.md',
49
+ 'tests'
50
+ ],
51
51
  plugins : {
52
52
  'basicstyles' : 1,
53
53
  'blockquote' : 1,
@@ -61,7 +61,6 @@ var CKBUILDER_CONFIG = {
61
61
  'filebrowser' : 1,
62
62
  'find' : 1,
63
63
  'floatingspace' : 1,
64
- 'footnotes' : 1,
65
64
  'format' : 1,
66
65
  'horizontalrule' : 1,
67
66
  'image' : 1,
@@ -75,6 +74,7 @@ var CKBUILDER_CONFIG = {
75
74
  'liststyle' : 1,
76
75
  'magicline' : 1,
77
76
  'newpage' : 1,
77
+ 'oembed' : 1,
78
78
  'pagebreak' : 1,
79
79
  'pastefromword' : 1,
80
80
  'pastetext' : 1,
@@ -91,7 +91,6 @@ var CKBUILDER_CONFIG = {
91
91
  'table' : 1,
92
92
  'tabletools' : 1,
93
93
  'templates' : 1,
94
- 'tliyoutube' : 1,
95
94
  'toolbar' : 1,
96
95
  'undo' : 1,
97
96
  'wysiwygarea' : 1
@@ -685,7 +685,12 @@ i(c)+"BrowseUrl"],void 0===f&&(f=a.config.filebrowserBrowseUrl));f&&(e.onClick=k
685
685
  c,d){if(-1!==d.indexOf(";")){for(var d=d.split(";"),b=0;b<d.length;b++)if(h(a,c,d[b]))return!0;return!1}return(a=a.getContents(c).get(d).filebrowser)&&a.url}function n(a,c){var d=this._.filebrowserSe.getDialog(),b=this._.filebrowserSe["for"],e=this._.filebrowserSe.filebrowser.onSelect;b&&d.getContentElement(b[0],b[1]).reset();if(!("function"==typeof c&&!1===c.call(this._.filebrowserSe))&&!(e&&!1===e.call(this._.filebrowserSe,a,c))&&("string"==typeof c&&c&&alert(c),a&&(b=this._.filebrowserSe,d=b.getDialog(),
686
686
  b=b.filebrowser.target||null)))if(b=b.split(":"),e=d.getContentElement(b[0],b[1]))e.setValue(a),d.selectPage(b[0])}CKEDITOR.plugins.add("filebrowser",{requires:"popup",init:function(a){a._.filebrowserFn=CKEDITOR.tools.addFunction(n,a);a.on("destroy",function(){CKEDITOR.tools.removeFunction(this._.filebrowserFn)})}});CKEDITOR.on("dialogDefinition",function(a){if(a.editor.plugins.filebrowser)for(var c=a.data.definition,d,b=0;b<c.contents.length;++b)if(d=c.contents[b])j(a.editor,a.data.name,c,d.elements),
687
687
  d.hidden&&d.filebrowser&&(d.hidden=!h(c,d.id,d.filebrowser))})})();CKEDITOR.plugins.add("find",{requires:"dialog",init:function(a){var b=a.addCommand("find",new CKEDITOR.dialogCommand("find"));b.canUndo=!1;b.readOnly=1;a.addCommand("replace",new CKEDITOR.dialogCommand("replace")).canUndo=!1;a.ui.addButton&&(a.ui.addButton("Find",{label:a.lang.find.find,command:"find",toolbar:"find,10"}),a.ui.addButton("Replace",{label:a.lang.find.replace,command:"replace",toolbar:"find,20"}));CKEDITOR.dialog.add("find",this.path+"dialogs/find.js");CKEDITOR.dialog.add("replace",this.path+
688
- "dialogs/find.js")}});CKEDITOR.config.find_highlight={element:"span",styles:{"background-color":"#004",color:"#fff"}};CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var f=CKEDITOR.addTemplate("panel-list",'<ul role="presentation" class="cke_panel_list">{items}</ul>'),g=CKEDITOR.addTemplate("panel-list-item",'<li id="{id}" class="cke_panel_listItem" role=presentation><a id="{id}_option" _cke_focus=1 hidefocus=true title="{title}" href="javascript:void(\'{val}\')" {onclick}="CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role="option">{text}</a></li>'),h=CKEDITOR.addTemplate("panel-list-group",
688
+ "dialogs/find.js")}});CKEDITOR.config.find_highlight={element:"span",styles:{"background-color":"#004",color:"#fff"}};(function(){function i(a){var j=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,p=function(){function f(a,c,e){b.setStyle(c,s(e));b.setStyle("position",a)}function e(a){var b=i.getDocumentPosition();switch(a){case "top":f("absolute","top",b.y-n-o);break;case "pin":f("fixed","top",t);break;case "bottom":f("absolute","top",b.y+(c.height||c.bottom-c.top)+o)}k=a}var k,i,l,c,h,n,r,m=j.floatSpaceDockedOffsetX||0,o=j.floatSpaceDockedOffsetY||0,q=j.floatSpacePinnedOffsetX||0,t=j.floatSpacePinnedOffsetY||
689
+ 0;return function(d){if(i=a.editable())if(d&&"focus"==d.name&&b.show(),b.removeStyle("left"),b.removeStyle("right"),l=b.getClientRect(),c=i.getClientRect(),h=g.getViewPaneSize(),n=l.height,r="pageXOffset"in g.$?g.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft,k){n+o<=c.top?e("top"):n+o>h.height-c.bottom?e("pin"):e("bottom");var d=h.width/2,d=0<c.left&&c.right<h.width&&c.width>l.width?"rtl"==a.config.contentsLangDirection?"right":"left":d-c.left>c.right-d?"left":"right",f;l.width>h.width?
690
+ (d="left",f=0):(f="left"==d?0<c.left?c.left:0:c.right<h.width?h.width-c.right:0,f+l.width>h.width&&(d="left"==d?"right":"left",f=0));b.setStyle(d,s(("pin"==k?q:m)+f+("pin"==k?0:"left"==d?r:-r)))}else k="pin",e("pin"),p(d)}}();if(m){var i=new CKEDITOR.template('<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" title="'+(CKEDITOR.env.gecko?" ":"")+'" lang="{langCode}" role="application" style="{style}"'+
691
+ (a.title?' aria-labelledby="cke_{name}_arialbl"':" ")+">"+(a.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':" ")+'<div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(i.output({content:m,id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(j.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),
692
+ q=CKEDITOR.tools.eventsBuffer(500,p),e=CKEDITOR.tools.eventsBuffer(100,p);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){p(b);a.on("change",q.input);g.on("scroll",e.input);g.on("resize",e.input)});a.on("blur",function(){b.hide();a.removeListener("change",q.input);g.removeListener("scroll",e.input);g.removeListener("resize",e.input)});a.on("destroy",function(){g.removeListener("scroll",e.input);g.removeListener("resize",
693
+ e.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var g=CKEDITOR.document.getWindow(),s=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(a){a.on("loaded",function(){i(this)},null,null,20)}})})();CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var f=CKEDITOR.addTemplate("panel-list",'<ul role="presentation" class="cke_panel_list">{items}</ul>'),g=CKEDITOR.addTemplate("panel-list-item",'<li id="{id}" class="cke_panel_listItem" role=presentation><a id="{id}_option" _cke_focus=1 hidefocus=true title="{title}" href="javascript:void(\'{val}\')" {onclick}="CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role="option">{text}</a></li>'),h=CKEDITOR.addTemplate("panel-list-group",
689
694
  '<h1 id="{id}" class="cke_panel_grouptitle" role="presentation" >{label}</h1>'),i=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(a,b){return this.addBlock(a,new CKEDITOR.ui.listBlock(this.getHolderElement(),b))};CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(a,b){var b=b||{},c=b.attributes||(b.attributes={});(this.multiSelect=!!b.multiSelect)&&(c["aria-multiselectable"]=!0);!c.role&&(c.role="listbox");this.base.apply(this,arguments);this.element.setAttribute("role",
690
695
  c.role);c=this.keys;c[40]="next";c[9]="next";c[38]="prev";c[CKEDITOR.SHIFT+9]="prev";c[32]=CKEDITOR.env.ie?"mouseup":"click";CKEDITOR.env.ie&&(c[13]="mouseup");this._.pendingHtml=[];this._.pendingList=[];this._.items={};this._.groups={}},_:{close:function(){if(this._.started){var a=f.output({items:this._.pendingList.join("")});this._.pendingList=[];this._.pendingHtml.push(a);delete this._.started}},getClick:function(){this._.click||(this._.click=CKEDITOR.tools.addFunction(function(a){var b=this.toggle(a);
691
696
  if(this.onClick)this.onClick(a,b)},this));return this._.click}},proto:{add:function(a,b,c){var d=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0);this._.items[a]=d;var e;e=CKEDITOR.tools.htmlEncodeAttr(a).replace(i,"\\'");a={id:d,val:e,onclick:CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(c||a),text:b||a};this._.pendingList.push(g.output(a))},startGroup:function(a){this._.close();
@@ -904,7 +909,21 @@ fa=8,x=4,y=2,s=1,E=" ",aa=w.$listItem,ka=w.$tableContent,ia=q({},w.$nonEditable
904
909
  a)==a}};var ca=function(){function a(a,d){var b=a.$.elementFromPoint(d.x,d.y);return b&&b.nodeType?new CKEDITOR.dom.element(b):null}return function(c,d,b){if(!c.mouse)return null;var e=c.doc,f=c.line.wrap,b=b||c.mouse,g=a(e,b);d&&v(c,g)&&(f.hide(),g=a(e,b),f.show());return!g||!(g.type==CKEDITOR.NODE_ELEMENT&&g.$)||n.ie&&9>n.version&&!c.boundary.equals(g)&&!c.boundary.contains(g)?null:g}}(),z=CKEDITOR.dom.walker.whitespaces(),A=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),da=function(){function a(a){var b=
905
910
  a.element,e,f,g;if(!m(b)||b.contains(a.editable)||b.isReadOnly())return null;g=la(a,function(a,b){return!b.equals(a)},function(a,b){return ca(a,!0,b)},b);e=g.upper;f=g.lower;if(Q(a,e,f))return g.set(O,fa);if(e&&b.contains(e))for(;!e.getParent().equals(b);)e=e.getParent();else e=b.getFirst(function(b){return c(a,b)});if(f&&b.contains(f))for(;!f.getParent().equals(b);)f=f.getParent();else f=b.getLast(function(b){return c(a,b)});if(!e||!f)return null;o(a,e);o(a,f);if(!(a.mouse.y>e.size.top&&a.mouse.y<
906
911
  f.size.bottom))return null;for(var b=Number.MAX_VALUE,i,h,j,l;f&&!f.equals(e)&&(h=e.getNext(a.isRelevant));)i=Math.abs(ga(a,e,h)-a.mouse.y),i<b&&(b=i,j=e,l=h),e=h,o(a,e);if(!j||!l||!(a.mouse.y>j.size.top&&a.mouse.y<l.size.bottom))return null;g.upper=j;g.lower=l;return g.set(O,fa)}function c(a,b){return!(b&&b.type==CKEDITOR.NODE_TEXT||A(b)||p(b)||v(a,b)||b.type==CKEDITOR.NODE_ELEMENT&&b.$&&b.is("br"))}return function(c){var b=a(c),e;if(e=b){e=b.upper;var f=b.lower;e=!e||!f||p(f)||p(e)||f.equals(e)||
907
- e.equals(f)||f.contains(e)||e.contains(f)?!1:G(c,e)&&G(c,f)&&Q(c,e,f)?!0:!1}return e?b:null}}(),t=["top","left","right","bottom"]})();CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51;CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52;CKEDITOR.plugins.add("newpage",{init:function(a){a.addCommand("newpage",{modes:{wysiwyg:1,source:1},exec:function(b){var a=this;b.setData(b.config.newpage_html||"",function(){b.focus();setTimeout(function(){b.fire("afterCommandExec",{name:"newpage",command:a});b.selectionChange()},200)})},async:!0});a.ui.addButton&&a.ui.addButton("NewPage",{label:a.lang.newpage.toolbar,command:"newpage",toolbar:"document,20"})}});(function(){function e(a){return{"aria-label":a,"class":"cke_pagebreak",contenteditable:"false","data-cke-display-name":"pagebreak","data-cke-pagebreak":1,style:"page-break-after: always",title:a}}CKEDITOR.plugins.add("pagebreak",{requires:"fakeobjects",onLoad:function(){var a=("background:url("+CKEDITOR.getUrl(this.path+"images/pagebreak.gif")+") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:5px;cursor:default;").replace(/;/g,
912
+ e.equals(f)||f.contains(e)||e.contains(f)?!1:G(c,e)&&G(c,f)&&Q(c,e,f)?!0:!1}return e?b:null}}(),t=["top","left","right","bottom"]})();CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51;CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52;CKEDITOR.plugins.add("newpage",{init:function(a){a.addCommand("newpage",{modes:{wysiwyg:1,source:1},exec:function(b){var a=this;b.setData(b.config.newpage_html||"",function(){b.focus();setTimeout(function(){b.fire("afterCommandExec",{name:"newpage",command:a});b.selectionChange()},200)})},async:!0});a.ui.addButton&&a.ui.addButton("NewPage",{label:a.lang.newpage.toolbar,command:"newpage",toolbar:"document,20"})}});(function(){CKEDITOR.plugins.add("oembed",{icons:"oembed",hidpi:!0,requires:"widget,dialog",version:1.17,init:function(e){function l(a,d,c,f,g,j,h,b){jQuery("body").oembed(a,{onEmbed:function(d){var g=jQuery.fn.oembed.getOEmbedProvider(a);b.element.data("resizeType",j);if("responsive"==j||"custom"==j)b.element.data("maxWidth",c),b.element.data("maxHeight",f);b.element.data("align",h);"center"==h?(b.inline||b.element.setStyle("text-align","center"),b.element.removeStyle("float")):(b.inline||b.element.removeStyle("text-align"),
913
+ "none"==h?b.element.removeStyle("float"):b.element.setStyle("float",h));"string"===typeof d.code?(b.element.$.firstChild&&b.element.$.removeChild(b.element.$.firstChild),b.element.appendHtml(d.code),b.element.data("oembed",a),b.element.data("oembed_provider",g.name),b.element.addClass("oembed-provider-"+g.name)):"string"===typeof d.code[0].outerHTML?(b.element.$.firstChild&&b.element.$.removeChild(b.element.$.firstChild),b.element.appendHtml(d.code[0].outerHTML),b.element.data("oembed",a),b.element.data("oembed_provider",
914
+ g.name),b.element.addClass("oembed-provider-"+g.name)):alert(e.lang.oembed.noEmbedCode)},onError:function(a){0<a.indexOf("vimeo.com")?alert(e.lang.oembed.noVimeo):alert(e.lang.oembed.Error)},maxHeight:f,maxWidth:c,useResponsiveResize:g,embedMethod:"editor"})}(function(){"undefined"===typeof jQuery?CKEDITOR.scriptLoader.load("//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js",function(){jQuery.noConflict();"undefined"===typeof jQuery.fn.oembed&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(CKEDITOR.plugins.getPath("oembed")+
915
+ "libs/jquery.oembed.min.js"))}):"undefined"===typeof jQuery.fn.oembed&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(CKEDITOR.plugins.getPath("oembed")+"libs/jquery.oembed.min.js"))})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{oEmbed:function(a,d,c,f){function g(){if(null==d||"undefined"==d)d=null;if(null==c||"undefined"==c)c=null;if(null==f||"undefined"==f)f=!1;l(a,e,!1,d,c,f)}if(1>a.length||0>a.indexOf("http"))return alert(e.lang.oembed.invalidUrl),!1;"undefined"===typeof jQuery.fn.oembed?
916
+ CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(CKEDITOR.plugins.getPath("oembed")+"libs/jquery.oembed.min.js"),function(){g()}):g();return!0}});e.widgets.add("oembed",{draggable:!1,mask:!0,dialog:"oembed",allowedContent:{div:{styles:"text-align,float",attributes:"*",classes:null!=e.config.oembed_WrapperClass?e.config.oembed_WrapperClass:"embeddedContent"},"div(embeddedContent,oembed-provider-*) iframe":{attributes:"*"},"div(embeddedContent,oembed-provider-*) blockquote":{attributes:"*"},"div(embeddedContent,oembed-provider-*) script":{attributes:"*"}},
917
+ template:'<div class="'+(null!=e.config.oembed_WrapperClass?e.config.oembed_WrapperClass:"embeddedContent")+'"></div>',upcast:function(a){return"div"==a.name&&a.hasClass(null!=e.config.oembed_WrapperClass?e.config.oembed_WrapperClass:"embeddedContent")},init:function(){var a={oembed:this.element.data("oembed")||"",resizeType:this.element.data("resizeType")||"noresize",maxWidth:this.element.data("maxWidth")||560,maxHeight:this.element.data("maxHeight")||315,align:this.element.data("align")||"none",
918
+ oembed_provider:this.element.data("oembed_provider")||""};this.setData(a);this.element.addClass("oembed-provider-"+a.oembed_provider);this.on("dialog",function(a){a.data.widget=this},this)}});e.ui.addButton("oembed",{label:e.lang.oembed.button,command:"oembed",toolbar:"insert,10",icon:this.path+"icons/"+(CKEDITOR.env.hidpi?"hidpi/":"")+"oembed.png"});var k=function(){var a=this.getDialog(),d=this.getValue(),c=a.getContentElement("general","maxSizeBox").getElement(),a=a.getContentElement("general",
919
+ "sizeBox").getElement();"noresize"==d?(c.hide(),a.hide()):"custom"==d?(c.hide(),a.show()):(c.show(),a.hide())};String.prototype.beginsWith=function(a){return 0===this.indexOf(a)};CKEDITOR.dialog.add("oembed",function(a){return{title:a.lang.oembed.title,minWidth:CKEDITOR.env.ie&&CKEDITOR.env.quirks?568:550,minHeight:155,onShow:function(){var a={oembed:this.widget.element.data("oembed")||"",resizeType:this.widget.element.data("resizeType")||"noresize",maxWidth:this.widget.element.data("maxWidth"),maxHeight:this.widget.element.data("maxHeight"),
920
+ align:this.widget.element.data("align")||"none"};this.widget.setData(a);this.getContentElement("general","resizeType").setValue(a.resizeType);this.getContentElement("general","align").setValue(a.align);var a=this.getContentElement("general","resizeType").getValue(),c=this.getContentElement("general","maxSizeBox").getElement(),f=this.getContentElement("general","sizeBox").getElement();"noresize"==a?(c.hide(),f.hide()):"custom"==a?(c.hide(),f.show()):(c.show(),f.hide())},onOk:function(){},contents:[{label:a.lang.common.generalTab,
921
+ id:"general",elements:[{type:"html",id:"oembedHeader",html:'<div style="white-space:normal;width:500px;padding-bottom:10px">'+a.lang.oembed.pasteUrl+"</div>"},{type:"text",id:"embedCode",focus:function(){this.getElement().focus()},label:a.lang.oembed.url,title:a.lang.oembed.pasteUrl,setup:function(a){a.data.oembed&&this.setValue(a.data.oembed)},commit:function(d){var c=CKEDITOR.dialog.getCurrent(),f=c.getValueOf("general","embedCode").replace(/\s/g,""),g=c.getContentElement("general","resizeType").getValue(),
922
+ e=c.getContentElement("general","align").getValue(),h=null,b=null,i=!1,k=c.getParentEditor();if(1>f.length||0>f.indexOf("http"))return alert(a.lang.oembed.invalidUrl),!1;"noresize"==g?(i=!1,b=h=null):"responsive"==g?(h=c.getContentElement("general","maxWidth").getInputElement().getValue(),b=c.getContentElement("general","maxHeight").getInputElement().getValue(),i=!0):"custom"==g&&(h=c.getContentElement("general","width").getInputElement().getValue(),b=c.getContentElement("general","height").getInputElement().getValue(),
923
+ i=!1);l(f,k,h,b,i,g,e,d);d.setData("oembed",f);d.setData("resizeType",g);d.setData("align",e);d.setData("maxWidth",h);d.setData("maxHeight",b)}},{type:"hbox",widths:["50%","50%"],children:[{id:"resizeType",type:"select",label:a.lang.oembed.resizeType,"default":"noresize",setup:function(a){a.data.resizeType&&this.setValue(a.data.resizeType)},items:[[a.lang.oembed.noresize,"noresize"],[a.lang.oembed.responsive,"responsive"],[a.lang.oembed.custom,"custom"]],onChange:k},{type:"hbox",id:"maxSizeBox",widths:["120px",
924
+ "120px"],style:"float:left;position:absolute;left:58%;width:200px",children:[{type:"text",width:"100px",id:"maxWidth","default":null!=a.config.oembed_maxWidth?a.config.oembed_maxWidth:"560",label:a.lang.oembed.maxWidth,title:a.lang.oembed.maxWidthTitle,setup:function(a){a.data.maxWidth&&this.setValue(a.data.maxWidth)}},{type:"text",id:"maxHeight",width:"120px","default":null!=a.config.oembed_maxHeight?a.config.oembed_maxHeight:"315",label:a.lang.oembed.maxHeight,title:a.lang.oembed.maxHeightTitle,
925
+ setup:function(a){a.data.maxHeight&&this.setValue(a.data.maxHeight)}}]},{type:"hbox",id:"sizeBox",widths:["120px","120px"],style:"float:left;position:absolute;left:58%;width:200px",children:[{type:"text",id:"width",width:"100px","default":null!=a.config.oembed_maxWidth?a.config.oembed_maxWidth:"560",label:a.lang.oembed.width,title:a.lang.oembed.widthTitle,setup:function(a){a.data.maxWidth&&this.setValue(a.data.maxWidth)}},{type:"text",id:"height",width:"120px","default":null!=a.config.oembed_maxHeight?
926
+ a.config.oembed_maxHeight:"315",label:a.lang.oembed.height,title:a.lang.oembed.heightTitle,setup:function(a){a.data.maxHeight&&this.setValue(a.data.maxHeight)}}]}]},{type:"hbox",id:"alignment",children:[{id:"align",type:"radio",items:[[a.lang.oembed.none,"none"],[a.lang.common.alignLeft,"left"],[a.lang.common.alignCenter,"center"],[a.lang.common.alignRight,"right"]],label:a.lang.common.align,setup:function(a){this.setValue(a.data.align)}}]}]}]}})}})})();(function(){function e(a){return{"aria-label":a,"class":"cke_pagebreak",contenteditable:"false","data-cke-display-name":"pagebreak","data-cke-pagebreak":1,style:"page-break-after: always",title:a}}CKEDITOR.plugins.add("pagebreak",{requires:"fakeobjects",onLoad:function(){var a=("background:url("+CKEDITOR.getUrl(this.path+"images/pagebreak.gif")+") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:5px;cursor:default;").replace(/;/g,
908
927
  " !important;");CKEDITOR.addCss("div.cke_pagebreak{"+a+"}")},init:function(a){a.blockless||(a.addCommand("pagebreak",CKEDITOR.plugins.pagebreakCmd),a.ui.addButton&&a.ui.addButton("PageBreak",{label:a.lang.pagebreak.toolbar,command:"pagebreak",toolbar:"insert,70"}),CKEDITOR.env.webkit&&a.on("contentDom",function(){a.document.on("click",function(b){b=b.data.getTarget();b.is("div")&&b.hasClass("cke_pagebreak")&&a.getSelection().selectElement(b)})}))},afterInit:function(a){function b(f){CKEDITOR.tools.extend(f.attributes,
909
928
  e(a.lang.pagebreak.alt),!0);f.children.length=0}var c=a.dataProcessor,g=c&&c.dataFilter,c=c&&c.htmlFilter,h=/page-break-after\s*:\s*always/i,i=/display\s*:\s*none/i;c&&c.addRules({attributes:{"class":function(a,b){var c=a.replace("cke_pagebreak","");if(c!=a){var d=CKEDITOR.htmlParser.fragment.fromHtml('<span style="display: none;">&nbsp;</span>').children[0];b.children.length=0;b.add(d);d=b.attributes;delete d["aria-label"];delete d.contenteditable;delete d.title}return c}}},{applyToAll:!0,priority:5});
910
929
  g&&g.addRules({elements:{div:function(a){if(a.attributes["data-cke-pagebreak"])b(a);else if(h.test(a.attributes.style)){var c=a.children[0];c&&("span"==c.name&&i.test(c.attributes.style))&&b(a)}}}})}});CKEDITOR.plugins.pagebreakCmd={exec:function(a){var b=a.document.createElement("div",{attributes:e(a.lang.pagebreak.alt)});a.insertElement(b)},context:"div",allowedContent:{div:{styles:"!page-break-after"},span:{match:function(a){return(a=a.parent)&&"div"==a.name&&a.styles&&a.styles["page-break-after"]},
@@ -964,7 +983,7 @@ command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:c.cell.s
964
983
  group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:c.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:c.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},tablecolumn:{label:c.column.menu,group:"tablecolumn",order:1,getItems:function(){return{tablecolumn_insertBefore:CKEDITOR.TRISTATE_OFF,tablecolumn_insertAfter:CKEDITOR.TRISTATE_OFF,tablecolumn_delete:CKEDITOR.TRISTATE_OFF}}},tablecolumn_insertBefore:{label:c.column.insertBefore,
965
984
  group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:c.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:c.column.deleteColumn,group:"tablecolumn",command:"columnDelete",order:15}});e.contextMenu&&e.contextMenu.addListener(function(a,b,c){return(a=c.contains({td:1,th:1},1))&&!a.isReadOnly()?{tablecell:CKEDITOR.TRISTATE_OFF,tablerow:CKEDITOR.TRISTATE_OFF,tablecolumn:CKEDITOR.TRISTATE_OFF}:null})},getSelectedCells:p};
966
985
  CKEDITOR.plugins.add("tabletools",CKEDITOR.plugins.tabletools)})();CKEDITOR.tools.buildTableMap=function(p){for(var p=p.$.rows,o=-1,q=[],r=0;r<p.length;r++){o++;!q[o]&&(q[o]=[]);for(var k=-1,u=0;u<p[r].cells.length;u++){var t=p[r].cells[u];for(k++;q[o][k];)k++;for(var m=isNaN(t.colSpan)?1:t.colSpan,t=isNaN(t.rowSpan)?1:t.rowSpan,v=0;v<t;v++){q[o+v]||(q[o+v]=[]);for(var s=0;s<m;s++)q[o+v][k+s]=p[r].cells[u]}k+=m-1}}return q};(function(){CKEDITOR.plugins.add("templates",{requires:"dialog",init:function(a){CKEDITOR.dialog.add("templates",CKEDITOR.getUrl(this.path+"dialogs/templates.js"));a.addCommand("templates",new CKEDITOR.dialogCommand("templates"));a.ui.addButton&&a.ui.addButton("Templates",{label:a.lang.templates.button,command:"templates",toolbar:"doctools,10"})}});var c={},f={};CKEDITOR.addTemplates=function(a,d){c[a]=d};CKEDITOR.getTemplates=function(a){return c[a]};CKEDITOR.loadTemplates=function(a,d){for(var e=
967
- [],b=0,c=a.length;b<c;b++)f[a[b]]||(e.push(a[b]),f[a[b]]=1);e.length?CKEDITOR.scriptLoader.load(e,d):setTimeout(d,0)}})();CKEDITOR.config.templates_files=[CKEDITOR.getUrl("plugins/templates/templates/default.js")];CKEDITOR.config.templates_replaceContent=!0;CKEDITOR.plugins.add("tliyoutube",{icons:"tliyoutube",init:function(a){a.addCommand("tliyoutubeDialog",new CKEDITOR.dialogCommand("tliyoutubeDialog"));a.ui.addButton("tliyoutube",{label:"Insert YouTube video",command:"tliyoutubeDialog",toolbar:"paragraph"});CKEDITOR.dialog.add("tliyoutubeDialog",this.path+"dialogs/tliyoutube.js")}});(function(){function w(a){function d(){for(var b=g(),e=CKEDITOR.tools.clone(a.config.toolbarGroups)||n(a),f=0;f<e.length;f++){var k=e[f];if("/"!=k){"string"==typeof k&&(k=e[f]={name:k});var i,d=k.groups;if(d)for(var h=0;h<d.length;h++)i=d[h],(i=b[i])&&c(k,i);(i=b[k.name])&&c(k,i)}}return e}function g(){var b={},c,f,e;for(c in a.ui.items)f=a.ui.items[c],e=f.toolbar||"others",e=e.split(","),f=e[0],e=parseInt(e[1]||-1,10),b[f]||(b[f]=[]),b[f].push({name:c,order:e});for(f in b)b[f]=b[f].sort(function(b,
986
+ [],b=0,c=a.length;b<c;b++)f[a[b]]||(e.push(a[b]),f[a[b]]=1);e.length?CKEDITOR.scriptLoader.load(e,d):setTimeout(d,0)}})();CKEDITOR.config.templates_files=[CKEDITOR.getUrl("plugins/templates/templates/default.js")];CKEDITOR.config.templates_replaceContent=!0;(function(){function w(a){function d(){for(var b=g(),e=CKEDITOR.tools.clone(a.config.toolbarGroups)||n(a),f=0;f<e.length;f++){var k=e[f];if("/"!=k){"string"==typeof k&&(k=e[f]={name:k});var i,d=k.groups;if(d)for(var h=0;h<d.length;h++)i=d[h],(i=b[i])&&c(k,i);(i=b[k.name])&&c(k,i)}}return e}function g(){var b={},c,f,e;for(c in a.ui.items)f=a.ui.items[c],e=f.toolbar||"others",e=e.split(","),f=e[0],e=parseInt(e[1]||-1,10),b[f]||(b[f]=[]),b[f].push({name:c,order:e});for(f in b)b[f]=b[f].sort(function(b,
968
987
  a){return b.order==a.order?0:0>a.order?-1:0>b.order?1:b.order<a.order?-1:1});return b}function c(c,e){if(e.length){c.items?c.items.push(a.ui.create("-")):c.items=[];for(var f;f=e.shift();)if(f="string"==typeof f?f:f.name,!b||-1==CKEDITOR.tools.indexOf(b,f))(f=a.ui.create(f))&&a.addFeature(f)&&c.items.push(f)}}function h(b){var a=[],e,d,h;for(e=0;e<b.length;++e)d=b[e],h={},"/"==d?a.push(d):CKEDITOR.tools.isArray(d)?(c(h,CKEDITOR.tools.clone(d)),a.push(h)):d.items&&(c(h,CKEDITOR.tools.clone(d.items)),
969
988
  h.name=d.name,a.push(h));return a}var b=a.config.removeButtons,b=b&&b.split(","),e=a.config.toolbar;"string"==typeof e&&(e=a.config["toolbar_"+e]);return a.toolbar=e?h(e):d()}function n(a){return a._.toolbarGroups||(a._.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",
970
989
  "indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var u=function(){this.toolbars=[];this.focusCommandExecuted=!1};u.prototype.focus=function(){for(var a=0,d;d=this.toolbars[a++];)for(var g=0,c;c=d.items[g++];)if(c.focus){c.focus();return}};var x={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(a){a.toolbox&&(a.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){a.toolbox.focus()},
@@ -1011,9 +1030,4 @@ c.docType+'<html dir="'+c.contentsLangDirection+'" lang="'+(c.contentsLanguage||
1011
1030
  "")+">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded=1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"<\/script>";CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(c+='<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)<\/script>');h&&(CKEDITOR.env.ie&&10>CKEDITOR.env.version)&&(c+='<script id="cke_basetagscrpt">var baseTag = document.querySelector( "base" );baseTag.href = baseTag.href;<\/script>');
1012
1031
  a=a.replace(/(?=\s*<\/(:?head)>)/,c);this.clearCustomData();this.clearListeners();b.fire("contentDomUnload");var i=this.getDocument();try{i.write(a)}catch(j){setTimeout(function(){i.write(a)},0)}}},getData:function(a){if(a)return this.getHtml();var a=this.editor,e=a.config,b=e.fullPage,c=b&&a.docType,d=b&&a.xmlDeclaration,g=this.getDocument(),b=b?g.getDocumentElement().getOuterHtml():g.getBody().getHtml();CKEDITOR.env.gecko&&e.enterMode!=CKEDITOR.ENTER_BR&&(b=b.replace(/<br>(?=\s*(:?$|<\/body>))/,
1013
1032
  ""));b=a.dataProcessor.toDataFormat(b);d&&(b=d+"\n"+b);c&&(b=c+"\n"+b);return b},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:j.baseProto.focus.call(this)},detach:function(){var a=this.editor,e=a.document,a=a.window.getFrame();j.baseProto.detach.call(this);this.clearCustomData();e.getDocumentElement().clearCustomData();a.clearCustomData();CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);(e=a.removeCustomData("onResize"))&&e.removeListener();a.remove()}}})})();
1014
- CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;CKEDITOR.config.contentsCss=CKEDITOR.getUrl("contents.css");(function(){function i(a){var j=a.config,m=a.fire("uiSpace",{space:"top",html:""}).html,p=function(){function f(a,c,e){b.setStyle(c,s(e));b.setStyle("position",a)}function e(a){var b=i.getDocumentPosition();switch(a){case "top":f("absolute","top",b.y-n-o);break;case "pin":f("fixed","top",t);break;case "bottom":f("absolute","top",b.y+(c.height||c.bottom-c.top)+o)}k=a}var k,i,l,c,h,n,r,m=j.floatSpaceDockedOffsetX||0,o=j.floatSpaceDockedOffsetY||0,q=j.floatSpacePinnedOffsetX||0,t=j.floatSpacePinnedOffsetY||
1015
- 0;return function(d){if(i=a.editable())if(d&&"focus"==d.name&&b.show(),b.removeStyle("left"),b.removeStyle("right"),l=b.getClientRect(),c=i.getClientRect(),h=g.getViewPaneSize(),n=l.height,r="pageXOffset"in g.$?g.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft,k){n+o<=c.top?e("top"):n+o>h.height-c.bottom?e("pin"):e("bottom");var d=h.width/2,d=0<c.left&&c.right<h.width&&c.width>l.width?"rtl"==a.config.contentsLangDirection?"right":"left":d-c.left>c.right-d?"left":"right",f;l.width>h.width?
1016
- (d="left",f=0):(f="left"==d?0<c.left?c.left:0:c.right<h.width?h.width-c.right:0,f+l.width>h.width&&(d="left"==d?"right":"left",f=0));b.setStyle(d,s(("pin"==k?q:m)+f+("pin"==k?0:"left"==d?r:-r)))}else k="pin",e("pin"),p(d)}}();if(m){var i=new CKEDITOR.template('<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" title="'+(CKEDITOR.env.gecko?" ":"")+'" lang="{langCode}" role="application" style="{style}"'+
1017
- (a.title?' aria-labelledby="cke_{name}_arialbl"':" ")+">"+(a.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':" ")+'<div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),b=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(i.output({content:m,id:a.id,langDir:a.lang.dir,langCode:a.langCode,name:a.name,style:"display:none;z-index:"+(j.baseFloatZIndex-1),topId:a.ui.spaceId("top"),voiceLabel:a.title}))),
1018
- q=CKEDITOR.tools.eventsBuffer(500,p),e=CKEDITOR.tools.eventsBuffer(100,p);b.unselectable();b.on("mousedown",function(a){a=a.data;a.getTarget().hasAscendant("a",1)||a.preventDefault()});a.on("focus",function(b){p(b);a.on("change",q.input);g.on("scroll",e.input);g.on("resize",e.input)});a.on("blur",function(){b.hide();a.removeListener("change",q.input);g.removeListener("scroll",e.input);g.removeListener("resize",e.input)});a.on("destroy",function(){g.removeListener("scroll",e.input);g.removeListener("resize",
1019
- e.input);b.clearCustomData();b.remove()});a.focusManager.hasFocus&&b.show();a.focusManager.add(b,1)}}var g=CKEDITOR.document.getWindow(),s=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(a){a.on("loaded",function(){i(this)},null,null,20)}})})();CKEDITOR.config.plugins='basicstyles,blockquote,dialogui,dialog,clipboard,button,panelbutton,panel,floatpanel,colorbutton,colordialog,menu,contextmenu,elementspath,enterkey,entities,popup,filebrowser,find,listblock,richcombo,format,horizontalrule,image,lineutils,widget,image2,imagepaste,indent,indentblock,indentlist,justify,fakeobjects,link,list,liststyle,magicline,newpage,pagebreak,pastefromword,pastetext,removeformat,selectall,sharedspace,showblocks,showborders,sourcearea,sourcedialog,stylescombo,stylesheetparser,syntaxhighlight,table,tabletools,templates,tliyoutube,toolbar,undo,wysiwygarea,floatingspace';CKEDITOR.config.skin='moonocolor';(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('bold,0,,italic,24,,strike,48,,subscript,72,,superscript,96,,underline,120,,blockquote,144,,copy-rtl,168,,copy,192,,cut-rtl,216,,cut,240,,paste-rtl,264,,paste,288,,bgcolor,312,,textcolor,336,,find-rtl,360,,find,384,,replace,408,,horizontalrule,432,,image,456,,indent-rtl,480,,indent,504,,outdent-rtl,528,,outdent,552,,justifyblock,576,,justifycenter,600,,justifyleft,624,,justifyright,648,,anchor-rtl,672,,anchor,696,,link,720,,unlink,744,,bulletedlist-rtl,768,,bulletedlist,792,,numberedlist-rtl,816,,numberedlist,840,,newpage-rtl,864,,newpage,888,,pagebreak-rtl,912,,pagebreak,936,,pastefromword-rtl,960,,pastefromword,984,,pastetext-rtl,1008,,pastetext,1032,,removeformat,1056,,selectall,1080,,showblocks-rtl,1104,,showblocks,1128,,source-rtl,1152,,source,1176,,sourcedialog-rtl,1200,,sourcedialog,1224,,syntaxhighlight,2496,auto,table,1272,,templates-rtl,1296,,templates,1320,,tliyoutube,2688,auto,redo-rtl,1368,,redo,1392,,undo-rtl,1416,,undo,1440,','icons_hidpi.png');else setIcons('bold,0,auto,italic,24,auto,strike,48,auto,subscript,72,auto,superscript,96,auto,underline,120,auto,blockquote,144,auto,copy-rtl,168,auto,copy,192,auto,cut-rtl,216,auto,cut,240,auto,paste-rtl,264,auto,paste,288,auto,bgcolor,312,auto,textcolor,336,auto,find-rtl,360,auto,find,384,auto,replace,408,auto,horizontalrule,432,auto,image,456,auto,indent-rtl,480,auto,indent,504,auto,outdent-rtl,528,auto,outdent,552,auto,justifyblock,576,auto,justifycenter,600,auto,justifyleft,624,auto,justifyright,648,auto,anchor-rtl,672,auto,anchor,696,auto,link,720,auto,unlink,744,auto,bulletedlist-rtl,768,auto,bulletedlist,792,auto,numberedlist-rtl,816,auto,numberedlist,840,auto,newpage-rtl,864,auto,newpage,888,auto,pagebreak-rtl,912,auto,pagebreak,936,auto,pastefromword-rtl,960,auto,pastefromword,984,auto,pastetext-rtl,1008,auto,pastetext,1032,auto,removeformat,1056,auto,selectall,1080,auto,showblocks-rtl,1104,auto,showblocks,1128,auto,source-rtl,1152,auto,source,1176,auto,sourcedialog-rtl,1200,auto,sourcedialog,1224,auto,syntaxhighlight,1248,auto,table,1272,auto,templates-rtl,1296,auto,templates,1320,auto,tliyoutube,1344,auto,redo-rtl,1368,auto,redo,1392,auto,undo-rtl,1416,auto,undo,1440,auto','icons.png');})();CKEDITOR.lang.languages={"en":1};}());
1033
+ CKEDITOR.config.disableObjectResizing=!1;CKEDITOR.config.disableNativeTableHandles=!0;CKEDITOR.config.disableNativeSpellChecker=!0;CKEDITOR.config.contentsCss=CKEDITOR.getUrl("contents.css");CKEDITOR.config.plugins='basicstyles,blockquote,dialogui,dialog,clipboard,button,panelbutton,panel,floatpanel,colorbutton,colordialog,menu,contextmenu,elementspath,enterkey,entities,popup,filebrowser,find,floatingspace,listblock,richcombo,format,horizontalrule,image,lineutils,widget,image2,imagepaste,indent,indentblock,indentlist,justify,fakeobjects,link,list,liststyle,magicline,newpage,oembed,pagebreak,pastefromword,pastetext,removeformat,selectall,sharedspace,showblocks,showborders,sourcearea,sourcedialog,stylescombo,stylesheetparser,syntaxhighlight,table,tabletools,templates,toolbar,undo,wysiwygarea';CKEDITOR.config.skin='moonocolor';(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('bold,0,,italic,24,,strike,48,,subscript,72,,superscript,96,,underline,120,,blockquote,144,,copy-rtl,168,,copy,192,,cut-rtl,216,,cut,240,,paste-rtl,264,,paste,288,,bgcolor,312,,textcolor,336,,find-rtl,360,,find,384,,replace,408,,horizontalrule,432,,image,456,,indent-rtl,480,,indent,504,,outdent-rtl,528,,outdent,552,,justifyblock,576,,justifycenter,600,,justifyleft,624,,justifyright,648,,anchor-rtl,672,,anchor,696,,link,720,,unlink,744,,bulletedlist-rtl,768,,bulletedlist,792,,numberedlist-rtl,816,,numberedlist,840,,newpage-rtl,864,,newpage,888,,oembed,912,,pagebreak-rtl,936,,pagebreak,960,,pastefromword-rtl,984,,pastefromword,1008,,pastetext-rtl,1032,,pastetext,1056,,removeformat,1080,,selectall,1104,,showblocks-rtl,1128,,showblocks,1152,,source-rtl,1176,,source,1200,,sourcedialog-rtl,1224,,sourcedialog,1248,,syntaxhighlight,2544,auto,table,1296,,templates-rtl,1320,,templates,1344,,redo-rtl,1368,,redo,1392,,undo-rtl,1416,,undo,1440,','icons_hidpi.png');else setIcons('bold,0,auto,italic,24,auto,strike,48,auto,subscript,72,auto,superscript,96,auto,underline,120,auto,blockquote,144,auto,copy-rtl,168,auto,copy,192,auto,cut-rtl,216,auto,cut,240,auto,paste-rtl,264,auto,paste,288,auto,bgcolor,312,auto,textcolor,336,auto,find-rtl,360,auto,find,384,auto,replace,408,auto,horizontalrule,432,auto,image,456,auto,indent-rtl,480,auto,indent,504,auto,outdent-rtl,528,auto,outdent,552,auto,justifyblock,576,auto,justifycenter,600,auto,justifyleft,624,auto,justifyright,648,auto,anchor-rtl,672,auto,anchor,696,auto,link,720,auto,unlink,744,auto,bulletedlist-rtl,768,auto,bulletedlist,792,auto,numberedlist-rtl,816,auto,numberedlist,840,auto,newpage-rtl,864,auto,newpage,888,auto,oembed,912,auto,pagebreak-rtl,936,auto,pagebreak,960,auto,pastefromword-rtl,984,auto,pastefromword,1008,auto,pastetext-rtl,1032,auto,pastetext,1056,auto,removeformat,1080,auto,selectall,1104,auto,showblocks-rtl,1128,auto,showblocks,1152,auto,source-rtl,1176,auto,source,1200,auto,sourcedialog-rtl,1224,auto,sourcedialog,1248,auto,syntaxhighlight,1272,auto,table,1296,auto,templates-rtl,1320,auto,templates,1344,auto,redo-rtl,1368,auto,redo,1392,auto,undo-rtl,1416,auto,undo,1440,auto','icons.png');})();CKEDITOR.lang.languages={"en":1};}());
@@ -2,4 +2,4 @@
2
2
  Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
3
3
  For licensing, see LICENSE.html or http://ckeditor.com/license
4
4
  */
5
- CKEDITOR.lang['en']={"editor":"Rich Text Editor","editorPanel":"Rich Text Editor panel","common":{"editorHelp":"Press ALT 0 for help","browseServer":"Browse Server","url":"URL","protocol":"Protocol","upload":"Upload","uploadSubmit":"Send it to the Server","image":"Image","flash":"Flash","form":"Form","checkbox":"Checkbox","radio":"Radio Button","textField":"Text Field","textarea":"Textarea","hiddenField":"Hidden Field","button":"Button","select":"Selection Field","imageButton":"Image Button","notSet":"<not set>","id":"Id","name":"Name","langDir":"Language Direction","langDirLtr":"Left to Right (LTR)","langDirRtl":"Right to Left (RTL)","langCode":"Language Code","longDescr":"Long Description URL","cssClass":"Stylesheet Classes","advisoryTitle":"Advisory Title","cssStyle":"Style","ok":"OK","cancel":"Cancel","close":"Close","preview":"Preview","resize":"Resize","generalTab":"General","advancedTab":"Advanced","validateNumberFailed":"This value is not a number.","confirmNewPage":"Any unsaved changes to this content will be lost. Are you sure you want to load new page?","confirmCancel":"You have changed some options. Are you sure you want to close the dialog window?","options":"Options","target":"Target","targetNew":"New Window (_blank)","targetTop":"Topmost Window (_top)","targetSelf":"Same Window (_self)","targetParent":"Parent Window (_parent)","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","styles":"Style","cssClasses":"Stylesheet Classes","width":"Width","height":"Height","align":"Alignment","alignLeft":"Left","alignRight":"Right","alignCenter":"Center","alignJustify":"Justify","alignTop":"Top","alignMiddle":"Middle","alignBottom":"Bottom","alignNone":"None","invalidValue":"Invalid value.","invalidHeight":"Height must be a number.","invalidWidth":"Width must be a number.","invalidCssLength":"Value specified for the \"%1\" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"Value specified for the \"%1\" field must be a positive number with or without a valid HTML measurement unit (px or %).","invalidInlineStyle":"Value specified for the inline style must consist of one or more tuples with the format of \"name : value\", separated by semi-colons.","cssLengthTooltip":"Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1<span class=\"cke_accessibility\">, unavailable</span>"},"basicstyles":{"bold":"Bold","italic":"Italic","strike":"Strikethrough","subscript":"Subscript","superscript":"Superscript","underline":"Underline"},"blockquote":{"toolbar":"Block Quote"},"clipboard":{"copy":"Copy","copyError":"Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).","cut":"Cut","cutError":"Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).","paste":"Paste","pasteArea":"Paste Area","pasteMsg":"Please paste inside the following box using the keyboard (<strong>Ctrl/Cmd+V</strong>) and hit OK","securityMsg":"Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.","title":"Paste"},"button":{"selectedLabel":"%1 (Selected)"},"colorbutton":{"auto":"Automatic","bgColorTitle":"Background Color","colors":{"000":"Black","800000":"Maroon","8B4513":"Saddle Brown","2F4F4F":"Dark Slate Gray","008080":"Teal","000080":"Navy","4B0082":"Indigo","696969":"Dark Gray","B22222":"Fire Brick","A52A2A":"Brown","DAA520":"Golden Rod","006400":"Dark Green","40E0D0":"Turquoise","0000CD":"Medium Blue","800080":"Purple","808080":"Gray","F00":"Red","FF8C00":"Dark Orange","FFD700":"Gold","008000":"Green","0FF":"Cyan","00F":"Blue","EE82EE":"Violet","A9A9A9":"Dim Gray","FFA07A":"Light Salmon","FFA500":"Orange","FFFF00":"Yellow","00FF00":"Lime","AFEEEE":"Pale Turquoise","ADD8E6":"Light Blue","DDA0DD":"Plum","D3D3D3":"Light Grey","FFF0F5":"Lavender Blush","FAEBD7":"Antique White","FFFFE0":"Light Yellow","F0FFF0":"Honeydew","F0FFFF":"Azure","F0F8FF":"Alice Blue","E6E6FA":"Lavender","FFF":"White"},"more":"More Colors...","panelTitle":"Colors","textColorTitle":"Text Color"},"colordialog":{"clear":"Clear","highlight":"Highlight","options":"Color Options","selected":"Selected Color","title":"Select color"},"contextmenu":{"options":"Context Menu Options"},"elementspath":{"eleLabel":"Elements path","eleTitle":"%1 element"},"find":{"find":"Find","findOptions":"Find Options","findWhat":"Find what:","matchCase":"Match case","matchCyclic":"Match cyclic","matchWord":"Match whole word","notFoundMsg":"The specified text was not found.","replace":"Replace","replaceAll":"Replace All","replaceSuccessMsg":"%1 occurrence(s) replaced.","replaceWith":"Replace with:","title":"Find and Replace"},"format":{"label":"Format","panelTitle":"Paragraph Format","tag_address":"Address","tag_div":"Normal (DIV)","tag_h1":"Heading 1","tag_h2":"Heading 2","tag_h3":"Heading 3","tag_h4":"Heading 4","tag_h5":"Heading 5","tag_h6":"Heading 6","tag_p":"Normal","tag_pre":"Formatted"},"horizontalrule":{"toolbar":"Insert Horizontal Line"},"image":{"alertUrl":"Please type the image URL","alt":"Alternative Text","border":"Border","btnUpload":"Send it to the Server","button2Img":"Do you want to transform the selected image button on a simple image?","hSpace":"HSpace","img2Button":"Do you want to transform the selected image on a image button?","infoTab":"Image Info","linkTab":"Link","lockRatio":"Lock Ratio","menu":"Image Properties","resetSize":"Reset Size","title":"Image Properties","titleButton":"Image Button Properties","upload":"Upload","urlMissing":"Image source URL is missing.","vSpace":"VSpace","validateBorder":"Border must be a whole number.","validateHSpace":"HSpace must be a whole number.","validateVSpace":"VSpace must be a whole number."},"widget":{"move":"Click and drag to move"},"image2":{"alt":"Alternative Text","btnUpload":"Send it to the Server","captioned":"Captioned image","captionPlaceholder":"Caption","infoTab":"Image Info","lockRatio":"Lock Ratio","menu":"Image Properties","pathName":"image","pathNameCaption":"caption","resetSize":"Reset Size","resizer":"Click and drag to resize","title":"Image Properties","uploadTab":"Upload","urlMissing":"Image source URL is missing."},"indent":{"indent":"Increase Indent","outdent":"Decrease Indent"},"justify":{"block":"Justify","center":"Center","left":"Align Left","right":"Align Right"},"fakeobjects":{"anchor":"Anchor","flash":"Flash Animation","hiddenfield":"Hidden Field","iframe":"IFrame","unknown":"Unknown Object"},"link":{"acccessKey":"Access Key","advanced":"Advanced","advisoryContentType":"Advisory Content Type","advisoryTitle":"Advisory Title","anchor":{"toolbar":"Anchor","menu":"Edit Anchor","title":"Anchor Properties","name":"Anchor Name","errorName":"Please type the anchor name","remove":"Remove Anchor"},"anchorId":"By Element Id","anchorName":"By Anchor Name","charset":"Linked Resource Charset","cssClasses":"Stylesheet Classes","emailAddress":"E-Mail Address","emailBody":"Message Body","emailSubject":"Message Subject","id":"Id","info":"Link Info","langCode":"Language Code","langDir":"Language Direction","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","menu":"Edit Link","name":"Name","noAnchors":"(No anchors available in the document)","noEmail":"Please type the e-mail address","noUrl":"Please type the link URL","other":"<other>","popupDependent":"Dependent (Netscape)","popupFeatures":"Popup Window Features","popupFullScreen":"Full Screen (IE)","popupLeft":"Left Position","popupLocationBar":"Location Bar","popupMenuBar":"Menu Bar","popupResizable":"Resizable","popupScrollBars":"Scroll Bars","popupStatusBar":"Status Bar","popupToolbar":"Toolbar","popupTop":"Top Position","rel":"Relationship","selectAnchor":"Select an Anchor","styles":"Style","tabIndex":"Tab Index","target":"Target","targetFrame":"<frame>","targetFrameName":"Target Frame Name","targetPopup":"<popup window>","targetPopupName":"Popup Window Name","title":"Link","toAnchor":"Link to anchor in the text","toEmail":"E-mail","toUrl":"URL","toolbar":"Link","type":"Link Type","unlink":"Unlink","upload":"Upload"},"list":{"bulletedlist":"Insert/Remove Bulleted List","numberedlist":"Insert/Remove Numbered List"},"liststyle":{"armenian":"Armenian numbering","bulletedTitle":"Bulleted List Properties","circle":"Circle","decimal":"Decimal (1, 2, 3, etc.)","decimalLeadingZero":"Decimal leading zero (01, 02, 03, etc.)","disc":"Disc","georgian":"Georgian numbering (an, ban, gan, etc.)","lowerAlpha":"Lower Alpha (a, b, c, d, e, etc.)","lowerGreek":"Lower Greek (alpha, beta, gamma, etc.)","lowerRoman":"Lower Roman (i, ii, iii, iv, v, etc.)","none":"None","notset":"<not set>","numberedTitle":"Numbered List Properties","square":"Square","start":"Start","type":"Type","upperAlpha":"Upper Alpha (A, B, C, D, E, etc.)","upperRoman":"Upper Roman (I, II, III, IV, V, etc.)","validateStartNumber":"List start number must be a whole number."},"magicline":{"title":"Insert paragraph here"},"newpage":{"toolbar":"New Page"},"pagebreak":{"alt":"Page Break","toolbar":"Insert Page Break for Printing"},"pastefromword":{"confirmCleanup":"The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?","error":"It was not possible to clean up the pasted data due to an internal error","title":"Paste from Word","toolbar":"Paste from Word"},"pastetext":{"button":"Paste as plain text","title":"Paste as Plain Text"},"removeformat":{"toolbar":"Remove Format"},"selectall":{"toolbar":"Select All"},"showblocks":{"toolbar":"Show Blocks"},"sourcearea":{"toolbar":"Source"},"sourcedialog":{"toolbar":"Source","title":"Source"},"stylescombo":{"label":"Styles","panelTitle":"Formatting Styles","panelTitle1":"Block Styles","panelTitle2":"Inline Styles","panelTitle3":"Object Styles"},"syntaxhighlight":{"title":"Add or update a code snippet","contextTitle":"Edit source code","sourceTab":"Source code","langLbl":"Select language","sourceTextareaEmptyError":"Source code mustn't be empty.","advancedTab":"Advanced","hideGutter":"Hide gutter","hideGutterLbl":"Hide gutter & line numbers.","hideControls":"Hide controls","hideControlsLbl":"Hide code controls at the top of the code block.","collapse":"Collapse","collapseLbl":"Collapse the code block by default. (controls need to be turned on)","codeTitleLbl":"Use a Code Title","showColumns":"Show columns","showColumnsLbl":"Show row columns in the first line.","lineWrap":"Disable line wrapping","lineWrapLbl":"Switch off line wrapping.","lineCount":"Default line count","highlight":"Highlight lines","highlightLbl":"Enter a comma seperated lines of lines you want to highlight, eg <em style=\"font-style:italic\">3,10,15</em>."},"table":{"border":"Border size","caption":"Caption","cell":{"menu":"Cell","insertBefore":"Insert Cell Before","insertAfter":"Insert Cell After","deleteCell":"Delete Cells","merge":"Merge Cells","mergeRight":"Merge Right","mergeDown":"Merge Down","splitHorizontal":"Split Cell Horizontally","splitVertical":"Split Cell Vertically","title":"Cell Properties","cellType":"Cell Type","rowSpan":"Rows Span","colSpan":"Columns Span","wordWrap":"Word Wrap","hAlign":"Horizontal Alignment","vAlign":"Vertical Alignment","alignBaseline":"Baseline","bgColor":"Background Color","borderColor":"Border Color","data":"Data","header":"Header","yes":"Yes","no":"No","invalidWidth":"Cell width must be a number.","invalidHeight":"Cell height must be a number.","invalidRowSpan":"Rows span must be a whole number.","invalidColSpan":"Columns span must be a whole number.","chooseColor":"Choose"},"cellPad":"Cell padding","cellSpace":"Cell spacing","column":{"menu":"Column","insertBefore":"Insert Column Before","insertAfter":"Insert Column After","deleteColumn":"Delete Columns"},"columns":"Columns","deleteTable":"Delete Table","headers":"Headers","headersBoth":"Both","headersColumn":"First column","headersNone":"None","headersRow":"First Row","invalidBorder":"Border size must be a number.","invalidCellPadding":"Cell padding must be a positive number.","invalidCellSpacing":"Cell spacing must be a positive number.","invalidCols":"Number of columns must be a number greater than 0.","invalidHeight":"Table height must be a number.","invalidRows":"Number of rows must be a number greater than 0.","invalidWidth":"Table width must be a number.","menu":"Table Properties","row":{"menu":"Row","insertBefore":"Insert Row Before","insertAfter":"Insert Row After","deleteRow":"Delete Rows"},"rows":"Rows","summary":"Summary","title":"Table Properties","toolbar":"Table","widthPc":"percent","widthPx":"pixels","widthUnit":"width unit"},"templates":{"button":"Templates","emptyListMsg":"(No templates defined)","insertOption":"Replace actual contents","options":"Template Options","selectPromptMsg":"Please select the template to open in the editor","title":"Content Templates"},"toolbar":{"toolbarCollapse":"Collapse Toolbar","toolbarExpand":"Expand Toolbar","toolbarGroups":{"document":"Document","clipboard":"Clipboard/Undo","editing":"Editing","forms":"Forms","basicstyles":"Basic Styles","paragraph":"Paragraph","links":"Links","insert":"Insert","styles":"Styles","colors":"Colors","tools":"Tools"},"toolbars":"Editor toolbars"},"undo":{"redo":"Redo","undo":"Undo"}};
5
+ CKEDITOR.lang['en']={"editor":"Rich Text Editor","editorPanel":"Rich Text Editor panel","common":{"editorHelp":"Press ALT 0 for help","browseServer":"Browse Server","url":"URL","protocol":"Protocol","upload":"Upload","uploadSubmit":"Send it to the Server","image":"Image","flash":"Flash","form":"Form","checkbox":"Checkbox","radio":"Radio Button","textField":"Text Field","textarea":"Textarea","hiddenField":"Hidden Field","button":"Button","select":"Selection Field","imageButton":"Image Button","notSet":"<not set>","id":"Id","name":"Name","langDir":"Language Direction","langDirLtr":"Left to Right (LTR)","langDirRtl":"Right to Left (RTL)","langCode":"Language Code","longDescr":"Long Description URL","cssClass":"Stylesheet Classes","advisoryTitle":"Advisory Title","cssStyle":"Style","ok":"OK","cancel":"Cancel","close":"Close","preview":"Preview","resize":"Resize","generalTab":"General","advancedTab":"Advanced","validateNumberFailed":"This value is not a number.","confirmNewPage":"Any unsaved changes to this content will be lost. Are you sure you want to load new page?","confirmCancel":"You have changed some options. Are you sure you want to close the dialog window?","options":"Options","target":"Target","targetNew":"New Window (_blank)","targetTop":"Topmost Window (_top)","targetSelf":"Same Window (_self)","targetParent":"Parent Window (_parent)","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","styles":"Style","cssClasses":"Stylesheet Classes","width":"Width","height":"Height","align":"Alignment","alignLeft":"Left","alignRight":"Right","alignCenter":"Center","alignJustify":"Justify","alignTop":"Top","alignMiddle":"Middle","alignBottom":"Bottom","alignNone":"None","invalidValue":"Invalid value.","invalidHeight":"Height must be a number.","invalidWidth":"Width must be a number.","invalidCssLength":"Value specified for the \"%1\" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).","invalidHtmlLength":"Value specified for the \"%1\" field must be a positive number with or without a valid HTML measurement unit (px or %).","invalidInlineStyle":"Value specified for the inline style must consist of one or more tuples with the format of \"name : value\", separated by semi-colons.","cssLengthTooltip":"Enter a number for a value in pixels or a number with a valid CSS unit (px, %, in, cm, mm, em, ex, pt, or pc).","unavailable":"%1<span class=\"cke_accessibility\">, unavailable</span>"},"basicstyles":{"bold":"Bold","italic":"Italic","strike":"Strikethrough","subscript":"Subscript","superscript":"Superscript","underline":"Underline"},"blockquote":{"toolbar":"Block Quote"},"clipboard":{"copy":"Copy","copyError":"Your browser security settings don't permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl/Cmd+C).","cut":"Cut","cutError":"Your browser security settings don't permit the editor to automatically execute cutting operations. Please use the keyboard for that (Ctrl/Cmd+X).","paste":"Paste","pasteArea":"Paste Area","pasteMsg":"Please paste inside the following box using the keyboard (<strong>Ctrl/Cmd+V</strong>) and hit OK","securityMsg":"Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.","title":"Paste"},"button":{"selectedLabel":"%1 (Selected)"},"colorbutton":{"auto":"Automatic","bgColorTitle":"Background Color","colors":{"000":"Black","800000":"Maroon","8B4513":"Saddle Brown","2F4F4F":"Dark Slate Gray","008080":"Teal","000080":"Navy","4B0082":"Indigo","696969":"Dark Gray","B22222":"Fire Brick","A52A2A":"Brown","DAA520":"Golden Rod","006400":"Dark Green","40E0D0":"Turquoise","0000CD":"Medium Blue","800080":"Purple","808080":"Gray","F00":"Red","FF8C00":"Dark Orange","FFD700":"Gold","008000":"Green","0FF":"Cyan","00F":"Blue","EE82EE":"Violet","A9A9A9":"Dim Gray","FFA07A":"Light Salmon","FFA500":"Orange","FFFF00":"Yellow","00FF00":"Lime","AFEEEE":"Pale Turquoise","ADD8E6":"Light Blue","DDA0DD":"Plum","D3D3D3":"Light Grey","FFF0F5":"Lavender Blush","FAEBD7":"Antique White","FFFFE0":"Light Yellow","F0FFF0":"Honeydew","F0FFFF":"Azure","F0F8FF":"Alice Blue","E6E6FA":"Lavender","FFF":"White"},"more":"More Colors...","panelTitle":"Colors","textColorTitle":"Text Color"},"colordialog":{"clear":"Clear","highlight":"Highlight","options":"Color Options","selected":"Selected Color","title":"Select color"},"contextmenu":{"options":"Context Menu Options"},"elementspath":{"eleLabel":"Elements path","eleTitle":"%1 element"},"find":{"find":"Find","findOptions":"Find Options","findWhat":"Find what:","matchCase":"Match case","matchCyclic":"Match cyclic","matchWord":"Match whole word","notFoundMsg":"The specified text was not found.","replace":"Replace","replaceAll":"Replace All","replaceSuccessMsg":"%1 occurrence(s) replaced.","replaceWith":"Replace with:","title":"Find and Replace"},"format":{"label":"Format","panelTitle":"Paragraph Format","tag_address":"Address","tag_div":"Normal (DIV)","tag_h1":"Heading 1","tag_h2":"Heading 2","tag_h3":"Heading 3","tag_h4":"Heading 4","tag_h5":"Heading 5","tag_h6":"Heading 6","tag_p":"Normal","tag_pre":"Formatted"},"horizontalrule":{"toolbar":"Insert Horizontal Line"},"image":{"alertUrl":"Please type the image URL","alt":"Alternative Text","border":"Border","btnUpload":"Send it to the Server","button2Img":"Do you want to transform the selected image button on a simple image?","hSpace":"HSpace","img2Button":"Do you want to transform the selected image on a image button?","infoTab":"Image Info","linkTab":"Link","lockRatio":"Lock Ratio","menu":"Image Properties","resetSize":"Reset Size","title":"Image Properties","titleButton":"Image Button Properties","upload":"Upload","urlMissing":"Image source URL is missing.","vSpace":"VSpace","validateBorder":"Border must be a whole number.","validateHSpace":"HSpace must be a whole number.","validateVSpace":"VSpace must be a whole number."},"widget":{"move":"Click and drag to move"},"image2":{"alt":"Alternative Text","btnUpload":"Send it to the Server","captioned":"Captioned image","captionPlaceholder":"Caption","infoTab":"Image Info","lockRatio":"Lock Ratio","menu":"Image Properties","pathName":"image","pathNameCaption":"caption","resetSize":"Reset Size","resizer":"Click and drag to resize","title":"Image Properties","uploadTab":"Upload","urlMissing":"Image source URL is missing."},"indent":{"indent":"Increase Indent","outdent":"Decrease Indent"},"justify":{"block":"Justify","center":"Center","left":"Align Left","right":"Align Right"},"fakeobjects":{"anchor":"Anchor","flash":"Flash Animation","hiddenfield":"Hidden Field","iframe":"IFrame","unknown":"Unknown Object"},"link":{"acccessKey":"Access Key","advanced":"Advanced","advisoryContentType":"Advisory Content Type","advisoryTitle":"Advisory Title","anchor":{"toolbar":"Anchor","menu":"Edit Anchor","title":"Anchor Properties","name":"Anchor Name","errorName":"Please type the anchor name","remove":"Remove Anchor"},"anchorId":"By Element Id","anchorName":"By Anchor Name","charset":"Linked Resource Charset","cssClasses":"Stylesheet Classes","emailAddress":"E-Mail Address","emailBody":"Message Body","emailSubject":"Message Subject","id":"Id","info":"Link Info","langCode":"Language Code","langDir":"Language Direction","langDirLTR":"Left to Right (LTR)","langDirRTL":"Right to Left (RTL)","menu":"Edit Link","name":"Name","noAnchors":"(No anchors available in the document)","noEmail":"Please type the e-mail address","noUrl":"Please type the link URL","other":"<other>","popupDependent":"Dependent (Netscape)","popupFeatures":"Popup Window Features","popupFullScreen":"Full Screen (IE)","popupLeft":"Left Position","popupLocationBar":"Location Bar","popupMenuBar":"Menu Bar","popupResizable":"Resizable","popupScrollBars":"Scroll Bars","popupStatusBar":"Status Bar","popupToolbar":"Toolbar","popupTop":"Top Position","rel":"Relationship","selectAnchor":"Select an Anchor","styles":"Style","tabIndex":"Tab Index","target":"Target","targetFrame":"<frame>","targetFrameName":"Target Frame Name","targetPopup":"<popup window>","targetPopupName":"Popup Window Name","title":"Link","toAnchor":"Link to anchor in the text","toEmail":"E-mail","toUrl":"URL","toolbar":"Link","type":"Link Type","unlink":"Unlink","upload":"Upload"},"list":{"bulletedlist":"Insert/Remove Bulleted List","numberedlist":"Insert/Remove Numbered List"},"liststyle":{"armenian":"Armenian numbering","bulletedTitle":"Bulleted List Properties","circle":"Circle","decimal":"Decimal (1, 2, 3, etc.)","decimalLeadingZero":"Decimal leading zero (01, 02, 03, etc.)","disc":"Disc","georgian":"Georgian numbering (an, ban, gan, etc.)","lowerAlpha":"Lower Alpha (a, b, c, d, e, etc.)","lowerGreek":"Lower Greek (alpha, beta, gamma, etc.)","lowerRoman":"Lower Roman (i, ii, iii, iv, v, etc.)","none":"None","notset":"<not set>","numberedTitle":"Numbered List Properties","square":"Square","start":"Start","type":"Type","upperAlpha":"Upper Alpha (A, B, C, D, E, etc.)","upperRoman":"Upper Roman (I, II, III, IV, V, etc.)","validateStartNumber":"List start number must be a whole number."},"magicline":{"title":"Insert paragraph here"},"newpage":{"toolbar":"New Page"},"oembed":{"title":"Embed Media Content (Photo, Video, Audio or Rich Content)","button":"Embed Media from External Sites","pasteUrl":"Paste a URL (shorted URLs are also supported) from one of the supported sites (e.g. YouTube, Flickr, Qik, Vimeo, Hulu, Viddler, MyOpera, etc.).","invalidUrl":"Please provide a valid URL.","noEmbedCode":"No embed code found, or site is not supported.","url":"URL:","width":"Width:","height":"Height:","widthTitle":"Width for the embeded content","heightTitle":"Height for the embeded content","maxWidth":"Max. Width:","maxHeight":"Max. Height:","maxWidthTitle":"Maximum Width for the embeded Content","maxHeightTitle":"Maximum Height for the embeded Content","none":"None","resizeType":"Resize Type (videos only):","noresize":"No Resize (use default)","responsive":"Responsive Resize","custom":"Specific Resize","noVimeo":"The owner of this video has set domain restrictions and you will not be able to embed it on your website.","Error":"Media Content could not been retrieved, please try a different URL."},"pagebreak":{"alt":"Page Break","toolbar":"Insert Page Break for Printing"},"pastefromword":{"confirmCleanup":"The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?","error":"It was not possible to clean up the pasted data due to an internal error","title":"Paste from Word","toolbar":"Paste from Word"},"pastetext":{"button":"Paste as plain text","title":"Paste as Plain Text"},"removeformat":{"toolbar":"Remove Format"},"selectall":{"toolbar":"Select All"},"showblocks":{"toolbar":"Show Blocks"},"sourcearea":{"toolbar":"Source"},"sourcedialog":{"toolbar":"Source","title":"Source"},"stylescombo":{"label":"Styles","panelTitle":"Formatting Styles","panelTitle1":"Block Styles","panelTitle2":"Inline Styles","panelTitle3":"Object Styles"},"syntaxhighlight":{"title":"Add or update a code snippet","contextTitle":"Edit source code","sourceTab":"Source code","langLbl":"Select language","sourceTextareaEmptyError":"Source code mustn't be empty.","advancedTab":"Advanced","hideGutter":"Hide gutter","hideGutterLbl":"Hide gutter & line numbers.","hideControls":"Hide controls","hideControlsLbl":"Hide code controls at the top of the code block.","collapse":"Collapse","collapseLbl":"Collapse the code block by default. (controls need to be turned on)","codeTitleLbl":"Use a Code Title","showColumns":"Show columns","showColumnsLbl":"Show row columns in the first line.","lineWrap":"Disable line wrapping","lineWrapLbl":"Switch off line wrapping.","lineCount":"Default line count","highlight":"Highlight lines","highlightLbl":"Enter a comma seperated lines of lines you want to highlight, eg <em style=\"font-style:italic\">3,10,15</em>."},"table":{"border":"Border size","caption":"Caption","cell":{"menu":"Cell","insertBefore":"Insert Cell Before","insertAfter":"Insert Cell After","deleteCell":"Delete Cells","merge":"Merge Cells","mergeRight":"Merge Right","mergeDown":"Merge Down","splitHorizontal":"Split Cell Horizontally","splitVertical":"Split Cell Vertically","title":"Cell Properties","cellType":"Cell Type","rowSpan":"Rows Span","colSpan":"Columns Span","wordWrap":"Word Wrap","hAlign":"Horizontal Alignment","vAlign":"Vertical Alignment","alignBaseline":"Baseline","bgColor":"Background Color","borderColor":"Border Color","data":"Data","header":"Header","yes":"Yes","no":"No","invalidWidth":"Cell width must be a number.","invalidHeight":"Cell height must be a number.","invalidRowSpan":"Rows span must be a whole number.","invalidColSpan":"Columns span must be a whole number.","chooseColor":"Choose"},"cellPad":"Cell padding","cellSpace":"Cell spacing","column":{"menu":"Column","insertBefore":"Insert Column Before","insertAfter":"Insert Column After","deleteColumn":"Delete Columns"},"columns":"Columns","deleteTable":"Delete Table","headers":"Headers","headersBoth":"Both","headersColumn":"First column","headersNone":"None","headersRow":"First Row","invalidBorder":"Border size must be a number.","invalidCellPadding":"Cell padding must be a positive number.","invalidCellSpacing":"Cell spacing must be a positive number.","invalidCols":"Number of columns must be a number greater than 0.","invalidHeight":"Table height must be a number.","invalidRows":"Number of rows must be a number greater than 0.","invalidWidth":"Table width must be a number.","menu":"Table Properties","row":{"menu":"Row","insertBefore":"Insert Row Before","insertAfter":"Insert Row After","deleteRow":"Delete Rows"},"rows":"Rows","summary":"Summary","title":"Table Properties","toolbar":"Table","widthPc":"percent","widthPx":"pixels","widthUnit":"width unit"},"templates":{"button":"Templates","emptyListMsg":"(No templates defined)","insertOption":"Replace actual contents","options":"Template Options","selectPromptMsg":"Please select the template to open in the editor","title":"Content Templates"},"toolbar":{"toolbarCollapse":"Collapse Toolbar","toolbarExpand":"Expand Toolbar","toolbarGroups":{"document":"Document","clipboard":"Clipboard/Undo","editing":"Editing","forms":"Forms","basicstyles":"Basic Styles","paragraph":"Paragraph","links":"Links","insert":"Insert","styles":"Styles","colors":"Colors","tools":"Tools"},"toolbars":"Editor toolbars"},"undo":{"redo":"Redo","undo":"Undo"}};
@@ -1,21 +1,20 @@
1
1
  /**
2
- * The footnotes dialog definition.
2
+ * The effective references dialog definition.
3
3
  *
4
- * Version 1.0.9
5
- * https://github.com/andykirk/CKEditorFootnotes
4
+ * Based on https://github.com/andykirk/CKEditorFootnotes Version 1.0.9
6
5
  *
7
6
  */
8
7
 
9
8
  // Dialog definition.
10
- CKEDITOR.dialog.add( 'footnotesDialog', function( editor ) {
9
+ CKEDITOR.dialog.add( 'referencesDialog', function( editor ) {
11
10
 
12
11
  return {
13
12
  editor_name: false,
14
13
  // Basic properties of the dialog window: title, minimum size.
15
- title: 'Manage Footnotes',
14
+ title: 'Manage References',
16
15
  minWidth: 400,
17
16
  minHeight: 200,
18
- footnotes_el: false,
17
+ references_el: false,
19
18
 
20
19
  // Dialog window contents definition.
21
20
  contents: [
@@ -27,19 +26,19 @@ CKEDITOR.dialog.add( 'footnotesDialog', function( editor ) {
27
26
  // The tab contents.
28
27
  elements: [
29
28
  {
30
- // Text input field for the footnotes text.
29
+ // Text input field for the references text.
31
30
  type: 'textarea',
32
- id: 'new_footnote',
33
- 'class': 'footnote_text',
34
- label: 'New footnote:',
31
+ id: 'new_reference',
32
+ 'class': 'reference_text',
33
+ label: 'New reference:',
35
34
  inputStyle: 'height: 100px',
36
35
  },
37
36
  {
38
- // Text input field for the footnotes title (explanation).
37
+ // Text input field for the references title (explanation).
39
38
  type: 'text',
40
- id: 'footnote_id',
41
- name: 'footnote_id',
42
- label: 'No existing footnotes',
39
+ id: 'reference_id',
40
+ name: 'reference_id',
41
+ label: 'No existing references',
43
42
 
44
43
 
45
44
  // Called by the main setupContent call on dialog initialization.
@@ -47,25 +46,25 @@ CKEDITOR.dialog.add( 'footnotesDialog', function( editor ) {
47
46
  var dialog = this.getDialog();
48
47
  $el = jQuery('#' + this.domId);
49
48
 
50
- dialog.footnotes_el = $el;
49
+ dialog.references_el = $el;
51
50
 
52
51
  editor = dialog.getParentEditor();
53
- // Dynamically add existing footnotes:
54
- $footnotes = editor.plugins.footnotes.editorContents(editor).find('.footnotes ol');
52
+ // Dynamically add existing references:
53
+ $references = editor.plugins.effective_references.editorContents(editor).find('.references ol');
55
54
  $this = this;
56
55
 
57
- if ($footnotes.length > 0) {
56
+ if ($references.length > 0) {
58
57
  if ($el.find('p').length == 0) {
59
- $el.append('<p style="margin-bottom: 10px;"><strong>OR:</strong> Choose footnote:</p><ol class="footnotes_list"></ol>');
58
+ $el.append('<p style="margin-bottom: 10px;"><strong>OR:</strong> Choose reference:</p><ol class="references_list"></ol>');
60
59
  } else {
61
60
  $el.find('ol').empty();
62
61
  }
63
62
 
64
63
  var radios = '';
65
- $footnotes.find('li').each(function(){
64
+ $references.find('li').each(function(){
66
65
  $item = jQuery(this);
67
- var footnote_id = $item.attr('data-footnote-id');
68
- radios += '<li style="margin-left: 15px;"><input type="radio" name="footnote_id" value="' + footnote_id + '" id="fn_' + footnote_id + '" /> <label for="fn_' + footnote_id + '" style="white-space: normal; display: inline-block; padding: 0 25px 0 5px; vertical-align: top; margin-bottom: 10px;">' + $item.find('cite').text() + '</label></li>';
66
+ var reference_id = $item.attr('data-reference-id');
67
+ radios += '<li style="margin-left: 15px;"><input type="radio" name="reference_id" value="' + reference_id + '" id="fn_' + reference_id + '" /> <label for="fn_' + reference_id + '" style="white-space: normal; display: inline-block; padding: 0 25px 0 5px; vertical-align: top; margin-bottom: 10px;">' + $item.find('cite').text() + '</label></li>';
69
68
  });
70
69
 
71
70
  $el.children('label,div').css('display', 'none');
@@ -96,7 +95,7 @@ CKEDITOR.dialog.add( 'footnotesDialog', function( editor ) {
96
95
 
97
96
  CKEDITOR.replaceAll( function( textarea, config ) {
98
97
  // Make sure the textarea has the correct class:
99
- if (!textarea.className.match(/footnote_text/)) {
98
+ if (!textarea.className.match(/reference_text/)) {
100
99
  return false;
101
100
  }
102
101
 
@@ -118,7 +117,7 @@ CKEDITOR.dialog.add( 'footnotesDialog', function( editor ) {
118
117
  config.height = 80;
119
118
  config.resize_enabled = false;
120
119
  config.autoGrow_minHeight = 80;
121
- config.removePlugins = 'footnotes';
120
+ config.removePlugins = 'references';
122
121
 
123
122
  config.on = {
124
123
  focus: function( evt ){
@@ -135,23 +134,23 @@ CKEDITOR.dialog.add( 'footnotesDialog', function( editor ) {
135
134
  // This method is invoked once a user clicks the OK button, confirming the dialog.
136
135
  onOk: function() {
137
136
  var dialog = this;
138
- var footnote_editor = CKEDITOR.instances[dialog.editor_name];
139
- var footnote_id = dialog.getValueOf('tab-basic', 'footnote_id');
140
- var footnote_data = footnote_editor.getData();
141
- footnote_editor.destroy();
142
-
143
- if (footnote_id == '') {
144
- // No existing id selected, check for new footnote:
145
- if (footnote_data == '') {
137
+ var reference_editor = CKEDITOR.instances[dialog.editor_name];
138
+ var reference_id = dialog.getValueOf('tab-basic', 'reference_id');
139
+ var reference_data = reference_editor.getData();
140
+ reference_editor.destroy();
141
+
142
+ if (reference_id == '') {
143
+ // No existing id selected, check for new reference:
144
+ if (reference_data == '') {
146
145
  // Nothing entered, so quit:
147
146
  return;
148
147
  } else {
149
- // Insert new footnote:
150
- editor.plugins.footnotes.build(footnote_data, true, editor);
148
+ // Insert new reference:
149
+ editor.plugins.effective_references.build(reference_data, true, editor);
151
150
  }
152
151
  } else {
153
- // Insert existing footnote:
154
- editor.plugins.footnotes.build(footnote_id, false, editor);
152
+ // Insert existing reference:
153
+ editor.plugins.effective_references.build(reference_id, false, editor);
155
154
  }
156
155
  // Destroy the editor so it's rebuilt properly next time:
157
156
  return;
@@ -159,8 +158,8 @@ CKEDITOR.dialog.add( 'footnotesDialog', function( editor ) {
159
158
 
160
159
  onCancel: function() {
161
160
  var dialog = this;
162
- var footnote_editor = CKEDITOR.instances[dialog.editor_name];
163
- footnote_editor.destroy();
161
+ var reference_editor = CKEDITOR.instances[dialog.editor_name];
162
+ reference_editor.destroy();
164
163
  }
165
164
  };
166
165
  });
@@ -0,0 +1,300 @@
1
+ /**
2
+ * Basic sample plugin inserting references elements into CKEditor editing area.
3
+ *
4
+ * Based on https://github.com/andykirk/CKEditorFootnotes Version 1.0.9
5
+ *
6
+ */
7
+ // Register the plugin within the editor.
8
+ CKEDITOR.plugins.add( 'effective_references', {
9
+
10
+ reference_ids: [],
11
+ requires: 'widget',
12
+ icons: 'effectivereferences',
13
+
14
+
15
+ // The plugin initialization logic goes inside this method.
16
+ init: function(editor) {
17
+ // Allow `cite` to be editable:
18
+ CKEDITOR.dtd.$editable['cite'] = 1;
19
+
20
+ // Add some CSS tweaks:
21
+ var css = '.references{background:#eee; padding:1px 15px;} .references cite{font-style: normal;}';
22
+ CKEDITOR.addCss(css);
23
+
24
+ var $this = this;
25
+
26
+ // Force a reorder on startup to make sure all vars are set: (e.g. references store):
27
+ editor.on('instanceReady', function(evt) {
28
+ $this.reorderMarkers(editor);
29
+ });
30
+
31
+ // Add the reorder change event:
32
+ editor.on('change', function(evt) {
33
+ // Copy the references_store as we may be doing a cut:
34
+ if(!evt.editor.references_tmp) {
35
+ evt.editor.references_tmp = evt.editor.references_store;
36
+ }
37
+
38
+ // Prevent no selection errors:
39
+ if (!evt.editor.getSelection().getStartElement()) {
40
+ return;
41
+ }
42
+ // Don't reorder the markers if editing a cite:
43
+ var reference_section = evt.editor.getSelection().getStartElement().getAscendant('section');
44
+ if (reference_section && reference_section.$.className.indexOf('references') != -1) {
45
+ return;
46
+ }
47
+ // SetTimeout seems to be necessary (it's used in the core but can't be 100% sure why)
48
+ setTimeout(function(){
49
+ $this.reorderMarkers(editor);
50
+ },
51
+ 0
52
+ );
53
+ });
54
+
55
+ // Build the initial references widget editables definition:
56
+ var prefix = editor.config.referencesPrefix ? '-' + editor.config.referencesPrefix : '';
57
+ var def = {
58
+ header: {
59
+ selector: 'header > *',
60
+ //allowedContent: ''
61
+ allowedContent: 'strong em span sub sup;'
62
+ }
63
+ };
64
+ var contents = jQuery('<div>' + editor.element.$.textContent + '</div>')
65
+ , l = contents.find('.references li').length
66
+ , i = 1;
67
+ for (i; i <= l; i++) {
68
+ def['reference_' + i] = {selector: '#reference' + prefix + '-' + i + ' cite', allowedContent: 'a[href]; cite[*](*); strong em span br'};
69
+ }
70
+
71
+ // Register the references widget.
72
+ editor.widgets.add('references', {
73
+
74
+ // Minimum HTML which is required by this widget to work.
75
+ requiredContent: 'section(references)',
76
+
77
+ // Check the elements that need to be converted to widgets.
78
+ upcast: function(element) {
79
+ return element.name == 'section' && element.hasClass('references');
80
+ },
81
+
82
+ editables: def
83
+ });
84
+
85
+ // Register the referencemarker widget.
86
+ editor.widgets.add('referencemarker', {
87
+
88
+ // Minimum HTML which is required by this widget to work.
89
+ requiredContent: 'sup[data-reference-id]',
90
+
91
+ // Check the elements that need to be converted to widgets.
92
+ upcast: function(element) {
93
+ return element.name == 'sup' && element.attributes['data-reference-id'] != 'undefined';
94
+ }
95
+ });
96
+
97
+ // Define an editor command that opens our dialog.
98
+ editor.addCommand('references', new CKEDITOR.dialogCommand('referencesDialog', {
99
+ // @TODO: This needs work:
100
+ allowedContent: 'section[*](*);header[*](*);li[*];a[*];cite(*)[*];sup[*]',
101
+ requiredContent: 'section[*](*);header[*](*);li[*];a[*];cite(*)[*];sup[*]'
102
+ }));
103
+
104
+ // Create a toolbar button that executes the above command.
105
+ editor.ui.addButton('EffectiveReferences', {
106
+
107
+ // The text part of the button (if available) and tooptip.
108
+ label: 'Insert References',
109
+
110
+ // The command to execute on click.
111
+ command: 'references',
112
+
113
+ // The button placement in the toolbar (toolbar group name).
114
+ toolbar: 'insert'
115
+ });
116
+
117
+ // Register our dialog file. this.path is the plugin folder path.
118
+ CKEDITOR.dialog.add('referencesDialog', this.path + 'dialogs/references.js');
119
+ },
120
+
121
+ editorContents: function(editor) {
122
+ if (editor.config.referencesEditorSelector) {
123
+ return jQuery(eval(editor.config.referencesEditorSelector)).contents()
124
+ } else {
125
+ return jQuery('#' + editor.id + '_contents iframe').contents().find('body');
126
+ }
127
+ },
128
+
129
+ build: function(reference, is_new, editor) {
130
+
131
+ if (is_new) {
132
+ // Generate new id:
133
+ reference_id = this.generateReferenceId();
134
+ } else {
135
+ // Existing reference id passed:
136
+ reference_id = reference;
137
+ }
138
+
139
+ // Insert the marker:
140
+ var reference_marker = '<sup data-reference-id="' + reference_id + '">X</sup>';
141
+
142
+ editor.insertHtml(reference_marker);
143
+
144
+ if (is_new) {
145
+ editor.fire('lockSnapshot');
146
+ this.addReference(this.buildReference(reference_id, reference, false, editor), editor);
147
+ editor.fire('unlockSnapshot');
148
+ }
149
+ this.reorderMarkers(editor);
150
+ },
151
+
152
+ buildReference: function(reference_id, reference_text, data, editor) {
153
+ data ? data : false;
154
+ var links = '';
155
+ var letters = 'abcdefghijklmnopqrstuvwxyz';
156
+ var order = data ? data.order.indexOf(reference_id) + 1
157
+ : 1;
158
+ var prefix = editor.config.referencesPrefix ? '-' + editor.config.referencesPrefix : '';
159
+ if (data && data.occurrences[reference_id] == 1) {
160
+ links = '<a href="#reference-marker' + prefix + '-' + order + '-1">^</a> ';
161
+ } else if (data && data.occurrences[reference_id] > 1) {
162
+ var i = 0
163
+ , l = data.occurrences[reference_id]
164
+ , n = l;
165
+ for (i; i < l; i++) {
166
+ links += '<a href="#reference-marker' + prefix + '-' + order + '-' + (i + 1) + '">' + letters.charAt(i) + '</a>';
167
+ if (i < l-1) {
168
+ links += ', ';
169
+ } else {
170
+ links += ' ';
171
+ }
172
+ }
173
+ }
174
+ reference = '<li id="reference' + prefix + '-' + order + '" data-reference-id="' + reference_id + '">' + links + '<cite>' + reference_text + '</cite></li>';
175
+ return reference;
176
+ },
177
+
178
+ addReference: function(reference, editor) {
179
+ $contents = this.editorContents(editor);
180
+ $references = $contents.find('.references');
181
+
182
+ if ($references.length == 0) {
183
+ var container = '<section class="references"><header><h2>References</h2></header><ol>' + reference + '</ol></section>';
184
+ // Move cursor to end of content:
185
+ var range = editor.createRange();
186
+ range.moveToElementEditEnd(range.root);
187
+ editor.getSelection().selectRanges([range]);
188
+ // Insert the container:
189
+ editor.insertHtml(container);
190
+ } else {
191
+ $references.find('ol').append(reference);
192
+ }
193
+ return;
194
+ },
195
+
196
+ generateReferenceId: function() {
197
+ var id = Math.random().toString(36).substr(2, 5);
198
+ while (jQuery.inArray(id, this.reference_ids) != -1) {
199
+ id = String(this.generateReferenceId());
200
+ }
201
+ this.reference_ids.push(id);
202
+ return id;
203
+ },
204
+
205
+ reorderMarkers: function(editor) {
206
+ editor.fire('lockSnapshot');
207
+ var prefix = editor.config.referencesPrefix ? '-' + editor.config.referencesPrefix : '';
208
+ $contents = this.editorContents(editor);
209
+ var data = {
210
+ order: [],
211
+ occurrences: {}
212
+ };
213
+
214
+ // Check that there's a references section. If it's been deleted the markers are useless:
215
+ if ($contents.find('.references').length == 0) {
216
+ $contents.find('sup[data-reference-id]').remove();
217
+ editor.fire('unlockSnapshot');
218
+ return;
219
+ }
220
+
221
+ // Find all the markers in the document:
222
+ var $markers = $contents.find('sup[data-reference-id]');
223
+ // If there aren't any, remove the References container:
224
+ if ($markers.length == 0) {
225
+ $contents.find('.references').parent().remove();
226
+ editor.fire('unlockSnapshot');
227
+ return;
228
+ }
229
+
230
+ // Otherwise reorder the markers:
231
+ $markers.each(function(){
232
+ var reference_id = jQuery(this).attr('data-reference-id')
233
+ , marker_ref
234
+ , n = data.order.indexOf(reference_id);
235
+
236
+ // If this is the markers first occurrence:
237
+ if (n == -1) {
238
+ // Store the id:
239
+ data.order.push(reference_id);
240
+ n = data.order.length;
241
+ data.occurrences[reference_id] = 1;
242
+ marker_ref = n + '-1';
243
+ } else {
244
+ // Otherwise increment the number of occurrences:
245
+ // (increment n due to zero-index array)
246
+ n++;
247
+ data.occurrences[reference_id]++;
248
+ marker_ref = n + '-' + data.occurrences[reference_id];
249
+ }
250
+ // Replace the marker contents:
251
+ var marker = '<a href="#reference' + prefix + '-' + n + '" id="reference-marker' + prefix + '-' + marker_ref + '" rel="reference">[' + n + ']</a>';
252
+ jQuery(this).html(marker);
253
+ });
254
+
255
+ // Prepare the references_store object:
256
+ editor.references_store = {};
257
+
258
+ // Then rebuild the References content to match marker order:
259
+ var references = '';
260
+ var reference_text = '';
261
+ var i = 0
262
+ , l = data.order.length;
263
+ for (i; i < l; i++) {
264
+ reference_id = data.order[i];
265
+ reference_text = $contents.find('.references [data-reference-id=' + reference_id + '] cite').html();
266
+ // If the references text can't be found in the editor, it may be in the tmp store
267
+ // following a cut:
268
+ if (!reference_text) {
269
+ reference_text = editor.references_tmp[reference_id];
270
+ }
271
+ references += this.buildReference(reference_id, reference_text, data, editor);
272
+ // Store the references for later use (post cut/paste):
273
+ editor.references_store[reference_id] = reference_text;
274
+ }
275
+
276
+ // Insert the references into the list:
277
+ $contents.find('.references ol').html(references);
278
+
279
+ // Next we need to reinstate the 'editable' properties of the references.
280
+ // (we have to do this individually due to Widgets 'fireOnce' for editable selectors)
281
+ var el = $contents.find('.references')
282
+ , reference_widget;
283
+ // So first we need to find the right Widget instance:
284
+ // (I hope there's a better way of doing this but I can't find one)
285
+ for (i in editor.widgets.instances) {
286
+ if (editor.widgets.instances[i].name == 'references') {
287
+ reference_widget = editor.widgets.instances[i];
288
+ break;
289
+ }
290
+ }
291
+ // Then we `initEditable` each reference, giving it a unique selector:
292
+ for (i in data.order) {
293
+ n = parseInt(i) + 1;
294
+ reference_widget.initEditable('reference_' + n, {selector: '#reference' + prefix + '-' + n +' cite', allowedContent: 'a[href]; cite[*](*); em strong span'});
295
+ }
296
+
297
+ editor.fire('unlockSnapshot');
298
+ return;
299
+ }
300
+ });