Initial checkin

This commit is contained in:
genuineparts 2025-06-20 19:10:23 +02:00
commit d75eb444fc
4304 changed files with 369634 additions and 0 deletions

View file

@ -0,0 +1,47 @@
K 25
svn:wc:ra_dav:version-url
V 61
/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js
END
cite.js
K 25
svn:wc:ra_dav:version-url
V 69
/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/cite.js
END
del.js
K 25
svn:wc:ra_dav:version-url
V 68
/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/del.js
END
abbr.js
K 25
svn:wc:ra_dav:version-url
V 69
/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/abbr.js
END
attributes.js
K 25
svn:wc:ra_dav:version-url
V 75
/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/attributes.js
END
acronym.js
K 25
svn:wc:ra_dav:version-url
V 72
/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/acronym.js
END
ins.js
K 25
svn:wc:ra_dav:version-url
V 68
/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/ins.js
END
element_common.js
K 25
svn:wc:ra_dav:version-url
V 79
/astat/!svn/ver/1/trunk/thirdparty/tiny/plugins/xhtmlxtras/js/element_common.js
END

View file

@ -0,0 +1,266 @@
9
dir
34
http://svn.astat.org/astat/trunk/thirdparty/tiny/plugins/xhtmlxtras/js
http://svn.astat.org/astat
2009-06-07T19:12:55.973801Z
1
genuineparts
svn:special svn:externals svn:needs-lock
bb7ccd2a-c66b-0410-9765-967ca6f03dfc
cite.js
file
2009-06-08T19:44:28.000000Z
e040502ec18d1753e06ad2539845c94d
2009-06-07T19:12:55.973801Z
1
genuineparts
541
del.js
file
2009-06-08T19:44:28.000000Z
1a3e75fcc6068565321ee605c14600eb
2009-06-07T19:12:55.973801Z
1
genuineparts
1752
abbr.js
file
2009-06-08T19:44:28.000000Z
892a82c58482d8562e39030d5207e917
2009-06-07T19:12:55.973801Z
1
genuineparts
570
attributes.js
file
2009-06-08T19:44:28.000000Z
174131d5cd479e39470099964d5d0cec
2009-06-07T19:12:55.973801Z
1
genuineparts
3791
acronym.js
file
2009-06-08T19:44:28.000000Z
1f21ff0566ddcf3050f8c3af19b7875d
2009-06-07T19:12:55.973801Z
1
genuineparts
556
ins.js
file
2009-06-08T19:44:28.000000Z
4062038470e36e8da56a9fc4ce31fa4e
2009-06-07T19:12:55.973801Z
1
genuineparts
1750
element_common.js
file
2009-06-08T19:44:28.000000Z
26055edb8559dd22e18819dfe93d895c
2009-06-07T19:12:55.973801Z
1
genuineparts
7385

View file

@ -0,0 +1 @@
9

View file

@ -0,0 +1,25 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function init() {
SXE.initElementDialog('abbr');
if (SXE.currentAction == "update") {
SXE.showRemoveButton();
}
}
function insertAbbr() {
SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr');
tinyMCEPopup.close();
}
function removeAbbr() {
SXE.removeElement('abbr');
tinyMCEPopup.close();
}
tinyMCEPopup.onInit.add(init);

View file

@ -0,0 +1,25 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function init() {
SXE.initElementDialog('acronym');
if (SXE.currentAction == "update") {
SXE.showRemoveButton();
}
}
function insertAcronym() {
SXE.insertElement('acronym');
tinyMCEPopup.close();
}
function removeAcronym() {
SXE.removeElement('acronym');
tinyMCEPopup.close();
}
tinyMCEPopup.onInit.add(init);

View file

