Вход Регистрация
Файл: upload/admin/view/javascript/ckeditor/plugins/codemirror/js/util/continuecomment.js
Строк: 89
<?php
(function() {
  var 
modes = ["clike""css""javascript"];
  for (var 
0modes.length; ++i)
    
CodeMirror.extendMode(modes[i], {blockCommentStart"/*",
                                     
blockCommentEnd"*/",
                                     
blockCommentContinue" * "});

  
CodeMirror.commands.newlineAndIndentContinueComment = function(cm) {
    var 
pos cm.getCursor(), token cm.getTokenAt(pos);
    var 
mode CodeMirror.innerMode(cm.getMode(), token.state).mode;
    var 
space;

    if (
token.type == "comment" && mode.blockCommentStart) {
      var 
end token.string.indexOf(mode.blockCommentEnd);
      var 
full cm.getRange({linepos.linech0}, {linepos.linechtoken.end}), found;
      if (
end != -&& end == token.string.length mode.blockCommentEnd.length) {
        
// Comment ended, don't continue it
      
} else if (token.string.indexOf(mode.blockCommentStart) == 0) {
        
space full.slice(0token.start);
        if (!/^
s*$/.test(space)) {
          
space "";
          for (var 
0token.start; ++ispace += " ";
        }
      } else if ((
found full.indexOf(mode.blockCommentContinue)) != -&&
                 
found mode.blockCommentContinue.length token.start &&
                 /^
s*$/.test(full.slice(0found))) {
        
space full.slice(0found);
      }
    }

    if (
space != null)
      
cm.replaceSelection("n" space mode.blockCommentContinue"end");
    else
      
cm.execCommand("newlineAndIndent");
  };
})();
?>
Онлайн: 0
Реклама