Browse Source

Merge pull request #6869 from GordonSmith/HPCC-12791

HPCC-12791 Paste not working in ECL Playground

Reviewed-By: Kevin Wang <kevin.wang@lexisnexis.com>
Reviewed-By: Miguel Vazquez <miguel.vazquez@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 years ago
parent
commit
77074c1b9c

+ 32 - 0
esp/src/CodeMirror2/addon/dialog/dialog.css

@@ -0,0 +1,32 @@
+.CodeMirror-dialog {
+  position: absolute;
+  left: 0; right: 0;
+  background: white;
+  z-index: 15;
+  padding: .1em .8em;
+  overflow: hidden;
+  color: #333;
+}
+
+.CodeMirror-dialog-top {
+  border-bottom: 1px solid #eee;
+  top: 0;
+}
+
+.CodeMirror-dialog-bottom {
+  border-top: 1px solid #eee;
+  bottom: 0;
+}
+
+.CodeMirror-dialog input {
+  border: none;
+  outline: none;
+  background: transparent;
+  width: 20em;
+  color: inherit;
+  font-family: monospace;
+}
+
+.CodeMirror-dialog button {
+  font-size: 70%;
+}

+ 20 - 0
esp/src/CodeMirror2/addon/fold/foldgutter.css

@@ -0,0 +1,20 @@
+.CodeMirror-foldmarker {
+  color: blue;
+  text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
+  font-family: arial;
+  line-height: .3;
+  cursor: pointer;
+}
+.CodeMirror-foldgutter {
+  width: .7em;
+}
+.CodeMirror-foldgutter-open,
+.CodeMirror-foldgutter-folded {
+  cursor: pointer;
+}
+.CodeMirror-foldgutter-open:after {
+  content: "\25BE";
+}
+.CodeMirror-foldgutter-folded:after {
+  content: "\25B8";
+}

+ 76 - 0
esp/src/CodeMirror2/addon/scroll/annotatescrollbar.js

@@ -0,0 +1,76 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+  if (typeof exports == "object" && typeof module == "object") // CommonJS
+    mod(require("../../lib/codemirror"));
+  else if (typeof define == "function" && define.amd) // AMD
+    define(["../../lib/codemirror"], mod);
+  else // Plain browser env
+    mod(CodeMirror);
+})(function(CodeMirror) {
+  "use strict";
+
+  CodeMirror.defineExtension("annotateScrollbar", function(className) {
+    return new Annotation(this, className);
+  });
+
+  function Annotation(cm, className) {
+    this.cm = cm;
+    this.className = className;
+    this.annotations = [];
+    this.div = cm.getWrapperElement().appendChild(document.createElement("div"));
+    this.div.style.cssText = "position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none";
+    this.computeScale();
+
+    var self = this;
+    cm.on("refresh", this.resizeHandler = function(){
+      if (self.computeScale()) self.redraw();
+    });
+  }
+
+  Annotation.prototype.computeScale = function() {
+    var cm = this.cm;
+    var hScale = (cm.getWrapperElement().clientHeight - cm.display.barHeight) /
+      cm.heightAtLine(cm.lastLine() + 1, "local");
+    if (hScale != this.hScale) {
+      this.hScale = hScale;
+      return true;
+    }
+  };
+
+  Annotation.prototype.update = function(annotations) {
+    this.annotations = annotations;
+    this.redraw();
+  };
+
+  Annotation.prototype.redraw = function() {
+    var cm = this.cm, hScale = this.hScale;
+    if (!cm.display.barWidth) return;
+
+    var frag = document.createDocumentFragment(), anns = this.annotations;
+    for (var i = 0, nextTop; i < anns.length; i++) {
+      var ann = anns[i];
+      var top = nextTop || cm.charCoords(ann.from, "local").top * hScale;
+      var bottom = cm.charCoords(ann.to, "local").bottom * hScale;
+      while (i < anns.length - 1) {
+        nextTop = cm.charCoords(anns[i + 1].from, "local").top * hScale;
+        if (nextTop > bottom + .9) break;
+        ann = anns[++i];
+        bottom = cm.charCoords(ann.to, "local").bottom * hScale;
+      }
+      var height = Math.max(bottom - top, 3);
+
+      var elt = frag.appendChild(document.createElement("div"));
+      elt.style.cssText = "position: absolute; right: 0px; width: " + Math.max(cm.display.barWidth - 1, 2) + "px; top: " + top + "px; height: " + height + "px";
+      elt.className = this.className;
+    }
+    this.div.textContent = "";
+    this.div.appendChild(frag);
+  };
+
+  Annotation.prototype.clear = function() {
+    this.cm.off("refresh", this.resizeHandler);
+    this.div.parentNode.removeChild(this.div);
+  };
+});

+ 66 - 0
esp/src/CodeMirror2/addon/scroll/simplescrollbars.css

@@ -0,0 +1,66 @@
+.CodeMirror-simplescroll-horizontal div, .CodeMirror-simplescroll-vertical div {
+  position: absolute;
+  background: #ccc;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+  border: 1px solid #bbb;
+  border-radius: 2px;
+}
+
+.CodeMirror-simplescroll-horizontal, .CodeMirror-simplescroll-vertical {
+  position: absolute;
+  z-index: 6;
+  background: #eee;
+}
+
+.CodeMirror-simplescroll-horizontal {
+  bottom: 0; left: 0;
+  height: 8px;
+}
+.CodeMirror-simplescroll-horizontal div {
+  bottom: 0;
+  height: 100%;
+}
+
+.CodeMirror-simplescroll-vertical {
+  right: 0; top: 0;
+  width: 8px;
+}
+.CodeMirror-simplescroll-vertical div {
+  right: 0;
+  width: 100%;
+}
+
+
+.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler {
+  display: none;
+}
+
+.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div {
+  position: absolute;
+  background: #bcd;
+  border-radius: 3px;
+}
+
+.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical {
+  position: absolute;
+  z-index: 6;
+}
+
+.CodeMirror-overlayscroll-horizontal {
+  bottom: 0; left: 0;
+  height: 6px;
+}
+.CodeMirror-overlayscroll-horizontal div {
+  bottom: 0;
+  height: 100%;
+}
+
+.CodeMirror-overlayscroll-vertical {
+  right: 0; top: 0;
+  width: 6px;
+}
+.CodeMirror-overlayscroll-vertical div {
+  right: 0;
+  width: 100%;
+}