@ -0,0 +1,123 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
function init() {
tinyMCEPopup.resizeToInnerSize();
var inst = tinyMCEPopup.editor;
var dom = inst.dom;
var elm = inst.selection.getNode();
var f = document.forms[0];
var onclick = dom.getAttrib(elm, 'onclick');
setFormValue('title', dom.getAttrib(elm, 'title'));
setFormValue('id', dom.getAttrib(elm, 'id'));
setFormValue('style', dom.getAttrib(elm, "style"));
setFormValue('dir', dom.getAttrib(elm, 'dir'));
setFormValue('lang', dom.getAttrib(elm, 'lang'));
setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
setFormValue('onclick', onclick);
setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
className = dom.getAttrib(elm, 'class');
addClassesToList('classlist', 'advlink_styles');
selectByValue(f, 'classlist', className, true);
TinyMCE_EditableSelects.init();
}
function setFormValue(name, value) {
if(value && document.forms[0].elements[name]){
document.forms[0].elements[name].value = value;
}
}
function insertAction() {
var inst = tinyMCEPopup.editor;
var elm = inst.selection.getNode();
tinyMCEPopup.execCommand("mceBeginUndoLevel");
setAllAttribs(elm);
tinyMCEPopup.execCommand("mceEndUndoLevel");
tinyMCEPopup.close();
}
function setAttrib(elm, attrib, value) {
var formObj = document.forms[0];
var valueElm = formObj.elements[attrib.toLowerCase()];
var inst = tinyMCEPopup.editor;
var dom = inst.dom;
if (typeof(value) == "undefined" || value == null) {
value = "";
if (valueElm)
value = valueElm.value;
}
if (value != "") {
dom.setAttrib(elm, attrib.toLowerCase(), value);
if (attrib == "style")
attrib = "style.cssText";
if (attrib.substring(0, 2) == 'on')
value = 'return true;' + value;
if (attrib == "class")
attrib = "className";
elm[attrib]=value;
} else
elm.removeAttribute(attrib);
}
function setAllAttribs(elm) {
var f = document.forms[0];
setAttrib(elm, 'title');
setAttrib(elm, 'id');
setAttrib(elm, 'style');
setAttrib(elm, 'class', getSelectValue(f, 'classlist'));
setAttrib(elm, 'dir');
setAttrib(elm, 'lang');
setAttrib(elm, 'tabindex');
setAttrib(elm, 'accesskey');
setAttrib(elm, 'onfocus');
setAttrib(elm, 'onblur');
setAttrib(elm, 'onclick');
setAttrib(elm, 'ondblclick');
setAttrib(elm, 'onmousedown');
setAttrib(elm, 'onmouseup');
setAttrib(elm, 'onmouseover');
setAttrib(elm, 'onmousemove');
setAttrib(elm, 'onmouseout');
setAttrib(elm, 'onkeypress');
setAttrib(elm, 'onkeydown');
setAttrib(elm, 'onkeyup');
// Refresh in old MSIE
// if (tinyMCE.isMSIE5)
// elm.outerHTML = elm.outerHTML;
}
function insertAttribute() {
tinyMCEPopup.close();
}
tinyMCEPopup.onInit.add(init);
tinyMCEPopup.requireLangPack();

View file

@ -0,0 +1,25 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function init() {
SXE.initElementDialog('cite');
if (SXE.currentAction == "update") {
SXE.showRemoveButton();
}
}
function insertCite() {
SXE.insertElement('cite');
tinyMCEPopup.close();
}
function removeCite() {
SXE.removeElement('cite');
tinyMCEPopup.close();
}
tinyMCEPopup.onInit.add(init);

View file

@ -0,0 +1,60 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function init() {
SXE.initElementDialog('del');
if (SXE.currentAction == "update") {
setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
SXE.showRemoveButton();
}
}
function setElementAttribs(elm) {
setAllCommonAttribs(elm);
setAttrib(elm, 'datetime');
setAttrib(elm, 'cite');
}
function insertDel() {
var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
insertInlineElement('del');
var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
setElementAttribs(elm);
}
}
} else {
setElementAttribs(elm);
}
tinyMCEPopup.editor.nodeChanged();
tinyMCEPopup.execCommand('mceEndUndoLevel');
tinyMCEPopup.close();
}
function insertInlineElement(en) {
var ed = tinyMCEPopup.editor, dom = ed.dom;
ed.getDoc().execCommand('FontName', false, 'mceinline');
tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
dom.replace(dom.create(en), n, 1);
});
}
function removeDel() {
SXE.removeElement('del');
tinyMCEPopup.close();
}
tinyMCEPopup.onInit.add(init);

