/*
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
modified by eztrust, yiming
*/
(function () {
function setHtml(a) {
var r, h;
if (a.id) {
r = "";
h = "";
$.ajax({
async: false,
dataType: "text",
url: a.htmlsrc,
data: {},
success: function (data) {
h = data;
}
});
r += h;
} else {
r = a.html;
}
return r;
}
CKEDITOR.dialog.add("EzTemplatesDialog", function (c) {
function o(a, b) {
var k = CKEDITOR.dom.element.createFromHtml(''), d = '
' + f.options + "" },
{ id: "chkInsertOpt", type: "checkbox", label: f.insertOption, "default": l.templates_replaceContent}
]
}]
}],
buttons: [CKEDITOR.dialog.cancelButton],
onShow: function () {
loadTemplates();
},
onHide: function () {
this._.element.removeListener("keydown", i)
}
}
function loadTemplates() {
var a = CKEDITOR.dialog.getCurrent().getContentElement("selectTpl", "templatesList");
g = a.getElement();
CKEDITOR.loadTemplates(l.templates_files, function () {
var b = (l.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]), i = e.imagesPath, e = e.templates, n = e.length, j = 0; j < n; j++) {
var m = o(e[j], i);
m.setAttribute("aria-posinset", j + 1);
m.setAttribute("aria-setsize",
n);
c.append(m)
}
a.focus()
} else
g.setHtml('