r1678 - in branches/bxe_2_0: . js
[email protected] Mon, 21 May 2007 19:02:31 +0200 (CEST)
| Newsgroups | gmane.editors.bitflux.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: chregu
Date: Mon May 21 19:02:30 2007
New Revision: 1678
Log:
implements BXEB-21
OnLoad-, onSave- und onTransform-Callbacks
see also https://fosswiki.liip.ch/display/BXE/BXE+2.0+config.xml
Modified:
branches/bxe_2_0/bxeLoader.js
branches/bxe_2_0/js/bxeConfig.js
branches/bxe_2_0/js/bxeFunctions.js
Modified: branches/bxe_2_0/bxeLoader.js
==============================================================================
--- branches/bxe_2_0/bxeLoader.js (original)
+++ branches/bxe_2_0/bxeLoader.js Mon May 21 19:02:30 2007
@@ -376,6 +376,9 @@
}
function xml_loaded(xmldoc) {
+ if ( bxe_config.options['onLoad']) {
+ eval(bxe_config.options['onLoad'] +"(xmldoc,'onLoad')");
+ }
bxe_about_box.addText("Load RelaxNG " + bxe_config.validationfile + " ");
if (!(bxe_config.validationfile && xmldoc.XMLNode.loadSchema(bxe_config.validationfile,validation_loaded))) {
bxe_about_box.addText("RelaxNG File was not found");
Modified: branches/bxe_2_0/js/bxeConfig.js
==============================================================================
--- branches/bxe_2_0/js/bxeConfig.js (original)
+++ branches/bxe_2_0/js/bxeConfig.js Mon May 21 19:02:30 2007
@@ -73,7 +73,6 @@
bxe_config.scriptfiles = bxe_config.getContentMultiple("/config/files/scripts/file");
bxe_config.xslparams = bxe_config.getContentMultiple("/config/files/input/xslparams",true);
- console.log("XSLPARAMS",bxe_config.xslparams);
var ps = bxe_config.getPlugins();
for (var i=0; i < ps.length; i++) {
Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js (original)
+++ branches/bxe_2_0/js/bxeFunctions.js Mon May 21 19:02:30 2007
@@ -52,10 +52,15 @@
}
var xml = bxe_getXmlDomDocument(true);
+
if (!xml) {
alert(bxe_i18n.getText("You're in Source Mode. Not possible to use this button"));
}
+ if ( bxe_config.options['onSaveBefore']) {
+ eval(bxe_config.options['onSaveBefore'] +"(xml,'onSaveBefore')");
+ }
+
var xmlstr =xml.saveXML(xml);
function callback (e) {
@@ -75,6 +80,11 @@
eval(bxe_config.options['onSaveFileCreated']);
}
+
+ if ( bxe_config.options['onSaveAfter']) {
+ xml = bxe_getXmlDocument();
+ eval(bxe_config.options['onSaveAfter'] +"(xml,'onSaveAfter')");
+ }
if (e.td.Reload) {
document.location.reload();
}
@@ -2182,6 +2192,9 @@
startTimer = new Date();
bxe_dump("TRANSFsORM\n");
var xml = bxe_config.xmldoc;
+ if ( bxe_config.options['onTransformBefore']) {
+ eval(bxe_config.options['onTransformBefore'] +"(xml,'onTransformBefore')");
+ }
var node = xml.documentElement;
@@ -2246,6 +2259,10 @@
}
+ if ( bxe_config.options['onTransformAfter']) {
+ eval(bxe_config.options['onTransformAfter'] +"(xml,'onTransformAfter')");
+ }
+
@@ -2681,4 +2698,5 @@
bxe_Transform(false,false,e);
return true;
}
-/* end example function */
\ No newline at end of file
+/* end example function */
+
--
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs