This commit is contained in:
iriska-gri committed 2023-09-19 08:40:10 +03:00
1 parent 0e64eede38
commit bd6101a785
749 files changed
+144291

No files matched your search

@@ -0,0 +1 @@
(function(){tinymce.PluginManager.requireLangPack("grappelli");var e=tinymce.DOM;tinymce.create("tinymce.plugins.Grappelli",{init:function(t,n){var r=this;tb=t.getParam("grappelli_adv_toolbar","toolbar2");documentstructure_css=n+"../../../themes/advanced/skins/grappelli/content_documentstructure_"+t.settings.language+".css";cookie_date=new Date;var s=cookie_date.getFullYear();cookie_date.setYear(s+1);cookie_grappelli_show_documentstructure=tinymce.util.Cookie.get("grappelli_show_documentstructure");cookie_grappelli_show_documentstructure!=null?t.settings.grappelli_show_documentstructure=cookie_grappelli_show_documentstructure:tinymce.util.Cookie.set("grappelli_show_documentstructure",t.settings.grappelli_show_documentstructure,cookie_date,"/");t.onInit.add(function(){"mce_fullscreen"==t.id&&t.dom.addClass(t.dom.select("body"),"fullscreen");t.settings.grappelli_adv_hidden?r._hide_adv_menu(t):r._show_adv_menu(t);t.settings.grappelli_show_documentstructure=="on"?r._show_documentstructure(t):r._hide_documentstructure(t)});t.addCommand("Grappelli_Adv",function(){e.isHidden(t.controlManager.get(tb).id)?r._show_adv_menu(t):r._hide_adv_menu(t)});t.addCommand("Grappelli_DocumentStructure",function(){i=t.controlManager;t.settings.grappelli_show_documentstructure=="on"?r._hide_documentstructure(t):r._show_documentstructure(t)});t.addButton("grappelli_adv",{title:"grappelli.grappelli_adv_desc",cmd:"Grappelli_Adv"});t.addButton("grappelli_documentstructure",{title:"grappelli.grappelli_documentstructure_desc",cmd:"Grappelli_DocumentStructure"});t.onBeforeExecCommand.add(function(e,t,n,i){if("mceFullScreen"!=t)return;if("mce_fullscreen"==e.id){base_ed=tinyMCE.get(e.settings.fullscreen_editor_id);e.settings.grappelli_adv_hidden?r._hide_adv_menu(base_ed):r._show_adv_menu(base_ed);e.settings.grappelli_show_documentstructure=="on"?r._show_documentstructure(base_ed):r._hide_documentstructure(base_ed)}});t.addShortcut("alt+shift+z",t.getLang("grappelli_adv_desc"),"Grappelli_Adv")},_resizeIframe:function(t,n,r){var i=t.getContentAreaContainer().firstChild;e.setStyle(i,"height",i.clientHeight+r);t.theme.deltaHeight+=r},_show_documentstructure:function(e){head=e.getBody().previousSibling;var t=head.childNodes;for(var n=0;n<t.length;n++)if(t[n].nodeName=="LINK"&&t[n].getAttribute("href")==documentstructure_css)return;var r=document.createElement("link");r.rel="stylesheet";r.mce_href=documentstructure_css;r.href=documentstructure_css;head.appendChild(r);e.settings.grappelli_show_documentstructure="on";tinymce.util.Cookie.set("grappelli_show_documentstructure","on",cookie_date,"/");e.controlManager.setActive("grappelli_documentstructure",!0)},_hide_documentstructure:function(e){head=e.getBody().previousSibling;vs_link=null;var t=head.childNodes;for(var n=0;n<t.length;n++)if(t[n].nodeName=="LINK"&&t[n].getAttribute("href")==documentstructure_css){vs_link=t[n];break}if(vs_link!==null){head.removeChild(vs_link);e.settings.grappelli_show_documentstructure="off";tinymce.util.Cookie.set("grappelli_show_documentstructure","off",cookie_date,"/");e.controlManager.setActive("grappelli_documentstructure",!1)}},_show_adv_menu:function(t){if(t.controlManager.get(tb,!1)){t.controlManager.setActive("grappelli_adv",1);e.show(t.controlManager.get(tb).id);this._resizeIframe(t,tb,-28);t.settings.grappelli_adv_hidden=0}},_hide_adv_menu:function(t){if(t.controlManager.get(tb,!1)){t.controlManager.setActive("grappelli_adv",0);e.hide(t.controlManager.get(tb).id);this._resizeIframe(t,tb,28);t.settings.grappelli_adv_hidden=1}},getInfo:function(){return{longname:"Grappelli Plugin",author:"vonautomatisch (patrick kranzlmueller)",authorurl:"http://vonautomatisch.at",infourl:"http://code.google.com/p/django-grappelli/",version:"1.1"}}});tinymce.PluginManager.add("grappelli",tinymce.plugins.Grappelli)})();
@@ -0,0 +1,206 @@
(function() {
tinymce.PluginManager.requireLangPack('grappelli');
var DOM = tinymce.DOM;
tinymce.create("tinymce.plugins.Grappelli", {
init: function(ed, url) {
var t = this;
tb = ed.getParam("grappelli_adv_toolbar", "toolbar2");
documentstructure_css = url + "../../../themes/advanced/skins/grappelli/content_documentstructure_" + ed.settings.language + ".css";
cookie_date = new Date();
var year = cookie_date.getFullYear();
cookie_date.setYear(year + 1);
// get/set cookie
cookie_grappelli_show_documentstructure = tinymce.util.Cookie.get('grappelli_show_documentstructure');
if (cookie_grappelli_show_documentstructure != null) {
ed.settings.grappelli_show_documentstructure = cookie_grappelli_show_documentstructure;
} else {
tinymce.util.Cookie.set('grappelli_show_documentstructure', ed.settings.grappelli_show_documentstructure, cookie_date, '/');
}
ed.onInit.add(function() {
if ("mce_fullscreen" == ed.id) {
ed.dom.addClass(ed.dom.select('body'), 'fullscreen');
}
if (ed.settings.grappelli_adv_hidden) {
t._hide_adv_menu(ed);
} else {
t._show_adv_menu(ed);
}
if (ed.settings.grappelli_show_documentstructure == "on") {
t._show_documentstructure(ed);
} else {
t._hide_documentstructure(ed);
}
});
// ADD COMMAND for SHOW/HIDE ADVANCED MENU
ed.addCommand("Grappelli_Adv", function() {
if (DOM.isHidden(ed.controlManager.get(tb).id)) {
t._show_adv_menu(ed);
} else {
t._hide_adv_menu(ed);
}
});
// ADD COMMAND for SHOW/HIDE DOCUMENTSTRUCTURE
ed.addCommand("Grappelli_DocumentStructure", function() {
i = ed.controlManager;
if (ed.settings.grappelli_show_documentstructure == "on") {
t._hide_documentstructure(ed);
} else {
t._show_documentstructure(ed);
}
});
// ADD BUTTON: ADVANCED MENU
ed.addButton("grappelli_adv", {
title: "grappelli.grappelli_adv_desc",
cmd: "Grappelli_Adv"
});
// ADD BUTTON: DOCUMENT STRUCTURE
ed.addButton("grappelli_documentstructure", {
title: "grappelli.grappelli_documentstructure_desc",
cmd: "Grappelli_DocumentStructure"
});
/// FULLSCREEN
ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) {
if ("mceFullScreen" != cmd) {
return;
};
if ("mce_fullscreen" == ed.id) {
base_ed = tinyMCE.get(ed.settings.fullscreen_editor_id);
/// ADVANCED MENU
if (!ed.settings.grappelli_adv_hidden) {
t._show_adv_menu(base_ed);
} else {
t._hide_adv_menu(base_ed);
}
/// DOCUMENT STRUCTURE
if (ed.settings.grappelli_show_documentstructure == "on") {
t._show_documentstructure(base_ed);
} else {
t._hide_documentstructure(base_ed);
}
}
});
ed.addShortcut("alt+shift+z", ed.getLang("grappelli_adv_desc"), "Grappelli_Adv");
// CONTENT HAS TO BE WITHIN A BLOCK-LEVEL-ELEMENT
// ed.onNodeChange.add(function(ed, cm, e) {
// if (e.nodeName == "TD" || e.nodeName == "BODY") {
// cn = e.childNodes;
// for (i = cn.length - 1; i >= 0; i--) {
// c_cn = cn[i];
// if (c_cn.nodeType == 3 || (!ed.dom.isBlock(c_cn) && c_cn.nodeType != 8)) {
// if (c_cn.nodeType != 3 || /[^\s]/g.test(c_cn.nodeValue)) {
// bl = ed.dom.create('p');
// bl.appendChild(c_cn.cloneNode(1));
// new_cn = c_cn.parentNode.replaceChild(bl, c_cn);
// // move caret
// r = ed.getDoc().createRange();
// r.setStart(bl, bl.nodeValue ? bl.nodeValue.length : 0);
// r.setEnd(bl, bl.nodeValue ? bl.nodeValue.length : 0);
// ed.selection.setRng(r);
// }
// }
// }
// }
// });
},
// INTERNAL: RESIZE
_resizeIframe: function(ed, tb, b) {
var iframe = ed.getContentAreaContainer().firstChild;
DOM.setStyle(iframe, "height", iframe.clientHeight + b);
ed.theme.deltaHeight += b
},
// INTERNAL: SHOW/HIDE DOCUMENT STRUCTURE
_show_documentstructure: function(ed) {
head = ed.getBody().previousSibling;
var headChilds = head.childNodes;
for (var i = 0; i < headChilds.length; i++) {
if (headChilds[i].nodeName == "LINK"
&& headChilds[i].getAttribute('href') == documentstructure_css) {
// documentstructure_css is already set so...
return;
}
}
var vs_link = document.createElement("link");
vs_link.rel="stylesheet";
vs_link.mce_href = documentstructure_css;
vs_link.href = documentstructure_css;
head.appendChild(vs_link);
ed.settings.grappelli_show_documentstructure = 'on';
tinymce.util.Cookie.set('grappelli_show_documentstructure', 'on', cookie_date, '/');
ed.controlManager.setActive('grappelli_documentstructure', true);
},
_hide_documentstructure: function(ed) {
head = ed.getBody().previousSibling;
vs_link = null;
var headChilds = head.childNodes;
for (var i = 0; i < headChilds.length; i++) {
if (headChilds[i].nodeName == "LINK"
&& headChilds[i].getAttribute('href') == documentstructure_css) {
// found the node with documentstructure_css
vs_link = headChilds[i];
break;
}
}
if (vs_link !== null) {
// if we found the node with documentstructure_css, delete it
head.removeChild(vs_link);
ed.settings.grappelli_show_documentstructure = 'off';
tinymce.util.Cookie.set('grappelli_show_documentstructure', 'off', cookie_date, '/');
ed.controlManager.setActive('grappelli_documentstructure', false);
}
},
// INTERNAL: SHOW/HIDE ADVANCED MENU
_show_adv_menu: function(ed) {
if (ed.controlManager.get(tb, false)) {
ed.controlManager.setActive("grappelli_adv", 1);
DOM.show(ed.controlManager.get(tb).id);
this._resizeIframe(ed, tb, -28);
ed.settings.grappelli_adv_hidden = 0;
}
},
_hide_adv_menu: function(ed) {
if (ed.controlManager.get(tb, false)) {
ed.controlManager.setActive("grappelli_adv", 0);
DOM.hide(ed.controlManager.get(tb).id);
this._resizeIframe(ed, tb, 28);
ed.settings.grappelli_adv_hidden = 1;
}
},
// GET INFO
getInfo: function() {
return {
longname: "Grappelli Plugin",
author: "vonautomatisch (patrick kranzlmueller)",
authorurl: "http://vonautomatisch.at",
infourl: "http://code.google.com/p/django-grappelli/",
version: "1.1"
}
}
});
tinymce.PluginManager.add("grappelli", tinymce.plugins.Grappelli)
})();
Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

