Вход Регистрация
Файл: upload/admin/view/javascript/ckeditor/plugins/codemirror/js/util/runmode.js
Строк: 56
<?php
CodeMirror
.runMode = function(stringmodespeccallbackoptions) {
  var 
mode CodeMirror.getMode(CodeMirror.defaultsmodespec);

  if (
callback.nodeType == 1) {
    var 
tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
    var 
node callbackcol 0;
    
node.innerHTML "";
    
callback = function(textstyle) {
      if (
text == "n") {
        
node.appendChild(document.createElement("br"));
        
col 0;
        return;
      }
      var 
content "";
      
// replace tabs
      
for (var pos 0;;) {
        var 
idx text.indexOf("t"pos);
        if (
idx == -1) {
          
content += text.slice(pos);
          
col += text.length pos;
          break;
        } else {
          
col += idx pos;
          
content += text.slice(posidx);
          var 
size tabSize col tabSize;
          
col += size;
          for (var 
0size; ++icontent += " ";
          
pos idx 1;
        }
      }

      if (
style) {
        var 
sp node.appendChild(document.createElement("span"));
        
sp.className "cm-" style.replace(/ +/g" cm-");
        
sp.appendChild(document.createTextNode(content));
      } else {
        
node.appendChild(document.createTextNode(content));
      }
    };
  }

  var 
lines CodeMirror.splitLines(string), state CodeMirror.startState(mode);
  for (var 
0lines.lengthe; ++i) {
    if (
icallback("n");
    var 
stream = new CodeMirror.StringStream(lines[i]);
    while (!
stream.eol()) {
      var 
style mode.token(streamstate);
      
callback(stream.current(), styleistream.start);
      
stream.start stream.pos;
    }
  }
};
?>
Онлайн: 0
Реклама