Farabi

 view release on metacpan or  search on metacpan

lib/Farabi/files/public/assets/codemirror/lib/codemirror.js  view on Meta::CPAN

230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
  d.maxLineChanged = false;
 
  // Used for measuring wheel scrolling granularity
  d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;
 
  // True when shift is held down.
  d.shift = false;
 
  // Used to track whether anything happened since the context menu
  // was opened.
  d.selForContextMenu = null;
}
 
// STATE UPDATES
 
// Used to get the editor into a consistent state again when options change.
 
function loadMode(cm) {
  cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);
  resetModeState(cm);
}

lib/Farabi/files/public/assets/codemirror/lib/codemirror.js  view on Meta::CPAN

2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
// Work around nonsensical selection resetting in IE9/10
if (ie && !ie_upto8 && cm.display.inputHasSelection === text) {
  resetInput(cm);
  return false;
}
 
var withOp = !cm.curOp;
if (withOp) startOperation(cm);
cm.display.shift = false;
 
if (text.charCodeAt(0) == 0x200b && doc.sel == cm.display.selForContextMenu && !prevInput)
  prevInput = "\u200b";
// Find the part of the input that is actually new
var same = 0, l = Math.min(prevInput.length, text.length);
while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;
var inserted = text.slice(same), textLines = splitLines(inserted);
 
// When pasing N lines into N selections, insert one line per selection
var multiPaste = cm.state.pasteIncoming && textLines.length > 1 && doc.sel.ranges.length == textLines.length;
 
// Normal behavior is to insert the new text into every selection

lib/Farabi/files/public/assets/codemirror/lib/codemirror.js  view on Meta::CPAN

2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
  }));
else
  on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });
// Prevent normal selection in the editor (we handle our own)
on(d.lineSpace, "selectstart", function(e) {
  if (!eventInWidget(d, e)) e_preventDefault(e);
});
// Some browsers fire contextmenu *after* opening the menu, at
// which point we can't mess with it anymore. Context menu is
// handled in onMouseDown for these browsers.
if (!captureRightClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);});
 
// Sync scrolling between fake scrollbars and real scrollable
// area, ensure viewport is updated when scrolling.
on(d.scroller, "scroll", function() {
  if (d.scroller.clientHeight) {
    setScrollTop(cm, d.scroller.scrollTop);
    setScrollLeft(cm, d.scroller.scrollLeft, true);
    signal(cm, "scroll", cm);
  }
});

lib/Farabi/files/public/assets/codemirror/lib/codemirror.js  view on Meta::CPAN

2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
    else if (e_target(e) == display.scroller)
      e_preventDefault(e);
    break;
  case 2:
    if (webkit) cm.state.lastMiddleDown = +new Date;
    if (start) extendSelection(cm.doc, start);
    setTimeout(bind(focusInput, cm), 20);
    e_preventDefault(e);
    break;
  case 3:
    if (captureRightClick) onContextMenu(cm, e);
    break;
  }
}
 
var lastClick, lastDoubleClick;
function leftButtonDown(cm, e, start) {
  setTimeout(bind(ensureFocus, cm), 0);
 
  var now = +new Date, type;
  if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {

lib/Farabi/files/public/assets/codemirror/lib/codemirror.js  view on Meta::CPAN

3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
function onFocus(cm) {
  if (cm.options.readOnly == "nocursor") return;
  if (!cm.state.focused) {
    signal(cm, "focus", cm);
    cm.state.focused = true;
    addClass(cm.display.wrapper, "CodeMirror-focused");
    // The prevInput test prevents this from firing when a context
    // menu is closed (since the resetInput would kill the
    // select-all detection hack)
    if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {
      resetInput(cm);
      if (webkit) setTimeout(bind(resetInput, cm, true), 0); // Issue #1730
    }
  }
  slowPoll(cm);
  restartBlink(cm);
}
function onBlur(cm) {
  if (cm.state.focused) {
    signal(cm, "blur", cm);

lib/Farabi/files/public/assets/codemirror/lib/codemirror.js  view on Meta::CPAN

3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
  }
  clearInterval(cm.display.blinker);
  setTimeout(function() {if (!cm.state.focused) cm.display.shift = false;}, 150);
}
 
// CONTEXT MENU HANDLING
 
// To make the context menu work, we need to briefly unhide the
// textarea (making it as unobtrusive as possible) to let the
// right-click take effect on it.
function onContextMenu(cm, e) {
  if (signalDOMEvent(cm, e, "contextmenu")) return;
  var display = cm.display;
  if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;
 
  var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;
  if (!pos || presto) return; // Opera is difficult.
 
  // Reset the current text selection only if the click is done outside of the selection
  // and 'resetSelectionOnContextMenu' option is true.
  var reset = cm.options.resetSelectionOnContextMenu;
  if (reset && cm.doc.sel.contains(pos) == -1)
    operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);
 
  var oldCSS = display.input.style.cssText;
  display.inputDiv.style.position = "absolute";
  display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) +
    "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: " +
    (ie ? "rgba(255, 255, 255, .05)" : "transparent") +
    "; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
  focusInput(cm);
  resetInput(cm);
  // Adds "Select all" to context menu in FF
  if (!cm.somethingSelected()) display.input.value = display.prevInput = " ";
  display.selForContextMenu = cm.doc.sel;
  clearTimeout(display.detectingSelectAll);
 
  // Select-all will be greyed out if there's nothing to select, so
  // this adds a zero-width space so that we can later check whether
  // it got selected.
  function prepareSelectAllHack() {
    if (display.input.selectionStart != null) {
      var selected = cm.somethingSelected();
      var extval = display.input.value = "\u200b" + (selected ? display.input.value : "");
      display.prevInput = selected ? "" : "\u200b";
      display.input.selectionStart = 1; display.input.selectionEnd = extval.length;
      // Re-set this, in case some other handler touched the
      // selection in the meantime.
      display.selForContextMenu = cm.doc.sel;
    }
  }
  function rehide() {
    display.inputDiv.style.position = "relative";
    display.input.style.cssText = oldCSS;
    if (ie_upto8) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos;
    slowPoll(cm);
 
    // Try to detect the user choosing select-all
    if (display.input.selectionStart != null) {
      if (!ie || ie_upto8) prepareSelectAllHack();
      var i = 0, poll = function() {
        if (display.selForContextMenu == cm.doc.sel && display.input.selectionStart == 0)
          operation(cm, commands.selectAll)(cm);
        else if (i++ < 10) display.detectingSelectAll = setTimeout(poll, 500);
        else resetInput(cm);
      };
      display.detectingSelectAll = setTimeout(poll, 200);
    }
  }
 
  if (ie && !ie_upto8) prepareSelectAllHack();
  if (captureRightClick) {

lib/Farabi/files/public/assets/codemirror/lib/codemirror.js  view on Meta::CPAN

3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
    var mouseup = function() {
      off(window, "mouseup", mouseup);
      setTimeout(rehide, 20);
    };
    on(window, "mouseup", mouseup);
  } else {
    setTimeout(rehide, 50);
  }
}
 