+ 8 - 0
esp/src/CodeMirror2/addon/search/matchesonscrollbar.css

@@ -0,0 +1,8 @@
+.CodeMirror-search-match {
+  background: gold;
+  border-top: 1px solid orange;
+  border-bottom: 1px solid orange;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+  opacity: .5;
+}

+ 90 - 0
esp/src/CodeMirror2/addon/search/matchesonscrollbar.js

@@ -0,0 +1,90 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+  if (typeof exports == "object" && typeof module == "object") // CommonJS
+    mod(require("../../lib/codemirror"), require("./searchcursor"), require("../scroll/annotatescrollbar"));
+  else if (typeof define == "function" && define.amd) // AMD
+    define(["../../lib/codemirror", "./searchcursor", "../scroll/annotatescrollbar"], mod);
+  else // Plain browser env
+    mod(CodeMirror);
+})(function(CodeMirror) {
+  "use strict";
+
+  CodeMirror.defineExtension("showMatchesOnScrollbar", function(query, caseFold, className) {
+    return new SearchAnnotation(this, query, caseFold, className);
+  });
+
+  function SearchAnnotation(cm, query, caseFold, className) {
+    this.cm = cm;
+    this.annotation = cm.annotateScrollbar(className || "CodeMirror-search-match");
+    this.query = query;
+    this.caseFold = caseFold;
+    this.gap = {from: cm.firstLine(), to: cm.lastLine() + 1};
+    this.matches = [];
+    this.update = null;
+
+    this.findMatches();
+    this.annotation.update(this.matches);
+
+    var self = this;
+    cm.on("change", this.changeHandler = function(_cm, change) { self.onChange(change); });
+  }
+
+  var MAX_MATCHES = 1000;
+
+  SearchAnnotation.prototype.findMatches = function() {
+    if (!this.gap) return;
+    for (var i = 0; i < this.matches.length; i++) {
+      var match = this.matches[i];
+      if (match.from.line >= this.gap.to) break;
+      if (match.to.line >= this.gap.from) this.matches.splice(i--, 1);
+    }
+    var cursor = this.cm.getSearchCursor(this.query, CodeMirror.Pos(this.gap.from, 0), this.caseFold);
+    while (cursor.findNext()) {
+      var match = {from: cursor.from(), to: cursor.to()};
+      if (match.from.line >= this.gap.to) break;
+      this.matches.splice(i++, 0, match);
+      if (this.matches.length > MAX_MATCHES) break;
+    }
+    this.gap = null;
+  };
+
+  function offsetLine(line, changeStart, sizeChange) {
+    if (line <= changeStart) return line;
+    return Math.max(changeStart, line + sizeChange);
+  }
+
+  SearchAnnotation.prototype.onChange = function(change) {
+    var startLine = change.from.line;
+    var endLine = CodeMirror.changeEnd(change).line;
+    var sizeChange = endLine - change.to.line;
+    if (this.gap) {
+      this.gap.from = Math.min(offsetLine(this.gap.from, startLine, sizeChange), change.from.line);
+      this.gap.to = Math.max(offsetLine(this.gap.to, startLine, sizeChange), change.from.line);
+    } else {
+      this.gap = {from: change.from.line, to: endLine + 1};
+    }
+
+    if (sizeChange) for (var i = 0; i < this.matches.length; i++) {
+      var match = this.matches[i];
+      var newFrom = offsetLine(match.from.line, startLine, sizeChange);
+      if (newFrom != match.from.line) match.from = CodeMirror.Pos(newFrom, match.from.ch);
+      var newTo = offsetLine(match.to.line, startLine, sizeChange);
+      if (newTo != match.to.line) match.to = CodeMirror.Pos(newTo, match.to.ch);
+    }
+    clearTimeout(this.update);
+    var self = this;
+    this.update = setTimeout(function() { self.updateAfterChange(); }, 250);
+  };
+
+  SearchAnnotation.prototype.updateAfterChange = function() {
+    this.findMatches();
+    this.annotation.update(this.matches);
+  };
+
+  SearchAnnotation.prototype.clear = function() {
+    this.cm.off("change", this.changeHandler);
+    this.annotation.clear();
+  };
+});

File diff suppressed because it is too large
+ 26 - 0
esp/src/CodeMirror2/codemirror-compressed.js


+ 269 - 70
esp/src/CodeMirror2/lib/codemirror.css

