Файл: upload/admin/view/javascript/ckeditor/plugins/templates/dialogs/templates.js
Строк: 110
<?php
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
(function(){CKEDITOR.dialog.add("templates",function(c){function r(a,b){var m=CKEDITOR.dom.element.createFromHtml('x3ca hrefx3d"javascript:void(0)" tabIndexx3d"-1" rolex3d"option" x3ex3cdiv classx3d"cke_tpl_item"x3ex3c/divx3ex3c/ax3e'),d='x3ctable stylex3d"width:350px;" classx3d"cke_tpl_preview" rolex3d"presentation"x3ex3ctrx3e';a.image&&b&&(d+='x3ctd classx3d"cke_tpl_preview_img"x3ex3cimg srcx3d"'+CKEDITOR.getUrl(b+a.image)+'"'+(CKEDITOR.env.ie6Compat?' onloadx3d"this.widthx3dthis.width"':
"")+' altx3d"" titlex3d""x3ex3c/tdx3e');d+='x3ctd stylex3d"white-space:normal;"x3ex3cspan classx3d"cke_tpl_title"x3e'+a.title+"x3c/spanx3ex3cbr/x3e";a.description&&(d+="x3cspanx3e"+a.description+"x3c/spanx3e");d+="x3c/tdx3ex3c/trx3ex3c/tablex3e";m.getFirst().setHtml(d);m.on("click",function(){t(a.html)});return m}function t(a){var b=CKEDITOR.dialog.getCurrent();b.getValueOf("selectTpl","chkInsertOpt")?(c.fire("saveSnapshot"),c.setData(a,function(){b.hide();var a=c.createRange();
a.moveToElementEditStart(c.editable());a.select();setTimeout(function(){c.fire("saveSnapshot")},0)})):(c.insertHtml(a),b.hide())}function k(a){var b=a.data.getTarget(),c=g.equals(b);if(c||g.contains(b)){var d=a.data.getKeystroke(),f=g.getElementsByTag("a"),e;if(f){if(c)e=f.getItem(0);else switch(d){case 40:e=b.getNext();break;case 38:e=b.getPrevious();break;case 13:case 32:b.fire("click")}e&&(e.focus(),a.data.preventDefault())}}}var h=CKEDITOR.plugins.get("templates");CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(h.path+
"dialogs/templates.css"));var g,h="cke_tpl_list_label_"+CKEDITOR.tools.getNextNumber(),f=c.lang.templates,n=c.config;return{title:c.lang.templates.title,minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:"selectTpl",label:f.title,elements:[{type:"vbox",padding:5,children:[{id:"selectTplText",type:"html",html:"x3cspanx3e"+f.selectPromptMsg+"x3c/spanx3e"},{id:"templatesList",type:"html",focus:!0,html:'x3cdiv classx3d"cke_tpl_list" tabIndexx3d"-1" rolex3d"listbox" aria-labelledbyx3d"'+
h+'"x3ex3cdiv classx3d"cke_tpl_loading"x3ex3cspanx3ex3c/spanx3ex3c/divx3ex3c/divx3ex3cspan classx3d"cke_voice_label" idx3d"'+h+'"x3e'+f.options+"x3c/spanx3e"},{id:"chkInsertOpt",type:"checkbox",label:f.insertOption,"default":n.templates_replaceContent}]}]}],buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var a=this.getContentElement("selectTpl","templatesList");g=a.getElement();CKEDITOR.loadTemplates(n.templates_files,function(){var b=(n.templates||"default").split(",");
if(b.length){var c=g;c.setHtml("");for(var d=0,h=b.length;d<h;d++)for(var e=CKEDITOR.getTemplates(b[d]),k=e.imagesPath,e=e.templates,q=e.length,l=0;l<q;l++){var p=r(e[l],k);p.setAttribute("aria-posinset",l+1);p.setAttribute("aria-setsize",q);c.append(p)}a.focus()}else g.setHtml('x3cdiv classx3d"cke_tpl_empty"x3ex3cspanx3e'+f.emptyListMsg+"x3c/spanx3ex3c/divx3e")});this._.element.on("keydown",k)},onHide:function(){this._.element.removeListener("keydown",k)}}})})();
?>