@@ -0,0 +1,4 @@
tinyMCE.addI18n("cs.grappelli",{
grappelli_adv_desc:"Zobrazit/Skrýt pokročilé možnosti",
grappelli_documentstructure_desc:"Zobrazit/Skrýt strukturu dokumentu",
});
@@ -0,0 +1,4 @@
tinyMCE.addI18n("de.grappelli",{
grappelli_adv_desc:"Erweitertes Menü anzeigen/verbergen",
grappelli_documentstructure_desc:"Dokumentenstruktur anzeigen/verbergen",
});
@@ -0,0 +1,4 @@
tinyMCE.addI18n("en.grappelli",{
grappelli_adv_desc:"Show/Hide Advanced Menu",
grappelli_documentstructure_desc:"Show/Hide Document Structure",
});
@@ -0,0 +1,4 @@
tinyMCE.addI18n("fr.grappelli",{
grappelli_adv_desc:"Basculer le menu avancé",
grappelli_documentstructure_desc:"Basculé la structure de document",
});
@@ -0,0 +1,4 @@
tinyMCE.addI18n("pl.grappelli",{
grappelli_adv_desc:"Pokaż/Ukryj zaawansowane menu",
grappelli_documentstructure_desc:"Pokaż/Ukryj strukturę dokumentu"
});
@@ -0,0 +1,4 @@
tinyMCE.addI18n("ru.grappelli",{
grappelli_adv_desc:"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u002f\u0421\u043a\u0440\u044b\u0442\u044c\u0020\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u043e\u0435\u0020\u041c\u0435\u043d\u044e",
grappelli_documentstructure_desc:"\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u002f\u0421\u043a\u0440\u044b\u0442\u044c\u0020\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\u0020\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430",
});