@@ -1,110 +1,309 @@
+/* BASICS */
+
 .CodeMirror {
-  line-height: 1em;
+  /* Set height, width, borders, and global font properties here */
   font-family: monospace;
+  height: 300px;
+}
+
+/* PADDING */
+
+.CodeMirror-lines {
+  padding: 4px 0; /* Vertical padding around content */
+}
+.CodeMirror pre {
+  padding: 0 4px; /* Horizontal padding of content */
+}
+
+.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+  background-color: white; /* The little square between H and V scrollbars */
+}
+
+/* GUTTER */
+
+.CodeMirror-gutters {
+  border-right: 1px solid #ddd;
+  background-color: #f7f7f7;
+  white-space: nowrap;
+}
+.CodeMirror-linenumbers {}
+.CodeMirror-linenumber {
+  padding: 0 3px 0 5px;
+  min-width: 20px;
+  text-align: right;
+  color: #999;
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
+}
+
+.CodeMirror-guttermarker { color: black; }
+.CodeMirror-guttermarker-subtle { color: #999; }
+
+/* CURSOR */
+
+.CodeMirror div.CodeMirror-cursor {
+  border-left: 1px solid black;
+}
+/* Shown when moving in bi-directional text */
+.CodeMirror div.CodeMirror-secondarycursor {
+  border-left: 1px solid silver;
+}
+.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
+  width: auto;
+  border: 0;
+  background: #7e7;
+}
+.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
+  z-index: 1;
+}
+
+.cm-animate-fat-cursor {
+  width: auto;
+  border: 0;
+  -webkit-animation: blink 1.06s steps(1) infinite;
+  -moz-animation: blink 1.06s steps(1) infinite;
+  animation: blink 1.06s steps(1) infinite;
+}
+@-moz-keyframes blink {
+  0% { background: #7e7; }
+  50% { background: none; }
+  100% { background: #7e7; }
+}
+@-webkit-keyframes blink {
+  0% { background: #7e7; }
+  50% { background: none; }
+  100% { background: #7e7; }
+}
+@keyframes blink {
+  0% { background: #7e7; }
+  50% { background: none; }
+  100% { background: #7e7; }
+}
+
+/* Can style cursor different in overwrite (non-insert) mode */
+div.CodeMirror-overwrite div.CodeMirror-cursor {}
+
+.cm-tab { display: inline-block; text-decoration: inherit; }
+
+.CodeMirror-ruler {
+  border-left: 1px solid #ccc;
+  position: absolute;
+}
+
+/* DEFAULT THEME */
+
+.cm-s-default .cm-keyword {color: #708;}
+.cm-s-default .cm-atom {color: #219;}
+.cm-s-default .cm-number {color: #164;}
+.cm-s-default .cm-def {color: #00f;}
+.cm-s-default .cm-variable,
+.cm-s-default .cm-punctuation,
+.cm-s-default .cm-property,
+.cm-s-default .cm-operator {}
+.cm-s-default .cm-variable-2 {color: #05a;}
+.cm-s-default .cm-variable-3 {color: #085;}
+.cm-s-default .cm-comment {color: #a50;}
+.cm-s-default .cm-string {color: #a11;}
+.cm-s-default .cm-string-2 {color: #f50;}
+.cm-s-default .cm-meta {color: #555;}
+.cm-s-default .cm-qualifier {color: #555;}
+.cm-s-default .cm-builtin {color: #30a;}
+.cm-s-default .cm-bracket {color: #997;}
+.cm-s-default .cm-tag {color: #170;}
+.cm-s-default .cm-attribute {color: #00c;}
+.cm-s-default .cm-header {color: blue;}
+.cm-s-default .cm-quote {color: #090;}
+.cm-s-default .cm-hr {color: #999;}
+.cm-s-default .cm-link {color: #00c;}
+
+.cm-negative {color: #d44;}
+.cm-positive {color: #292;}
+.cm-header, .cm-strong {font-weight: bold;}
+.cm-em {font-style: italic;}
+.cm-link {text-decoration: underline;}
+.cm-strikethrough {text-decoration: line-through;}
+
+.cm-s-default .cm-error {color: #f00;}
+.cm-invalidchar {color: #f00;}
+
+/* Default styles for common addons */
+
+div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
+div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
+.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
+.CodeMirror-activeline-background {background: #e8f2ff;}
+
+/* STOP */
+
+/* The rest of this file contains styles related to the mechanics of
+   the editor. You probably shouldn't touch them. */
+
+.CodeMirror {
+  line-height: 1;
+  position: relative;
+  overflow: hidden;
+  background: white;
+  color: black;
 }
 
 .CodeMirror-scroll {
-  overflow: auto;
-  height: 300px;
-  /* This is needed to prevent an IE[67] bug where the scrolled content
-     is visible outside of the scrolling box. */
+  overflow: scroll !important; /* Things will break if this is overridden */
+  /* 30px is the magic margin used to hide the element's real scrollbars */
+  /* See overflow: hidden in .CodeMirror */
+  margin-bottom: -30px; margin-right: -30px;
+  padding-bottom: 30px;
+  height: 100%;
+  outline: none; /* Prevent dragging from highlighting the element */
+  position: relative;
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
+}
+.CodeMirror-sizer {
   position: relative;
+  border-right: 30px solid transparent;
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
 }
 
-.CodeMirror-gutter {
+/* The fake, visible scrollbars. Used to force redraw during scrolling
+   before actuall scrolling happens, thus preventing shaking and
+   flickering artifacts. */
+.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+  position: absolute;
+  z-index: 6;
+  display: none;
+}
+.CodeMirror-vscrollbar {
+  right: 0; top: 0;
+  overflow-x: hidden;
+  overflow-y: scroll;
+}
+.CodeMirror-hscrollbar {
+  bottom: 0; left: 0;
+  overflow-y: hidden;
+  overflow-x: scroll;
+}
+.CodeMirror-scrollbar-filler {
+  right: 0; bottom: 0;
+}
+.CodeMirror-gutter-filler {
+  left: 0; bottom: 0;
+}
+
+.CodeMirror-gutters {
   position: absolute; left: 0; top: 0;
-  z-index: 10;
-  background-color: #f7f7f7;
-  border-right: 1px solid #eee;
-  min-width: 2em;
+  z-index: 3;
+}
+.CodeMirror-gutter {
+  white-space: normal;
   height: 100%;
+  -moz-box-sizing: content-box;
+  box-sizing: content-box;
+  display: inline-block;
+  margin-bottom: -30px;
+  /* Hack to make IE7 behave */
+  *zoom:1;
+  *display:inline;
 }
-.CodeMirror-gutter-text {
-  color: #aaa;
-  text-align: right;
-  padding: .4em .2em .4em .4em;
-  white-space: pre !important;
+.CodeMirror-gutter-wrapper {
+  position: absolute;
+  z-index: 4;
+  height: 100%;
 }
-.CodeMirror-lines {
-  padding: .4em;
+.CodeMirror-gutter-elt {
+  position: absolute;
+  cursor: default;
+  z-index: 4;
 }
 
+.CodeMirror-lines {
+  cursor: text;
+  min-height: 1px; /* prevents collapsing before first draw */
+}
 .CodeMirror pre {
-  -moz-border-radius: 0;
-  -webkit-border-radius: 0;
-  -o-border-radius: 0;
-  border-radius: 0;
-  border-width: 0; margin: 0; padding: 0; background: transparent;
+  /* Reset some styles that the rest of the page might have set */
+  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
+  border-width: 0;
+  background: transparent;
   font-family: inherit;
   font-size: inherit;
-  padding: 0; margin: 0;
+  margin: 0;
   white-space: pre;
   word-wrap: normal;
+  line-height: inherit;
+  color: inherit;
+  z-index: 2;
+  position: relative;
+  overflow: visible;
 }
-
 .CodeMirror-wrap pre {
   word-wrap: break-word;
   white-space: pre-wrap;
+  word-break: normal;
 }
-.CodeMirror-wrap .CodeMirror-scroll {
-  overflow-x: hidden;
+
+.CodeMirror-linebackground {
+  position: absolute;
+  left: 0; right: 0; top: 0; bottom: 0;
+  z-index: 0;
 }
 
-.CodeMirror textarea {
-  outline: none !important;
+.CodeMirror-linewidget {
+  position: relative;
+  z-index: 2;
+  overflow: auto;
 }
 
-.CodeMirror pre.CodeMirror-cursor {
-  z-index: 10;
+.CodeMirror-widget {}
+
+.CodeMirror-measure {
   position: absolute;
+  width: 100%;
+  height: 0;
+  overflow: hidden;
   visibility: hidden;
-  border-left: 1px solid black;
-  border-right:none;
-  width:0;
 }
-.CodeMirror pre.CodeMirror-cursor.CodeMirror-overwrite {}
-.CodeMirror-focused pre.CodeMirror-cursor {
+.CodeMirror-measure pre { position: static; }
+
+.CodeMirror div.CodeMirror-cursor {
+  position: absolute;
+  border-right: none;
+  width: 0;
+}
+
+div.CodeMirror-cursors {
+  visibility: hidden;
+  position: relative;
+  z-index: 3;
+}
+.CodeMirror-focused div.CodeMirror-cursors {
   visibility: visible;
 }
 
-div.CodeMirror-selected { background: #d9d9d9; }
-.CodeMirror-focused div.CodeMirror-selected { background: #d7d4f0; }
+.CodeMirror-selected { background: #d9d9d9; }
+.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
+.CodeMirror-crosshair { cursor: crosshair; }
 
-.CodeMirror-searching {
+.cm-searching {
   background: #ffa;
   background: rgba(255, 255, 0, .4);
 }
 
-/* Default theme */
-
-.cm-s-default span.cm-keyword {color: #708;}
-.cm-s-default span.cm-atom {color: #219;}
-.cm-s-default span.cm-number {color: #164;}
-.cm-s-default span.cm-def {color: #00f;}
-.cm-s-default span.cm-variable {color: black;}
-.cm-s-default span.cm-variable-2 {color: #05a;}
-.cm-s-default span.cm-variable-3 {color: #085;}
-.cm-s-default span.cm-property {color: black;}
-.cm-s-default span.cm-operator {color: black;}
-.cm-s-default span.cm-comment {color: #a50;}
-.cm-s-default span.cm-string {color: #a11;}
-.cm-s-default span.cm-string-2 {color: #f50;}
-.cm-s-default span.cm-meta {color: #555;}
-.cm-s-default span.cm-error {color: #f00;}
-.cm-s-default span.cm-qualifier {color: #555;}
-.cm-s-default span.cm-builtin {color: #30a;}
-.cm-s-default span.cm-bracket {color: #cc7;}
-.cm-s-default span.cm-tag {color: #170;}
-.cm-s-default span.cm-attribute {color: #00c;}
-.cm-s-default span.cm-header {color: #a0a;}
-.cm-s-default span.cm-quote {color: #090;}
-.cm-s-default span.cm-hr {color: #999;}
-.cm-s-default span.cm-link {color: #00c;}
-
-span.cm-header, span.cm-strong {font-weight: bold;}
-span.cm-em {font-style: italic;}
-span.cm-emstrong {font-style: italic; font-weight: bold;}
-span.cm-link {text-decoration: underline;}
+/* IE7 hack to prevent it from returning funny offsetTops on the spans */
+.CodeMirror span { *vertical-align: text-bottom; }
 
-div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
-div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
+/* Used to force a border model for a node */
+.cm-force-border { padding-right: .1px; }
+
+@media print {
+  /* Hide the cursor when printing */
+  .CodeMirror div.CodeMirror-cursors {
+    visibility: hidden;
+  }
+}
+
+/* See issue #2901 */
+.cm-tab-wrap-hack:after { content: ''; }
+
+/* Help users use markselection to safely style text background */
+span.CodeMirror-selectedtext { background: none; }

File diff suppressed because it is too large
+ 0 - 1
esp/src/CodeMirror2/lib/codemirror.js


+ 0 - 196
esp/src/CodeMirror2/lib/util/foldcode.js

@@ -1,196 +0,0 @@
-// the tagRangeFinder function is
-//   Copyright (C) 2011 by Daniel Glazman <daniel@glazman.org>
-// released under the MIT license (../../LICENSE) like the rest of CodeMirror
-CodeMirror.tagRangeFinder = function(cm, line, hideEnd) {
-  var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
-  var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
-  var xmlNAMERegExp = new RegExp("^[" + nameStartChar + "][" + nameChar + "]*");
-
-  var lineText = cm.getLine(line);
-  var found = false;
-  var tag = null;
-  var pos = 0;
-  while (!found) {
-    pos = lineText.indexOf("<", pos);
-    if (-1 == pos) // no tag on line
-      return;
-    if (pos + 1 < lineText.length && lineText[pos + 1] == "/") { // closing tag
-      pos++;
-      continue;
-    }
-    // ok we weem to have a start tag
-    if (!lineText.substr(pos + 1).match(xmlNAMERegExp)) { // not a tag name...
-      pos++;
-      continue;
-    }
-    var gtPos = lineText.indexOf(">", pos + 1);
-    if (-1 == gtPos) { // end of start tag not in line
-      var l = line + 1;
-      var foundGt = false;
-      var lastLine = cm.lineCount();
-      while (l < lastLine && !foundGt) {
-        var lt = cm.getLine(l);
-        var gt = lt.indexOf(">");
-        if (-1 != gt) { // found a >
-          foundGt = true;
-          var slash = lt.lastIndexOf("/", gt);
-          if (-1 != slash && slash < gt) {
-            var str = lineText.substr(slash, gt - slash + 1);
-            if (!str.match( /\/\s*\>/ )) { // yep, that's the end of empty tag
-              if (hideEnd === true) l++;
-              return l;
-            }
-          }
-        }
-        l++;
-      }
-      found = true;
-    }
-    else {
-      var slashPos = lineText.lastIndexOf("/", gtPos);
-      if (-1 == slashPos) { // cannot be empty tag
-        found = true;
-        // don't continue
-      }
-      else { // empty tag?
-        // check if really empty tag
-        var str = lineText.substr(slashPos, gtPos - slashPos + 1);
-        if (!str.match( /\/\s*\>/ )) { // finally not empty
-          found = true;
-          // don't continue
-        }
-      }
-    }
-    if (found) {
-      var subLine = lineText.substr(pos + 1);
-      tag = subLine.match(xmlNAMERegExp);
-      if (tag) {
-        // we have an element name, wooohooo !
-        tag = tag[0];
-        // do we have the close tag on same line ???
-        if (-1 != lineText.indexOf("</" + tag + ">", pos)) // yep
-        {
-          found = false;
-        }
-        // we don't, so we have a candidate...
-      }
-      else
-        found = false;
-    }
-    if (!found)
-      pos++;
-  }
-
-  if (found) {
-    var startTag = "(\\<\\/" + tag + "\\>)|(\\<" + tag + "\\>)|(\\<" + tag + "\\s)|(\\<" + tag + "$)";
-    var startTagRegExp = new RegExp(startTag, "g");
-    var endTag = "</" + tag + ">";
-    var depth = 1;
-    var l = line + 1;
-    var lastLine = cm.lineCount();
-    while (l < lastLine) {
-      lineText = cm.getLine(l);
-      var match = lineText.match(startTagRegExp);
-      if (match) {
-        for (var i = 0; i < match.length; i++) {
-          if (match[i] == endTag)
-            depth--;
-          else
-            depth++;
-          if (!depth) {
-            if (hideEnd === true) l++;
-            return l;
-          }
-        }
-      }
-      l++;
-    }
-    return;
-  }
-};
-
-CodeMirror.braceRangeFinder = function(cm, line, hideEnd) {
-  var lineText = cm.getLine(line), at = lineText.length, startChar, tokenType;
-  for (;;) {
-    var found = lineText.lastIndexOf("{", at);
-    if (found < 0) break;
-    tokenType = cm.getTokenAt({line: line, ch: found}).className;
-    if (!/^(comment|string)/.test(tokenType)) { startChar = found; break; }
-    at = found - 1;
-  }
-  if (startChar == null || lineText.lastIndexOf("}") > startChar) return;
-  var count = 1, lastLine = cm.lineCount(), end;
-  outer: for (var i = line + 1; i < lastLine; ++i) {
-    var text = cm.getLine(i), pos = 0;
-    for (;;) {
-      var nextOpen = text.indexOf("{", pos), nextClose = text.indexOf("}", pos);
-      if (nextOpen < 0) nextOpen = text.length;
-      if (nextClose < 0) nextClose = text.length;
-      pos = Math.min(nextOpen, nextClose);
-      if (pos == text.length) break;
-      if (cm.getTokenAt({line: i, ch: pos + 1}).className == tokenType) {
-        if (pos == nextOpen) ++count;
-        else if (!--count) { end = i; break outer; }
-      }
-      ++pos;
-    }
-  }
-  if (end == null || end == line + 1) return;
-  if (hideEnd === true) end++;
-  return end;
-};
-
-CodeMirror.indentRangeFinder = function(cm, line) {
-  var tabSize = cm.getOption("tabSize");
-  var myIndent = cm.getLineHandle(line).indentation(tabSize), last;
-  for (var i = line + 1, end = cm.lineCount(); i < end; ++i) {
-    var handle = cm.getLineHandle(i);
-    if (!/^\s*$/.test(handle.text)) {
-      if (handle.indentation(tabSize) <= myIndent) break;
-      last = i;
-    }
-  }
-  if (!last) return null;
-  return last + 1;
-};
-
-CodeMirror.newFoldFunction = function(rangeFinder, markText, hideEnd) {
-  var folded = [];
-  if (markText == null) markText = '<div style="position: absolute; left: 2px; color:#600">&#x25bc;</div>%N%';
-
-  function isFolded(cm, n) {
-    for (var i = 0; i < folded.length; ++i) {
-      var start = cm.lineInfo(folded[i].start);
-      if (!start) folded.splice(i--, 1);
-      else if (start.line == n) return {pos: i, region: folded[i]};
-    }
-  }
-
-  function expand(cm, region) {
-    cm.clearMarker(region.start);
-    for (var i = 0; i < region.hidden.length; ++i)
-      cm.showLine(region.hidden[i]);
-  }
-
-  return function(cm, line) {
-    cm.operation(function() {
-      var known = isFolded(cm, line);
-      if (known) {
-        folded.splice(known.pos, 1);
-        expand(cm, known.region);
-      } else {
-        var end = rangeFinder(cm, line, hideEnd);
-        if (end == null) return;
-        var hidden = [];
-        for (var i = line + 1; i < end; ++i) {
-          var handle = cm.hideLine(i);
-          if (handle) hidden.push(handle);
-        }
-        var first = cm.setMarker(line, markText);
-        var region = {start: first, hidden: hidden};
-        cm.onDeleteLine(first, function() { expand(cm, region); });
-        folded.push(region);
-      }
-    });
-  };
-};

File diff suppressed because it is too large
+ 0 - 168
esp/src/CodeMirror2/mode/dot/dot.js


+ 0 - 55
esp/src/CodeMirror2/mode/dot/index.html

@@ -1,55 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <title>CodeMirror: ECL mode</title>
-    <link rel="stylesheet" href="../../lib/codemirror.css">
-    <script src="../../lib/codemirror.js"></script>
-    <script src="dot.js"></script>
-    <link rel="stylesheet" href="../../theme/declarative.css">
-    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-    <link rel="stylesheet" href="../../doc/docs.css">
-  </head>
-  <body>
-    <h1>CodeMirror: DOT mode</h1>
-    <form><textarea id="code" name="code">
-digraph G {
-
-	subgraph cluster_0 {
-		style=filled;
-		color=lightgrey;
-		node [style=filled,color=white];
-		a0 -&gt; a1 -&gt; a2 -&gt; a3;
-		label = &quot;process #1&quot;;
-	}
-
-	subgraph cluster_1 {
-		node [style=filled];
-		b0 -&gt; b1 -&gt; b2 -&gt; b3;
-		label = &quot;process #2&quot;;
-		color=blue
-	}
-	start -&gt; a0;
-	start -&gt; b0;
-	a1 -&gt; b3;
-	b2 -&gt; a3;
-	a3 -&gt; a0;
-	a3 -&gt; end;
-	b3 -&gt; end;
-
-	start [shape=Mdiamond];
-	end [shape=Msquare];
-}
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        tabMode: "indent",
-        lineNumbers: true,
-        matchBrackets: true
-      });
-    </script>
-
-    <p>Based on CodeMirror's ecl mode.  For more information see <a href="http://www.graphviz.org">GraphViz</a> web site.</p>
-    <p><strong>MIME types defined:</strong> <code>text/x-ecl</code>.</p>
-
-  </body>
-</html>

File diff suppressed because it is too large
+ 0 - 203
esp/src/CodeMirror2/mode/ecl/ecl.js


+ 0 - 45
esp/src/CodeMirror2/mode/ecl/index.html

@@ -1,45 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <title>CodeMirror: ECL mode</title>
-    <link rel="stylesheet" href="../../lib/codemirror.css">
-    <script src="../../lib/codemirror.js"></script>
-    <script src="ecl.js"></script>
-    <link rel="stylesheet" href="../../theme/declarative.css">
-    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-    <link rel="stylesheet" href="../../doc/docs.css">
-  </head>
-  <body>
-    <h1>CodeMirror: ECL mode</h1>
-    <form><textarea id="code" name="code">
-/*
-sample useless code to demonstrate ecl syntax highlighting
-this is a multiline comment!
-*/
-
-//  this is a singleline comment!
-
-import ut;
-r := 
-  record
-   string22 s1 := '123';
-   integer4 i1 := 123;
-  end;
-#option('tmp', true);
-d := dataset('tmp::qb', r, thor);
-output(d);
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        tabMode: "indent",
-        lineNumbers: true,
-        matchBrackets: true,
-        theme: "declarative"
-      });
-    </script>
-
-    <p>Based on CodeMirror's clike mode.  For more information see <a href="http://hpccsystems.com">HPCC Systems</a> web site.</p>
-    <p><strong>MIME types defined:</strong> <code>text/x-ecl</code>.</p>
-
-  </body>
-</html>

+ 0 - 45
esp/src/CodeMirror2/mode/xml/index.html

@@ -1,45 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>CodeMirror: XML mode</title>
-    <link rel="stylesheet" href="../../lib/codemirror.css">
-    <script src="../../lib/codemirror.js"></script>
-    <script src="xml.js"></script>
-    <style type="text/css">.foo{border-right: 1px solid red} .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-    <link rel="stylesheet" href="../../doc/docs.css">
-  </head>
-  <body>
-    <h1>CodeMirror: XML mode</h1>
-    <form><textarea id="code" name="code">
-&lt;html style="color: green"&gt;
-  &lt;!-- this is a comment --&gt;
-  &lt;head&gt;
-    &lt;title&gt;HTML Example&lt;/title&gt;
-  &lt;/head&gt;
-  &lt;body&gt;
-    The indentation tries to be &lt;em&gt;somewhat &amp;quot;do what
-    I mean&amp;quot;&lt;/em&gt;... but might not match your style.
-  &lt;/body&gt;
-&lt;/html&gt;
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: {name: "xml", alignCDATA: true},
-        lineNumbers: true
-      });
-    </script>
-    <p>The XML mode supports two configuration parameters:</p>
-    <dl>
-      <dt><code>htmlMode (boolean)</code></dt>
-      <dd>This switches the mode to parse HTML instead of XML. This
-      means attributes do not have to be quoted, and some elements
-      (such as <code>br</code>) do not require a closing tag.</dd>
-      <dt><code>alignCDATA (boolean)</code></dt>
-      <dd>Setting this to true will force the opening tag of CDATA
-      blocks to not be indented.</dd>
-    </dl>
-
-    <p><strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/html</code>.</p>
-  </body>
-</html>

+ 0 - 318
esp/src/CodeMirror2/mode/xml/xml.js

@@ -1,318 +0,0 @@
-CodeMirror.defineMode("xml", function(config, parserConfig) {
-  var indentUnit = config.indentUnit;
-  var Kludges = parserConfig.htmlMode ? {
-    autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
-                      'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
-                      'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
-                      'track': true, 'wbr': true},
-    implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
-                       'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
-                       'th': true, 'tr': true},
-    contextGrabbers: {
-      'dd': {'dd': true, 'dt': true},
-      'dt': {'dd': true, 'dt': true},
-      'li': {'li': true},
-      'option': {'option': true, 'optgroup': true},
-      'optgroup': {'optgroup': true},
-      'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
-            'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
-            'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
-            'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
-            'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
-      'rp': {'rp': true, 'rt': true},
-      'rt': {'rp': true, 'rt': true},
-      'tbody': {'tbody': true, 'tfoot': true},
-      'td': {'td': true, 'th': true},
-      'tfoot': {'tbody': true},
-      'th': {'td': true, 'th': true},
-      'thead': {'tbody': true, 'tfoot': true},
-      'tr': {'tr': true}
-    },
-    doNotIndent: {"pre": true},
-    allowUnquoted: true,
-    allowMissing: true
-  } : {
-    autoSelfClosers: {},
-    implicitlyClosed: {},
-    contextGrabbers: {},
-    doNotIndent: {},
-    allowUnquoted: false,
-    allowMissing: false
-  };
-  var alignCDATA = parserConfig.alignCDATA;
-
-  // Return variables for tokenizers
-  var tagName, type;
-
-  function inText(stream, state) {
-    function chain(parser) {
-      state.tokenize = parser;
-      return parser(stream, state);
-    }
-
-    var ch = stream.next();
-    if (ch == "<") {
-      if (stream.eat("!")) {
-        if (stream.eat("[")) {
-          if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
-          else return null;
-        }
-        else if (stream.match("--")) return chain(inBlock("comment", "-->"));
-        else if (stream.match("DOCTYPE", true, true)) {
-          stream.eatWhile(/[\w\._\-]/);
-          return chain(doctype(1));
-        }
-        else return null;
-      }
-      else if (stream.eat("?")) {
-        stream.eatWhile(/[\w\._\-]/);
-        state.tokenize = inBlock("meta", "?>");
-        return "meta";
-      }
-      else {
-        type = stream.eat("/") ? "closeTag" : "openTag";
-        stream.eatSpace();
-        tagName = "";
-        var c;
-        while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
-        state.tokenize = inTag;
-        return "tag";
-      }
-    }
-    else if (ch == "&") {
-      var ok;
-      if (stream.eat("#")) {
-        if (stream.eat("x")) {
-          ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");          
-        } else {
-          ok = stream.eatWhile(/[\d]/) && stream.eat(";");
-        }
-      } else {
-        ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
-      }
-      return ok ? "atom" : "error";
-    }
-    else {
-      stream.eatWhile(/[^&<]/);
-      return null;
-    }
-  }
-
-  function inTag(stream, state) {
-    var ch = stream.next();
-    if (ch == ">" || (ch == "/" && stream.eat(">"))) {
-      state.tokenize = inText;
-      type = ch == ">" ? "endTag" : "selfcloseTag";
-      return "tag";
-    }
-    else if (ch == "=") {
-      type = "equals";
-      return null;
-    }
-    else if (/[\'\"]/.test(ch)) {
-      state.tokenize = inAttribute(ch);
-      return state.tokenize(stream, state);
-    }
-    else {
-      stream.eatWhile(/[^\s\u00a0=<>\"\'\/?]/);
-      return "word";
-    }
-  }
-
-  function inAttribute(quote) {
-    return function(stream, state) {
-      while (!stream.eol()) {
-        if (stream.next() == quote) {
-          state.tokenize = inTag;
-          break;
-        }
-      }
-      return "string";
-    };
-  }
-
-  function inBlock(style, terminator) {
-    return function(stream, state) {
-      while (!stream.eol()) {
-        if (stream.match(terminator)) {
-          state.tokenize = inText;
-          break;
-        }
-        stream.next();
-      }
-      return style;
-    };
-  }
-  function doctype(depth) {
-    return function(stream, state) {
-      var ch;
-      while ((ch = stream.next()) != null) {
-        if (ch == "<") {
-          state.tokenize = doctype(depth + 1);
-          return state.tokenize(stream, state);
-        } else if (ch == ">") {
-          if (depth == 1) {
-            state.tokenize = inText;
-            break;
-          } else {
-            state.tokenize = doctype(depth - 1);
-            return state.tokenize(stream, state);
-          }
-        }
-      }
-      return "meta";
-    };
-  }
-
-  var curState, setStyle;
-  function pass() {
-    for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
-  }
-  function cont() {
-    pass.apply(null, arguments);
-    return true;
-  }
-
-  function pushContext(tagName, startOfLine) {
-    var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);
-    curState.context = {
-      prev: curState.context,
-      tagName: tagName,
-      indent: curState.indented,
-      startOfLine: startOfLine,
-      noIndent: noIndent
-    };
-  }
-  function popContext() {
-    if (curState.context) curState.context = curState.context.prev;
-  }
-
-  function element(type) {
-    if (type == "openTag") {
-      curState.tagName = tagName;
-      return cont(attributes, endtag(curState.startOfLine));
-    } else if (type == "closeTag") {
-      var err = false;
-      if (curState.context) {
-        if (curState.context.tagName != tagName) {
-          if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) {
-            popContext();
-          }
-          err = !curState.context || curState.context.tagName != tagName;
-        }
-      } else {
-        err = true;
-      }
-      if (err) setStyle = "error";
-      return cont(endclosetag(err));
-    }
-    return cont();
-  }
-  function endtag(startOfLine) {
-    return function(type) {
-      if (type == "selfcloseTag" ||
-          (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(curState.tagName.toLowerCase()))) {
-        maybePopContext(curState.tagName.toLowerCase());
-        return cont();
-      }
-      if (type == "endTag") {
-        maybePopContext(curState.tagName.toLowerCase());
-        pushContext(curState.tagName, startOfLine);
-        return cont();
-      }
-      return cont();
-    };
-  }
-  function endclosetag(err) {
-    return function(type) {
-      if (err) setStyle = "error";
-      if (type == "endTag") { popContext(); return cont(); }
-      setStyle = "error";
-      return cont(arguments.callee);
-    };
-  }
-  function maybePopContext(nextTagName) {
-    var parentTagName;
-    while (true) {
-      if (!curState.context) {
-        return;
-      }
-      parentTagName = curState.context.tagName.toLowerCase();
-      if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
-          !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
-        return;
-      }
-      popContext();
-    }
-  }
-
-  function attributes(type) {
-    if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);}
-    if (type == "endTag" || type == "selfcloseTag") return pass();
-    setStyle = "error";
-    return cont(attributes);
-  }
-  function attribute(type) {
-    if (type == "equals") return cont(attvalue, attributes);
-    if (!Kludges.allowMissing) setStyle = "error";
-    return (type == "endTag" || type == "selfcloseTag") ? pass() : cont();
-  }
-  function attvalue(type) {
-    if (type == "string") return cont(attvaluemaybe);
-    if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();}
-    setStyle = "error";
-    return (type == "endTag" || type == "selfCloseTag") ? pass() : cont();
-  }
-  function attvaluemaybe(type) {
-    if (type == "string") return cont(attvaluemaybe);
-    else return pass();
-  }
-
-  return {
-    startState: function() {
-      return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, context: null};
-    },
-
-    token: function(stream, state) {
-      if (stream.sol()) {
-        state.startOfLine = true;
-        state.indented = stream.indentation();
-      }
-      if (stream.eatSpace()) return null;
-
-      setStyle = type = tagName = null;
-      var style = state.tokenize(stream, state);
-      state.type = type;
-      if ((style || type) && style != "comment") {
-        curState = state;
-        while (true) {
-          var comb = state.cc.pop() || element;
-          if (comb(type || style)) break;
-        }
-      }
-      state.startOfLine = false;
-      return setStyle || style;
-    },
-
-    indent: function(state, textAfter, fullLine) {
-      var context = state.context;
-      if ((state.tokenize != inTag && state.tokenize != inText) ||
-          context && context.noIndent)
-        return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
-      if (alignCDATA && /<!\[CDATA\[/.test(textAfter)) return 0;
-      if (context && /^<\//.test(textAfter))
-        context = context.prev;
-      while (context && !context.startOfLine)
-        context = context.prev;
-      if (context) return context.indent + indentUnit;
-      else return 0;
-    },
-
-    electricChars: "/"
-  };
-});
-
-CodeMirror.defineMIME("text/xml", "xml");
-CodeMirror.defineMIME("application/xml", "xml");
-//if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
-//  CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});

+ 6 - 3
esp/src/eclwatch/ECLSourceWidget.js

@@ -67,6 +67,9 @@ define([
             resize: function (args) {
                 this.inherited(arguments);
                 this.borderContainer.resize();
+                if (this.editor) {
+                    this.editor.setSize("100%", "100%");
+                }
             },
 
             layout: function (args) {
@@ -91,14 +94,14 @@ define([
                 this.editor = CodeMirror.fromTextArea(document.getElementById(this.id + "EclCode"), {
                     tabMode: "indent",
                     matchBrackets: true,
-                    gutter: true,
                     lineNumbers: true,
                     mode: mode,
                     readOnly: this.readOnly,
-                    gutter: mode === "xml" ? true : false,
-                    onGutterClick: CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder)
+                    foldGutter: mode === "xml" ? true : false,
+                    gutters: mode === "xml" ? ["CodeMirror-linenumbers", "CodeMirror-foldgutter"] : ["CodeMirror-linenumbers"]
                 });
                 dom.byId(this.id + "EclContent").style.backgroundColor = this.readOnly ? 0xd0d0d0 : 0xffffff;
+                this.editor.setSize("100%", "100%");
 
                 var context = this;
                 if (params.Wuid) {

+ 3 - 2
esp/src/eclwatch/HPCCPlatformWidget.js

@@ -344,12 +344,13 @@ define([
                     context.configSourceCM = CodeMirror.fromTextArea(dom.byId(context.id + "ConfigTextArea"), {
                         tabMode: "indent",
                         matchBrackets: true,
-                        gutter: true,
                         lineNumbers: true,
                         mode: "xml",
                         readOnly: true,
-                        onGutterClick: CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder)
+                        foldGutter: true,
+                        gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
                     });
+                    context.configSourceCM.setSize("100%", "100%");
                     context.configSourceCM.setValue(context.configText);
                 }); 
             }

+ 6 - 3
esp/src/eclwatch/PackageSourceWidget.js

@@ -61,6 +61,9 @@ define([
             resize: function (args) {
                 this.inherited(arguments);
                 this.borderContainer.resize();
+                if (this.editor) {
+                    this.editor.setSize("100%", "100%");
+                }
             },
 
             layout: function (args) {
@@ -75,14 +78,14 @@ define([
                 this.editor = CodeMirror.fromTextArea(document.getElementById(this.id + "XMLCode"), {
                     tabMode: "indent",
                     matchBrackets: true,
-                    gutter: true,
                     lineNumbers: true,
                     mode: this.isXmlContent ? "xml" : "ecl",
                     readOnly: this.readOnly,
-                    gutter: this.isXmlContent ? true : false,
-                    onGutterClick: CodeMirror.newFoldFunction(CodeMirror.tagRangeFinder)
+                    foldGutter: this.isXmlContent ? true : false,
+                    gutters: this.isXmlContent ? ["CodeMirror-linenumbers", "CodeMirror-foldgutter"] : ["CodeMirror-linenumbers"]
                 });
                 dom.byId(this.id + "XMLContent").style.backgroundColor = this.readOnly ? 0xd0d0d0 : 0xffffff;
+                this.editor.setSize("100%", "100%");
 
                 var context = this;
                 if (this.isXmlContent) {

+ 1 - 1
esp/src/eclwatch/templates/ECLSourceWidget.html

@@ -1,6 +1,6 @@
 <div class="${baseClass}">
     <div id="${id}BorderContainer" class="${baseClass}BorderContainer" style="width: 100%; height: 100%; overflow: hidden" data-dojo-props="splitter: false, gutters:false" data-dojo-type="dijit.layout.BorderContainer">
-        <div id="${id}EclContent" class="centerPanel" data-dojo-props="region: 'center'" data-dojo-type="dijit.layout.ContentPane">
+        <div id="${id}EclContent" class="centerPanel" style="padding:0px" data-dojo-props="region: 'center'" data-dojo-type="dijit.layout.ContentPane">
             <textarea id="${id}EclCode">...${i18n.Loading}...</textarea>
         </div>
     </div>

+ 1 - 1
esp/src/eclwatch/templates/PackageSourceWidget.html

@@ -1,6 +1,6 @@
 <div class="${baseClass}">
     <div id="${id}BorderContainer" class="${baseClass}BorderContainer" style="width: 100%; height: 100%; overflow: hidden" data-dojo-props="splitter: false, gutters:false" data-dojo-type="dijit.layout.BorderContainer">
-        <div id="${id}XMLContent" class="centerPanel" data-dojo-props="region: 'center'" data-dojo-type="dijit.layout.ContentPane">
+        <div id="${id}XMLContent" class="centerPanel" style="padding:0px" data-dojo-props="region: 'center'" data-dojo-type="dijit.layout.ContentPane">
             <textarea id="${id}XMLCode">${i18n.Loading}</textarea>
         </div>
     </div>

+ 7 - 5
esp/src/stub.htm

@@ -21,11 +21,13 @@
     <meta charset="utf-8">
     <title>ECL Watch</title>
     <link rel="icon" type="image/png" href="/esp/files/img/favlogo.png">
-    <link href="/esp/files/CodeMirror2/lib/codemirror.css" rel="stylesheet">
-    <script src="/esp/files/CodeMirror2/lib/codemirror.js"></script>
-    <script src="/esp/files/CodeMirror2/lib/util/foldcode.js"></script>
-    <script src="/esp/files/CodeMirror2/mode/ecl/ecl.js"></script>
-    <script src="/esp/files/CodeMirror2/mode/xml/xml.js"></script>
+    <link rel="stylesheet" href="/esp/files/CodeMirror2/lib/codemirror.css">
+    <link rel="stylesheet" href="/esp/files/CodeMirror2/addon/dialog/dialog.css">
+    <link rel="stylesheet" href="/esp/files/CodeMirror2/addon/search/matchesonscrollbar.css">
+    <link rel="stylesheet" href="/esp/files/CodeMirror2/addon/fold/foldgutter.css">
+    <script src="/esp/files/CodeMirror2/codemirror-compressed.js"></script>
+    <script src="/esp/files/CodeMirror2/addon/scroll/annotatescrollbar.js"></script>
+    <script src="/esp/files/CodeMirror2/addon/search/matchesonscrollbar.js"></script>
     <link href="/esp/files/eclwatch/css/ecl.css" rel="stylesheet">
     <link href="/esp/files/dijit/themes/claro/claro.css" media="screen" rel="stylesheet">
     <link href="/esp/files/dojox/grid/resources/Grid.css" rel="stylesheet">