removed dependency on built-editor.min.js 01/55501/1
authorChinthakayala,Sheshashailavas(sc2914) <sc2914@att.com>
Wed, 27 Jun 2018 16:11:44 +0000 (16:11 +0000)
committerChinthakayala,Sheshashailavas(sc2914) <sc2914@att.com>
Wed, 27 Jun 2018 16:25:31 +0000 (16:25 +0000)
and added ability to test DG from dgbuilder
 and fixed the break node on XML generation
 and added ability to download
  formatted DG XML and DG JSON

Issue-ID: SDNC-353
Change-Id: I799de5de2c4f61e9b56dbe996d8ac3e3b28061f7
Signed-off-by: Chinthakayala,Sheshashailavas(sc2914) <sc2914@att.com>
62 files changed:
dgbuilder/createReleaseDir.sh
dgbuilder/nodes/dge/dgelogic/block.html
dgbuilder/nodes/dge/dgelogic/breakNode.html
dgbuilder/nodes/dge/dgelogic/call.html
dgbuilder/nodes/dge/dgelogic/configure.html
dgbuilder/nodes/dge/dgelogic/delete.html
dgbuilder/nodes/dge/dgelogic/execute.html
dgbuilder/nodes/dge/dgelogic/exists.html
dgbuilder/nodes/dge/dgelogic/forNode.html
dgbuilder/nodes/dge/dgelogic/get-resource.html
dgbuilder/nodes/dge/dgelogic/is-available.html
dgbuilder/nodes/dge/dgelogic/notify.html
dgbuilder/nodes/dge/dgelogic/record.html
dgbuilder/nodes/dge/dgelogic/release.html
dgbuilder/nodes/dge/dgelogic/reserve.html
dgbuilder/nodes/dge/dgelogic/save.html
dgbuilder/nodes/dge/dgelogic/set.html
dgbuilder/nodes/dge/dgelogic/switchNode.html
dgbuilder/nodes/dge/dgelogic/update.html
dgbuilder/nodes/dge/dgemain/GenericXML.html
dgbuilder/nodes/dge/dgemain/comment.html
dgbuilder/nodes/dge/dgemain/dgstart.html
dgbuilder/nodes/dge/dgemain/method.html
dgbuilder/nodes/dge/dgeoutcome/already-active.html
dgbuilder/nodes/dge/dgeoutcome/failure.html
dgbuilder/nodes/dge/dgeoutcome/not-found.html
dgbuilder/nodes/dge/dgeoutcome/other.html
dgbuilder/nodes/dge/dgeoutcome/outcome.html
dgbuilder/nodes/dge/dgeoutcome/outcomeFalse.html
dgbuilder/nodes/dge/dgeoutcome/outcomeTrue.html
dgbuilder/nodes/dge/dgeoutcome/success.html
dgbuilder/nodes/dge/dgereturn/returnFailure.html
dgbuilder/nodes/dge/dgereturn/returnSuccess.html
dgbuilder/public/ace/.ace-diff.js.swp [new file with mode: 0644]
dgbuilder/public/ace/ace-diff.js [new file with mode: 0755]
dgbuilder/public/ace/ace-styles.css [new file with mode: 0644]
dgbuilder/public/ace/ace.js [new file with mode: 0755]
dgbuilder/public/ace/diff_match_patch.js [new file with mode: 0755]
dgbuilder/public/ace/ext-searchbox.js [new file with mode: 0644]
dgbuilder/public/ace/mode-html.js [new file with mode: 0644]
dgbuilder/public/ace/mode-javascript.js [new file with mode: 0644]
dgbuilder/public/ace/mode-json.js [new file with mode: 0644]
dgbuilder/public/ace/mode-xml.js [new file with mode: 0644]
dgbuilder/public/ace/theme-dreamweaver.js [new file with mode: 0644]
dgbuilder/public/ace/theme-eclipse.js [new file with mode: 0644]
dgbuilder/public/ace/theme-tomorrow.js [new file with mode: 0644]
dgbuilder/public/ace/theme-twilight.js [new file with mode: 0644]
dgbuilder/public/ace/worker-html.js [new file with mode: 0644]
dgbuilder/public/ace/worker-javascript.js [new file with mode: 0644]
dgbuilder/public/ace/worker-json.js [new file with mode: 0644]
dgbuilder/public/ace/worker-xml.js [new file with mode: 0644]
dgbuilder/public/index.html
dgbuilder/public/orion/built-editor.css [deleted file]
dgbuilder/public/orion/built-editor.min.js [deleted file]
dgbuilder/public/red/main.js
dgbuilder/public/red/ui/editor.js
dgbuilder/public/red/ui/library.js
dgbuilder/public/util/js/dgeToXml.js
dgbuilder/public/util/js/sliValues.js
dgbuilder/public/util/js/validateNodeXml.js
dgbuilder/red/server.js
dgbuilder/releases/sdnc1.0/customSettings.js

index 00d185f..eff8485 100755 (executable)
@@ -21,6 +21,11 @@ dbName="sdnctl"
 dbUser="sdnctl"
 dbPassword="gamma"
 gitLocalRepository="$4"
+restConfUrl="http://localhost:8181/restconf/operations/SLI-API:execute-graph"
+restConfUser="admin"
+restConfPassword="admin"
+formatXML="Y"
+formatJSON="Y"
 
 lastPort=$(find "releases/" -name "customSettings.js" |xargs grep uiPort|cut -d: -f2|sed -e s/,//|sort|tail -1)
 echo $lastPort|grep uiPort >/dev/null 2>&1
@@ -54,6 +59,7 @@ if [ ! -e "./$customSettingsFile" ]
 then
        echo "module.exports = {" >$customSettingsFile
        echo "          'name' : '$name'," >>$customSettingsFile
+       echo "          'loginId' :'$loginId'," >>$customSettingsFile
        echo "          'emailAddress' :'$emailid'," >>$customSettingsFile
        echo "          'uiPort' :$nextPort," >>$customSettingsFile
        echo "          'mqttReconnectTime': 15000," >>$customSettingsFile
@@ -70,7 +76,12 @@ then
        echo "          'dbName': '$dbName'," >>$customSettingsFile
        echo "          'dbUser': '$dbUser'," >>$customSettingsFile
        echo "          'dbPassword': '$dbPassword'," >>$customSettingsFile
-       echo "          'gitLocalRepository': '$gitLocalRepository'" >>$customSettingsFile
+       echo "          'gitLocalRepository': '$gitLocalRepository'," >>$customSettingsFile
+       echo "          'restConfUrl': '$restConfUrl'," >>$customSettingsFile
+       echo "          'restConfUser': '$restConfUser'," >>$customSettingsFile
+       echo "          'restConfPassword': '$restConfPassword'," >>$customSettingsFile
+       echo "          'formatXML': '$formatXML'," >>$customSettingsFile
+       echo "          'formatJSON': '$formatJSON'" >>$customSettingsFile
        echo "          }" >>$customSettingsFile
 fi
        #echo "Created custom settings  file $customSettingsFile"
index fadf8a8..4e6d2b9 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                        $('#node-input-atomic-chkBox').prop('checked', false);
                }
 
-
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+               blockXmlEditor=that.editor;
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-               blockXmlEditor=that.editor;
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
-                               //console.log("validate clicked.");
+                               console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               //console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-               
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                }       
                delete this.editor;
                delete blockXmlEditor;
-        }
+       }
     });
 function updateXml(){
        if($("#node-input-atomic-chkBox").is(':checked')){
                $("#node-input-name").val("block : atomic");
                $("#node-input-atomic").val("true");
                //alert($("#node-input-xml-editor div.textview div.textviewContent").text());
-               var xmlStr = blockXmlEditor.getText();
+               var xmlStr = blockXmlEditor.getValue();
                var re = new RegExp("<block[^<]+");
                xmlStr=xmlStr.replace(re,"<block atomic='true'>");
                //$("#node-input-xml-editor div.textview div.textviewContent").text(xmlStr);
-               blockXmlEditor.setText(xmlStr);
+               blockXmlEditor.setValue(xmlStr);
                //console.log("block xmlStr:" + xmlStr);
        }else{
                $("#node-input-name").val("block");
                $("#node-input-atomic").val("false");
-               var xmlStr = blockXmlEditor.getText();
+               var xmlStr = blockXmlEditor.getValue();
                var re = new RegExp("<block[^<]+");
                xmlStr=xmlStr.replace(re,"<block>");
-               blockXmlEditor.setText(xmlStr);
+               blockXmlEditor.setValue(xmlStr);
                //$("#node-input-xml-editor div.textview div.textviewContent").text(xmlStr);
                //console.log("block xmlStr:" + xmlStr);
        }
index e3edef9..8bb20f4 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 0e49e26..d207ec9 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               //console.log("show Values clicked.");
-                               showValuesBox(that.editor,rpcValues);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 7503b1f..9deda0d 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index b4c7f52..31008bf 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 3d5fc6d..4832745 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 001e8ca..b499e45 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
-
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index c7327db..8126b11 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index b3b6558..31478d7 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 8bc45ef..32d7665 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index e5bc24b..ec91980 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
-                               //console.log("validate clicked.");
+                               console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               //console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 3eb7a2e..facc79c 100644 (file)
@@ -90,7 +90,7 @@
         category: 'DGElogic',
         defaults: {
             name: {value:"record"},
-            xml: {value:"<record>\n"},
+            xml: {value:"<record plugin=''>\n"},
            comments:{value:""},        
             outputs: {value:1}
         },
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 044616a..dfaf2e9 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index bcd3fcb..d706544 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 6e02215..a34b534 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index bcbcae3..5410d3f 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 35c9fe6..3088d39 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
-               //To increase the width of dialogbox
-               //$(".ui-dialog.ui-widget.ui-widget-content.ui-corner-all.ui-front.ui-dialog-buttons.ui-draggable.ui-resizable").css("width","1400px");
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 
 function encodeTestStr(xmlStr){
index a7d2828..f6c3adc 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
-                               //console.log("validate clicked.");
+                               console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               //console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 4c9c01a..123473a 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               //console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index c34d14c..f6da461 100644 (file)
@@ -22,6 +22,7 @@
     <div class="form-row">
         <label for="node-input-info" style="width: 100% !important;"><i class="fa fa-comments"></i> More</label>
         <input type="hidden" id="node-input-info" autofocus="autofocus">
+       <div class="form-row node-text-editor-row">
         <div style="height: 250px;" class="node-text-editor" id="node-input-info-editor" ></div>
         <input type="hidden" id="node-input-comments">
     </div>
         labelStyle: function() {
             return this.name?"node_label_italic":"";
         },
+        oneditprepare: function() {
+            var that = this;
+            $( "#node-input-outputs" ).spinner({
+                min:1
+            });
+            var comments = $( "#node-input-comments").val();
+            if(comments != null){
+               comments = comments.trim();
+               if(comments != ''){
+                       $("#node-input-btnComments").html("<span style='color:blue;'><b>View Comments</b></span>");
+               }
+            }
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
+            };
+            $( "#dialog" ).on("dialogresize", functionDialogResize);
+            $( "#dialog" ).one("dialogopen", function(ev) {
+                var size = $( "#dialog" ).dialog('option','sizeCache-function');
+                if (size) {
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
+                }
+            });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-info-editor',
+                mode: 'ace/mode/markdown',
+               fontSize: "15pt"
+            });
+       console.dir(this.editor);
+           this.editor.setValue($("#node-input-info").val(),-1);
+           this.editor.focus();
+        },
+/*
         oneditprepare: function() {
             $( "#node-input-outputs" ).spinner({
                 min:1
                 });
                 $("#node-input-name").focus();
             });
+           this.editor = RED.editor.createEditor({
+                       id: 'node-input-info-editor',
+                       mode: 'ace/mode/markdown',
+                       options: {
+                               showLineNumbers : false,
+                               enableBasicAutocompletion : true,
+                               enableSnippets:true,
+                               fontSize: "14px"
+                       }
+               });
+            console.dir(this.editor);
+            this.editor.setValue($("#node-input-info").val(),-1);
+            this.editor.focus();
+
         },
+       */
         oneditsave: function() {
-            $("#node-input-info").val(this.editor.getText());
+            $("#node-input-info").val(this.editor.getValue());
             delete this.editor;
         }
     });
index a203a44..273d51d 100644 (file)
@@ -764,7 +764,7 @@ function showDgStartGenerateXmlStatus(){
                }
                var xmlLines = formatted_xml.split("\n");
                console.log("Number of lines " + xmlLines.length);
-               var numberOfLines = xmlLines.length;
+               //var numberOfLines = xmlLines.length;
                //var display_formatted_xml = formatted_xml.replace("&lt;","<");
                var currentNodeSet = getCurrentFlowNodeSet();
                //get max x and y coordinates
@@ -810,8 +810,10 @@ function showDgStartGenerateXmlStatus(){
                var unformatted_json_str=JSON.stringify(currentNodeSet);
                var formatted_json = vkbeautify.json(unformatted_json_str);
                //var displayHtmlStr="<div><textarea readonly='1' style='width:1100px;height:700px;border:none'>" + formatted_xml + "</textarea></div>";
-               var displayHtmlStr="<div style='font-size:20px;'><xmp>" + formatted_xml + "</xmp></div>";
-               var xmlInfoStr = "<div id='xml-info-div'><p>" + "XML size:" + sizeStr +  " <br>Number of Lines:" + numberOfLines +  "</p></div>";
+               //var displayHtmlStr="<div style='font-size:20px;'><xmp>" + formatted_xml + "</xmp></div>";
+               var displayHtmlStr=  "";
+              
+               //var xmlInfoStr = "<div id='xml-info-div'><p>" + "XML size:" + sizeStr +  " <br>Number of Lines:" + numberOfLines +  "</p></div>";
                var htmlCode ="";
                $( "#xmldialog" ).dialog({
                        title: "XML Generated",
@@ -866,6 +868,7 @@ function showDgStartGenerateXmlStatus(){
                                },
                        */
                            "Validate XML" : function (event) {
+                               $("#ace-editor-div").show();
                                if(!event) event = window.event;
                                var target = $(event.target);
                                target.text("Validating XML");
@@ -928,7 +931,8 @@ function showDgStartGenerateXmlStatus(){
                                        var reqData = {
                                                "flowHtml" : htmlCode,
                                                "flowXml" : formatted_xml,
-                                               "flowJson" : formatted_json
+                                               "flowJson" : formatted_json,
+                                               "emailAddress" : RED.settings.emailAddress
                                        };
 
                                        $.post( "/sendEmail",reqData )
@@ -988,8 +992,8 @@ function showDgStartGenerateXmlStatus(){
                                        .done(function( data ) {
                                        console.log("calling uploadxml. sending to server");
                                                //var successHtmlStr = "<object width='600' height='450' type='text/html' data='"  + data.url + "' />";
-                                               
-                                               if( data != undefined  && data != null &&  (data.stdout.indexOf('Saving SvcLogicGraph') != -1 || data.stderr.indexOf('Saving SvcLogicGraph') != -1)){
+                                               //console.dir(data);    
+                                               if( data != undefined  && data != null &&  ((data.stdout != undefined && data.stdout != null && data.stdout.indexOf('Saving SvcLogicGraph') != -1) || (data.stderr != undefined && data.stderr != null &&  data.stderr.indexOf('Saving SvcLogicGraph') != -1))){
                                                        //RED.notify("<strong>Uploaded Successfully</strong>");
                                                        //console.dir(data);
                                                        var _moduleName = data.module;
@@ -1204,8 +1208,12 @@ function showDgStartGenerateXmlStatus(){
                                        form.append('<input type="hidden" name="moduleName" value="' + moduleName + '"/>');
                                        form.append('<input type="hidden" name="methodName" value="' + formattedMethodName + '"/>');
                                        form.appendTo('body');
-                                       //$("#flowXmlId").val(formatted_xml);
-                                       $("#flowXmlId").val(unformatted_xml_str);
+                                       console.log("format_xml:" + format_xml);
+                                       if(format_xml == "Y" || format_xml == undefined){
+                                               $("#flowXmlId").val(formatted_xml);
+                                       }else{
+                                               $("#flowXmlId").val(unformatted_xml_str);
+                                       }
                                        $("#dwnldXmlFormId").submit();
                                        //console.log("Form submitted.");
                                });
@@ -1245,8 +1253,12 @@ function showDgStartGenerateXmlStatus(){
                                        form.append('<input type="hidden" name="moduleName" value="' + moduleName + '"/>');
                                        form.append('<input type="hidden" name="methodName" value="' + formattedMethodName + '"/>');
                                        form.appendTo('body');
-                                       //$("#flowJsonId").val(formatted_json);
-                                       $("#flowJsonId").val(unformatted_json_str);
+                                       console.log("format_json:" + format_json);
+                                       if(format_json == "Y" || format_json == undefined){
+                                               $("#flowJsonId").val(formatted_json);
+                                       }else{
+                                               $("#flowJsonId").val(unformatted_json_str);
+                                       }
                                        $("#dwnldJsonFormId").submit();
                                        //console.log("Form submitted.");
                                });
@@ -1261,6 +1273,7 @@ function showDgStartGenerateXmlStatus(){
                                unformatted_xml_str="";
                                unformatted_json_str="";
                                */
+                               ace.edit('xmldialog').destroy();
                               $('.ui-dialog:has(#xmldialog)').empty().remove();
                                RED.view.redraw();
 
@@ -1272,6 +1285,17 @@ function showDgStartGenerateXmlStatus(){
                        },
                        open:function (){
                                $(function(){
+                                       try{
+                                               var aceEditor = ace.edit("xmldialog");
+                                                       aceEditor.setTheme("ace/theme/eclipse");
+                                                       aceEditor.session.setMode("ace/mode/xml");
+                                                       aceEditor.setValue(formatted_xml);
+                                                       document.getElementById('xmldialog').style.fontSize='18px';
+                                                       aceEditor.setReadOnly(true);
+                                                       var numberOfLines = aceEditor.session.getLength();
+                                                       var xmlInfoStr = "<div id='xml-info-div'><p>" + "XML size:" + sizeStr +  " <br>Number of Lines:" + numberOfLines +  "</p></div>";
+                                       }catch(err){
+                                       }
                                $("#xmldialog").dialog("widget").find(".ui-dialog-buttonpane").append(xmlInfoStr);
                                        console.log("opened.");
                                });
index 134896e..c83c319 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
                                //console.log("show Values clicked.");
                                showRpcsValuesBox(that.editor,rpcValues);
                });
-
-            });
-
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
index 914bda1..8391acf 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index cabfab4..c5ac20f 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 0b6bb8f..67bc276 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 7ceb2e7..135cfe3 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 122f7d3..f5c2dd0 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index d104420..7972772 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index a080bbf..cdd6e36 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index 347d7d6..3a4dee6 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
+            var that = this;
             $( "#node-input-outputs" ).spinner({
                 min:1
             });
-
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
-    });
+       }
+   }); 
 </script>
index 60ab229..d88bdc6 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
-
+            var that = this;
+            $( "#node-input-outputs" ).spinner({
+                min:1
+            });
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
index e2d50f3..ede22b4 100644 (file)
             return this.name;
         },
         oneditprepare: function() {
-
-
+            var that = this;
+            $( "#node-input-outputs" ).spinner({
+                min:1
+            });
             var comments = $( "#node-input-comments").val();
             if(comments != null){
                comments = comments.trim();
                }
             }
 
