Index: lams_central/web/ckeditor/README.md =================================================================== diff -u -r7a355f326f0acb24a25460c16b3824e5cc610297 -rb9d1ec3fae172f7c9cf591469e6ba84ba901d079 --- lams_central/web/ckeditor/README.md (.../README.md) (revision 7a355f326f0acb24a25460c16b3824e5cc610297) +++ lams_central/web/ckeditor/README.md (.../README.md) (revision b9d1ec3fae172f7c9cf591469e6ba84ba901d079) @@ -64,8 +64,7 @@ For CKEditor 4.16.2 the code to remove is b.getAttribute("class")&&(c=c.replace("\x3e",' class\x3d"'+b.getAttribute("class")+'"\x3e')); -- (NOT REQUIRED ANYMORE AS OF CKEDITOR 4.16.2) -bootstrapTabs plugin. +- bootstrapTabs plugin The "element.getAscendant"'s function that was specified on Double click and contextMenu listener methods were replaced with the following "return !( element instanceof CKEDITOR.dom.document ) && element.hasClass('bootstrap-tabs') ;". As otherwise it always false positively determined there is a tabs element in CKEditor canvas (due to LAMS header containing a tab). Modify plugins/bootstrapTabs/dialogs/plugin.js or optimised ckeditor.js Index: lams_central/web/ckeditor/ckeditor.js =================================================================== diff -u -rdf1f12e9204857c30ff03608a5a989052d1ab114 -rb9d1ec3fae172f7c9cf591469e6ba84ba901d079 --- lams_central/web/ckeditor/ckeditor.js (.../ckeditor.js) (revision df1f12e9204857c30ff03608a5a989052d1ab114) +++ lams_central/web/ckeditor/ckeditor.js (.../ckeditor.js) (revision b9d1ec3fae172f7c9cf591469e6ba84ba901d079) @@ -824,8 +824,8 @@ a.styles["font-style"]}]],underline:["u",["span",function(a){return"underline"==a.styles["text-decoration"]}]],strike:["s","strike",["span",function(a){return"line-through"==a.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},b=c.config,a=c.lang.basicstyles;d("Bold",a.bold,"bold",b.coreStyles_bold);d("Italic",a.italic,"italic",b.coreStyles_italic);d("Underline",a.underline,"underline",b.coreStyles_underline);d("Strike",a.strike,"strike",b.coreStyles_strike);d("Subscript",a.subscript, "subscript",b.coreStyles_subscript);d("Superscript",a.superscript,"superscript",b.coreStyles_superscript);c.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}});CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"};CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"};CKEDITOR.config.coreStyles_underline={element:"u"};CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"};CKEDITOR.config.coreStyles_subscript={element:"sub"}; CKEDITOR.config.coreStyles_superscript={element:"sup"};CKEDITOR.plugins.add("bootstrapTabs",{lang:"en,ru",requires:"dialog",icons:"bootstrapTabs",init:function(a){a.addCommand("bootstrapTabs",new CKEDITOR.dialogCommand("bootstrapTabsDialog",{allowedContent:"div ul li a[role,href,id,aria-*,data-number-of-tabs,data-tab-set-title,data-toggle](bootstrap-tabs,nav,nav-tabs,tab-link,active,tab-content,tab-pane,tab-pane-content)"}));a.ui.addButton("BootstrapTabs",{label:a.lang.bootstrapTabs.buttonLabel,command:"bootstrapTabs",toolbar:"insert"});CKEDITOR.dialog.add("bootstrapTabsDialog", -this.path+"dialogs/bootstrapTabs.js");a.contextMenu&&(a.addMenuGroup("bootstrapTabsGroup"),a.addMenuItem("bootstrapTabsItem",{label:a.lang.bootstrapTabs.contextMenuLabel,icon:this.path+"icons/bootstrapTabs.png",command:"bootstrapTabs",group:"bootstrapTabsGroup"}),a.contextMenu.addListener(function(a){if(ascendant=a.getAscendant(function(a){return!(a instanceof CKEDITOR.dom.document)&&(a.hasClass("nav-tabs")||a.hasClass("tab-content"))}))return{bootstrapTabsItem:CKEDITOR.TRISTATE_OFF}}));a.on("doubleclick", -function(a){if(ascendant=a.data.element.getAscendant(function(a){return!(a instanceof CKEDITOR.dom.document)&&("a"==a.name&&"tab"==a.attributes.role||a.hasClass("nav-tabs")||a.hasClass("tab-content"))}))a.data.dialog="bootstrapTabsDialog"})}});CKEDITOR.plugins.add("panelbutton",{requires:"button",onLoad:function(){function e(c){var b=this._;b.state!=CKEDITOR.TRISTATE_DISABLED&&(this.createPanel(c),b.on?b.panel.hide():b.panel.showBlock(this._.id,this.document.getById(this._.id),4))}CKEDITOR.ui.panelButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(c){var b=c.panel||{};delete c.panel;this.base(c);this.document=b.parent&&b.parent.getDocument()||CKEDITOR.document;b.block={attributes:b.attributes};b.toolbarRelated=!0;this.hasArrow= +this.path+"dialogs/bootstrapTabs.js");a.contextMenu&&(a.addMenuGroup("bootstrapTabsGroup"),a.addMenuItem("bootstrapTabsItem",{label:a.lang.bootstrapTabs.contextMenuLabel,icon:this.path+"icons/bootstrapTabs.png",command:"bootstrapTabs",group:"bootstrapTabsGroup"}),a.contextMenu.addListener(function(a){if(ascendant=a.getAscendant(function(a){return!(a instanceof CKEDITOR.dom.document)&&a.hasClass("bootstrap-tabs")}))return{bootstrapTabsItem:CKEDITOR.TRISTATE_OFF}}));a.on("doubleclick", +function(a){if(ascendant=a.data.element.getAscendant(function(a){return!(a instanceof CKEDITOR.dom.document)&&(("a"==a.name&&"tab"==a.attributes.role)||a.hasClass("bootstrap-tabs"))}))a.data.dialog="bootstrapTabsDialog"})}});CKEDITOR.plugins.add("panelbutton",{requires:"button",onLoad:function(){function e(c){var b=this._;b.state!=CKEDITOR.TRISTATE_DISABLED&&(this.createPanel(c),b.on?b.panel.hide():b.panel.showBlock(this._.id,this.document.getById(this._.id),4))}CKEDITOR.ui.panelButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(c){var b=c.panel||{};delete c.panel;this.base(c);this.document=b.parent&&b.parent.getDocument()||CKEDITOR.document;b.block={attributes:b.attributes};b.toolbarRelated=!0;this.hasArrow= "listbox";this.click=e;this._={panelDefinition:b}},statics:{handler:{create:function(c){return new CKEDITOR.ui.panelButton(c)}}},proto:{createPanel:function(c){var b=this._;if(!b.panel){var f=this._.panelDefinition,e=this._.panelDefinition.block,h=f.parent||CKEDITOR.document.getBody(),d=this._.panel=new CKEDITOR.ui.floatPanel(c,h,f),f=d.addBlock(b.id,e),a=this,g=c.getCommand(this.command);d.onShow=function(){a.className&&this.element.addClass(a.className+"_panel");a.setState(CKEDITOR.TRISTATE_ON); b.on=1;a.editorFocus&&c.focus();if(a.onOpen)a.onOpen()};d.onHide=function(d){a.className&&this.element.getFirst().removeClass(a.className+"_panel");!a.modes&&g?a.setStateFromCommand(g):a.setState(a.modes&&a.modes[c.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED);b.on=0;if(!d&&a.onClose)a.onClose()};d.onEscape=function(){d.hide(1);a.document.getById(b.id).focus()};if(this.onBlock)this.onBlock(d,f);f.onHide=function(){b.on=0;!a.modes&&a.command?a.setStateFromCommand(g):a.setState(CKEDITOR.TRISTATE_OFF)}}}, setStateFromCommand:function(c){this.setState(c.state)}}})},beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_PANELBUTTON,CKEDITOR.ui.panelButton.handler)}});CKEDITOR.UI_PANELBUTTON="panelbutton";(function(){CKEDITOR.plugins.add("panel",{beforeInit:function(a){a.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler)}});CKEDITOR.UI_PANEL="panel";CKEDITOR.ui.panel=function(a,b){b&&CKEDITOR.tools.extend(this,b);CKEDITOR.tools.extend(this,{className:"",css:[]});this.id=CKEDITOR.tools.getNextId();this.document=a;this.isFramed=this.forceIFrame||this.css.length;this._={blocks:{}}};CKEDITOR.ui.panel.handler={create:function(a){return new CKEDITOR.ui.panel(a)}};var g=CKEDITOR.addTemplate("panel",