summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorMaverick2016-06-08 16:17:11 +0530
committerMaverick2016-06-08 16:17:11 +0530
commitfa68d3caeb1cb35a7e74b113a73634761e0214e5 (patch)
tree96725ebda294a393bcba6adf9f635baeda046ba8 /index.html
parent6e5a67fab9d1ffef731b0dfda0d29b4baf9c704f (diff)
downloadxcos-on-web-fa68d3caeb1cb35a7e74b113a73634761e0214e5.tar.gz
xcos-on-web-fa68d3caeb1cb35a7e74b113a73634761e0214e5.tar.bz2
xcos-on-web-fa68d3caeb1cb35a7e74b113a73634761e0214e5.zip
Integrated the XSL transformation with the HTML file
Diffstat (limited to 'index.html')
-rw-r--r--index.html38
1 files changed, 28 insertions, 10 deletions
diff --git a/index.html b/index.html
index 94c7a12..29c59ab 100644
--- a/index.html
+++ b/index.html
@@ -491,30 +491,48 @@
var xmlFromExportXML=null;
var flagXcosClickedFirst=false;
- // Defines a new export action
- editor.addAction('exportXML', function(editor, cell) {
- var textarea = document.createElement('textarea');
+
+
+ /*
+ Maverick
+ The Export buttons in toolbar call this function with varying
+ arguments.
+ The third argument is used to decide which button is being
+ pressed.
+ exportXML : 2 arguments
+ exportXcos: 3 arguments
+ */
+ function displayXMLorXcos()
+ {
+ var textarea = document.createElement('textarea');
textarea.style.width = '400px';
textarea.style.height = '400px';
var enc = new mxCodec(mxUtils.createXmlDocument());
- var node = enc.encode(editor.graph.getModel());
+ var node = enc.encode(arguments[0].graph.getModel());
//console.log(mxUtils.getPrettyXml(node));
textarea.value = mxUtils.getPrettyXml(node);
xmlFromExportXML=mxUtils.getXml(node);
- if(!flagXcosClickedFirst)
- showModalWindow(graph, 'XML', textarea, 410, 440);
+
+ if(arguments[2]==null)
+ showModalWindow(graph, 'XML', textarea, 410, 440);
+
+ }
+
+ // Defines a new export action
+ editor.addAction('exportXML', function(editor, cell) {
+ //Only two parameters passed here.
+ displayXMLorXcos(editor,cell);
});
/* Maverick
Reference: http://www.w3schools.com/xsl/xsl_client.asp*/
- editor.addAction('exportXcos', function() {
- flagXcosClickedFirst=true;
- editor.execute('exportXML');
- flagXcosClickedFirst=false;
+ editor.addAction('exportXcos', function(editor,cell) {
+ //Mind the 3 parameters.
+ displayXMLorXcos(editor,cell,true);
if(xmlFromExportXML==null) alert('First create the XML file.');
else
{