View file

@ -0,0 +1,231 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
tinyMCEPopup.requireLangPack();
function initCommonAttributes(elm) {
var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
// Setup form data for common element attributes
setFormValue('title', dom.getAttrib(elm, 'title'));
setFormValue('id', dom.getAttrib(elm, 'id'));
selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);
setFormValue('style', dom.getAttrib(elm, 'style'));
selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));
setFormValue('lang', dom.getAttrib(elm, 'lang'));
setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
setFormValue('onclick', dom.getAttrib(elm, 'onclick'));
setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
}
function setFormValue(name, value) {
if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;
}
function insertDateTime(id) {
document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");
}
function getDateTime(d, fmt) {
fmt = fmt.replace("%D", "%m/%d/%y");
fmt = fmt.replace("%r", "%I:%M:%S %p");
fmt = fmt.replace("%Y", "" + d.getFullYear());
fmt = fmt.replace("%y", "" + d.getYear());
fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
fmt = fmt.replace("%%", "%");
return fmt;
}
function addZeros(value, len) {
var i;
value = "" + value;
if (value.length < len) {
for (i=0; i<(len-value.length); i++)
value = "0" + value;
}
return value;
}
function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
if (!form_obj || !form_obj.elements[field_name])
return;
var sel = form_obj.elements[field_name];
var found = false;
for (var i=0; i<sel.options.length; i++) {
var option = sel.options[i];
if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
option.selected = true;
found = true;
} else
option.selected = false;
}
if (!found && add_custom && value != '') {
var option = new Option('Value: ' + value, value);
option.selected = true;
sel.options[sel.options.length] = option;
}
return found;
}
function setAttrib(elm, attrib, value) {
var formObj = document.forms[0];
var valueElm = formObj.elements[attrib.toLowerCase()];
tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);
}
function setAllCommonAttribs(elm) {
setAttrib(elm, 'title');
setAttrib(elm, 'id');
setAttrib(elm, 'class');
setAttrib(elm, 'style');
setAttrib(elm, 'dir');
setAttrib(elm, 'lang');
/*setAttrib(elm, 'onfocus');
setAttrib(elm, 'onblur');
setAttrib(elm, 'onclick');
setAttrib(elm, 'ondblclick');
setAttrib(elm, 'onmousedown');
setAttrib(elm, 'onmouseup');
setAttrib(elm, 'onmouseover');
setAttrib(elm, 'onmousemove');
setAttrib(elm, 'onmouseout');
setAttrib(elm, 'onkeypress');
setAttrib(elm, 'onkeydown');
setAttrib(elm, 'onkeyup');*/
}
SXE = {
currentAction : "insert",
inst : tinyMCEPopup.editor,
updateElement : null
}
SXE.focusElement = SXE.inst.selection.getNode();
SXE.initElementDialog = function(element_name) {
addClassesToList('class', 'xhtmlxtras_styles');
TinyMCE_EditableSelects.init();
element_name = element_name.toLowerCase();
var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
if (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) {
SXE.currentAction = "update";
}
if (SXE.currentAction == "update") {
initCommonAttributes(elm);
SXE.updateElement = elm;
}
document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true);
}
SXE.insertElement = function(element_name) {
var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;
tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
tagName = element_name;
if (tinymce.isIE && element_name.indexOf('html:') == 0)
element_name = element_name.substring(5).toLowerCase();
insertInlineElement(element_name);
var elementArray = tinymce.grep(SXE.inst.dom.select(element_name));
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
if (SXE.inst.dom.getAttrib(elm, '_mce_new')) {
elm.id = '';
elm.setAttribute('id', '');
elm.removeAttribute('id');
elm.removeAttribute('_mce_new');
setAllCommonAttribs(elm);
}
}
}
} else {
setAllCommonAttribs(elm);
}
SXE.inst.nodeChanged();
tinyMCEPopup.execCommand('mceEndUndoLevel');
}
SXE.removeElement = function(element_name){
element_name = element_name.toLowerCase();
elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){
tinyMCEPopup.execCommand('mceBeginUndoLevel');
tinyMCE.execCommand('mceRemoveNode', false, elm);
SXE.inst.nodeChanged();
tinyMCEPopup.execCommand('mceEndUndoLevel');
}
}
SXE.showRemoveButton = function() {
document.getElementById("remove").style.display = 'block';
}
SXE.containsClass = function(elm,cl) {
return (elm.className.indexOf(cl) > -1) ? true : false;
}
SXE.removeClass = function(elm,cl) {
if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {
return true;
}
var classNames = elm.className.split(" ");
var newClassNames = "";
for (var x = 0, cnl = classNames.length; x < cnl; x++) {
if (classNames[x] != cl) {
newClassNames += (classNames[x] + " ");
}
}
elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end
}
SXE.addClass = function(elm,cl) {
if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;
return true;
}
function insertInlineElement(en) {
var ed = tinyMCEPopup.editor, dom = ed.dom;
ed.getDoc().execCommand('FontName', false, 'mceinline');
tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
dom.replace(dom.create(en, {_mce_new : 1}), n, 1);
});
}

View file

@ -0,0 +1,59 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function init() {
SXE.initElementDialog('ins');
if (SXE.currentAction == "update") {
setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
SXE.showRemoveButton();
}
}
function setElementAttribs(elm) {
setAllCommonAttribs(elm);
setAttrib(elm, 'datetime');
setAttrib(elm, 'cite');
}
function insertIns() {
var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
insertInlineElement('INS');
var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
setElementAttribs(elm);
}
}
} else {
setElementAttribs(elm);
}
tinyMCEPopup.editor.nodeChanged();
tinyMCEPopup.execCommand('mceEndUndoLevel');
tinyMCEPopup.close();
}
function removeIns() {
SXE.removeElement('ins');
tinyMCEPopup.close();
}
function insertInlineElement(en) {
var ed = tinyMCEPopup.editor, dom = ed.dom;
ed.getDoc().execCommand('FontName', false, 'mceinline');
tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
dom.replace(dom.create(en), n, 1);
});
}
tinyMCEPopup.onInit.add(init);

View file

@ -0,0 +1,25 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function init() {
SXE.initElementDialog('abbr');
if (SXE.currentAction == "update") {
SXE.showRemoveButton();
}
}
function insertAbbr() {
SXE.insertElement(tinymce.isIE ? 'html:abbr' : 'abbr');
tinyMCEPopup.close();
}
function removeAbbr() {
SXE.removeElement('abbr');
tinyMCEPopup.close();
}
tinyMCEPopup.onInit.add(init);

View file

@ -0,0 +1,25 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function init() {
SXE.initElementDialog('acronym');
if (SXE.currentAction == "update") {
SXE.showRemoveButton();
}
}
function insertAcronym() {
SXE.insertElement('acronym');
tinyMCEPopup.close();
}
function removeAcronym() {
SXE.removeElement('acronym');
tinyMCEPopup.close();
}
tinyMCEPopup.onInit.add(init);

View file

