+ diffJsonSinceImportDialog: function diffJsonSinceImportDialog(){
+ var currDGObj = getCurrentFlowNodeSet();
+ var currDGObjStr = JSON.stringify(currDGObj,null,4);
+ //console.log(currDGObjStr);
+ //$(function() {
+var htmlStr = "<div id=\"flex-container\">" +
+ "<div><div id=\"editor1\"></div></div>" +
+ "<div id=\"gutter\"></div>" +
+ "<div><div id=\"editor2\"></div></div>" +
+"</div>" +
+
+"<script>" +
+"$(function () {" +
+ "var aceDiffer = new AceDiff({" +
+ "mode: \"ace/mode/json\"," +
+ "theme: \"ace/theme/eclipse\"," +
+ "left: {" +
+ "id: \"editor1\"," +
+ "content: $(\"#example-content-1\").html()," +
+ "editable: false," +
+ "copyLinkEnabled: false" +
+ "}," +
+ "right: {" +
+ "id: \"editor2\"," +
+ "content: $(\"#example-content-2\").html()," +
+ "editable: false," +
+ "copyLinkEnabled: false" +
+ "}," +
+ "classes: {" +
+ "gutterID: \"gutter\"" +
+ "}" +
+ "});" +
+"});" +
+"</script>" ;
+var origDGFile ="[]";
+var diffStatus = "DG JSON UNCHANGED";
+ $.get("/readFile",{"filePath" : "orig_dgs/" + activeWorkspace })
+ .done(function( data ) {
+ if(data != undefined && data != null && data.output != undefined ){
+ origDGFile= data.output;
+ }
+ })
+ .fail(function(err) {
+ })
+ .always(function() {
+ if(origDGFile != currDGObjStr){
+ diffStatus="DG JSON CHANGED";
+ }
+ htmlStr += "<div id=\"example-content-1\" style=\"display: none\">" +
+ origDGFile +
+ "</div>" +
+ "<div id=\"example-content-2\" style=\"display: none\">" +
+ currDGObjStr +
+ "</div>" ;
+
+//var htmlStr='<object type="text/html" data="display-diff.html" ></object>';
+
+ $("#diff-browser-dialog").dialog({
+ modal:true,
+ autoOpen :false,
+ title: "Json Diff :" + diffStatus,
+ width: 1200,
+ height: 600,
+ minWidth :1200 ,
+ minHeight :600,
+ buttons :[
+ {
+ text: "Close",
+ click: function() {
+ //$( this ).dialog( "close" );
+ $("#diff-browser-dialog").dialog("close");
+ }
+ }
+ ],
+ open:function(){
+ $('#diff-browser-dialog').keypress(function(e) {
+ if (e.keyCode == $.ui.keyCode.ENTER) {
+ $('#diff-browser-dialog').parent().find('.ui-dialog-buttonpane button:first').click();
+ return false;
+ }
+ });
+ }
+ }).dialog('open').html(htmlStr);
+ });
+ //});
+ },
+ diffXmlSinceImportDialog: function diffXmlSinceImportDialog(){
+ var currDGObj = getCurrentFlowNodeSet();
+ //console.dir(currDGObj);
+ var currDGObjStr ="";
+ try{
+ currDGObjStr = getNodeToXml(JSON.stringify(currDGObj));
+ }catch(err){
+ }
+ var curr_formatted_xml = vkbeautify.xml(currDGObjStr);
+ //console.log(curr_formatted_xml);
+ //console.log(currDGObjStr);
+ //$(function() {
+var htmlStr = "<div id=\"flex-container\">" +
+ "<div><div id=\"editor1\"></div></div>" +
+ "<div id=\"gutter\"></div>" +
+ "<div><div id=\"editor2\"></div></div>" +
+"</div>" +
+
+"<script>" +
+"$(function () {" +
+ "var aceDiffer = new AceDiff({" +
+ "mode: \"ace/mode/xml\"," +
+ "theme: \"ace/theme/eclipse\"," +
+ //"theme: \"ace/theme/twilight\"," +
+ "left: {" +
+ "id: \"editor1\"," +
+ "content: $(\"#example-content-1\").html()," +
+ "editable: false," +
+ "copyLinkEnabled: false" +
+ "}," +
+ "right: {" +
+ "id: \"editor2\"," +
+ "content: $(\"#example-content-2\").html()," +
+ "editable: false," +
+ "copyLinkEnabled: false" +
+ "}," +
+ "classes: {" +
+ "gutterID: \"gutter\"" +
+ "}" +
+ "});" +
+"});" +
+"</script>" ;
+var origXmlFile ="";
+var origDGFile ="";
+var diffStatus = "DG XML UNCHANGED";
+ $.get("/readFile",{"filePath" : "orig_dgs/" + activeWorkspace })
+ .done(function( data ) {
+ if(data != undefined && data != null && data.output != undefined ){
+ origDGFile= data.output;
+ try{
+ var origDGObjStr = getNodeToXml(origDGFile);
+ origXmlFile = vkbeautify.xml(origDGObjStr);
+ }catch(err){
+ }
+ }
+ })
+ .fail(function(err) {
+ })
+ .always(function() {
+ if(origXmlFile != curr_formatted_xml){
+ diffStatus = "DG XML CHANGED";
+ }
+ htmlStr += "<div id=\"example-content-1\" style=\"display: none\">" +
+ origXmlFile +
+ "</div>" +
+ "<div id=\"example-content-2\" style=\"display: none\">" +
+ curr_formatted_xml +
+ "</div>" ;
+
+//var htmlStr='<object type="text/html" data="display-diff.html" ></object>';
+
+ $("#diff-browser-dialog").dialog({
+ modal:true,
+ autoOpen :false,
+ title: "XML Diff",
+ width: 1200,
+ height: 600,
+ minWidth : 1200,
+ minHeight :600,
+ buttons :[
+ {
+ text: "Close",
+ click: function() {
+ //$( this ).dialog( "close" );
+ $("#diff-browser-dialog").dialog("close");
+ }
+ }
+ ],
+ open:function(){
+ $('#diff-browser-dialog').keypress(function(e) {
+ if (e.keyCode == $.ui.keyCode.ENTER) {
+ $('#diff-browser-dialog').parent().find('.ui-dialog-buttonpane button:first').click();
+ return false;
+ }
+ });
+ }
+ }).dialog('open').html(htmlStr);
+ });
+ //});
+ },