|
|
@ -1,74 +1,75 @@ |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
// External plugins not part of the default Ckeditor package. |
|
|
|
{% if _u.logged %} |
|
|
|
var plugins = [ |
|
|
|
// External plugins not part of the default Ckeditor package. |
|
|
|
'asciimath', |
|
|
|
var plugins = [ |
|
|
|
'asciisvg', |
|
|
|
'asciimath', |
|
|
|
'audio', |
|
|
|
'asciisvg', |
|
|
|
'ckeditor_wiris', |
|
|
|
'audio', |
|
|
|
'dialogui', |
|
|
|
'ckeditor_wiris', |
|
|
|
'glossary', |
|
|
|
'dialogui', |
|
|
|
'leaflet', |
|
|
|
'glossary', |
|
|
|
'mapping', |
|
|
|
'leaflet', |
|
|
|
'maximize', |
|
|
|
'mapping', |
|
|
|
'mathjax', |
|
|
|
'maximize', |
|
|
|
'oembed', |
|
|
|
'mathjax', |
|
|
|
'toolbar', |
|
|
|
'oembed', |
|
|
|
'toolbarswitch', |
|
|
|
'toolbar', |
|
|
|
'video', |
|
|
|
'toolbarswitch', |
|
|
|
'wikilink', |
|
|
|
'video', |
|
|
|
'wordcount', |
|
|
|
'wikilink', |
|
|
|
'youtube' |
|
|
|
'wordcount', |
|
|
|
]; |
|
|
|
'youtube' |
|
|
|
|
|
|
|
]; |
|
|
|
plugins.forEach(function(plugin) { |
|
|
|
|
|
|
|
CKEDITOR.plugins.addExternal(plugin, '{{ _p.web_main ~ 'inc/lib/javascript/ckeditor/plugins/' }}' + plugin + '/'); |
|
|
|
plugins.forEach(function(plugin) { |
|
|
|
}); |
|
|
|
CKEDITOR.plugins.addExternal(plugin, '{{ _p.web_main ~ 'inc/lib/javascript/ckeditor/plugins/' }}' + plugin + '/'); |
|
|
|
|
|
|
|
}); |
|
|
|
/** |
|
|
|
|
|
|
|
* Function use to load templates in a div |
|
|
|
|
|
|
|
**/ |
|
|
|
|
|
|
|
var showTemplates = function (ckeditorName) { |
|
|
|
|
|
|
|
var editorName = 'content'; |
|
|
|
|
|
|
|
if (ckeditorName && ckeditorName.length > 0) { |
|
|
|
|
|
|
|
editorName = ckeditorName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
CKEDITOR.editorConfig(CKEDITOR.config); |
|
|
|
|
|
|
|
CKEDITOR.loadTemplates(CKEDITOR.config.templates_files, function (a){ |
|
|
|
|
|
|
|
var templatesConfig = CKEDITOR.getTemplates("default"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var $templatesUL = $("<ul>"); |
|
|
|
/** |
|
|
|
|
|
|
|
* Function use to load templates in a div |
|
|
|
|
|
|
|
**/ |
|
|
|
|
|
|
|
var showTemplates = function (ckeditorName) { |
|
|
|
|
|
|
|
var editorName = 'content'; |
|
|
|
|
|
|
|
if (ckeditorName && ckeditorName.length > 0) { |
|
|
|
|
|
|
|
editorName = ckeditorName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
CKEDITOR.editorConfig(CKEDITOR.config); |
|
|
|
|
|
|
|
CKEDITOR.loadTemplates(CKEDITOR.config.templates_files, function (a){ |
|
|
|
|
|
|
|
var templatesConfig = CKEDITOR.getTemplates("default"); |
|
|
|
|
|
|
|
|
|
|
|
$.each(templatesConfig.templates, function () { |
|
|
|
var $templatesUL = $("<ul>"); |
|
|
|
var template = this; |
|
|
|
|
|
|
|
var $templateLi = $("<li>"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var templateHTML = "<img src=\"" + templatesConfig.imagesPath + template.image + "\" ><div>"; |
|
|
|
$.each(templatesConfig.templates, function () { |
|
|
|
templateHTML += "<b>" + template.title + "</b>"; |
|
|
|
var template = this; |
|
|
|
|
|
|
|
var $templateLi = $("<li>"); |
|
|
|
|
|
|
|
|
|
|
|
if (template.description) { |
|
|
|
var templateHTML = "<img src=\"" + templatesConfig.imagesPath + template.image + "\" ><div>"; |
|
|
|
templateHTML += "<div class=description>" + template.description + "</div>"; |
|
|
|
templateHTML += "<b>" + template.title + "</b>"; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templateHTML += "</div>"; |
|
|
|
if (template.description) { |
|
|
|
|
|
|
|
templateHTML += "<div class=description>" + template.description + "</div>"; |
|
|
|
$("<a>", { |
|
|
|
|
|
|
|
href: "#", |
|
|
|
|
|
|
|
html: templateHTML, |
|
|
|
|
|
|
|
click: function (e) { |
|
|
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
if (CKEDITOR.instances[editorName]) { |
|
|
|
|
|
|
|
CKEDITOR.instances[editorName].setData(template.html, function () { |
|
|
|
|
|
|
|
this.checkDirty(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}).appendTo($templateLi); |
|
|
|
|
|
|
|
$templatesUL.append($templateLi); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
$templatesUL.appendTo("#frmModel"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templateHTML += "</div>"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("<a>", { |
|
|
|
|
|
|
|
href: "#", |
|
|
|
|
|
|
|
html: templateHTML, |
|
|
|
|
|
|
|
click: function (e) { |
|
|
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
if (CKEDITOR.instances[editorName]) { |
|
|
|
|
|
|
|
CKEDITOR.instances[editorName].setData(template.html, function () { |
|
|
|
|
|
|
|
this.checkDirty(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).appendTo($templateLi); |
|
|
|
|
|
|
|
$templatesUL.append($templateLi); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
$templatesUL.appendTo("#frmModel"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
{% endif %} |
|
|
|
$(document).ready(function(){ |
|
|
|
$(document).ready(function(){ |
|
|
|
$("#open-view-list").click(function(){ |
|
|
|
$("#open-view-list").click(function(){ |
|
|
|
$("#student-list-work").fadeIn(300); |
|
|
|
$("#student-list-work").fadeIn(300); |
|
|
|