@ -0,0 +1,123 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
function init() {
tinyMCEPopup.resizeToInnerSize();
var inst = tinyMCEPopup.editor;
var dom = inst.dom;
var elm = inst.selection.getNode();
var f = document.forms[0];
var onclick = dom.getAttrib(elm, 'onclick');
setFormValue('title', dom.getAttrib(elm, 'title'));
setFormValue('id', dom.getAttrib(elm, 'id'));
setFormValue('style', dom.getAttrib(elm, "style"));
setFormValue('dir', dom.getAttrib(elm, 'dir'));
setFormValue('lang', dom.getAttrib(elm, 'lang'));
setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
setFormValue('onclick', onclick);
setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
className = dom.getAttrib(elm, 'class');
addClassesToList('classlist', 'advlink_styles');
selectByValue(f, 'classlist', className, true);
TinyMCE_EditableSelects.init();
}
function setFormValue(name, value) {
if(value && document.forms[0].elements[name]){
document.forms[0].elements[name].value = value;
}
}
function insertAction() {
var inst = tinyMCEPopup.editor;
var elm = inst.selection.getNode();
tinyMCEPopup.execCommand("mceBeginUndoLevel");
setAllAttribs(elm);
tinyMCEPopup.execCommand("mceEndUndoLevel");
tinyMCEPopup.close();
}
function setAttrib(elm, attrib, value) {
var formObj = document.forms[0];
var valueElm = formObj.elements[attrib.toLowerCase()];
var inst = tinyMCEPopup.editor;
var dom = inst.dom;
if (typeof(value) == "undefined" || value == null) {
value = "";
if (valueElm)
value = valueElm.value;
}
if (value != "") {
dom.setAttrib(elm, attrib.toLowerCase(), value);
if (attrib == "style")
attrib = "style.cssText";
if (attrib.substring(0, 2) == 'on')
value = 'return true;' + value;
if (attrib == "class")
attrib = "className";
elm[attrib]=value;
} else
elm.removeAttribute(attrib);
}
function setAllAttribs(elm) {
var f = document.forms[0];
setAttrib(elm, 'title');
setAttrib(elm, 'id');
setAttrib(elm, 'style');
setAttrib(elm, 'class', getSelectValue(f, 'classlist'));
setAttrib(elm, 'dir');
setAttrib(elm, 'lang');
setAttrib(elm, 'tabindex');
setAttrib(elm, 'accesskey');
setAttrib(elm, 'onfocus');
setAttrib(elm, 'onblur');
setAttrib(elm, 'onclick');
setAttrib(elm, 'ondblclick');
setAttrib(elm, 'onmousedown');
setAttrib(elm, 'onmouseup');
setAttrib(elm, 'onmouseover');
setAttrib(elm, 'onmousemove');
setAttrib(elm, 'onmouseout');
setAttrib(elm, 'onkeypress');
setAttrib(elm, 'onkeydown');
setAttrib(elm, 'onkeyup');
// Refresh in old MSIE
// if (tinyMCE.isMSIE5)
// elm.outerHTML = elm.outerHTML;
}
function insertAttribute() {
tinyMCEPopup.close();
}
tinyMCEPopup.onInit.add(init);
tinyMCEPopup.requireLangPack();

View file

@ -0,0 +1,25 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function init() {
SXE.initElementDialog('cite');
if (SXE.currentAction == "update") {
SXE.showRemoveButton();
}
}
function insertCite() {
SXE.insertElement('cite');
tinyMCEPopup.close();
}
function removeCite() {
SXE.removeElement('cite');
tinyMCEPopup.close();
}
tinyMCEPopup.onInit.add(init);

View file

@ -0,0 +1,60 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function init() {
SXE.initElementDialog('del');
if (SXE.currentAction == "update") {
setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
SXE.showRemoveButton();
}
}
function setElementAttribs(elm) {
setAllCommonAttribs(elm);
setAttrib(elm, 'datetime');
setAttrib(elm, 'cite');
}
function insertDel() {
var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL');
tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
insertInlineElement('del');
var elementArray = tinymce.grep(SXE.inst.dom.select('del'), function(n) {return n.id == '#sxe_temp_del#';});
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
setElementAttribs(elm);
}
}
} else {
setElementAttribs(elm);
}
tinyMCEPopup.editor.nodeChanged();
tinyMCEPopup.execCommand('mceEndUndoLevel');
tinyMCEPopup.close();
}
function insertInlineElement(en) {
var ed = tinyMCEPopup.editor, dom = ed.dom;
ed.getDoc().execCommand('FontName', false, 'mceinline');
tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
dom.replace(dom.create(en), n, 1);
});
}
function removeDel() {
SXE.removeElement('del');
tinyMCEPopup.close();
}
tinyMCEPopup.onInit.add(init);