-            function functionDialogResize(ev,ui) {
-                $("#node-input-xml-editor").css("height",(ui.size.height-275)+"px");
+            function functionDialogResize() {
+                var rows = $("#dialog-form>div:not(.node-text-editor-row)");
+                var height = $("#dialog-form").height();
+                for (var i=0;i<rows.size();i++) {
+                    height -= $(rows[i]).outerHeight(true);
+                }
+                var editorRow = $("#dialog-form>div.node-text-editor-row");
+                height -= (parseInt(editorRow.css("marginTop"))+parseInt(editorRow.css("marginBottom")));
+                $(".node-text-editor").css("height",height+"px");
+                that.editor.resize();
             };
-
-            $( "#dialog" ).dialog( "option", "width", 1200 );
-            $( "#dialog" ).dialog( "option", "height", 750 );
             $( "#dialog" ).on("dialogresize", functionDialogResize);
             $( "#dialog" ).one("dialogopen", function(ev) {
                 var size = $( "#dialog" ).dialog('option','sizeCache-function');
                 if (size) {
-                    functionDialogResize(null,{size:size});
+                    $("#dialog").dialog('option','width',size.width);
+                    $("#dialog").dialog('option','height',size.height);
+                    functionDialogResize();
                 }
             });
+            $( "#dialog" ).one("dialogclose", function(ev,ui) {
+                var height = $( "#dialog" ).dialog('option','height');
+                $( "#dialog" ).off("dialogresize",functionDialogResize);
+            });
 
+            this.editor = RED.editor.createEditor({
+                id: 'node-input-xml-editor',
+                mode: 'ace/mode/html'
+            });
+            this.editor.setValue($("#node-input-xml").val(),-1);
+       /*      
+            RED.library.create({
+                url:"functions", // where to get the data from
+                type:"function", // the type of object the library is for
+                editor:this.editor, // the field name the main text body goes to
+                mode:"ace/mode/html",
+                fields:['name','outputs']
+            });
+       */
+            this.editor.focus();
            /* close dialog when ESC is pressed and released */ 
-            $( "#dialog" ).keyup(function(event){
+            $( "#node-input-xml-editor" ).keyup(function(event){
                if(event.which == 27 ) {
                        $("#node-dialog-cancel").click();
                }
            }); 
-
-
-            $( "#dialog" ).one("dialogclose", function(ev,ui) {
-                var height = $( "#dialog" ).dialog('option','height');
-                $( "#dialog" ).off("dialogresize",functionDialogResize);
-            });
-
-            var that = this;
-            require(["orion/editor/edit"], function(edit) {
-                that.editor = edit({
-                    parent:document.getElementById('node-input-xml-editor'),
-                    lang:"html",
-                    contents: $("#node-input-xml").val()
-                });
-                RED.library.create({
-                    url:"functions", // where to get the data from
-                    type:"function", // the type of object the library is for
-                    editor:that.editor, // the field name the main text body goes to
-                    fields:['name','outputs']
-                });
-                $("#node-input-name").focus();
                $("#node-input-validate").click(function(){
                                console.log("validate clicked.");
                                //console.dir(that.editor);
                                //console.log("getText:" + that.editor.getText());
-                               var val = that.editor.getText();
+                               var val = that.editor.getValue();
                                validateXML(val); 
                });
                $("#node-input-show-sli-values").click(function(){
-                               console.log("SLIValues clicked.");
-                               showValuesBox(that.editor,sliValuesObj);
+                       //console.log("show Values clicked.");
+                       showValuesBox(that.editor,sliValuesObj);
                });
-            });
            //for click of add comments button
            $("#node-input-btnComments").click(function(e){
                        showCommentsBox();
            }); 
-
-        },
+       },
         oneditsave: function() {
-            $("#node-input-xml").val(this.editor.getText());
-               var resp=validateXML(this.editor.getText());
+            $("#node-input-xml").val(this.editor.getValue());
+               var resp=validateXML(this.editor.getValue());
                if(resp){
                        this.status = {fill:"green",shape:"dot",text:"OK"};
                }else{
                        this.status = {fill:"red",shape:"dot",text:"ERROR"};
                }       
                delete this.editor;
-        }
+       }
     });
 </script>
