{:uriI"¹file://app/assets/javascripts/admin/codemirror/addon/search/jump-to-line.js?type=application/javascript&pipeline=self&id=e9c0f4df888e17e3a2a592d493d8b182123e38de5eb55122390839aa8b93e936:ET:load_pathI"app/assets/javascripts;T:
filenameI"Iapp/assets/javascripts/admin/codemirror/addon/search/jump-to-line.js;T: nameI"/admin/codemirror/addon/search/jump-to-line;T:logical_pathI"7admin/codemirror/addon/search/jump-to-line.self.js;T:content_typeI"application/javascript;T:sourceI"”// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
// Defines jumpToLine command. Uses dialog.js if present.
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../dialog/dialog"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../dialog/dialog"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
function dialog(cm, text, shortText, deflt, f) {
if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
else f(prompt(shortText, deflt));
}
var jumpDialog =
'Jump to line: (Use line:column or scroll% syntax)';
function interpretLine(cm, string) {
var num = Number(string)
if (/^[-+]/.test(string)) return cm.getCursor().line + num
else return num - 1
}
CodeMirror.commands.jumpToLine = function(cm) {
var cur = cm.getCursor();
dialog(cm, jumpDialog, "Jump to line:", (cur.line + 1) + ":" + cur.ch, function(posStr) {
if (!posStr) return;
var match;
if (match = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(posStr)) {
cm.setCursor(interpretLine(cm, match[1]), Number(match[2]))
} else if (match = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(posStr)) {
var line = Math.round(cm.lineCount() * Number(match[1]) / 100);
if (/^[-+]/.test(match[1])) line = cur.line + line + 1;
cm.setCursor(line - 1, cur.ch);
} else if (match = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(posStr)) {
cm.setCursor(interpretLine(cm, match[1]), cur.ch);
}
});
};
CodeMirror.keyMap["default"]["Alt-G"] = "jumpToLine";
});
;T:
metadata{:dependencieso:Set:
@hash}
I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"Wfile-digest://app/assets/javascripts/admin/codemirror/addon/search/jump-to-line.js;TTF:
requiredo;;} F:stubbedo;;} F:
linkso;;} F:charsetI"
utf-8;F:digest"%ΈÂ|ïðIÀ}2•MÞ¹Æϸ±ðJ(ÃÉeH¼gìDpZ:lengthi”:dependencies_digest"%´Ë1Jy
ý%X$ª›TuÅÉ?;f‚{_
:LjuQº¿äÖ:idI"Ee9c0f4df888e17e3a2a592d493d8b182123e38de5eb55122390839aa8b93e936;F:
mtimel+˜{Ð[