只读模式
group, 分享
评论更多问题
博客标签总是存在一个
This commit is contained in:
lealife
2015-06-15 18:01:48 +08:00
parent 7e458bb433
commit 6987a38820
1453 changed files with 114561 additions and 91536 deletions

28
public/tinymce/plugins/template/plugin.js Normal file → Executable file
View File

@ -17,7 +17,7 @@ tinymce.PluginManager.add('template', function(editor) {
return function() {
var templateList = editor.settings.templates;
if (typeof(templateList) == "string") {
if (typeof templateList == "string") {
tinymce.util.XHR.send({
url: templateList,
success: function(text) {
@ -100,18 +100,28 @@ tinymce.PluginManager.add('template', function(editor) {
win = editor.windowManager.open({
title: 'Insert template',
layout: 'flex',
direction: 'column',
align: 'stretch',
padding: 15,
spacing: 10,
body: [
{type: 'container', label: 'Templates', items: {
type: 'listbox', name: 'template', values: values, onselect: onSelectTemplate
}},
items: [
{type: 'form', flex: 0, padding: 0, items: [
{type: 'container', label: 'Templates', items: {
type: 'listbox', label: 'Templates', name: 'template', values: values, onselect: onSelectTemplate
}}
]},
{type: 'label', name: 'description', label: 'Description', text: '\u00a0'},
{type: 'iframe', minWidth: 600, minHeight: 400, border: 1}
{type: 'iframe', flex: 1, border: 1}
],
onsubmit: function() {
insertTemplate(false, templateHtml);
}
},
width: editor.getParam('template_popup_width', 600),
height: editor.getParam('template_popup_height', 500)
});
win.find('listbox')[0].fire('select');
@ -163,7 +173,7 @@ tinymce.PluginManager.add('template', function(editor) {
each(dom.select('*', e), function(e) {
each(vl, function(v, k) {
if (dom.hasClass(e, k)) {
if (typeof(vl[k]) == 'function') {
if (typeof vl[k] == 'function') {
vl[k](e);
}
}
@ -173,7 +183,7 @@ tinymce.PluginManager.add('template', function(editor) {
function replaceTemplateValues(html, templateValuesOptionName) {
each(editor.getParam(templateValuesOptionName), function(v, k) {
if (typeof(v) != 'function') {
if (typeof v != 'function') {
html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v);
}
});