View file

@ -0,0 +1,231 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
tinyMCEPopup.requireLangPack();
function initCommonAttributes(elm) {
var formObj = document.forms[0], dom = tinyMCEPopup.editor.dom;
// Setup form data for common element attributes
setFormValue('title', dom.getAttrib(elm, 'title'));
setFormValue('id', dom.getAttrib(elm, 'id'));
selectByValue(formObj, 'class', dom.getAttrib(elm, 'class'), true);
setFormValue('style', dom.getAttrib(elm, 'style'));
selectByValue(formObj, 'dir', dom.getAttrib(elm, 'dir'));
setFormValue('lang', dom.getAttrib(elm, 'lang'));
setFormValue('onfocus', dom.getAttrib(elm, 'onfocus'));
setFormValue('onblur', dom.getAttrib(elm, 'onblur'));
setFormValue('onclick', dom.getAttrib(elm, 'onclick'));
setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick'));
setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown'));
setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup'));
setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover'));
setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove'));
setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout'));
setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress'));
setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown'));
setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup'));
}
function setFormValue(name, value) {
if(document.forms[0].elements[name]) document.forms[0].elements[name].value = value;
}
function insertDateTime(id) {
document.getElementById(id).value = getDateTime(new Date(), "%Y-%m-%dT%H:%M:%S");
}
function getDateTime(d, fmt) {
fmt = fmt.replace("%D", "%m/%d/%y");
fmt = fmt.replace("%r", "%I:%M:%S %p");
fmt = fmt.replace("%Y", "" + d.getFullYear());
fmt = fmt.replace("%y", "" + d.getYear());
fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2));
fmt = fmt.replace("%d", addZeros(d.getDate(), 2));
fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2));
fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2));
fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2));
fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1));
fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM"));
fmt = fmt.replace("%%", "%");
return fmt;
}
function addZeros(value, len) {
var i;
value = "" + value;
if (value.length < len) {
for (i=0; i<(len-value.length); i++)
value = "0" + value;
}
return value;
}
function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
if (!form_obj || !form_obj.elements[field_name])
return;
var sel = form_obj.elements[field_name];
var found = false;
for (var i=0; i<sel.options.length; i++) {
var option = sel.options[i];
if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
option.selected = true;
found = true;
} else
option.selected = false;
}
if (!found && add_custom && value != '') {
var option = new Option('Value: ' + value, value);
option.selected = true;
sel.options[sel.options.length] = option;
}
return found;
}
function setAttrib(elm, attrib, value) {
var formObj = document.forms[0];
var valueElm = formObj.elements[attrib.toLowerCase()];
tinyMCEPopup.editor.dom.setAttrib(elm, attrib, value || valueElm.value);
}
function setAllCommonAttribs(elm) {
setAttrib(elm, 'title');
setAttrib(elm, 'id');
setAttrib(elm, 'class');
setAttrib(elm, 'style');
setAttrib(elm, 'dir');
setAttrib(elm, 'lang');
/*setAttrib(elm, 'onfocus');
setAttrib(elm, 'onblur');
setAttrib(elm, 'onclick');
setAttrib(elm, 'ondblclick');
setAttrib(elm, 'onmousedown');
setAttrib(elm, 'onmouseup');
setAttrib(elm, 'onmouseover');
setAttrib(elm, 'onmousemove');
setAttrib(elm, 'onmouseout');
setAttrib(elm, 'onkeypress');
setAttrib(elm, 'onkeydown');
setAttrib(elm, 'onkeyup');*/
}
SXE = {
currentAction : "insert",
inst : tinyMCEPopup.editor,
updateElement : null
}
SXE.focusElement = SXE.inst.selection.getNode();
SXE.initElementDialog = function(element_name) {
addClassesToList('class', 'xhtmlxtras_styles');
TinyMCE_EditableSelects.init();
element_name = element_name.toLowerCase();
var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
if (elm != null && elm.nodeName.toUpperCase() == element_name.toUpperCase()) {
SXE.currentAction = "update";
}
if (SXE.currentAction == "update") {
initCommonAttributes(elm);
SXE.updateElement = elm;
}
document.forms[0].insert.value = tinyMCEPopup.getLang(SXE.currentAction, 'Insert', true);
}
SXE.insertElement = function(element_name) {
var elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase()), h, tagName;
tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
tagName = element_name;
if (tinymce.isIE && element_name.indexOf('html:') == 0)
element_name = element_name.substring(5).toLowerCase();
insertInlineElement(element_name);
var elementArray = tinymce.grep(SXE.inst.dom.select(element_name));
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
if (SXE.inst.dom.getAttrib(elm, '_mce_new')) {
elm.id = '';
elm.setAttribute('id', '');
elm.removeAttribute('id');
elm.removeAttribute('_mce_new');
setAllCommonAttribs(elm);
}
}
}
} else {
setAllCommonAttribs(elm);
}
SXE.inst.nodeChanged();
tinyMCEPopup.execCommand('mceEndUndoLevel');
}
SXE.removeElement = function(element_name){
element_name = element_name.toLowerCase();
elm = SXE.inst.dom.getParent(SXE.focusElement, element_name.toUpperCase());
if(elm && elm.nodeName.toUpperCase() == element_name.toUpperCase()){
tinyMCEPopup.execCommand('mceBeginUndoLevel');
tinyMCE.execCommand('mceRemoveNode', false, elm);
SXE.inst.nodeChanged();
tinyMCEPopup.execCommand('mceEndUndoLevel');
}
}
SXE.showRemoveButton = function() {
document.getElementById("remove").style.display = 'block';
}
SXE.containsClass = function(elm,cl) {
return (elm.className.indexOf(cl) > -1) ? true : false;
}
SXE.removeClass = function(elm,cl) {
if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) {
return true;
}
var classNames = elm.className.split(" ");
var newClassNames = "";
for (var x = 0, cnl = classNames.length; x < cnl; x++) {
if (classNames[x] != cl) {
newClassNames += (classNames[x] + " ");
}
}
elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end
}
SXE.addClass = function(elm,cl) {
if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl;
return true;
}
function insertInlineElement(en) {
var ed = tinyMCEPopup.editor, dom = ed.dom;
ed.getDoc().execCommand('FontName', false, 'mceinline');
tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
dom.replace(dom.create(en, {_mce_new : 1}), n, 1);
});
}

