git add stuff
This commit is contained in:
12
simpla/design/js/tiny_mce/plugins/template/blank.htm
vendored
Normal file
12
simpla/design/js/tiny_mce/plugins/template/blank.htm
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>blank_page</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<script type="text/javascript">
|
||||
parent.TemplateDialog.loadCSSFiles(document);
|
||||
</script>
|
||||
</head>
|
||||
<body id="mceTemplatePreview" class="mceContentBody">
|
||||
|
||||
</body>
|
||||
</html>
|
||||
23
simpla/design/js/tiny_mce/plugins/template/css/template.css
vendored
Normal file
23
simpla/design/js/tiny_mce/plugins/template/css/template.css
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
#frmbody {
|
||||
padding: 10px;
|
||||
background-color: #FFF;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
|
||||
.frmRow {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#templatesrc {
|
||||
border: none;
|
||||
width: 320px;
|
||||
height: 240px;
|
||||
}
|
||||
|
||||
.title {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.mceActionPanel {
|
||||
padding-top: 5px;
|
||||
}
|
||||
1
simpla/design/js/tiny_mce/plugins/template/editor_plugin.js
vendored
Normal file
1
simpla/design/js/tiny_mce/plugins/template/editor_plugin.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length<d){for(f=0;f<(d-g.length);f++){g="0"+g}}return g}b=b.replace("%D","%m/%d/%y");b=b.replace("%r","%I:%M:%S %p");b=b.replace("%Y",""+e.getFullYear());b=b.replace("%y",""+e.getYear());b=b.replace("%m",c(e.getMonth()+1,2));b=b.replace("%d",c(e.getDate(),2));b=b.replace("%H",""+c(e.getHours(),2));b=b.replace("%M",""+c(e.getMinutes(),2));b=b.replace("%S",""+c(e.getSeconds(),2));b=b.replace("%I",""+((e.getHours()+11)%12+1));b=b.replace("%p",""+(e.getHours()<12?"AM":"PM"));b=b.replace("%B",""+this.editor.getLang("template_months_long").split(",")[e.getMonth()]);b=b.replace("%b",""+this.editor.getLang("template_months_short").split(",")[e.getMonth()]);b=b.replace("%A",""+this.editor.getLang("template_day_long").split(",")[e.getDay()]);b=b.replace("%a",""+this.editor.getLang("template_day_short").split(",")[e.getDay()]);b=b.replace("%%","%");return b}});tinymce.PluginManager.add("template",tinymce.plugins.TemplatePlugin)})();
|
||||
106
simpla/design/js/tiny_mce/plugins/template/js/template.js
vendored
Normal file
106
simpla/design/js/tiny_mce/plugins/template/js/template.js
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
tinyMCEPopup.requireLangPack();
|
||||
|
||||
var TemplateDialog = {
|
||||
preInit : function() {
|
||||
var url = tinyMCEPopup.getParam("template_external_list_url");
|
||||
|
||||
if (url != null)
|
||||
document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></sc'+'ript>');
|
||||
},
|
||||
|
||||
init : function() {
|
||||
var ed = tinyMCEPopup.editor, tsrc, sel, x, u;
|
||||
|
||||
tsrc = ed.getParam("template_templates", false);
|
||||
sel = document.getElementById('tpath');
|
||||
|
||||
// Setup external template list
|
||||
if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') {
|
||||
for (x=0, tsrc = []; x<tinyMCETemplateList.length; x++)
|
||||
tsrc.push({title : tinyMCETemplateList[x][0], src : tinyMCETemplateList[x][1], description : tinyMCETemplateList[x][2]});
|
||||
}
|
||||
|
||||
for (x=0; x<tsrc.length; x++)
|
||||
sel.options[sel.options.length] = new Option(tsrc[x].title, tinyMCEPopup.editor.documentBaseURI.toAbsolute(tsrc[x].src));
|
||||
|
||||
this.resize();
|
||||
this.tsrc = tsrc;
|
||||
},
|
||||
|
||||
resize : function() {
|
||||
var w, h, e;
|
||||
|
||||
if (!self.innerWidth) {
|
||||
w = document.body.clientWidth - 50;
|
||||
h = document.body.clientHeight - 160;
|
||||
} else {
|
||||
w = self.innerWidth - 50;
|
||||
h = self.innerHeight - 170;
|
||||
}
|
||||
|
||||
e = document.getElementById('templatesrc');
|
||||
|
||||
if (e) {
|
||||
e.style.height = Math.abs(h) + 'px';
|
||||
e.style.width = Math.abs(w - 5) + 'px';
|
||||
}
|
||||
},
|
||||
|
||||
loadCSSFiles : function(d) {
|
||||
var ed = tinyMCEPopup.editor;
|
||||
|
||||
tinymce.each(ed.getParam("content_css", '').split(','), function(u) {
|
||||
d.write('<link href="' + ed.documentBaseURI.toAbsolute(u) + '" rel="stylesheet" type="text/css" />');
|
||||
});
|
||||
},
|
||||
|
||||
selectTemplate : function(u, ti) {
|
||||
var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc;
|
||||
|
||||
if (!u)
|
||||
return;
|
||||
|
||||
d.body.innerHTML = this.templateHTML = this.getFileContents(u);
|
||||
|
||||
for (x=0; x<tsrc.length; x++) {
|
||||
if (tsrc[x].title == ti)
|
||||
document.getElementById('tmpldesc').innerHTML = tsrc[x].description || '';
|
||||
}
|
||||
},
|
||||
|
||||
insert : function() {
|
||||
tinyMCEPopup.execCommand('mceInsertTemplate', false, {
|
||||
content : this.templateHTML,
|
||||
selection : tinyMCEPopup.editor.selection.getContent()
|
||||
});
|
||||
|
||||
tinyMCEPopup.close();
|
||||
},
|
||||
|
||||
getFileContents : function(u) {
|
||||
var x, d, t = 'text/plain';
|
||||
|
||||
function g(s) {
|
||||
x = 0;
|
||||
|
||||
try {
|
||||
x = new ActiveXObject(s);
|
||||
} catch (s) {
|
||||
}
|
||||
|
||||
return x;
|
||||
};
|
||||
|
||||
x = window.ActiveXObject ? g('Msxml2.XMLHTTP') || g('Microsoft.XMLHTTP') : new XMLHttpRequest();
|
||||
|
||||
// Synchronous AJAX load file
|
||||
x.overrideMimeType && x.overrideMimeType(t);
|
||||
x.open("GET", u, false);
|
||||
x.send(null);
|
||||
|
||||
return x.responseText;
|
||||
}
|
||||
};
|
||||
|
||||
TemplateDialog.preInit();
|
||||
tinyMCEPopup.onInit.add(TemplateDialog.init, TemplateDialog);
|
||||
1
simpla/design/js/tiny_mce/plugins/template/langs/en_dlg.js
vendored
Normal file
1
simpla/design/js/tiny_mce/plugins/template/langs/en_dlg.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
tinyMCE.addI18n('en.template_dlg',{title:"Templates",label:"Template","desc_label":"Description",desc:"Insert Predefined Template Content",select:"Select a Template",preview:"Preview",warning:"Warning: Updating a template with a different one may cause data loss.","mdate_format":"%Y-%m-%d %H:%M:%S","cdate_format":"%Y-%m-%d %H:%M:%S","months_long":"January,February,March,April,May,June,July,August,September,October,November,December","months_short":"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec","day_long":"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday","day_short":"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"});
|
||||
1
simpla/design/js/tiny_mce/plugins/template/langs/ru_dlg.js
vendored
Normal file
1
simpla/design/js/tiny_mce/plugins/template/langs/ru_dlg.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
tinyMCE.addI18n('ru.template_dlg',{title:"\u0428\u0430\u0431\u043b\u043e\u043d\u044b",label:"\u0428\u0430\u0431\u043b\u043e\u043d","desc_label":"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435",desc:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d",select:"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0448\u0430\u0431\u043b\u043e\u043d",preview:"\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440",warning:"\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u043e\u0442\u0435\u0440\u044f\u043c \u0434\u0430\u043d\u043d\u044b\u0445/","mdate_format":"%Y.%m.%d %H:%M:%S","cdate_format":"%Y.%m.%d %H:%M:%S","months_long":"\u044f\u043d\u0432\u0430\u0440\u044c,\u0444\u0435\u0432\u0440\u0430\u043b\u044c,\u043c\u0430\u0440\u0442,\u0430\u043f\u0440\u0435\u043b\u044c,\u043c\u0430\u0439,\u0438\u044e\u043d\u044c,\u0438\u044e\u043b\u044c,\u0430\u0432\u0433\u0443\u0441\u0442,\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c,\u043e\u043a\u0442\u044f\u0431\u0440\u044c,\u043d\u043e\u044f\u0431\u0440\u044c,\u0434\u0435\u043a\u0430\u0431\u0440\u044c","months_short":"\u044f\u043d\u0432,\u0444\u0435\u0432,\u043c\u0430\u0440\u0442,\u0430\u043f\u0440,\u043c\u0430\u0439,\u0438\u044e\u043d\u044c,\u0438\u044e\u043b\u044c,\u0430\u0432\u0433,\u0441\u0435\u043d,\u043e\u043a\u0442,\u043d\u043e\u044f,\u0434\u0435\u043a","day_long":"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435,\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a,\u0432\u0442\u043e\u0440\u043d\u0438\u043a,\u0441\u0440\u0435\u0434\u0430,\u0447\u0435\u0442\u0432\u0435\u0440\u0433,\u043f\u044f\u0442\u043d\u0438\u0446\u0443,\u0441\u0443\u0431\u0431\u043e\u0442\u0430,\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","day_short":"\u0432\u0441,\u043f\u043d,\u0432\u0442,\u0441\u0440,\u0447\u0442,\u043f\u0442,\u0441\u0431,\u0432\u0441"});
|
||||
31
simpla/design/js/tiny_mce/plugins/template/template.htm
vendored
Normal file
31
simpla/design/js/tiny_mce/plugins/template/template.htm
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>{#template_dlg.title}</title>
|
||||
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
|
||||
<script type="text/javascript" src="js/template.js"></script>
|
||||
<link href="css/template.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body onresize="TemplateDialog.resize();">
|
||||
<form onsubmit="TemplateDialog.insert();return false;">
|
||||
<div id="frmbody">
|
||||
<div class="title">{#template_dlg.desc}</div>
|
||||
<div class="frmRow"><label for="tpath" title="{#template_dlg.select}">{#template_dlg.label}:</label>
|
||||
<select id="tpath" name="tpath" onchange="TemplateDialog.selectTemplate(this.options[this.selectedIndex].value, this.options[this.selectedIndex].text);" class="mceFocus">
|
||||
<option value="">{#template_dlg.select}...</option>
|
||||
</select>
|
||||
<span id="warning"></span></div>
|
||||
<div class="frmRow"><label for="tdesc">{#template_dlg.desc_label}:</label>
|
||||
<span id="tmpldesc"></span></div>
|
||||
<fieldset>
|
||||
<legend>{#template_dlg.preview}</legend>
|
||||
<iframe id="templatesrc" name="templatesrc" src="blank.htm" width="690" height="400" frameborder="0"></iframe>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="mceActionPanel">
|
||||
<input type="submit" id="insert" name="insert" value="{#insert}" />
|
||||
<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user