function contextMenuInGutter(cm, e) {
  if (!hasHandler(cm, "gutterContextMenu")) return false;
  return gutterEvent(cm, e, "gutterContextMenu", false, signal);
}
 
// UPDATING
 
// Compute the position of the end of a change (its 'to' property
// refers to the pre-change end).
var changeEnd = CodeMirror.changeEnd = function(change) {
  if (!change.text) return change.to;
  return Pos(change.from.line + change.text.length - 1,
             lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0));

lib/Farabi/files/public/assets/codemirror/lib/codemirror.js  view on Meta::CPAN

3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
  if (changeHandler || changesHandler) {
    var obj = {
      from: from, to: to,
      text: change.text,
      removed: change.removed,
      origin: change.origin
    };
    if (changeHandler) signalLater(cm, "change", cm, obj);
    if (changesHandler) (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj);
  }
  cm.display.selForContextMenu = null;
}
 
function replaceRange(doc, code, from, to, origin) {
  if (!to) to = from;
  if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp; }
  if (typeof code == "string") code = splitLines(code);
  makeChange(doc, {from: from, to: to, text: code, origin: origin});
}
 
// SCROLLING THINGS INTO VIEW

lib/Farabi/files/public/assets/codemirror/lib/codemirror.js  view on Meta::CPAN

4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
}, true);
option("coverGutterNextToScrollbar", false, updateScrollbars, true);
option("lineNumbers", false, function(cm) {
  setGuttersForLineNumbers(cm.options);
  guttersChanged(cm);
}, true);
option("firstLineNumber", 1, guttersChanged, true);
option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true);
option("showCursorWhenSelecting", false, updateSelection, true);
 
option("resetSelectionOnContextMenu", true);
 
option("readOnly", false, function(cm, val) {
  if (val == "nocursor") {
    onBlur(cm);
    cm.display.input.blur();
    cm.display.disabled = true;
  } else {
    cm.display.disabled = false;
    if (!val) resetInput(cm);
  }

lib/Farabi/files/public/assets/jshint/jshint-1.1.0.js  view on Meta::CPAN

206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
require.define("/node_modules/underscore/package.json",Function(['require','module','exports','__dirname','__filename','process','global'],"module.exports = {\"main\":\"underscore.js\"}\n//@ sourceURL=/node_modules/underscore/package.json"
));
 
require.define("/node_modules/underscore/underscore.js",Function(['require','module','exports','__dirname','__filename','process','global'],"//     Underscore.js 1.4.4\n//     http://underscorejs.org\n//     (c) 2009-2013 Jeremy Ashkenas, DocumentClo...
));
 
require.define("events",Function(['require','module','exports','__dirname','__filename','process','global'],"if (!process.EventEmitter) process.EventEmitter = function () {};\n\nvar EventEmitter = exports.EventEmitter = process.EventEmitter;\nvar isA...
));
 
require.define("/src/shared/vars.js",Function(['require','module','exports','__dirname','__filename','process','global'],"// jshint -W001\n\n\"use strict\";\n\n// Identifiers provided by the ECMAScript standard.\n\nexports.reservedVars = {\n\targumen...
));
 
require.define("/src/shared/messages.js",Function(['require','module','exports','__dirname','__filename','process','global'],"\"use strict\";\n\nvar _ = require(\"underscore\");\n\nvar errors = {\n\t// JSHint options\n\tE001: \"Bad option: '{a}'.\",\...
));
 
require.define("/src/stable/lex.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*\n * Lexical analysis and token construction.\n */\n\n\"use strict\";\n\nvar _      = require(\"underscore\");\nvar events = re...
));
 
require.define("/src/stable/reg.js",Function(['require','module','exports','__dirname','__filename','process','global'],"/*\n * Regular expressions. Some of these are stupidly long.\n */\n\n/*jshint maxlen:1000 */\n\n\"use string\";\n\n// Unsafe comm...
));



( run in 0.350 second using v1.01-cache-2.11-cpan-26ccb49234f )