Вход Регистрация
Файл: upload/admin/view/javascript/ckeditor/plugins/codemirror/js/util/overlay.js
Строк: 75
<?php
// Utility function that allows modes to be combined. The mode given
// as the base argument takes care of most of the normal mode
// functionality, but a second (typically simple) mode is used, which
// can override the style of text. Both modes get to parse all of the
// text, but when both assign a non-null style to a piece of code, the
// overlay wins, unless the combine argument was true, in which case
// the styles are combined.

// overlayParser is the old, deprecated name
CodeMirror.overlayMode CodeMirror.overlayParser = function(baseoverlaycombine) {
  return {
    
startState: function() {
      return {
        
baseCodeMirror.startState(base),
        
overlayCodeMirror.startState(overlay),
        
basePos0baseCurnull,
        
overlayPos0overlayCurnull
      
};
    },
    
copyState: function(state) {
      return {
        
baseCodeMirror.copyState(basestate.base),
        
overlayCodeMirror.copyState(overlaystate.overlay),
        
basePosstate.basePosbaseCurnull,
        
overlayPosstate.overlayPosoverlayCurnull
      
};
    },

    
token: function(streamstate) {
      if (
stream.start == state.basePos) {
        
state.baseCur base.token(streamstate.base);
        
state.basePos stream.pos;
      }
      if (
stream.start == state.overlayPos) {
        
stream.pos stream.start;
        
state.overlayCur overlay.token(streamstate.overlay);
        
state.overlayPos stream.pos;
      }
      
stream.pos Math.min(state.basePosstate.overlayPos);
      if (
stream.eol()) state.basePos state.overlayPos 0;

      if (
state.overlayCur == null) return state.baseCur;
      if (
state.baseCur != null && combine) return state.baseCur " " state.overlayCur;
      else return 
state.overlayCur;
    },
    
    
indentbase.indent && function(statetextAfter) {
      return 
base.indent(state.basetextAfter);
    },
    
electricCharsbase.electricChars,

    
innerMode: function(state) { return {statestate.basemodebase}; },
    
    
blankLine: function(state) {
      if (
base.blankLinebase.blankLine(state.base);
      if (
overlay.blankLineoverlay.blankLine(state.overlay);
    }
  };
};
?>
Онлайн: 0
Реклама