View file

@ -0,0 +1,59 @@
/**
* $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
*
* @author Moxiecode - based on work by Andrew Tetlaw
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
*/
function init() {
SXE.initElementDialog('ins');
if (SXE.currentAction == "update") {
setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
SXE.showRemoveButton();
}
}
function setElementAttribs(elm) {
setAllCommonAttribs(elm);
setAttrib(elm, 'datetime');
setAttrib(elm, 'cite');
}
function insertIns() {
var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS');
tinyMCEPopup.execCommand('mceBeginUndoLevel');
if (elm == null) {
var s = SXE.inst.selection.getContent();
if(s.length > 0) {
insertInlineElement('INS');
var elementArray = tinymce.grep(SXE.inst.dom.select('ins'), function(n) {return n.id == '#sxe_temp_ins#';});
for (var i=0; i<elementArray.length; i++) {
var elm = elementArray[i];
setElementAttribs(elm);
}
}
} else {
setElementAttribs(elm);
}
tinyMCEPopup.editor.nodeChanged();
tinyMCEPopup.execCommand('mceEndUndoLevel');
tinyMCEPopup.close();
}
function removeIns() {
SXE.removeElement('ins');
tinyMCEPopup.close();
}
function insertInlineElement(en) {
var ed = tinyMCEPopup.editor, dom = ed.dom;
ed.getDoc().execCommand('FontName', false, 'mceinline');
tinymce.each(dom.select(tinymce.isWebKit ? 'span' : 'font'), function(n) {
if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline')
dom.replace(dom.create(en), n, 1);
});
}
tinyMCEPopup.onInit.add(init);