diff --git a/dgbuilder/public/ace/.ace-diff.js.swp b/dgbuilder/public/ace/.ace-diff.js.swp
new file mode 100644 (file)
index 0000000..9068df9
Binary files /dev/null and b/dgbuilder/public/ace/.ace-diff.js.swp differ
diff --git a/dgbuilder/public/ace/ace-diff.js b/dgbuilder/public/ace/ace-diff.js
new file mode 100755 (executable)
index 0000000..27b7a58
--- /dev/null
@@ -0,0 +1,961 @@
+(function(root, factory) {
+  if (typeof define === 'function' && define.amd) {
+    define([], factory);
+  } else if (typeof exports === 'object') {
+    module.exports = factory(require());
+  } else {
+    root.AceDiff = factory(root);
+  }
+}(this, function() {
+  'use strict';
+
+  var Range = require('ace/range').Range;
+
+  var C = {
+    DIFF_EQUAL: 0,
+    DIFF_DELETE: -1,
+    DIFF_INSERT: 1,
+    EDITOR_RIGHT: 'right',
+    EDITOR_LEFT: 'left',
+    RTL: 'rtl',
+    LTR: 'ltr',
+    SVG_NS: 'http://www.w3.org/2000/svg',
+    DIFF_GRANULARITY_SPECIFIC: 'specific',
+    DIFF_GRANULARITY_BROAD: 'broad'
+  };
+
+  // our constructor
+  function AceDiff(options) {
+    this.options = {};
+
+    extend(true, this.options, {
+      mode: null,
+      theme: null,
+      diffGranularity: C.DIFF_GRANULARITY_BROAD,
+      lockScrolling: false, // not implemented yet
+      showDiffs: true,
+      showConnectors: true,
+      maxDiffs: 5000,
+      left: {
+        id: 'acediff-left-editor',
+        content: null,
+        mode: null,
+        theme: null,
+        editable: true,
+        copyLinkEnabled: true
+      },
+      right: {
+        id: 'acediff-right-editor',
+        content: null,
+        mode: null,
+        theme: null,
+        editable: true,
+        copyLinkEnabled: true
+      },
+      classes: {
+        gutterID: 'acediff-gutter',
+        diff: 'acediff-diff',
+        connector: 'acediff-connector',
+        newCodeConnectorLink: 'acediff-new-code-connector-copy',
+        newCodeConnectorLinkContent: '&#8594;',
+        deletedCodeConnectorLink: 'acediff-deleted-code-connector-copy',
+        deletedCodeConnectorLinkContent: '&#8592;',
+        copyRightContainer: 'acediff-copy-right',
+        copyLeftContainer: 'acediff-copy-left'
+      },
+      connectorYOffset: 0
+    }, options);
+
+    // instantiate the editors in an internal data structure that will store a little info about the diffs and
+    // editor content
+    this.editors = {
+      left: {
+        ace: ace.edit(this.options.left.id),
+        markers: [],
+        lineLengths: []
+      },
+      right: {
+        ace: ace.edit(this.options.right.id),
+        markers: [],
+        lineLengths: []
+      },
+      editorHeight: null
+    };
+
+    addEventHandlers(this);
+
+    this.lineHeight = this.editors.left.ace.renderer.lineHeight; // assumption: both editors have same line heights
+
+    // set up the editors
+    this.editors.left.ace.getSession().setMode(getMode(this, C.EDITOR_LEFT));
+    this.editors.right.ace.getSession().setMode(getMode(this, C.EDITOR_RIGHT));
+    this.editors.left.ace.setReadOnly(!this.options.left.editable);
+    this.editors.right.ace.setReadOnly(!this.options.right.editable);
+    this.editors.left.ace.setTheme(getTheme(this, C.EDITOR_LEFT));
+    this.editors.right.ace.setTheme(getTheme(this, C.EDITOR_RIGHT));
+
+    createCopyContainers(this);
+    createGutter(this);
+
+    // if the data is being supplied by an option, set the editor values now
+    if (this.options.left.content) {
+      this.editors.left.ace.setValue(this.options.left.content, -1);
+    }
+    if (this.options.right.content) {
+      this.editors.right.ace.setValue(this.options.right.content, -1);
+    }
+
+    // store the visible height of the editors (assumed the same)
+    this.editors.editorHeight = getEditorHeight(this);
+
+    this.diff();
+  }
+
+
+  // our public API
+  AceDiff.prototype = {
+
+    // allows on-the-fly changes to the AceDiff instance settings
+    setOptions: function(options) {
+      extend(true, this.options, options);
+      this.diff();
+    },
+
+    getNumDiffs: function() {
+      return this.diffs.length;
+    },
+
+    // exposes the Ace editors in case the dev needs it
+    getEditors: function() {
+      return {
+        left: this.editors.left.ace,
+        right: this.editors.right.ace
+      }
+    },
+
+    // our main diffing function. I actually don't think this needs to exposed: it's called automatically,
+    // but just to be safe, it's included
+    diff: function() {
+      var dmp = new diff_match_patch();
+      var val1 = this.editors.left.ace.getSession().getValue();
+      var val2 = this.editors.right.ace.getSession().getValue();
+      var diff = dmp.diff_main(val2, val1);
+      dmp.diff_cleanupSemantic(diff);
+
+      this.editors.left.lineLengths  = getLineLengths(this.editors.left);
+      this.editors.right.lineLengths = getLineLengths(this.editors.right);
+
+      // parse the raw diff into something a little more palatable
+      var diffs = [];
+      var offset = {
+        left: 0,
+        right: 0
+      };
+
+      diff.forEach(function(chunk) {
+        var chunkType = chunk[0];
+        var text = chunk[1];
+
+        // oddly, occasionally the algorithm returns a diff with no changes made
+        if (text.length === 0) {
+          return;
+        }
+        if (chunkType === C.DIFF_EQUAL) {
+          offset.left += text.length;
+          offset.right += text.length;
+        } else if (chunkType === C.DIFF_DELETE) {
+          diffs.push(computeDiff(this, C.DIFF_DELETE, offset.left, offset.right, text));
+          offset.right += text.length;
+
+        } else if (chunkType === C.DIFF_INSERT) {
+          diffs.push(computeDiff(this, C.DIFF_INSERT, offset.left, offset.right, text));
+          offset.left += text.length;
+        }
+      }, this);
+
+      // simplify our computed diffs; this groups together multiple diffs on subsequent lines
+      this.diffs = simplifyDiffs(this, diffs);
+
+      // if we're dealing with too many diffs, fail silently
+      if (this.diffs.length > this.options.maxDiffs) {
+        return;
+      }
+
+      clearDiffs(this);
+      decorate(this);
+    },
+
+    destroy: function() {
+
+      // destroy the two editors
+      var leftValue = this.editors.left.ace.getValue();
+      this.editors.left.ace.destroy();
+      var oldDiv = this.editors.left.ace.container;
+      var newDiv = oldDiv.cloneNode(false);
+      newDiv.textContent = leftValue;
+      oldDiv.parentNode.replaceChild(newDiv, oldDiv);
+
+      var rightValue = this.editors.right.ace.getValue();
+      this.editors.right.ace.destroy();
+      oldDiv = this.editors.right.ace.container;
+      newDiv = oldDiv.cloneNode(false);
+      newDiv.textContent = rightValue;
+      oldDiv.parentNode.replaceChild(newDiv, oldDiv);
+
+      document.getElementById(this.options.classes.gutterID).innerHTML = '';
+    }
+  };
+
+
+  function getMode(acediff, editor) {
+    var mode = acediff.options.mode;
+    if (editor === C.EDITOR_LEFT && acediff.options.left.mode !== null) {
+      mode = acediff.options.left.mode;
+    }
+    if (editor === C.EDITOR_RIGHT && acediff.options.right.mode !== null) {
+      mode = acediff.options.right.mode;
+    }
+    return mode;
+  }
+
+
+  function getTheme(acediff, editor) {
+    var theme = acediff.options.theme;
+    if (editor === C.EDITOR_LEFT && acediff.options.left.theme !== null) {
+      theme = acediff.options.left.theme;
+    }
+    if (editor === C.EDITOR_RIGHT && acediff.options.right.theme !== null) {
+      theme = acediff.options.right.theme;
+    }
+    return theme;
+  }
+
+
+  function addEventHandlers(acediff) {
+    var leftLastScrollTime = new Date().getTime(),
+        rightLastScrollTime = new Date().getTime(),
+        now;
+
+    acediff.editors.left.ace.getSession().on('changeScrollTop', function(scroll) {
+      now = new Date().getTime();
+      if (rightLastScrollTime + 50 < now) {
+        updateGap(acediff, 'left', scroll);
+      }
+    });
+
+    acediff.editors.right.ace.getSession().on('changeScrollTop', function(scroll) {
+      now = new Date().getTime();
+      if (leftLastScrollTime + 50 < now) {
+        updateGap(acediff, 'right', scroll);
+      }
+    });
+
+    var diff = acediff.diff.bind(acediff);
+    acediff.editors.left.ace.on('change', diff);
+    acediff.editors.right.ace.on('change', diff);
+
+    if (acediff.options.left.copyLinkEnabled) {
+      on('#' + acediff.options.classes.gutterID, 'click', '.' + acediff.options.classes.newCodeConnectorLink, function(e) {
+        copy(acediff, e, C.LTR);
+      });
+    }
+    if (acediff.options.right.copyLinkEnabled) {
+      on('#' + acediff.options.classes.gutterID, 'click', '.' + acediff.options.classes.deletedCodeConnectorLink, function(e) {
+        copy(acediff, e, C.RTL);
+      });
+    }
+
+    var onResize = debounce(function() {
+      acediff.editors.availableHeight = document.getElementById(acediff.options.left.id).offsetHeight;
+
+      // TODO this should re-init gutter
+      acediff.diff();
+    }, 250);
+
+    window.addEventListener('resize', onResize);
+  }
+
+
+  function copy(acediff, e, dir) {
+    var diffIndex = parseInt(e.target.getAttribute('data-diff-index'), 10);
+    var diff = acediff.diffs[diffIndex];
+    var sourceEditor, targetEditor;
+
+    var startLine, endLine, targetStartLine, targetEndLine;
+    if (dir === C.LTR) {
+      sourceEditor = acediff.editors.left;
+      targetEditor = acediff.editors.right;
+      startLine = diff.leftStartLine;
+      endLine = diff.leftEndLine;
+      targetStartLine = diff.rightStartLine;
+      targetEndLine = diff.rightEndLine;
+    } else {
+      sourceEditor = acediff.editors.right;
+      targetEditor = acediff.editors.left;
+      startLine = diff.rightStartLine;
+      endLine = diff.rightEndLine;
+      targetStartLine = diff.leftStartLine;
+      targetEndLine = diff.leftEndLine;
+    }
+
+    var contentToInsert = '';
+    for (var i=startLine; i<endLine; i++) {
+      contentToInsert += getLine(sourceEditor, i) + '\n';
+    }
+
+    var startContent = '';
+    for (var i=0; i<targetStartLine; i++) {
+      startContent += getLine(targetEditor, i) + '\n';
+    }
+
+    var endContent = '';
+    var totalLines = targetEditor.ace.getSession().getLength();
+    for (var i=targetEndLine; i<totalLines; i++) {
+      endContent += getLine(targetEditor, i);
+      if (i<totalLines-1) {
+        endContent += '\n';
+      }
+    }
+
+    endContent = endContent.replace(/\s*$/, '');
+
+    // keep track of the scroll height
+    var h = targetEditor.ace.getSession().getScrollTop();
+    targetEditor.ace.getSession().setValue(startContent + contentToInsert + endContent);
+    targetEditor.ace.getSession().setScrollTop(parseInt(h));
+
+    acediff.diff();
+  }
+
+
+  function getLineLengths(editor) {
+    var lines = editor.ace.getSession().doc.getAllLines();
+    var lineLengths = [];
+    lines.forEach(function(line) {
+      lineLengths.push(line.length + 1); // +1 for the newline char
+    });
+    return lineLengths;
+  }
+
+
+  // shows a diff in one of the two editors.
+  function showDiff(acediff, editor, startLine, endLine, className) {
+    var editor = acediff.editors[editor];
+
+    if (endLine < startLine) { // can this occur? Just in case.
+      endLine = startLine;
+    }
+
+    var classNames = className + ' ' + ((endLine > startLine) ? 'lines' : 'targetOnly');
+    endLine--; // because endLine is always + 1
+
+    // to get Ace to highlight the full row we just set the start and end chars to 0 and 1
+    editor.markers.push(editor.ace.session.addMarker(new Range(startLine, 0, endLine, 1), classNames, 'fullLine'));
+  }
+
+
+  // called onscroll. Updates the gap to ensure the connectors are all lining up
+  function updateGap(acediff, editor, scroll) {
+
+    clearDiffs(acediff);
+    decorate(acediff);
+
+    // reposition the copy containers containing all the arrows
+    positionCopyContainers(acediff);
+  }
+
+
+  function clearDiffs(acediff) {
+    acediff.editors.left.markers.forEach(function(marker) {
+      this.editors.left.ace.getSession().removeMarker(marker);
+    }, acediff);
+    acediff.editors.right.markers.forEach(function(marker) {
+      this.editors.right.ace.getSession().removeMarker(marker);
+    }, acediff);
+  }
+
+
+  function addConnector(acediff, leftStartLine, leftEndLine, rightStartLine, rightEndLine) {
+    var leftScrollTop  = acediff.editors.left.ace.getSession().getScrollTop();
+    var rightScrollTop = acediff.editors.right.ace.getSession().getScrollTop();
+
+    // All connectors, regardless of ltr or rtl have the same point system, even if p1 === p3 or p2 === p4
+    //  p1   p2
+    //
+    //  p3   p4
+
+    acediff.connectorYOffset = 1;
+
+    var p1_x = -1;
+    var p1_y = (leftStartLine * acediff.lineHeight) - leftScrollTop;
+    var p2_x = acediff.gutterWidth + 1;
+    var p2_y = rightStartLine * acediff.lineHeight - rightScrollTop;
+    var p3_x = -1;
+    var p3_y = (leftEndLine * acediff.lineHeight) - leftScrollTop + acediff.connectorYOffset;
+    var p4_x = acediff.gutterWidth + 1;
+    var p4_y = (rightEndLine * acediff.lineHeight) - rightScrollTop + acediff.connectorYOffset;
+    var curve1 = getCurve(p1_x, p1_y, p2_x, p2_y);
+    var curve2 = getCurve(p4_x, p4_y, p3_x, p3_y);
+
+    var verticalLine1 = 'L' + p2_x + ',' + p2_y + ' ' + p4_x + ',' + p4_y;
+    var verticalLine2 = 'L' + p3_x + ',' + p3_y + ' ' + p1_x + ',' + p1_y;
+    var d = curve1 + ' ' + verticalLine1 + ' ' + curve2 + ' ' + verticalLine2;
+
+    var el = document.createElementNS(C.SVG_NS, 'path');
+    el.setAttribute('d', d);
+    el.setAttribute('class', acediff.options.classes.connector);
+    acediff.gutterSVG.appendChild(el);
+  }
+
+
+  function addCopyArrows(acediff, info, diffIndex) {
+    if (info.leftEndLine > info.leftStartLine && acediff.options.left.copyLinkEnabled) {
+      var arrow = createArrow({
+        className: acediff.options.classes.newCodeConnectorLink,
+        topOffset: info.leftStartLine * acediff.lineHeight,
+        tooltip: 'Copy to right',
+        diffIndex: diffIndex,
+        arrowContent: acediff.options.classes.newCodeConnectorLinkContent
+      });
+      acediff.copyRightContainer.appendChild(arrow);
+    }
+
+    if (info.rightEndLine > info.rightStartLine && acediff.options.right.copyLinkEnabled) {
+      var arrow = createArrow({
+        className: acediff.options.classes.deletedCodeConnectorLink,
+        topOffset: info.rightStartLine * acediff.lineHeight,
+        tooltip: 'Copy to left',
+        diffIndex: diffIndex,
+        arrowContent: acediff.options.classes.deletedCodeConnectorLinkContent
+      });
+      acediff.copyLeftContainer.appendChild(arrow);
+    }
+  }
+
+
+  function positionCopyContainers(acediff) {
+    var leftTopOffset = acediff.editors.left.ace.getSession().getScrollTop();
+    var rightTopOffset = acediff.editors.right.ace.getSession().getScrollTop();
+
+    acediff.copyRightContainer.style.cssText = 'top: ' + (-leftTopOffset) + 'px';
+    acediff.copyLeftContainer.style.cssText = 'top: ' + (-rightTopOffset) + 'px';
+  }
+
+
+  /**
+   * This method takes the raw diffing info from the Google lib and returns a nice clean object of the following
+   * form:
+   * {
+   *   leftStartLine:
+   *   leftEndLine:
+   *   rightStartLine:
+   *   rightEndLine:
+   * }
+   *
+   * Ultimately, that's all the info we need to highlight the appropriate lines in the left + right editor, add the
+   * SVG connectors, and include the appropriate <<, >> arrows.
+   *
+   * Note: leftEndLine and rightEndLine are always the start of the NEXT line, so for a single line diff, there will
+   * be 1 separating the startLine and endLine values. So if leftStartLine === leftEndLine or rightStartLine ===
+   * rightEndLine, it means that new content from the other editor is being inserted and a single 1px line will be
+   * drawn.
+   */
+  function computeDiff(acediff, diffType, offsetLeft, offsetRight, diffText) {
+    var lineInfo = {};
+
+    // this was added in to hack around an oddity with the Google lib. Sometimes it would include a newline
+    // as the first char for a diff, other times not - and it would change when you were typing on-the-fly. This
+    // is used to level things out so the diffs don't appear to shift around
+    var newContentStartsWithNewline = /^\n/.test(diffText);
+
+    if (diffType === C.DIFF_INSERT) {
+
+      // pretty confident this returns the right stuff for the left editor: start & end line & char
+      var info = getSingleDiffInfo(acediff.editors.left, offsetLeft, diffText);
+
+      // this is the ACTUAL undoctored current line in the other editor. It's always right. Doesn't mean it's
+      // going to be used as the start line for the diff though.
+      var currentLineOtherEditor = getLineForCharPosition(acediff.editors.right, offsetRight);
+      var numCharsOnLineOtherEditor = getCharsOnLine(acediff.editors.right, currentLineOtherEditor);
+      var numCharsOnLeftEditorStartLine = getCharsOnLine(acediff.editors.left, info.startLine);
+      var numCharsOnLine = getCharsOnLine(acediff.editors.left, info.startLine);
+
+      // this is necessary because if a new diff starts on the FIRST char of the left editor, the diff can comes
+      // back from google as being on the last char of the previous line so we need to bump it up one
+      var rightStartLine = currentLineOtherEditor;
+      if (numCharsOnLine === 0 && newContentStartsWithNewline) {
+        newContentStartsWithNewline = false;
+      }
+      if (info.startChar === 0 && isLastChar(acediff.editors.right, offsetRight, newContentStartsWithNewline)) {
+        rightStartLine = currentLineOtherEditor + 1;
+      }
+
+      var sameLineInsert = info.startLine === info.endLine;
+
+      // whether or not this diff is a plain INSERT into the other editor, or overwrites a line take a little work to
+      // figure out. This feels like the hardest part of the entire script.
+      var numRows = 0;
+      if (
+
+        // dense, but this accommodates two scenarios:
+        // 1. where a completely fresh new line is being inserted in left editor, we want the line on right to stay a 1px line
+        // 2. where a new character is inserted at the start of a newline on the left but the line contains other stuff,
+        //    we DO want to make it a full line
+        (info.startChar > 0 || (sameLineInsert && diffText.length < numCharsOnLeftEditorStartLine)) &&
+
+        // if the right editor line was empty, it's ALWAYS a single line insert [not an OR above?]
+        numCharsOnLineOtherEditor > 0 &&
+
+        // if the text being inserted starts mid-line
+        (info.startChar < numCharsOnLeftEditorStartLine)) {
+        numRows++;
+      }
+
+      lineInfo = {
+        leftStartLine: info.startLine,
+        leftEndLine: info.endLine + 1,
+        rightStartLine: rightStartLine,
+        rightEndLine: rightStartLine + numRows
+      };
+
+    } else {
+      var info = getSingleDiffInfo(acediff.editors.right, offsetRight, diffText);
+
+      var currentLineOtherEditor = getLineForCharPosition(acediff.editors.left, offsetLeft);
+      var numCharsOnLineOtherEditor = getCharsOnLine(acediff.editors.left, currentLineOtherEditor);
+      var numCharsOnRightEditorStartLine = getCharsOnLine(acediff.editors.right, info.startLine);
+      var numCharsOnLine = getCharsOnLine(acediff.editors.right, info.startLine);
+
+      // this is necessary because if a new diff starts on the FIRST char of the left editor, the diff can comes
+      // back from google as being on the last char of the previous line so we need to bump it up one
+      var leftStartLine = currentLineOtherEditor;
+      if (numCharsOnLine === 0 && newContentStartsWithNewline) {
+        newContentStartsWithNewline = false;
+      }
+      if (info.startChar === 0 && isLastChar(acediff.editors.left, offsetLeft, newContentStartsWithNewline)) {
+        leftStartLine = currentLineOtherEditor + 1;
+      }
+
+      var sameLineInsert = info.startLine === info.endLine;
+      var numRows = 0;
+      if (
+
+        // dense, but this accommodates two scenarios:
+        // 1. where a completely fresh new line is being inserted in left editor, we want the line on right to stay a 1px line
+        // 2. where a new character is inserted at the start of a newline on the left but the line contains other stuff,
+        //    we DO want to make it a full line
+        (info.startChar > 0 || (sameLineInsert && diffText.length < numCharsOnRightEditorStartLine)) &&
+
+        // if the right editor line was empty, it's ALWAYS a single line insert [not an OR above?]
+        numCharsOnLineOtherEditor > 0 &&
+
+        // if the text being inserted starts mid-line
+        (info.startChar < numCharsOnRightEditorStartLine)) {
+          numRows++;
+      }
+
+      lineInfo = {
+        leftStartLine: leftStartLine,
+        leftEndLine: leftStartLine + numRows,
+        rightStartLine: info.startLine,
+        rightEndLine: info.endLine + 1
+      };
+    }
+
+    return lineInfo;
+  }
+
+
+  // helper to return the startline, endline, startChar and endChar for a diff in a particular editor. Pretty
+  // fussy function
+  function getSingleDiffInfo(editor, offset, diffString) {
+    var info = {
+      startLine: 0,
+      startChar: 0,
+      endLine: 0,
+      endChar: 0
+    };
+    var endCharNum = offset + diffString.length;
+    var runningTotal = 0;
+    var startLineSet = false,
+        endLineSet = false;
+
+    editor.lineLengths.forEach(function(lineLength, lineIndex) {
+      runningTotal += lineLength;
+
+      if (!startLineSet && offset < runningTotal) {
+        info.startLine = lineIndex;
+        info.startChar = offset - runningTotal + lineLength;
+        startLineSet = true;
+      }
+
+      if (!endLineSet && endCharNum <= runningTotal) {
+        info.endLine = lineIndex;
+        info.endChar = endCharNum - runningTotal + lineLength;
+        endLineSet = true;
+      }
+    });
+
+    // if the start char is the final char on the line, it's a newline & we ignore it
+    if (info.startChar > 0 && getCharsOnLine(editor, info.startLine) === info.startChar) {
+      info.startLine++;
+      info.startChar = 0;
+    }
+
+    // if the end char is the first char on the line, we don't want to highlight that extra line
+    if (info.endChar === 0) {
+      info.endLine--;
+    }
+
+    var endsWithNewline = /\n$/.test(diffString);
+    if (info.startChar > 0 && endsWithNewline) {
+      info.endLine++;
+    }
+
+    return info;
+  }
+
+
+  // note that this and everything else in this script uses 0-indexed row numbers
+  function getCharsOnLine(editor, line) {
+    return getLine(editor, line).length;
+  }
+
+
+  function getLine(editor, line) {
+    return editor.ace.getSession().doc.getLine(line);
+  }
+
+
+  function getLineForCharPosition(editor, offsetChars) {
+    var lines = editor.ace.getSession().doc.getAllLines(),
+        foundLine = 0,
+        runningTotal = 0;
+
+    for (var i=0; i<lines.length; i++) {
+      runningTotal += lines[i].length + 1; // +1 needed for newline char
+      if (offsetChars <= runningTotal) {
+        foundLine = i;
+        break;
+      }
+    }
+    return foundLine;
+  }
+
+
+  function isLastChar(editor, char, startsWithNewline) {
+    var lines = editor.ace.getSession().doc.getAllLines(),
+        runningTotal = 0,
+        isLastChar = false;
+
+    for (var i=0; i<lines.length; i++) {
+      runningTotal += lines[i].length + 1; // +1 needed for newline char
+      var comparison = runningTotal;
+      if (startsWithNewline) {
+        comparison--;
+      }
+
+      if (char === comparison) {
+        isLastChar = true;
+        break;
+      }
+    }
+    return isLastChar;
+  }
+
+
+  function createArrow(info) {
+    var el = document.createElement('div');
+    var props = {
+      'class': info.className,
+      'style': 'top:' + info.topOffset + 'px',
+      title: info.tooltip,
+      'data-diff-index': info.diffIndex
+    };
+    for (var key in props) {
+      el.setAttribute(key, props[key]);
+    }
+    el.innerHTML = info.arrowContent;
+    return el;
+  }
+
+
+  function createGutter(acediff) {
+    acediff.gutterHeight = document.getElementById(acediff.options.classes.gutterID).clientHeight;
+    acediff.gutterWidth = document.getElementById(acediff.options.classes.gutterID).clientWidth;
+
+    var leftHeight = getTotalHeight(acediff, C.EDITOR_LEFT);
+    var rightHeight = getTotalHeight(acediff, C.EDITOR_RIGHT);
+    var height = Math.max(leftHeight, rightHeight, acediff.gutterHeight);
+
+    acediff.gutterSVG = document.createElementNS(C.SVG_NS, 'svg');
+    acediff.gutterSVG.setAttribute('width', acediff.gutterWidth);
+    acediff.gutterSVG.setAttribute('height', height);
+
+    document.getElementById(acediff.options.classes.gutterID).appendChild(acediff.gutterSVG);
+  }
+
+  // acediff.editors.left.ace.getSession().getLength() * acediff.lineHeight
+  function getTotalHeight(acediff, editor) {
+    var ed = (editor === C.EDITOR_LEFT) ? acediff.editors.left : acediff.editors.right;
+    return ed.ace.getSession().getLength() * acediff.lineHeight;
+  }
+
+  // creates two contains for positioning the copy left + copy right arrows
+  function createCopyContainers(acediff) {
+    acediff.copyRightContainer = document.createElement('div');
+    acediff.copyRightContainer.setAttribute('class', acediff.options.classes.copyRightContainer);
+    acediff.copyLeftContainer = document.createElement('div');
+    acediff.copyLeftContainer.setAttribute('class', acediff.options.classes.copyLeftContainer);
+
+    document.getElementById(acediff.options.classes.gutterID).appendChild(acediff.copyRightContainer);
+    document.getElementById(acediff.options.classes.gutterID).appendChild(acediff.copyLeftContainer);
+  }
+
+
+  function clearGutter(acediff) {
+    //gutter.innerHTML = '';
+
+    var gutterEl  = document.getElementById(acediff.options.classes.gutterID);
+       try{
+               gutterEl.removeChild(acediff.gutterSVG);
+       }catch(err){
+       }
+
+    createGutter(acediff);
+  }
+
+
+  function clearArrows(acediff) {
+    acediff.copyLeftContainer.innerHTML = '';
+    acediff.copyRightContainer.innerHTML = '';
+  }
+
+
+  /*
+   * This combines multiple rows where, say, line 1 => line 1, line 2 => line 2, line 3-4 => line 3. That could be
+   * reduced to a single connector line 1=4 => line 1-3
+   */
+  function simplifyDiffs(acediff, diffs) {
+    var groupedDiffs = [];
+
+    function compare(val) {
+      return (acediff.options.diffGranularity === C.DIFF_GRANULARITY_SPECIFIC) ? val < 1 : val <= 1;
+    }
+
+    diffs.forEach(function(diff, index) {
+      if (index === 0) {
+        groupedDiffs.push(diff);
+        return;
+      }
+
+      // loop through all grouped diffs. If this new diff lies between an existing one, we'll just add to it, rather
+      // than create a new one
+      var isGrouped = false;
+      for (var i=0; i<groupedDiffs.length; i++) {
+        if (compare(Math.abs(diff.leftStartLine - groupedDiffs[i].leftEndLine)) &&
+            compare(Math.abs(diff.rightStartLine - groupedDiffs[i].rightEndLine))) {
+
+          // update the existing grouped diff to expand its horizons to include this new diff start + end lines
+          groupedDiffs[i].leftStartLine = Math.min(diff.leftStartLine, groupedDiffs[i].leftStartLine);
+          groupedDiffs[i].rightStartLine = Math.min(diff.rightStartLine, groupedDiffs[i].rightStartLine);
+          groupedDiffs[i].leftEndLine = Math.max(diff.leftEndLine, groupedDiffs[i].leftEndLine);
+          groupedDiffs[i].rightEndLine = Math.max(diff.rightEndLine, groupedDiffs[i].rightEndLine);
+          isGrouped = true;
+          break;
+        }
+      }
+
+      if (!isGrouped) {
+        groupedDiffs.push(diff);
+      }
+    });
+
+    // clear out any single line diffs (i.e. single line on both editors)
+    var fullDiffs = [];
+    groupedDiffs.forEach(function(diff) {
+      if (diff.leftStartLine === diff.leftEndLine && diff.rightStartLine === diff.rightEndLine) {
+        return;
+      }
+      fullDiffs.push(diff);
+    });
+
+    return fullDiffs;
+  }
+
+
+  function decorate(acediff) {
+    clearGutter(acediff);
+    clearArrows(acediff);
+
+    acediff.diffs.forEach(function(info, diffIndex) {
+      if (this.options.showDiffs) {
+        showDiff(this, C.EDITOR_LEFT, info.leftStartLine, info.leftEndLine, this.options.classes.diff);
+        showDiff(this, C.EDITOR_RIGHT, info.rightStartLine, info.rightEndLine, this.options.classes.diff);
+
+        if (this.options.showConnectors) {
+          addConnector(this, info.leftStartLine, info.leftEndLine, info.rightStartLine, info.rightEndLine);
+        }
+        addCopyArrows(this, info, diffIndex);
+      }
+    }, acediff);
+  }
+
+
+  function extend() {
+    var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {},
+      i = 1,
+      length = arguments.length,
+      deep = false,
+      toString = Object.prototype.toString,
+      hasOwn = Object.prototype.hasOwnProperty,
+      class2type = {
+        "[object Boolean]": "boolean",
+        "[object Number]": "number",
+        "[object String]": "string",
+        "[object Function]": "function",
+        "[object Array]": "array",
+        "[object Date]": "date",
+        "[object RegExp]": "regexp",
+        "[object Object]": "object"
+      },
+
+      jQuery = {
+        isFunction: function(obj) {
+          return jQuery.type(obj) === "function";
+        },
+        isArray: Array.isArray ||
+        function(obj) {
+          return jQuery.type(obj) === "array";
+        },
+        isWindow: function(obj) {
+          return obj !== null && obj === obj.window;
+        },
+        isNumeric: function(obj) {
+          return !isNaN(parseFloat(obj)) && isFinite(obj);
+        },
+        type: function(obj) {
+          return obj === null ? String(obj) : class2type[toString.call(obj)] || "object";
+        },
+        isPlainObject: function(obj) {
+          if (!obj || jQuery.type(obj) !== "object" || obj.nodeType) {
+            return false;
+          }
+          try {
+            if (obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
+              return false;
+            }
+          } catch (e) {
+            return false;
+          }
+          var key;
+          for (key in obj) {}
+          return key === undefined || hasOwn.call(obj, key);
+        }
+      };
+    if (typeof target === "boolean") {
+      deep = target;
+      target = arguments[1] || {};
+      i = 2;
+    }
+    if (typeof target !== "object" && !jQuery.isFunction(target)) {
+      target = {};
+    }
+    if (length === i) {
+      target = this;
+      --i;
+    }
+    for (i; i < length; i++) {
+      if ((options = arguments[i]) !== null) {
+        for (name in options) {
+          src = target[name];
+          copy = options[name];
+          if (target === copy) {
+            continue;
+          }
+          if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
+            if (copyIsArray) {
+              copyIsArray = false;
+              clone = src && jQuery.isArray(src) ? src : [];
+            } else {
+              clone = src && jQuery.isPlainObject(src) ? src : {};
+            }
+            // WARNING: RECURSION
+            target[name] = extend(deep, clone, copy);
+          } else if (copy !== undefined) {
+            target[name] = copy;
+          }
+        }
+      }
+    }
+
+    return target;
+  }
+
+
+  function getScrollingInfo(acediff, dir) {
+    return (dir == C.EDITOR_LEFT) ? acediff.editors.left.ace.getSession().getScrollTop() : acediff.editors.right.ace.getSession().getScrollTop();
+  }
+
+
+  function getEditorHeight(acediff) {
+    //editorHeight: document.getElementById(acediff.options.left.id).clientHeight
+    return document.getElementById(acediff.options.left.id).offsetHeight;
+  }
+
+  // generates a Bezier curve in SVG format
+  function getCurve(startX, startY, endX, endY) {
+    var w = endX - startX;
+    var halfWidth = startX + (w / 2);
+
+    // position it at the initial x,y coords
+    var curve = 'M ' + startX + ' ' + startY +
+
+      // now create the curve. This is of the form "C M,N O,P Q,R" where C is a directive for SVG ("curveto"),
+      // M,N are the first curve control point, O,P the second control point and Q,R are the final coords
+      ' C ' + halfWidth + ',' + startY + ' ' + halfWidth + ',' + endY + ' ' + endX + ',' + endY;
+
+    return curve;
+  }
+
+
+  function on(elSelector, eventName, selector, fn) {
+    var element = (elSelector === 'document') ? document : document.querySelector(elSelector);
+
+    element.addEventListener(eventName, function(event) {
+      var possibleTargets = element.querySelectorAll(selector);
+      var target = event.target;
+
+      for (var i = 0, l = possibleTargets.length; i < l; i++) {
+        var el = target;
+        var p = possibleTargets[i];
+
+        while(el && el !== element) {
+          if (el === p) {
+            return fn.call(p, event);
+          }
+          el = el.parentNode;
+        }
+      }
+    });
+  }
+
+
+  function debounce(func, wait, immediate) {
+    var timeout;
+    return function() {
+      var context = this, args = arguments;
+      var later = function() {
+        timeout = null;
+        if (!immediate) func.apply(context, args);
+      };
+      var callNow = immediate && !timeout;
+      clearTimeout(timeout);
+      timeout = setTimeout(later, wait);
+      if (callNow) func.apply(context, args);
+    };
+  }
+
+  return AceDiff;
+
+}));
diff --git a/dgbuilder/public/ace/ace-styles.css b/dgbuilder/public/ace/ace-styles.css
new file mode 100644 (file)
index 0000000..1095364
--- /dev/null
@@ -0,0 +1,90 @@
+#flex-container {
+    display: flex;
+    display: -webkit-flex;
+    flex-direction: row;
+    position: absolute;
+    bottom: 0;
+    width: 100%;
+    top: 0px !important;
+    left: 0px;
+
+    /* these 3 lines are to prevents an unsightly scrolling bounce affect on Safari */
+    height: 100%;
+    width: 100%;
+    overflow: auto;
+}
+#flex-container>div {
+    flex-grow: 1;
+    -webkit-flex-grow: 1;
+    position: relative;
+}
+#flex-container>div#gutter {
+    flex: 0 0 60px;
+    -webkit-flex: 0 0 60px;
+    border-left: 1px solid #999999;
+    border-right: 1px solid #999999;
+    background-color: #efefef;
+    overflow: hidden;
+}
+#gutter svg {
+    background-color: #efefef;
+}
+
+#editor1 {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    width: 100%;
+}
+#editor2 {
+    position: absolute;
+    top: 0;
+    bottom: 0;
+    width: 100%;
+}
+.acediff-diff {
+    background-color: #d8f2ff;
+    border-top: 1px solid #a2d7f2;
+    border-bottom: 1px solid #a2d7f2;
+    position: absolute;
+    z-index: 4;
+}
+.acediff-diff.targetOnly {
+    height: 0px !important;
+    border-top: 1px solid #a2d7f2;
+    border-bottom: 0px;
+    position: absolute;
+}
+.acediff-connector {
+    fill: #d8f2ff;
+    stroke: #a2d7f2;
+}
+
+.acediff-copy-left {
+    float: right;
+}
+.acediff-copy-right,
+.acediff-copy-left {
+    position: relative;
+}
+.acediff-copy-right div {
+    color: #000000;
+    text-shadow: 1px 1px #ffffff;
+    position: absolute;
+    margin: -3px 2px;
+    cursor: pointer;
+}
+.acediff-copy-right div:hover {
+    color: #004ea0;
+}
+.acediff-copy-left div {
+    color: #000000;
+    text-shadow: 1px 1px #ffffff;
+    position: absolute;
+    right: 0px;
+    margin: -3px 2px;
+    cursor: pointer;
+}
+.acediff-copy-left div:hover {
+    color: #c98100;
+}
diff --git a/dgbuilder/public/ace/ace.js b/dgbuilder/public/ace/ace.js
new file mode 100755 (executable)
index 0000000..35e1ea1
--- /dev/null
@@ -0,0 +1,11 @@
+(function(){function s(r){var i=function(e,t){return n("",e,t)},s=e;r&&(e[r]||(e[r]={}),s=e[r]);if(!s.define||!s.define.packaged)t.original=s.define,s.define=t,s.define.packaged=!0;if(!s.require||!s.require.packaged)n.original=s.require,s.require=i,s.require.packaged=!0}var ACE_NAMESPACE="",e=function(){return this}();if(!ACE_NAMESPACE&&typeof requirejs!="undefined")return;var t=function(e,n,r){if(typeof e!="string"){t.original?t.original.apply(window,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(r=n),t.modules||(t.modules={},t.payloads={}),t.payloads[e]=r,t.modules[e]=null},n=function(e,t,r){if(Object.prototype.toString.call(t)==="[object Array]"){var s=[];for(var o=0,u=t.length;o<u;++o){var a=i(e,t[o]);if(!a&&n.original)return n.original.apply(window,arguments);s.push(a)}r&&r.apply(null,s)}else{if(typeof t=="string"){var f=i(e,t);return!f&&n.original?n.original.apply(window,arguments):(r&&r(),f)}if(n.original)return n.original.apply(window,arguments)}},r=function(e,t){if(t.indexOf("!")!==-1){var n=t.split("!");return r(e,n[0])+"!"+r(e,n[1])}if(t.charAt(0)=="."){var i=e.split("/").slice(0,-1).join("/");t=i+"/"+t;while(t.indexOf(".")!==-1&&s!=t){var s=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return t},i=function(e,i){i=r(e,i);var s=t.modules[i];if(!s){s=t.payloads[i];if(typeof s=="function"){var o={},u={id:i,uri:"",exports:o,packaged:!0},a=function(e,t){return n(i,e,t)},f=s(a,o,u);o=f||u.exports,t.modules[i]=o,delete t.payloads[i]}s=t.modules[i]=o||s}return s};s(ACE_NAMESPACE)})(),define("ace/lib/regexp",["require","exports","module"],function(e,t,n){"use strict";function o(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function u(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(var r=n||0;r<e.length;r++)if(e[r]===t)return r;return-1}var r={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},i=r.exec.call(/()??/,"")[1]===undefined,s=function(){var e=/^/g;return r.test.call(e,""),!e.lastIndex}();if(s&&i)return;RegExp.prototype.exec=function(e){var t=r.exec.apply(this,arguments),n,a;if(typeof e=="string"&&t){!i&&t.length>1&&u(t,"")>-1&&(a=RegExp(this.source,r.replace.call(o(this),"g","")),r.replace.call(e.slice(t.index),a,function(){for(var e=1;e<arguments.length-2;e++)arguments[e]===undefined&&(t[e]=undefined)}));if(this._xregexp&&this._xregexp.captureNames)for(var f=1;f<t.length;f++)n=this._xregexp.captureNames[f-1],n&&(t[n]=t[f]);!s&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--}return t},s||(RegExp.prototype.test=function(e){var t=r.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t})}),define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function r(){}function w(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}function H(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}function B(e){var t=typeof e;return e===null||t==="undefined"||t==="boolean"||t==="number"||t==="string"}function j(e){var t,n,r;if(B(e))return e;n=e.valueOf;if(typeof n=="function"){t=n.call(e);if(B(t))return t}r=e.toString;if(typeof r=="function"){t=r.call(e);if(B(t))return t}throw new TypeError}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError("Function.prototype.bind called on incompatible "+n);var i=u.call(arguments,1),s=function(){if(this instanceof s){var e=n.apply(this,i.concat(u.call(arguments)));return Object(e)===e?e:this}return n.apply(t,i.concat(u.call(arguments)))};return n.prototype&&(r.prototype=n.prototype,s.prototype=new r,r.prototype=null),s});var i=Function.prototype.call,s=Array.prototype,o=Object.prototype,u=s.slice,a=i.bind(o.toString),f=i.bind(o.hasOwnProperty),l,c,h,p,d;if(d=f(o,"__defineGetter__"))l=i.bind(o.__defineGetter__),c=i.bind(o.__defineSetter__),h=i.bind(o.__lookupGetter__),p=i.bind(o.__lookupSetter__);if([1,2].splice(0).length!=2)if(!function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t=[],n;t.splice.apply(t,e(20)),t.splice.apply(t,e(26)),n=t.length,t.splice(5,0,"XXX"),n+1==t.length;if(n+1==t.length)return!0}())Array.prototype.splice=function(e,t){var n=this.length;e>0?e>n&&(e=n):e==void 0?e=0:e<0&&(e=Math.max(n+e,0)),e+t<n||(t=n-e);var r=this.slice(e,e+t),i=u.call(arguments,2),s=i.length;if(e===n)s&&this.push.apply(this,i);else{var o=Math.min(t,n-e),a=e+o,f=a+s-o,l=n-a,c=n-o;if(f<a)for(var h=0;h<l;++h)this[f+h]=this[a+h];else if(f>a)for(h=l;h--;)this[f+h]=this[a+h];if(s&&e===c)this.length=c,this.push.apply(this,i);else{this.length=c+s;for(h=0;h<s;++h)this[e+h]=i[h]}}return r};else{var v=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?v.apply(this,[e===void 0?0:e,t===void 0?this.length-e:t].concat(u.call(arguments,2))):[]}}Array.isArray||(Array.isArray=function(t){return a(t)=="[object Array]"});var m=Object("a"),g=m[0]!="a"||!(0 in m);Array.prototype.forEach||(Array.prototype.forEach=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=arguments[1],s=-1,o=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError;while(++s<o)s in r&&t.call(i,r[s],s,n)}),Array.prototype.map||(Array.prototype.map=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=Array(i),o=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var u=0;u<i;u++)u in r&&(s[u]=t.call(o,r[u],u,n));return s}),Array.prototype.filter||(Array.prototype.filter=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=[],o,u=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var f=0;f<i;f++)f in r&&(o=r[f],t.call(u,o,f,n)&&s.push(o));return s}),Array.prototype.every||(Array.prototype.every=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o<i;o++)if(o in r&&!t.call(s,r[o],o,n))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0,s=arguments[1];if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");for(var o=0;o<i;o++)if(o in r&&t.call(s,r[o],o,n))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduce of empty array with no initial value");var s=0,o;if(arguments.length>=2)o=arguments[1];else do{if(s in r){o=r[s++];break}if(++s>=i)throw new TypeError("reduce of empty array with no initial value")}while(!0);for(;s<i;s++)s in r&&(o=t.call(void 0,o,r[s],s,n));return o}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function(t){var n=F(this),r=g&&a(this)=="[object String]"?this.split(""):n,i=r.length>>>0;if(a(t)!="[object Function]")throw new TypeError(t+" is not a function");if(!i&&arguments.length==1)throw new TypeError("reduceRight of empty array with no initial value");var s,o=i-1;if(arguments.length>=2)s=arguments[1];else do{if(o in r){s=r[o--];break}if(--o<0)throw new TypeError("reduceRight of empty array with no initial value")}while(!0);do o in this&&(s=t.call(void 0,s,r[o],o,n));while(o--);return s});if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1)Array.prototype.indexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):F(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=H(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i<r;i++)if(i in n&&n[i]===t)return i;return-1};if(!Array.prototype.lastIndexOf||[0,1].lastIndexOf(0,-3)!=-1)Array.prototype.lastIndexOf=function(t){var n=g&&a(this)=="[object String]"?this.split(""):F(this),r=n.length>>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,H(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1};Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:o)});if(!Object.getOwnPropertyDescriptor){var y="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(y+t);if(!f(t,n))return;var r,i,s;r={enumerable:!0,configurable:!0};if(d){var u=t.__proto__;t.__proto__=o;var i=h(t,n),s=p(t,n);t.__proto__=u;if(i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var b;Object.prototype.__proto__===null?b=function(){return{__proto__:null}}:b=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=b();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var E=w({}),S=typeof document=="undefined"||w(document.createElement("div"));if(!E||!S)var x=Object.defineProperty}if(!Object.defineProperty||x){var T="Property description must be an object: ",N="Object.defineProperty called on non-object: ",C="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(N+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(T+r);if(x)try{return x.call(Object,t,n,r)}catch(i){}if(f(r,"value"))if(d&&(h(t,n)||p(t,n))){var s=t.__proto__;t.__proto__=o,delete t[n],t[n]=r.value,t.__proto__=s}else t[n]=r.value;else{if(!d)throw new TypeError(C);f(r,"get")&&l(t,n,r.get),f(r,"set")&&c(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)f(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(k){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(f(t,n))n+="?";t[n]=!0;var r=f(t,n);return delete t[n],r});if(!Object.keys){var L=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],O=A.length;for(var M in{toString:null})L=!1;Object.keys=function I(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var I=[];for(var t in e)f(e,t)&&I.push(t);if(L)for(var n=0,r=O;n<r;n++){var i=A[n];f(e,i)&&I.push(i)}return I}}Date.now||(Date.now=function(){return(new Date).getTime()});var _="  \n\v\f\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff";if(!String.prototype.trim||_.trim()){_="["+_+"]";var D=new RegExp("^"+_+_+"*"),P=new RegExp(_+_+"*$");String.prototype.trim=function(){return String(this).replace(D,"").replace(P,"")}}var F=function(e){if(e==null)throw new TypeError("can't convert "+e+" to object");return Object(e)}}),define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){"use strict";e("./regexp"),e("./es5-shim")}),define("ace/lib/dom",["require","exports","module"],function(e,t,n){"use strict";if(typeof document=="undefined")return;var r="http://www.w3.org/1999/xhtml";t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||r,e):document.createElement(e)},t.hasCssClass=function(e,t){var n=(e.className||"").split(/\s+/g);return n.indexOf(t)!==-1},t.addCssClass=function(e,n){t.hasCssClass(e,n)||(e.className+=" "+n)},t.removeCssClass=function(e,t){var n=e.className.split(/\s+/g);for(;;){var r=n.indexOf(t);if(r==-1)break;n.splice(r,1)}e.className=n.join(" ")},t.toggleCssClass=function(e,t){var n=e.className.split(/\s+/g),r=!0;for(;;){var i=n.indexOf(t);if(i==-1)break;r=!1,n.splice(i,1)}return r&&n.push(t),e.className=n.join(" "),r},t.setCssClass=function(e,n,r){r?t.addCssClass(e,n):t.removeCssClass(e,n)},t.hasCssString=function(e,t){var n=0,r;t=t||document;if(t.createStyleSheet&&(r=t.styleSheets)){while(n<r.length)if(r[n++].owningElement.id===e)return!0}else if(r=t.getElementsByTagName("style"))while(n<r.length)if(r[n++].id===e)return!0;return!1},t.importCssString=function(n,i,s){s=s||document;if(i&&t.hasCssString(i,s))return null;var o;s.createStyleSheet?(o=s.createStyleSheet(),o.cssText=n,i&&(o.owningElement.id=i)):(o=s.createElementNS?s.createElementNS(r,"style"):s.createElement("style"),o.appendChild(s.createTextNode(n)),i&&(o.id=i),t.getDocumentHead(s).appendChild(o))},t.importCssStylsheet=function(e,n){if(n.createStyleSheet)n.createStyleSheet(e);else{var r=t.createElement("link");r.rel="stylesheet",r.href=e,t.getDocumentHead(n).appendChild(r)}},t.getInnerWidth=function(e){return parseInt(t.computedStyle(e,"paddingLeft"),10)+parseInt(t.computedStyle(e,"paddingRight"),10)+e.clientWidth},t.getInnerHeight=function(e){return parseInt(t.computedStyle(e,"paddingTop"),10)+parseInt(t.computedStyle(e,"paddingBottom"),10)+e.clientHeight},window.pageYOffset!==undefined?(t.getPageScrollTop=function(){return window.pageYOffset},t.getPageScrollLeft=function(){return window.pageXOffset}):(t.getPageScrollTop=function(){return document.body.scrollTop},t.getPageScrollLeft=function(){return document.body.scrollLeft}),window.getComputedStyle?t.computedStyle=function(e,t){return t?(window.getComputedStyle(e,"")||{})[t]||"":window.getComputedStyle(e,"")||{}}:t.computedStyle=function(e,t){return t?e.currentStyle[t]:e.currentStyle},t.scrollbarWidth=function(e){var n=t.createElement("ace_inner");n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block";var r=t.createElement("ace_outer"),i=r.style;i.position="absolute",i.left="-10000px",i.overflow="hidden",i.width="200px",i.minWidth="0px",i.height="150px",i.display="block",r.appendChild(n);var s=e.documentElement;s.appendChild(r);var o=n.offsetWidth;i.overflow="scroll";var u=n.offsetWidth;return o==u&&(u=r.clientWidth),s.removeChild(r),o-u},t.setInnerHtml=function(e,t){var n=e.cloneNode(!1);return n.innerHTML=t,e.parentNode.replaceChild(n,e),n},"textContent"in document.documentElement?(t.setInnerText=function(e,t){e.textContent=t},t.getInnerText=function(e){return e.textContent}):(t.setInnerText=function(e,t){e.innerText=t},t.getInnerText=function(e){return e.innerText}),t.getParentWindow=function(e){return e.defaultView||e.parentWindow}}),define("ace/lib/oop",["require","exports","module"],function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}}),define("ace/lib/keys",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/oop"],function(e,t,n){"use strict";e("./fixoldbrowsers");var r=e("./oop"),i=function(){var e={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,"super":8,meta:8,command:8,cmd:8},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}},t,n;for(n in e.FUNCTION_KEYS)t=e.FUNCTION_KEYS[n].toLowerCase(),e[t]=parseInt(n,10);for(n in e.PRINTABLE_KEYS)t=e.PRINTABLE_KEYS[n].toLowerCase(),e[t]=parseInt(n,10);return r.mixin(e,e.MODIFIER_KEYS),r.mixin(e,e.PRINTABLE_KEYS),r.mixin(e,e.FUNCTION_KEYS),e.enter=e["return"],e.escape=e.esc,e.del=e["delete"],e[173]="-",function(){var t=["cmd","ctrl","alt","shift"];for(var n=Math.pow(2,t.length);n--;)e.KEY_MODS[n]=t.filter(function(t){return n&e.KEY_MODS[t]}).join("-")+"-"}(),e.KEY_MODS[0]="",e.KEY_MODS[-1]="input",e}();r.mixin(t,i),t.keyCodeToString=function(e){var t=i[e];return typeof t!="string"&&(t=String.fromCharCode(e)),t.toLowerCase()}}),define("ace/lib/useragent",["require","exports","module"],function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};if(typeof navigator!="object")return;var r=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase(),i=navigator.userAgent;t.isWin=r=="win",t.isMac=r=="mac",t.isLinux=r=="linux",t.isIE=navigator.appName=="Microsoft Internet Explorer"||navigator.appName.indexOf("MSAppHost")>=0?parseFloat((i.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((i.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=(window.Controllers||window.controllers)&&window.navigator.product==="Gecko",t.isOldGecko=t.isGecko&&parseInt((i.match(/rv\:(\d+)/)||[])[1],10)<4,t.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]",t.isWebKit=parseFloat(i.split("WebKit/")[1])||undefined,t.isChrome=parseFloat(i.split(" Chrome/")[1])||undefined,t.isAIR=i.indexOf("AdobeAIR")>=0,t.isIPad=i.indexOf("iPad")>=0,t.isTouchPad=i.indexOf("TouchPad")>=0,t.isChromeOS=i.indexOf(" CrOS ")>=0}),define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(e,t,n){"use strict";function o(e,t,n){var o=s(t);if(!i.isMac&&u){if(u[91]||u[92])o|=8;if(u.altGr){if((3&o)==3)return;u.altGr=0}if(n===18||n===17){var f="location"in t?t.location:t.keyLocation;if(n===17&&f===1)a=t.timeStamp;else if(n===18&&o===3&&f===2){var l=-a;a=t.timeStamp,l+=a,l<3&&(u.altGr=!0)}}}if(n in r.MODIFIER_KEYS){switch(r.MODIFIER_KEYS[n]){case"Alt":o=2;break;case"Shift":o=4;break;case"Ctrl":o=1;break;default:o=8}n=-1}o&8&&(n===91||n===93)&&(n=-1);if(!o&&n===13){var f="location"in t?t.location:t.keyLocation;if(f===3){e(t,o,-n);if(t.defaultPrevented)return}}if(i.isChromeOS&&o&8){e(t,o,n);if(t.defaultPrevented)return;o&=-9}return!!o||n in r.FUNCTION_KEYS||n in r.PRINTABLE_KEYS?e(t,o,n):!1}var r=e("./keys"),i=e("./useragent");t.addListener=function(e,t,n){if(e.addEventListener)return e.addEventListener(t,n,!1);if(e.attachEvent){var r=function(){n.call(e,window.event)};n._wrapper=r,e.attachEvent("on"+t,r)}},t.removeListener=function(e,t,n){if(e.removeEventListener)return e.removeEventListener(t,n,!1);e.detachEvent&&e.detachEvent("on"+t,n._wrapper||n)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return e.type=="dblclick"?0:e.type=="contextmenu"||i.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,n,r){function i(e){n&&n(e),r&&r(e),t.removeListener(document,"mousemove",n,!0),t.removeListener(document,"mouseup",i,!0),t.removeListener(document,"dragstart",i,!0)}return t.addListener(document,"mousemove",n,!0),t.addListener(document,"mouseup",i,!0),t.addListener(document,"dragstart",i,!0),i},t.addMouseWheelListener=function(e,n){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){var t=8;e.wheelDeltaX!==undefined?(e.wheelX=-e.wheelDeltaX/t,e.wheelY=-e.wheelDeltaY/t):(e.wheelX=0,e.wheelY=-e.wheelDelta/t),n(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){var t=.35;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=e.deltaX*t||0,e.wheelY=e.deltaY*t||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=(e.deltaX||0)*5,e.wheelY=(e.deltaY||0)*5}n(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=(e.detail||0)*5,e.wheelY=0):(e.wheelX=0,e.wheelY=(e.detail||0)*5),n(e)})},t.addMultiMouseDownListener=function(e,n,r,s){var o=0,u,a,f,l={2:"dblclick",3:"tripleclick",4:"quadclick"};t.addListener(e,"mousedown",function(e){t.getButton(e)!==0?o=0:e.detail>1?(o++,o>4&&(o=1)):o=1;if(i.isIE){var c=Math.abs(e.clientX-u)>5||Math.abs(e.clientY-a)>5;if(!f||c)o=1;f&&clearTimeout(f),f=setTimeout(function(){f=null},n[o-1]||600),o==1&&(u=e.clientX,a=e.clientY)}e._clicks=o,r[s]("mousedown",e);if(o>4)o=0;else if(o>1)return r[s](l[o],e)}),i.isOldIE&&t.addListener(e,"dblclick",function(e){o=2,f&&clearTimeout(f),f=setTimeout(function(){f=null},n[o-1]||600),r[s]("mousedown",e),r[s](l[o],e)})};var s=!i.isMac||!i.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};t.getModifierString=function(e){return r.KEY_MODS[s(e)]};var u=null,a=0;t.addCommandKeyListener=function(e,n){var r=t.addListener;if(i.isOldGecko||i.isOpera&&!("KeyboardEvent"in window)){var s=null;r(e,"keydown",function(e){s=e.keyCode}),r(e,"keypress",function(e){return o(n,e,s)})}else{var a=null;r(e,"keydown",function(e){u[e.keyCode]=!0;var t=o(n,e,e.keyCode);return a=e.defaultPrevented,t}),r(e,"keypress",function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),r(e,"keyup",function(e){u[e.keyCode]=null}),u||(u=Object.create(null),r(window,"focus",function(e){u=Object.create(null)}))}};if(window.postMessage&&!i.isOldIE){var f=1;t.nextTick=function(e,n){n=n||window;var r="zero-timeout-message-"+f;t.addListener(n,"message",function i(s){s.data==r&&(t.stopPropagation(s),t.removeListener(n,"message",i),e())}),n.postMessage(r,"*")}}t.nextFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame,t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),define("ace/lib/lang",["require","exports","module"],function(e,t,n){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){var n="";while(t>0){t&1&&(n+=e);if(t>>=1)e+=e}return n};var r=/^\s\s*/,i=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(r,"")},t.stringTrimRight=function(e){return e.replace(i,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){var t=[];for(var n=0,r=e.length;n<r;n++)e[n]&&typeof e[n]=="object"?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function(e){if(typeof e!="object"||!e)return e;var n=e.constructor;if(n===RegExp)return e;var r=n();for(var i in e)typeof e[i]=="object"?r[i]=t.deepCopy(e[i]):r[i]=e[i];return r},t.arrayToMap=function(e){var t={};for(var n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return e.replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,function(e){n.push({offset:arguments[arguments.length-2],length:e.length})}),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},r=function(e){return r.cancel(),t=setTimeout(n,e||0),r};return r.schedule=r,r.call=function(){return this.cancel(),e(),r},r.cancel=function(){return clearTimeout(t),t=null,r},r.isPending=function(){return t},r},t.delayedCall=function(e,t){var n=null,r=function(){n=null,e()},i=function(e){n==null&&(n=setTimeout(r,e||t))};return i.delay=function(e){n&&clearTimeout(n),n=setTimeout(r,e||t)},i.schedule=i,i.call=function(){this.cancel(),e()},i.cancel=function(){n&&clearTimeout(n),n=null},i.isPending=function(){return n},i}}),define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("../lib/dom"),o=e("../lib/lang"),u=i.isChrome<18,a=i.isIE,f=function(e,t){function b(e){if(h)return;if(k)t=0,r=e?0:n.value.length-1;else var t=e?2:1,r=2;try{n.setSelectionRange(t,r)}catch(i){}}function w(){if(h)return;n.value=f,i.isWebKit&&y.schedule()}function R(){clearTimeout(q),q=setTimeout(function(){p&&(n.style.cssText=p,p=""),t.renderer.$keepTextAreaAtCursor==null&&(t.renderer.$keepTextAreaAtCursor=!0,t.renderer.$moveTextAreaToCursor())},i.isOldIE?200:0)}var n=s.createElement("textarea");n.className="ace_text-input",i.isTouchPad&&n.setAttribute("x-palm-disable-auto-cap",!0),n.wrap="off",n.autocorrect="off",n.autocapitalize="off",n.spellcheck=!1,n.style.opacity="0",i.isOldIE&&(n.style.top="-100px"),e.insertBefore(n,e.firstChild);var f="\ 1\ 1",l=!1,c=!1,h=!1,p="",d=!0;try{var v=document.activeElement===n}catch(m){}r.addListener(n,"blur",function(e){t.onBlur(e),v=!1}),r.addListener(n,"focus",function(e){v=!0,t.onFocus(e),b()}),this.focus=function(){n.focus()},this.blur=function(){n.blur()},this.isFocused=function(){return v};var g=o.delayedCall(function(){v&&b(d)}),y=o.delayedCall(function(){h||(n.value=f,v&&b())});i.isWebKit||t.addEventListener("changeSelection",function(){t.selection.isEmpty()!=d&&(d=!d,g.schedule())}),w(),v&&t.onFocus();var E=function(e){return e.selectionStart===0&&e.selectionEnd===e.value.length};!n.setSelectionRange&&n.createTextRange&&(n.setSelectionRange=function(e,t){var n=this.createTextRange();n.collapse(!0),n.moveStart("character",e),n.moveEnd("character",t),n.select()},E=function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.text==e.value});if(i.isOldIE){var S=!1,x=function(e){if(S)return;var t=n.value;if(h||!t||t==f)return;if(e&&t==f[0])return T.schedule();A(t),S=!0,w(),S=!1},T=o.delayedCall(x);r.addListener(n,"propertychange",x);var N={13:1,27:1};r.addListener(n,"keyup",function(e){h&&(!n.value||N[e.keyCode])&&setTimeout(F,0);if((n.value.charCodeAt(0)||0)<129)return T.call();h?j():B()}),r.addListener(n,"keydown",function(e){T.schedule(50)})}var C=function(e){l?l=!1:E(n)?(t.selectAll(),b()):k&&b(t.selection.isEmpty())},k=null;this.setInputHandler=function(e){k=e},this.getInputHandler=function(){return k};var L=!1,A=function(e){k&&(e=k(e),k=null),c?(b(),e&&t.onPaste(e),c=!1):e==f.charAt(0)?L?t.execCommand("del",{source:"ace"}):t.execCommand("backspace",{source:"ace"}):(e.substring(0,2)==f?e=e.substr(2):e.charAt(0)==f.charAt(0)?e=e.substr(1):e.charAt(e.length-1)==f.charAt(0)&&(e=e.slice(0,-1)),e.charAt(e.length-1)==f.charAt(0)&&(e=e.slice(0,-1)),e&&t.onTextInput(e)),L&&(L=!1)},O=function(e){if(h)return;var t=n.value;A(t),w()},M=function(e,t){var n=e.clipboardData||window.clipboardData;if(!n||u)return;var r=a?"Text":"text/plain";return t?n.setData(r,t)!==!1:n.getData(r)},_=function(e,i){var s=t.getCopyText();if(!s)return r.preventDefault(e);M(e,s)?(i?t.onCut():t.onCopy(),r.preventDefault(e)):(l=!0,n.value=s,n.select(),setTimeout(function(){l=!1,w(),b(),i?t.onCut():t.onCopy()}))},D=function(e){_(e,!0)},P=function(e){_(e,!1)},H=function(e){var s=M(e);typeof s=="string"?(s&&t.onPaste(s),i.isIE&&setTimeout(b),r.preventDefault(e)):(n.value="",c=!0)};r.addCommandKeyListener(n,t.onCommandKey.bind(t)),r.addListener(n,"select",C),r.addListener(n,"input",O),r.addListener(n,"cut",D),r.addListener(n,"copy",P),r.addListener(n,"paste",H),(!("oncut"in n)||!("oncopy"in n)||!("onpaste"in n))&&r.addListener(e,"keydown",function(e){if(i.isMac&&!e.metaKey||!e.ctrlKey)return;switch(e.keyCode){case 67:P(e);break;case 86:H(e);break;case 88:D(e)}});var B=function(e){if(h||!t.onCompositionStart||t.$readOnly)return;h={},t.onCompositionStart(),setTimeout(j,0),t.on("mousedown",F),t.selection.isEmpty()||(t.insert(""),t.session.markUndoGroup(),t.selection.clearSelection()),t.session.markUndoGroup()},j=function(){if(!h||!t.onCompositionUpdate||t.$readOnly)return;var e=n.value.replace(/\x01/g,"");if(h.lastValue===e)return;t.onCompositionUpdate(e),h.lastValue&&t.undo(),h.lastValue=e;if(h.lastValue){var r=t.selection.getRange();t.insert(h.lastValue),t.session.markUndoGroup(),h.range=t.selection.getRange(),t.selection.setRange(r),t.selection.clearSelection()}},F=function(e){if(!t.onCompositionEnd||t.$readOnly)return;var r=h;h=!1;var i=setTimeout(function(){i=null;var e=n.value.replace(/\x01/g,"");if(h)return;e==r.lastValue?w():!r.lastValue&&e&&(w(),A(e))});k=function(n){return i&&clearTimeout(i),n=n.replace(/\x01/g,""),n==r.lastValue?"":(r.lastValue&&i&&t.undo(),n)},t.onCompositionEnd(),t.removeListener("mousedown",F),e.type=="compositionend"&&r.range&&t.selection.setRange(r.range)},I=o.delayedCall(j,50);r.addListener(n,"compositionstart",B),i.isGecko?r.addListener(n,"text",function(){I.schedule()}):(r.addListener(n,"keyup",function(){I.schedule()}),r.addListener(n,"keydown",function(){I.schedule()})),r.addListener(n,"compositionend",F),this.getElement=function(){return n},this.setReadOnly=function(e){n.readOnly=e},this.onContextMenu=function(e){L=!0,b(t.selection.isEmpty()),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,o){if(!o&&i.isOldIE)return;p||(p=n.style.cssText),n.style.cssText=(o?"z-index:100000;":"")+"height:"+n.style.height+";"+(i.isIE?"opacity:0.1;":"");var u=t.container.getBoundingClientRect(),a=s.computedStyle(t.container),f=u.top+(parseInt(a.borderTopWidth)||0),l=u.left+(parseInt(u.borderLeftWidth)||0),c=u.bottom-f-n.clientHeight-2,h=function(e){n.style.left=e.clientX-l-2+"px",n.style.top=Math.min(e.clientY-f-2,c)+"px"};h(e);if(e.type!="mousedown")return;t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),i.isWin&&!i.isOldIE&&r.capture(t.container,h,R)},this.onContextMenuClose=R;var q,U=function(e){t.textInput.onContextMenu(e),R()};r.addListener(t.renderer.scroller,"contextmenu",U),r.addListener(n,"contextmenu",U)};t.TextInput=f}),define("ace/mouse/default_handlers",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";function u(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e));var n=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];n.forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function a(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}function f(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row==e.end.row-1&&!e.start.column&&!e.end.column)var n=t.column-4;else var n=2*t.row-e.start.row-e.end.row;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent"),o=0;(function(){this.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var r=this.editor,i=e.getButton();if(i!==0){var s=r.getSelectionRange(),o=s.isEmpty();o&&r.selection.moveToPosition(n),r.textInput.onContextMenu(e.domEvent);return}this.mousedownEvent.time=Date.now();if(t&&!r.isFocused()){r.focus();if(this.$focusTimout&&!this.$clickSelection&&!r.inMultiSelectMode){this.setState("focusWait"),this.captureMouse(e);return}}return this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.renderer.scroller.setCapture&&n.renderer.scroller.setCapture(),n.setStyle("ace_selecting"),this.setState("select")},this.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var r=this.$clickSelection.comparePoint(n);if(r==-1)e=this.$clickSelection.end;else if(r==1)e=this.$clickSelection.start;else{var i=f(this.$clickSelection,n);n=i.cursor,e=i.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,n=this.editor,r=n.renderer.screenToTextCoordinates(this.x,this.y),i=n.selection[e](r.row,r.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(i.start),o=this.$clickSelection.comparePoint(i.end);if(s==-1&&o<=0){t=this.$clickSelection.end;if(i.end.row!=r.row||i.end.column!=r.column)r=i.start}else if(o==1&&s>=0){t=this.$clickSelection.start;if(i.start.row!=r.row||i.start.column!=r.column)r=i.end}else if(s==-1&&o==1)r=i.end,t=i.start;else{var u=f(this.$clickSelection,r);r=u.cursor,t=u.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(r),n.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>o||t-this.mousedownEvent.time>this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,r=n.session,i=r.getBracketRange(t);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var r=n.getSelectionRange();r.isMultiLine()&&r.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(r.start.row),this.$clickSelection.end=n.selection.getLineRange(r.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(e.getAccelKey())return;e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=e.domEvent.timeStamp,n=t-(this.$lastScrollTime||0),r=this.editor,i=r.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed);if(i||n<200)return this.$lastScrollTime=t,r.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()}}).call(u.prototype),t.DefaultHandlers=u}),define("ace/tooltip",["require","exports","module","ace/lib/oop","ace/lib/dom"],function(e,t,n){"use strict";function s(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}var r=e("./lib/oop"),i=e("./lib/dom");(function(){this.$init=function(){return this.$element=i.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){i.setInnerText(this.getElement(),e)},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){i.addCssClass(this.getElement(),e)},this.show=function(e,t,n){e!=null&&this.setText(e),t!=null&&n!=null&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth}}).call(s.prototype),t.Tooltip=s}),define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event","ace/tooltip"],function(e,t,n){"use strict";function u(e){function l(){var r=u.getDocumentPosition().row,s=n.$annotations[r];if(!s)return c();var o=t.session.getLength();if(r==o){var a=t.renderer.pixelToScreenCoordinates(0,u.y).row,l=u.$pos;if(a>t.session.documentToScreenRow(l.row,l.column))return c()}if(f==s)return;f=s.text.join("<br/>"),i.setHtml(f),i.show(),t.on("mousewheel",c);if(e.$tooltipFollowsMouse)h(u);else{var p=n.$cells[t.session.documentToScreenRow(r,0)].element,d=p.getBoundingClientRect(),v=i.getElement().style;v.left=d.right+"px",v.top=d.bottom+"px"}}function c(){o&&(o=clearTimeout(o)),f&&(i.hide(),f=null,t.removeEventListener("mousewheel",c))}function h(e){i.setPosition(e.x,e.y)}var t=e.editor,n=t.renderer.$gutterLayer,i=new a(t.container);e.editor.setDefaultHandler("guttermousedown",function(r){if(!t.isFocused()||r.getButton()!=0)return;var i=n.getRegion(r);if(i=="foldWidgets")return;var s=r.getDocumentPosition().row,o=t.session.selection;if(r.getShiftKey())o.selectTo(s,0);else{if(r.domEvent.detail==2)return t.selectAll(),r.preventDefault();e.$clickSelection=t.selection.getLineRange(s)}return e.setState("selectByLines"),e.captureMouse(r),r.preventDefault()});var o,u,f;e.editor.setDefaultHandler("guttermousemove",function(t){var n=t.domEvent.target||t.domEvent.srcElement;if(r.hasCssClass(n,"ace_fold-widget"))return c();f&&e.$tooltipFollowsMouse&&h(t),u=t;if(o)return;o=setTimeout(function(){o=null,u&&!e.isMousePressed?l():c()},50)}),s.addListener(t.renderer.$gutter,"mouseout",function(e){u=null;if(!f||o)return;o=setTimeout(function(){o=null,c()},50)}),t.on("changeSession",c)}function a(e){o.call(this,e)}var r=e("../lib/dom"),i=e("../lib/oop"),s=e("../lib/event"),o=e("../tooltip").Tooltip;i.inherits(a,o),function(){this.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,r=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),s=this.getHeight();e+=15,t+=15,e+i>n&&(e-=e+i-n),t+s>r&&(t-=20+s),o.prototype.setPosition.call(this,e,t)}}.call(a.prototype),t.GutterHandler=u}),define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){r.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){r.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var n=this.getDocumentPosition();this.$inSelection=t.contains(n.row,n.column)}return this.$inSelection},this.getButton=function(){return r.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=i.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(s.prototype)}),define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(e,t,n){"use strict";function f(e){function T(e,n){var r=Date.now(),i=!n||e.row!=n.row,s=!n||e.column!=n.column;if(!S||i||s)t.$blockScrolling+=1,t.moveCursorToPosition(e),t.$blockScrolling-=1,S=r,x={x:p,y:d};else{var o=l(x.x,x.y,p,d);o>a?S=null:r-S>=u&&(t.renderer.scrollCursorIntoView(),S=null)}}function N(e,n){var r=Date.now(),i=t.renderer.layerConfig.lineHeight,s=t.renderer.layerConfig.characterWidth,u=t.renderer.scroller.getBoundingClientRect(),a={x:{left:p-u.left,right:u.right-p},y:{top:d-u.top,bottom:u.bottom-d}},f=Math.min(a.x.left,a.x.right),l=Math.min(a.y.top,a.y.bottom),c={row:e.row,column:e.column};f/s<=2&&(c.column+=a.x.left<a.x.right?-3:2),l/i<=1&&(c.row+=a.y.top<a.y.bottom?-1:1);var h=e.row!=c.row,v=e.column!=c.column,m=!n||e.row!=n.row;h||v&&!m?E?r-E>=o&&t.renderer.scrollCursorIntoView(c):E=r:E=null}function C(){var e=g;g=t.renderer.screenToTextCoordinates(p,d),T(g,e),N(g,e)}function k(){m=t.selection.toOrientedRange(),h=t.session.addMarker(m,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(v),C(),v=setInterval(C,20),y=0,i.addListener(document,"mousemove",O)}function L(){clearInterval(v),t.session.removeMarker(h),h=null,t.$blockScrolling+=1,t.selection.fromOrientedRange(m),t.$blockScrolling-=1,t.isFocused()&&!w&&t.renderer.$cursorLayer.setBlinking(!t.getReadOnly()),m=null,g=null,y=0,E=null,S=null,i.removeListener(document,"mousemove",O)}function O(){A==null&&(A=setTimeout(function(){A!=null&&h&&L()},20))}function M(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return e=="text/plain"||e=="Text"})}function _(e){var t=["copy","copymove","all","uninitialized"],n=["move","copymove","linkmove","all","uninitialized"],r=s.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return r&&t.indexOf(i)>=0?o="copy":n.indexOf(i)>=0?o="move":t.indexOf(i)>=0&&(o="copy"),o}var t=e.editor,n=r.createElement("img");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",s.isOpera&&(n.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;");var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(t){e[t]=this[t]},this),t.addEventListener("mousedown",this.onMouseDown.bind(e));var c=t.container,h,p,d,v,m,g,y=0,b,w,E,S,x;this.onDragStart=function(e){if(this.cancelDrag||!c.draggable){var r=this;return setTimeout(function(){r.startSelect(),r.captureMouse(e)},0),e.preventDefault()}m=t.getSelectionRange();var i=e.dataTransfer;i.effectAllowed=t.getReadOnly()?"copy":"copyMove",s.isOpera&&(t.container.appendChild(n),n.scrollTop=0),i.setDragImage&&i.setDragImage(n,0,0),s.isOpera&&t.container.removeChild(n),i.clearData(),i.setData("Text",t.session.getTextRange()),w=!0,this.setState("drag")},this.onDragEnd=function(e){c.draggable=!1,w=!1,this.setState(null);if(!t.getReadOnly()){var n=e.dataTransfer.dropEffect;!b&&n=="move"&&t.session.remove(t.getSelectionRange()),t.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||k(),y++,e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragOver=function(e){if(t.getReadOnly()||!M(e.dataTransfer))return;return p=e.clientX,d=e.clientY,h||(k(),y++),A!==null&&(A=null),e.dataTransfer.dropEffect=b=_(e),i.preventDefault(e)},this.onDragLeave=function(e){y--;if(y<=0&&h)return L(),b=null,i.preventDefault(e)},this.onDrop=function(e){if(!g)return;var n=e.dataTransfer;if(w)switch(b){case"move":m.contains(g.row,g.column)?m={start:g,end:g}:m=t.moveText(m,g);break;case"copy":m=t.moveText(m,g,!0)}else{var r=n.getData("Text");m={start:g,end:t.session.insert(g,r)},t.focus(),b=null}return L(),i.preventDefault(e)},i.addListener(c,"dragstart",this.onDragStart.bind(e)),i.addListener(c,"dragend",this.onDragEnd.bind(e)),i.addListener(c,"dragenter",this.onDragEnter.bind(e)),i.addListener(c,"dragover",this.onDragOver.bind(e)),i.addListener(c,"dragleave",this.onDragLeave.bind(e)),i.addListener(c,"drop",this.onDrop.bind(e));var A=null}function l(e,t,n,r){return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2))}var r=e("../lib/dom"),i=e("../lib/event"),s=e("../lib/useragent"),o=200,u=200,a=5;(function(){this.dragWait=function(){var e=Date.now()-this.mousedownEvent.time;e>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var e=this.editor.container;e.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor,t=e.container;t.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var n=s.isWin?"default":"move";e.renderer.setCursorStyle(n),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;if(s.isIE&&this.state=="dragReady"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>3&&t.dragDrop()}if(this.state==="dragWait"){var n=l(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);n>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(!this.$dragEnabled)return;this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),r=e.getButton(),i=e.domEvent.detail||1;if(i===1&&r===0&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;"unselectable"in o&&(o.unselectable="on");if(t.getDragDelay()){if(s.isWebKit){this.cancelDrag=!0;var u=t.container;u.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}).call(f.prototype),t.DragdropHandler=f}),define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){n.readyState===4&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=r.getDocumentHead(),i=document.createElement("script");i.src=e,n.appendChild(i),i.onload=i.onreadystatechange=function(e,n){if(n||!i.readyState||i.readyState=="loaded"||i.readyState=="complete")i=i.onload=i.onreadystatechange=null,n||t()}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){"use strict";var r={},i=function(){this.propagationStopped=!0},s=function(){this.defaultPrevented=!0};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=i),t.preventDefault||(t.preventDefault=s),n=n.slice();for(var o=0;o<n.length;o++){n[o](t,this);if(t.propagationStopped)break}if(r&&!t.defaultPrevented)return r(t,this)},r._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(!n)return;n=n.slice();for(var r=0;r<n.length;r++)n[r](t,this)},r.once=function(e,t){var n=this;t&&this.addEventListener(e,function r(){n.removeEventListener(e,r),t.apply(null,arguments)})},r.setDefaultHandler=function(e,t){var n=this._defaultHandlers;n||(n=this._defaultHandlers={_disabled_:{}});if(n[e]){var r=n[e],i=n._disabled_[e];i||(n._disabled_[e]=i=[]),i.push(r);var s=i.indexOf(t);s!=-1&&i.splice(s,1)}n[e]=t},r.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(!n)return;var r=n._disabled_[e];if(n[e]==t){var i=n[e];r&&this.setDefaultHandler(e,r.pop())}else if(r){var s=r.indexOf(t);s!=-1&&r.splice(s,1)}},r.on=r.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[e];return r||(r=this._eventRegistry[e]=[]),r.indexOf(t)==-1&&r[n?"unshift":"push"](t),t},r.off=r.removeListener=r.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(!n)return;var r=n.indexOf(t);r!==-1&&n.splice(r,1)},r.removeAllListeners=function(e){this._eventRegistry&&(this._eventRegistry[e]=[])},t.EventEmitter=r}),define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/lib/net","ace/lib/event_emitter"],function(e,t,n){"no use strict";function f(r){a.packaged=r||e.packaged||n.packaged||u.define&&define.packaged;if(!u.document)return"";var i={},s="",o=document.currentScript||document._currentScript,f=o&&o.ownerDocument||document,c=f.getElementsByTagName("script");for(var h=0;h<c.length;h++){var p=c[h],d=p.src||p.getAttribute("src");if(!d)continue;var v=p.attributes;for(var m=0,g=v.length;m<g;m++){var y=v[m];y.name.indexOf("data-ace-")===0&&(i[l(y.name.replace(/^data-ace-/,""))]=y.value)}var b=d.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);b&&(s=b[1])}s&&(i.base=i.base||s,i.packaged=!0),i.basePath=i.base,i.workerPath=i.workerPath||i.base,i.modePath=i.modePath||i.base,i.themePath=i.themePath||i.base,delete i.base;for(var w in i)typeof i[w]!="undefined"&&t.set(w,i[w])}function l(e){return e.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}var r=e("./lib/lang"),i=e("./lib/oop"),s=e("./lib/net"),o=e("./lib/event_emitter").EventEmitter,u=function(){return this}(),a={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{}};t.get=function(e){if(!a.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return a[e]},t.set=function(e,t){if(!a.hasOwnProperty(e))throw new Error("Unknown config key: "+e);a[e]=t},t.all=function(){return r.copyObject(a)},i.implement(t,o),t.moduleUrl=function(e,t){if(a.$moduleUrls[e])return a.$moduleUrls[e];var n=e.split("/");t=t||n[n.length-2]||"";var r=t=="snippets"?"/":"-",i=n[n.length-1];if(t=="worker"&&r=="-"){var s=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");i=i.replace(s,"")}(!i||i==t)&&n.length>1&&(i=n[n.length-2]);var o=a[t+"Path"];return o==null?o=a.basePath:r=="/"&&(t=r=""),o&&o.slice(-1)!="/"&&(o+="/"),o+t+r+i+this.get("suffix")},t.setModuleUrl=function(e,t){return a.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(n,r){var i,o;Array.isArray(n)&&(o=n[0],n=n[1]);try{i=e(n)}catch(u){}if(i&&!t.$loading[n])return r&&r(i);t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(r);if(t.$loading[n].length>1)return;var a=function(){e([n],function(e){t._emit("load.module",{name:n,module:e});var r=t.$loading[n];t.$loading[n]=null,r.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();s.loadScript(t.moduleUrl(n,o),a)},t.init=f;var c={setOptions:function(e){Object.keys(e).forEach(function(t){this.setOption(t,e[t])},this)},getOptions:function(e){var t={};return e?Array.isArray(e)||(t=e,e=Object.keys(t)):e=Object.keys(this.$options),e.forEach(function(e){t[e]=this.getOption(e)},this),t},setOption:function(e,t){if(this["$"+e]===t)return;var n=this.$options[e];if(!n)return typeof console!="undefined"&&console.warn&&console.warn('misspelled option "'+e+'"'),undefined;if(n.forwardTo)return this[n.forwardTo]&&this[n.forwardTo].setOption(e,t);n.handlesSet||(this["$"+e]=t),n&&n.set&&n.set.call(this,t)},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:(typeof console!="undefined"&&console.warn&&console.warn('misspelled option "'+e+'"'),undefined)}},h={};t.defineOptions=function(e,t,n){return e.$options||(h[t]=e.$options={}),Object.keys(n).forEach(function(t){var r=n[t];typeof r=="string"&&(r={forwardTo:r}),r.name||(r.name=t),e.$options[r.name]=r,"initialValue"in r&&(e["$"+r.name]=r.initialValue)}),i.implement(e,c),this},t.resetOptions=function(e){Object.keys(e.$options).forEach(function(t){var n=e.$options[t];"value"in n&&e.setOption(t,n.value)})},t.setDefaultValue=function(e,n,r){var i=h[e]||(h[e]={});i[n]&&(i.forwardTo?t.setDefaultValue(i.forwardTo,n,r):i[n].value=r)},t.setDefaultValues=function(e,n){Object.keys(n).forEach(function(r){t.setDefaultValue(e,r,n[r])})}}),define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event"),i=e("../lib/useragent"),s=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,u=e("./mouse_event").MouseEvent,a=e("./dragdrop_handler").DragdropHandler,f=e("../config"),l=function(e){var t=this;this.editor=e,new s(this),new o(this),new a(this);var n=function(t){!e.isFocused()&&e.textInput&&e.textInput.moveToMouse(t),e.focus()},u=e.renderer.getMouseEventTarget();r.addListener(u,"click",this.onMouseEvent.bind(this,"click")),r.addListener(u,"mousemove",this.onMouseMove.bind(this,"mousemove")),r.addMultiMouseDownListener(u,[400,300,250],this,"onMouseEvent"),e.renderer.scrollBarV&&(r.addMultiMouseDownListener(e.renderer.scrollBarV.inner,[400,300,250],this,"onMouseEvent"),r.addMultiMouseDownListener(e.renderer.scrollBarH.inner,[400,300,250],this,"onMouseEvent"),i.isIE&&(r.addListener(e.renderer.scrollBarV.element,"mousedown",n),r.addListener(e.renderer.scrollBarH.element,"mousemove",n))),r.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"));var f=e.renderer.$gutter;r.addListener(f,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),r.addListener(f,"click",this.onMouseEvent.bind(this,"gutterclick")),r.addListener(f,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),r.addListener(f,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),r.addListener(u,"mousedown",n),r.addListener(f,"mousedown",function(t){return e.focus(),r.preventDefault(t)}),e.on("mousemove",function(n){if(t.state||t.$dragDelay||!t.$dragEnabled)return;var r=e.renderer.screenToTextCoordinates(n.x,n.y),i=e.session.selection.getRange(),s=e.renderer;!i.isEmpty()&&i.insideStart(r.row,r.column)?s.setCursorStyle("default"):s.setCursorStyle("")})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new u(t,this.editor))},this.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;if(!n||!n.length)return;this.editor._emit(e,new u(t,this.editor))},this.onMouseWheel=function(e,t){var n=new u(t,this.editor);n.speed=this.$scrollSpeed*2,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor.renderer;n.$keepTextAreaAtCursor&&(n.$keepTextAreaAtCursor=null);var s=this,o=function(e){if(!e)return;if(i.isWebKit&&!e.which&&s.releaseMouse)return s.releaseMouse();s.x=e.clientX,s.y=e.clientY,t&&t(e),s.mouseEvent=new u(e,s.editor),s.$mouseMoved=!0},a=function(e){clearInterval(l),f(),s[s.state+"End"]&&s[s.state+"End"](e),s.state="",n.$keepTextAreaAtCursor==null&&(n.$keepTextAreaAtCursor=!0,n.$moveTextAreaToCursor()),s.isMousePressed=!1,s.$onCaptureMouseMove=s.releaseMouse=null,e&&s.onMouseEvent("mouseup",e)},f=function(){s[s.state]&&s[s.state](),s.$mouseMoved=!1};if(i.isOldIE&&e.domEvent.type=="dblclick")return setTimeout(function(){a(e)});s.$onCaptureMouseMove=o,s.releaseMouse=r.capture(this.editor.container,o,a);var l=setInterval(f,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){if(t&&t.domEvent&&t.domEvent.type!="contextmenu")return;this.editor.off("nativecontextmenu",e),t&&t.domEvent&&r.stopEvent(t.domEvent)}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(l.prototype),f.defineOptions(l.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:i.isMac?150:0},dragEnabled:{initialValue:!0},focusTimout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=l}),define("ace/mouse/fold_handler",["require","exports","module"],function(e,t,n){"use strict";function r(e){e.on("click",function(t){var n=t.getDocumentPosition(),r=e.session,i=r.getFoldAt(n.row,n.column,1);i&&(t.getAccelKey()?r.removeFold(i):r.expandFold(i),t.stop())}),e.on("gutterclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[r]&&e.session.onFoldWidgetClick(r,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){var n=e.renderer.$gutterLayer.getRegion(t);if(n=="foldWidgets"){var r=t.getDocumentPosition().row,i=e.session,s=i.getParentFoldRangeData(r,!0),o=s.range||s.firstRange;if(o){r=o.start.row;var u=i.getFoldAt(r,i.getLine(r).length,1);u?i.removeFold(u):(i.addFold("...",o),e.renderer.scrollCursorIntoView({row:o.start.row,column:0}))}t.stop()}})}t.FoldHandler=r}),define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(e,t,n){"use strict";var r=e("../lib/keys"),i=e("../lib/event"),s=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]==e)return;while(t[t.length-1]&&t[t.length-1]!=this.$defaultHandler)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)},this.addKeyboardHandler=function(e,t){if(!e)return;typeof e=="function"&&!e.handleKeyboard&&(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);n!=-1&&this.$handlers.splice(n,1),t==undefined?this.$handlers.push(e):this.$handlers.splice(t,0,e),n==-1&&e.attach&&e.attach(this.$editor)},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return t==-1?!1:(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(n){return n.getStatusText&&n.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,n,r){var s,o=!1,u=this.$editor.commands;for(var a=this.$handlers.length;a--;){s=this.$handlers[a].handleKeyboard(this.$data,e,t,n,r);if(!s||!s.command)continue;s.command=="null"?o=!0:o=u.exec(s.command,this.$editor,s.args,r),o&&r&&e!=-1&&s.passEvent!=1&&s.command.passEvent!=1&&i.stopEvent(r);if(o)break}return o},this.onCommandKey=function(e,t,n){var i=r.keyCodeToString(n);this.$callKeyboardHandlers(t,i,n,e)},this.onTextInput=function(e){var t=this.$callKeyboardHandlers(-1,e);t||this.$editor.commands.exec("insertstring",this.$editor,e)}}).call(s.prototype),t.KeyBinding=s}),define("ace/range",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t){return e.row-t.row||e.column-t.column},i=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?t<this.start.column?-1:t>this.end.column?1:0:e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};else if(this.end.row<e)var n={row:e,column:0};if(this.start.row>t)var r={row:t+1,column:0};else if(this.start.row<e)var r={row:e,column:0};return i.fromPoints(r||this.start,n||this.end)},this.extend=function(e,t){var n=this.compare(e,t);if(n==0)return this;if(n==-1)var r={row:e,column:t};else var s={row:e,column:t};return i.fromPoints(r||this.start,s||this.end)},this.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},this.isMultiLine=function(){return this.start.row!==this.end.row},this.clone=function(){return i.fromPoints(this.start,this.end)},this.collapseRows=function(){return this.end.column==0?new i(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new i(this.start.row,0,this.end.row,0)},this.toScreenRange=function(e){var t=e.documentToScreenPosition(this.start),n=e.documentToScreenPosition(this.end);return new i(t.row,t.column,n.row,n.column)},this.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t}}).call(i.prototype),i.fromPoints=function(e,t){return new i(e.row,e.column,t.row,t.column)},i.comparePoints=r,i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=i}),define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,u=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.lead=this.selectionLead=this.doc.createAnchor(0,0),this.anchor=this.selectionAnchor=this.doc.createAnchor(0,0);var t=this;this.lead.on("change",function(e){t._emit("changeCursor"),t.$isEmpty||t._emit("changeSelection"),!t.$keepDesiredColumnOnChange&&e.old.column!=e.value.column&&(t.$desiredColumn=null)}),this.selectionAnchor.on("change",function(){t.$isEmpty||t._emit("changeSelection")})};(function(){r.implement(this,s),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return this.isEmpty()?!1:this.getRange().isMultiLine()},this.getCursor=function(){return this.lead.getPosition()},this.setSelectionAnchor=function(e,t){this.anchor.setPosition(e,t),this.$isEmpty&&(this.$isEmpty=!1,this._emit("changeSelection"))},this.getSelectionAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionLead=function(){return this.lead.getPosition()},this.shiftSelection=function(e){if(this.$isEmpty){this.moveCursorTo(this.lead.row,this.lead.column+e);return}var t=this.getSelectionAnchor(),n=this.getSelectionLead(),r=this.isBackwards();(!r||t.column!==0)&&this.setSelectionAnchor(t.row,t.column+e),(r||n.column!==0)&&this.$moveSelection(function(){this.moveCursorTo(n.row,n.column+e)})},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.isEmpty()?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var e=this.doc.getLength()-1;this.setSelectionAnchor(0,0),this.moveCursorTo(e,this.doc.getLine(e).length)},this.setRange=this.setSelectionRange=function(e,t){t?(this.setSelectionAnchor(e.end.row,e.end.column),this.selectTo(e.start.row,e.start.column)):(this.setSelectionAnchor(e.start.row,e.start.column),this.selectTo(e.end.row,e.end.column)),this.getRange().isEmpty()&&(this.$isEmpty=!0),this.$desiredColumn=null},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(typeof t=="undefined"){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n=typeof e=="number"?e:this.lead.row,r,i=this.session.getFoldLine(n);return i?(n=i.start.row,r=i.end.row):r=n,t===!0?new o(n,0,r,this.session.getLine(r).length):new o(n,0,r+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.moveCursorLeft=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(e.column===0)e.row>0&&this.moveCursorTo(e.row-1,this.doc.getLine(e.row-1).length);else{var n=this.session.getTabSize();this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(e.column-n,e.column).split(" ").length-1==n?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e=this.lead.getPosition(),t;if(t=this.session.getFoldAt(e.row,e.column,1))this.moveCursorTo(t.end.row,t.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var n=this.session.getTabSize(),e=this.lead;this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(e.column,e.column+n).split(" ").length-1==n?this.moveCursorBy(0,n):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,n=this.session.documentToScreenRow(e,t),r=this.session.screenToDocumentPosition(n,0),i=this.session.getDisplayLine(e,null,r.row,r.column),s=i.match(/^\s*/);s[0].length!=t&&!this.session.$useEmacsStyleLineStart&&(r.column+=s[0].length),this.moveCursorToPosition(r)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var n=this.session.getLine(t.row);if(t.column==n.length){var r=n.search(/\s+$/);r>0&&(t.column=r)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i;this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var s=this.session.getFoldAt(e,t,1);if(s){this.moveCursorTo(s.end.row,s.end.column);return}if(i=this.session.nonTokenRe.exec(r))t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,r=n.substring(t);if(t>=n.length){this.moveCursorTo(e,n.length),this.moveCursorRight(),e<this.doc.getLength()-1&&this.moveCursorWordRight();return}if(i=this.session.tokenRe.exec(r))t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(e,t)},this.moveCursorLongWordLeft=function(){var e=this.lead.row,t=this.lead.column,n;if(n=this.session.getFoldAt(e,t,-1)){this.moveCursorTo(n.start.row,n.start.column);return}var r=this.session.getFoldStringAt(e,t,-1);r==null&&(r=this.doc.getLine(e).substring(0,t));var s=i.stringReverse(r),o;this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;if(o=this.session.nonTokenRe.exec(s))t-=this.session.nonTokenRe.lastIndex,s=s.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0;if(t<=0){this.moveCursorTo(e,0),this.moveCursorLeft(),e>0&&this.moveCursorWordLeft();return}if(o=this.session.tokenRe.exec(s))t-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0;this.moveCursorTo(e,t)},this.$shortWordEndIndex=function(e){var t,n=0,r,i=/\s/,s=this.session.tokenRe;s.lastIndex=0;if(t=this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{while((r=e[n])&&i.test(r))n++;if(n<1){s.lastIndex=0;while((r=e[n])&&!s.test(r)){s.lastIndex=0,n++;if(i.test(r)){if(n>2){n--;break}while((r=e[n])&&i.test(r))n++;if(n>2)break}}}}return s.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),r=n.substring(t),i=this.session.getFoldAt(e,t,1);if(i)return this.moveCursorTo(i.end.row,i.end.column);if(t==n.length){var s=this.doc.getLength();do e++,r=this.doc.getLine(e);while(e<s&&/^\s*$/.test(r));/^\s+/.test(r)||(r=""),t=0}var o=this.$shortWordEndIndex(r);this.moveCursorTo(e,t+o)},this.moveCursorShortWordLeft=function(){var e=this.lead.row,t=this.lead.column,n;if(n=this.session.getFoldAt(e,t,-1))return this.moveCursorTo(n.start.row,n.start.column);var r=this.session.getLine(e).substring(0,t);if(t===0){do e--,r=this.doc.getLine(e);while(e>0&&/^\s*$/.test(r));t=r.length,/\s+$/.test(r)||(r="")}var s=i.stringReverse(r),o=this.$shortWordEndIndex(s);return this.moveCursorTo(e,t-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n=this.session.documentToScreenPosition(this.lead.row,this.lead.column);t===0&&(this.$desiredColumn?n.column=this.$desiredColumn:this.$desiredColumn=n.column);var r=this.session.screenToDocumentPosition(n.row+e,n.column);e!==0&&t===0&&r.row===this.lead.row&&r.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[r.row]&&r.row++,this.moveCursorTo(r.row,r.column+t,t===0)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var r=this.session.getFoldAt(e,t,1);r&&(e=r.start.row,t=r.start.column),this.$keepDesiredColumnOnChange=!0,this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var r=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(r.row,r.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e.call(null,this);var n=this.getCursor();return o.fromPoints(t,n)}catch(r){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(e.start==undefined){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=o.fromPoints(e[t].start,e[t].end);e.isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(u.prototype),t.Selection=u}),define("ace/tokenizer",["require","exports","module"],function(e,t,n){"use strict";var r=2e3,i=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){var n=this.states[t],r=[],i=0,s=this.matchMappings[t]={defaultToken:"text"},o="g",u=[];for(var a=0;a<n.length;a++){var f=n[a];f.defaultToken&&(s.defaultToken=f.defaultToken),f.caseInsensitive&&(o="gi");if(f.regex==null)continue;f.regex instanceof RegExp&&(f.regex=f.regex.toString().slice(1,-1));var l=f.regex,c=(new RegExp("(?:("+l+")|(.))")).exec("a").length-2;Array.isArray(f.token)?f.token.length==1||c==1?f.token=f.token[0]:c-1!=f.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:f,groupCount:c-1}),f.token=f.token[0]):(f.tokenArray=f.token,f.token=null,f.onMatch=this.$arrayTokens):typeof f.token=="function"&&!f.onMatch&&(c>1?f.onMatch=this.$applyToken:f.onMatch=f.token),c>1&&(/\\\d/.test(f.regex)?l=f.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+i+1)}):(c=1,l=this.removeCapturingGroups(f.regex)),!f.splitRegex&&typeof f.token!="string"&&u.push(f)),s[i]=a,i+=c,r.push(l),f.onMatch||(f.onMatch=null)}r.length||(s[0]=0,r.push("$")),u.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+r.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){r=e|0},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if(typeof n=="string")return[{type:n,value:e}];var r=[];for(var i=0,s=n.length;i<s;i++)t[i]&&(r[r.length]={type:n[i],value:t[i]});return r},this.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";var n=[],r=this.tokenArray;for(var i=0,s=r.length;i<s;i++)t[i+1]&&(n[n.length]={type:r[i],value:t[i+1]});return n},this.removeCapturingGroups=function(e){var t=e.replace(/\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g,function(e,t){return t?"(?:":e});return t},this.createSplitterRegexp=function(e,t){if(e.indexOf("(?=")!=-1){var n=0,r=!1,i={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(e,t,s,o,u,a){return r?r=u!="]":u?r=!0:o?(n==i.stack&&(i.end=a+1,i.stack=-1),n--):s&&(n++,s.length!=1&&(i.stack=n,i.start=a)),e}),i.end!=null&&/^\)*$/.test(e.substr(i.end))&&(e=e.substring(0,i.start)+e.substr(i.end))}return new RegExp(e,(t||"").replace("g",""))},this.getLineTokens=function(e,t){if(t&&typeof t!="string"){var n=t.slice(0);t=n[0],t==="#tmp"&&(n.shift(),t=n.shift())}else var n=[];var i=t||"start",s=this.states[i];s||(i="start",s=this.states[i]);var o=this.matchMappings[i],u=this.regExps[i];u.lastIndex=0;var a,f=[],l=0,c=0,h={type:null,value:""};while(a=u.exec(e)){var p=o.defaultToken,d=null,v=a[0],m=u.lastIndex;if(m-v.length>l){var g=e.substring(l,m-v.length);h.type==p?h.value+=g:(h.type&&f.push(h),h={type:p,value:g})}for(var y=0;y<a.length-2;y++){if(a[y+1]===undefined)continue;d=s[o[y]],d.onMatch?p=d.onMatch(v,i,n):p=d.token,d.next&&(typeof d.next=="string"?i=d.next:i=d.next(i,n),s=this.states[i],s||(this.reportError("state doesn't exist",i),i="start",s=this.states[i]),o=this.matchMappings[i],l=m,u=this.regExps[i],u.lastIndex=m);break}if(v)if(typeof p=="string")!!d&&d.merge===!1||h.type!==p?(h.type&&f.push(h),h={type:p,value:v}):h.value+=v;else if(p){h.type&&f.push(h),h={type:null,value:""};for(var y=0;y<p.length;y++)f.push(p[y])}if(l==e.length)break;l=m;if(c++>r){c>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});while(l<e.length)h.type&&f.push(h),h={value:e.substring(l,l+=2e3),type:"overflow"};i="start",n=[];break}}return h.type&&f.push(h),n.length>1&&n[0]!==i&&n.unshift("#tmp",i),{tokens:f,state:n.length?n:i}},this.reportError=function(e,t){var n=new Error(e);n.data=t,typeof console=="object"&&console.error&&console.error(n),setTimeout(function(){throw n})}}).call(i.prototype),t.Tokenizer=i}),define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang"),i=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(!t){for(var n in e)this.$rules[n]=e[n];return}for(var n in e){var r=e[n];for(var i=0;i<r.length;i++){var s=r[i];if(s.next||s.onMatch)typeof s.next!="string"?s.nextState&&s.nextState.indexOf(t)!==0&&(s.nextState=t+s.nextState):s.next.indexOf(t)!==0&&(s.next=t+s.next)}this.$rules[t+n]=r}},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,n,i,s){var o=typeof e=="function"?(new e).getRules():e;if(i)for(var u=0;u<i.length;u++)i[u]=t+i[u];else{i=[];for(var a in o)i.push(t+a)}this.addRules(o,t);if(n){var f=Array.prototype[s?"push":"unshift"];for(var u=0;u<i.length;u++)f.apply(this.$rules[i[u]],r.deepCopy(n))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var e=function(e,t){return(e!="start"||t.length)&&t.unshift(this.nextState,e),this.nextState},t=function(e,t){return t.shift(),t.shift()||"start"};this.normalizeRules=function(){function i(s){var o=r[s];o.processed=!0;for(var u=0;u<o.length;u++){var a=o[u];!a.regex&&a.start&&(a.regex=a.start,a.next||(a.next=[]),a.next.push({defaultToken:a.token},{token:a.token+".end",regex:a.end||a.start,next:"pop"}),a.token=a.token+".start",a.push=!0);var f=a.next||a.push;if(f&&Array.isArray(f)){var l=a.stateName;l||(l=a.token,typeof l!="string"&&(l=l[0]||""),r[l]&&(l+=n++)),r[l]=f,a.next=l,i(l)}else f=="pop"&&(a.next=t);a.push&&(a.nextState=a.next||a.push,a.next=e,delete a.push);if(a.rules)for(var c in a.rules)r[c]?r[c].push&&r[c].push.apply(r[c],a.rules[c]):r[c]=a.rules[c];if(a.include||typeof a=="string")var h=a.include||a,p=r[h];else Array.isArray(a)&&(p=a);if(p){var d=[u,1].concat(p);a.noEscape&&(d=d.filter(function(e){return!e.next})),o.splice.apply(o,d),u--,p=null}a.keywordMap&&(a.token=this.createKeywordMapper(a.keywordMap,a.defaultToken||"text",a.caseInsensitive),delete a.defaultToken)}}var n=0,r=this.$rules;Object.keys(r).forEach(i,this)},this.createKeywordMapper=function(e,t,n,r){var i=Object.create(null);return Object.keys(e).forEach(function(t){var s=e[t];n&&(s=s.toLowerCase());var o=s.split(r||"|");for(var u=o.length;u--;)i[o[u]]=t}),Object.getPrototypeOf(i)&&(i.__proto__=null),this.$keywordList=Object.keys(i),e=null,n?function(e){return i[e.toLowerCase()]||t}:function(e){return i[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(i.prototype),t.TextHighlightRules=i}),define("ace/mode/behaviour",["require","exports","module"],function(e,t,n){"use strict";var r=function(){this.$behaviours={}};(function(){this.add=function(e,t,n){switch(undefined){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=n},this.addBehaviours=function(e){for(var t in e)for(var n in e[t])this.add(t,n,e[t][n])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if(typeof e=="function")var n=(new e).getBehaviours(t);else var n=e.getBehaviours(t);this.addBehaviours(n)},this.getBehaviours=function(e){if(!e)return this.$behaviours;var t={};for(var n=0;n<e.length;n++)this.$behaviours[e[n]]&&(t[e[n]]=this.$behaviours[e[n]]);return t}}).call(r.prototype),t.Behaviour=r}),define("ace/unicode",["require","exports","module"],function(e,t,n){"use strict";function r(e){var n=/\w{4}/g;for(var r in e)t.packages[r]=e[r].replace(n,"\\u$&")}t.packages={},r({L:"0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",Ll:"0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A",Lu:"0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A",Lt:"01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",Lm:"02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",Lo:"01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",M:"0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",Mn:"0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",Mc:"0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC",Me:"0488048906DE20DD-20E020E2-20E4A670-A672",N:"0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nd:"0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nl:"16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",No:"00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",P:"0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",Pd:"002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",Ps:"0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",Pe:"0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",Pi:"00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",Pf:"00BB2019201D203A2E032E052E0A2E0D2E1D2E21",Pc:"005F203F20402054FE33FE34FE4D-FE4FFF3F",Po:"0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",S:"0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",Sm:"002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",Sc:"002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",Sk:"005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",So:"00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",Z:"002000A01680180E2000-200A20282029202F205F3000",Zs:"002000A01680180E2000-200A202F205F3000",Zl:"2028",Zp:"2029",C:"0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",Cc:"0000-001F007F-009F",Cf:"00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",Co:"E000-F8FF",Cs:"D800-DFFF",Cn:"03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"})}),define("ace/token_iterator",["require","exports","module"],function(e,t,n){"use strict";var r=function(e,t,n){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var r=e.getTokenAt(t,n);this.$tokenIndex=r?r.index:-1};(function(){this.stepBackward=function(){this.$tokenIndex-=1;while(this.$tokenIndex<0){this.$row-=1;if(this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){this.$tokenIndex+=1;var e;while(this.$tokenIndex>=this.$rowTokens.length){this.$row+=1,e||(e=this.$session.getLength());if(this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(n!==undefined)return n;n=0;while(t>0)t-=1,n+=e[t].value.length;return n}}).call(r.prototype),t.TokenIterator=r}),define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(e,t,n){"use strict";var r=e("../tokenizer").Tokenizer,i=e("./text_highlight_rules").TextHighlightRules,s=e("./behaviour").Behaviour,o=e("../unicode"),u=e("../lib/lang"),a=e("../token_iterator").TokenIterator,f=e("../range").Range,l=function(){this.HighlightRules=i,this.$behaviour=new s};(function(){this.tokenRe=new RegExp("^["+o.packages.L+o.packages.Mn+o.packages.Mc+o.packages.Nd+o.packages.Pc+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+o.packages.L+o.packages.Mn+o.packages.Mc+o.packages.Nd+o.packages.Pc+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules,this.$tokenizer=new r(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,n,r){function w(e){for(var t=n;t<=r;t++)e(i.getLine(t),t)}var i=t.doc,s=!0,o=!0,a=Infinity,f=t.getTabSize(),l=!1;if(!this.lineCommentStart){if(!this.blockComment)return!1;var c=this.blockComment.start,h=this.blockComment.end,p=new RegExp("^(\\s*)(?:"+u.escapeRegExp(c)+")"),d=new RegExp("(?:"+u.escapeRegExp(h)+")\\s*$"),v=function(e,t){if(g(e,t))return;if(!s||/\S/.test(e))i.insertInLine({row:t,column:e.length},h),i.insertInLine({row:t,column:a},c)},m=function(e,t){var n;(n=e.match(d))&&i.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(p))&&i.removeInLine(t,n[1].length,n[0].length)},g=function(e,n){if(p.test(e))return!0;var r=t.getTokens(n);for(var i=0;i<r.length;i++)if(r[i].type==="comment")return!0}}else{if(Array.isArray(this.lineCommentStart))var p=this.lineCommentStart.map(u.escapeRegExp).join("|"),c=this.lineCommentStart[0];else var p=u.escapeRegExp(this.lineCommentStart),c=this.lineCommentStart;p=new RegExp("^(\\s*)(?:"+p+") ?"),l=t.getUseSoftTabs();var m=function(e,t){var n=e.match(p);if(!n)return;var r=n[1].length,s=n[0].length;!b(e,r,s)&&n[0][s-1]==" "&&s--,i.removeInLine(t,r,s)},y=c+" ",v=function(e,t){if(!s||/\S/.test(e))b(e,a,a)?i.insertInLine({row:t,column:a},y):i.insertInLine({row:t,column:a},c)},g=function(e,t){return p.test(e)},b=function(e,t,n){var r=0;while(t--&&e.charAt(t)==" ")r++;if(r%f!=0)return!1;var r=0;while(e.charAt(n++)==" ")r++;return f>2?r%f!=f-1:r%f==0}}var E=Infinity;w(function(e,t){var n=e.search(/\S/);n!==-1?(n<a&&(a=n),o&&!g(e,t)&&(o=!1)):E>e.length&&(E=e.length)}),a==Infinity&&(a=E,s=!1,o=!1),l&&a%f!=0&&(a=Math.floor(a/f)*f),w(o?m:v)},this.toggleBlockComment=function(e,t,n,r){var i=this.blockComment;if(!i)return;!i.start&&i[0]&&(i=i[0]);var s=new a(t,r.row,r.column),o=s.getCurrentToken(),u=t.selection,l=t.selection.toOrientedRange(),c,h;if(o&&/comment/.test(o.type)){var p,d;while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.start);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;p=new f(m,g,m,g+i.start.length);break}o=s.stepBackward()}var s=new a(t,r.row,r.column),o=s.getCurrentToken();while(o&&/comment/.test(o.type)){var v=o.value.indexOf(i.end);if(v!=-1){var m=s.getCurrentTokenRow(),g=s.getCurrentTokenColumn()+v;d=new f(m,g,m,g+i.end.length);break}o=s.stepForward()}d&&t.remove(d),p&&(t.remove(p),c=p.start.row,h=-i.start.length)}else h=i.start.length,c=n.start.row,t.insert(n.end,i.end),t.insert(n.start,i.start);l.start.row==c&&(l.start.column+=h),l.end.row==c&&(l.end.column+=h),t.selection.fromOrientedRange(l)},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)e[t]&&(this.$embeds.push(t),this.$modes[t]=new e[t]);var n=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(var t=0;t<n.length;t++)(function(e){var r=n[t],i=e[r];e[n[t]]=function(){return this.$delegator(r,arguments,i)}})(this)},this.$delegator=function(e,t,n){var r=t[0];typeof r!="string"&&(r=r[0]);for(var i=0;i<this.$embeds.length;i++){if(!this.$modes[this.$embeds[i]])continue;var s=r.split(this.$embeds[i]);if(!s[0]&&s[1]){t[0]=s[1];var o=this.$modes[this.$embeds[i]];return o[e].apply(o,t)}}var u=n.apply(this,t);return n?u:undefined},this.transformAction=function(e,t,n,r,i){if(this.$behaviour){var s=this.$behaviour.getBehaviours();for(var o in s)if(s[o][t]){var u=s[o][t].apply(this,arguments);if(u)return u}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,n=[];for(var r in t){var i=t[r];for(var s=0,o=i.length;s<o;s++)if(typeof i[s].token=="string")/keyword|support|storage/.test(i[s].token)&&n.push(i[s].regex);else if(typeof i[s].token=="object")for(var u=0,a=i[s].token.length;u<a;u++)if(/keyword|support|storage/.test(i[s].token[u])){var r=i[s].regex.match(/\(.+?\)/g)[u];n.push(r.substr(1,r.length-2))}}this.completionKeywords=n}return e?n.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,n,r){var i=this.$keywordList||this.$createKeywordList();return i.map(function(e){return{name:e,value:e,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(l.prototype),t.Mode=l}),define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=t.Anchor=function(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),typeof n=="undefined"?this.setPosition(t.row,t.column):this.setPosition(t,n)};(function(){r.implement(this,i),this.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},this.getDocument=function(){return this.document},this.$insertRight=!1,this.onChange=function(e){var t=e.data,n=t.range;if(n.start.row==n.end.row&&n.start.row!=this.row)return;if(n.start.row>this.row)return;if(n.start.row==this.row&&n.start.column>this.column)return;var r=this.row,i=this.column,s=n.start,o=n.end;if(t.action==="insertText")if(s.row===r&&s.column<=i){if(s.column!==i||!this.$insertRight)s.row===o.row?i+=o.column-s.column:(i-=s.column,r+=o.row-s.row)}else s.row!==o.row&&s.row<r&&(r+=o.row-s.row);else t.action==="insertLines"?(s.row!==r||i!==0||!this.$insertRight)&&s.row<=r&&(r+=o.row-s.row):t.action==="removeText"?s.row===r&&s.column<i?o.column>=i?i=s.column:i=Math.max(0,i-(o.column-s.column)):s.row!==o.row&&s.row<r?(o.row===r&&(i=Math.max(0,i-o.column)+s.column),r-=o.row-s.row):o.row===r&&(r-=o.row-s.row,i=Math.max(0,i-o.column)+s.column):t.action=="removeLines"&&s.row<=r&&(o.row<=r?r-=o.row-s.row:(r=s.row,i=0));this.setPosition(r,i,!0)},this.setPosition=function(e,t,n){var r;n?r={row:e,column:t}:r=this.$clipPositionToDocument(e,t);if(this.row==r.row&&this.column==r.column)return;var i={row:this.row,column:this.column};this.row=r.row,this.column=r.column,this._signal("change",{old:i,value:r})},this.