PHP 8.1.33
Preview: runmode.js Size: 1.63 KB
/home/jambtst2015/public_html/ida.org.ng/wp-content/plugins/advanced-code-editor/js/runmode.js

CodeMirror.runMode = function(string, modespec, callback, options) {
  function esc(str) {
    return str.replace(/[<&]/, function(ch) { return ch == "<" ? "&lt;" : "&amp;"; });
  }

  var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
  var isNode = callback.nodeType == 1;
  var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
  if (isNode) {
    var node = callback, accum = [], col = 0;
    callback = function(text, style) {
      if (text == "\n") {
        accum.push("<br>");
        col = 0;
        return;
      }
      var escaped = "";
      // HTML-escape and replace tabs
      for (var pos = 0;;) {
        var idx = text.indexOf("\t", pos);
        if (idx == -1) {
          escaped += esc(text.slice(pos));
          col += text.length - pos;
          break;
        } else {
          col += idx - pos;
          escaped += esc(text.slice(pos, idx));
          var size = tabSize - col % tabSize;
          col += size;
          for (var i = 0; i < size; ++i) escaped += " ";
          pos = idx + 1;
        }
      }

      if (style) 
        accum.push("<span class=\"cm-" + esc(style) + "\">" + escaped + "</span>");
      else
        accum.push(escaped);
    };
  }
  var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
  for (var i = 0, e = lines.length; i < e; ++i) {
    if (i) callback("\n");
    var stream = new CodeMirror.StringStream(lines[i]);
    while (!stream.eol()) {
      var style = mode.token(stream, state);
      callback(stream.current(), style, i, stream.start);
      stream.start = stream.pos;
    }
  }
  if (isNode)
    node.innerHTML = accum.join("");
};

Directory Contents

Dirs: 0 × Files: 18

Name Size Perms Modified Actions
123 B lrw-r--r-- 2024-11-22 17:53:09
Edit Download
1.02 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
10.56 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
126.71 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
84.84 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
21.10 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
6.16 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
12.50 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
2.91 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
5.26 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
12.60 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
1.98 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
5.96 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
1.63 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
4.95 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
4.69 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
4.02 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download
9.68 KB lrw-r--r-- 2024-11-22 17:53:09
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).