// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE
// This is CodeMirror (https://codemirror.net), a code editor
// implemented in JavaScript on top of the browser's DOM.
//
// You can find some technical background for some of the code below
// at http://marijnhaverbeke.nl/blog/#cm-internals .
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.CodeMirror = factory());
}(this, (function () { 'use strict';
// Kludges for bugs and behavior differences that can't be feature
// detected are enabled based on userAgent etc sniffing.
var userAgent = navigator.userAgent;
var platform = navigator.platform;
var gecko = /gecko\/\d/i.test(userAgent);
var ie_upto10 = /MSIE \d/.test(userAgent);
var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent);
var edge = /Edge\/(\d+)/.exec(userAgent);
var ie = ie_upto10 || ie_11up || edge;
var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);
var webkit = !edge && /WebKit\//.test(userAgent);
var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent);
var chrome = !edge && /Chrome\//.test(userAgent);
var presto = /Opera\//.test(userAgent);
var safari = /Apple Computer/.test(navigator.vendor);
var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
var phantom = /PhantomJS/.test(userAgent);
var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent);
var android = /Android/.test(userAgent);
// This is woefully incomplete. Suggestions for alternative methods welcome.
var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);
var mac = ios || /Mac/.test(platform);
var chromeOS = /\bCrOS\b/.test(userAgent);
var windows = /win/i.test(platform);
var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/);
if (presto_version) { presto_version = Number(presto_version[1]); }
if (presto_version && presto_version >= 15) { presto = false; webkit = true; }
// Some browsers use the wrong event properties to signal cmd/ctrl on OS X
var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));
var captureRightClick = gecko || (ie && ie_version >= 9);
function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") }
var rmClass = function(node, cls) {
var current = node.className;
var match = classTest(cls).exec(current);
if (match) {
var after = current.slice(match.index + match[0].length);
node.className = current.slice(0, match.index) + (after ? match[1] + after : "");
}
};
function removeChildren(e) {
for (var count = e.childNodes.length; count > 0; --count)
{ e.removeChild(e.firstChild); }
return e
}
function removeChildrenAndAdd(parent, e) {
return removeChildren(parent).appendChild(e)
}
function elt(tag, content, className, style) {
var e = document.createElement(tag);
if (className) { e.className = className; }
if (style) { e.style.cssText = style; }
if (typeof content == "string") { e.appendChild(document.createTextNode(content)); }
else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }
return e
}
// wrapper for elt, which removes the elt from the accessibility tree
function eltP(tag, content, className, style) {
var e = elt(tag, content, className, style);
e.setAttribute("role", "presentation");
return e
}
var range;
if (document.createRange) { range = function(node, start, end, endNode) {
var r = document.createRange();
r.setEnd(endNode || node, end);
r.setStart(node, start);
return r
}; }
else { range = function(node, start, end) {
var r = document.body.createTextRange();
try { r.moveToElementText(node.parentNode); }
catch(e) { return r }
r.collapse(true);
r.moveEnd("character", end);
r.moveStart("character", start);
return r
}; }
function contains(parent, child) {
if (child.nodeType == 3) // Android browser always returns false when child is a textnode
{ child = child.parentNode; }
if (parent.contains)
{ return parent.contains(child) }
do {
if (child.nodeType == 11) { child = child.host; }
if (child == parent) { return true }
} while (child = child.parentNode)
}
function activeElt() {
// IE and Edge may throw an "Unspecified Error" when accessing document.activeElement.
// IE < 10 will throw when accessed while the page is loading or in an iframe.
// IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.
var activeElement;
try {
activeElement = document.activeElement;
} catch(e) {
activeElement = document.body || null;
}
while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
{ activeElement = activeElement.shadowRoot.activeElement; }
return activeElement
}
function addClass(node, cls) {
var current = node.className;
if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls; }
}
function joinClasses(a, b) {
var as = a.split(" ");
for (var i = 0; i < as.length; i++)
{ if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i]; } }
return b
}
var selectInput = function(node) { node.select(); };
if (ios) // Mobile Safari apparently has a bug where select() is broken.
{ selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }
else if (ie) // Suppress mysterious IE10 errors
{ selectInput = function(node) { try { node.select(); } catch(_e) {} }; }
function bind(f) {
var args = Array.prototype.slice.call(arguments, 1);
return function(){return f.apply(null, args)}
}
function copyObj(obj, target, overwrite) {
if (!target) { target = {}; }
for (var prop in obj)
{ if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
{ target[prop] = obj[prop]; } }
return target
}
// Counts the column offset in a string, taking tabs into account.
// Used mostly to find indentation.
function countColumn(string, end, tabSize, startIndex, startValue) {
if (end == null) {
end = string.search(/[^\s\u00a0]/);
if (end == -1) { end = string.length; }
}
for (var i = startIndex || 0, n = startValue || 0;;) {
var nextTab = string.indexOf("\t", i);
if (nextTab < 0 || nextTab >= end)
{ return n + (end - i) }
n += nextTab - i;
n += tabSize - (n % tabSize);
i = nextTab + 1;
}
}
var Delayed = function() {this.id = null;};
Delayed.prototype.set = function (ms, f) {
clearTimeout(this.id);
this.id = setTimeout(f, ms);
};
function indexOf(array, elt) {
for (var i = 0; i < array.length; ++i)
{ if (array[i] == elt) { return i } }
return -1
}
// Number of pixels added to scroller and sizer to hide scrollbar
var scrollerGap = 30;
// Returned or thrown by various protocols to signal 'I'm not
// handling this'.
var Pass = {toString: function(){return "CodeMirror.Pass"}};
// Reused option objects for setSelection & friends
var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"};
// The inverse of countColumn -- find the offset that corresponds to
// a particular column.
function findColumn(string, goal, tabSize) {
for (var pos = 0, col = 0;;) {
var nextTab = string.indexOf("\t", pos);
if (nextTab == -1) { nextTab = string.length; }
var skipped = nextTab - pos;
if (nextTab == string.length || col + skipped >= goal)
{ return pos + Math.min(skip
没有合适的资源?快使用搜索试试~ 我知道了~
codemirror支持中文数据库模式表字段SQL自动代码提示
共325个文件
js:250个
css:67个
md:3个
5星 · 超过95%的资源 需积分: 5 46 下载量 157 浏览量
2020-03-25
16:28:03
上传
评论 1
收藏 825KB RAR 举报
温馨提示
codemirror的sql代码提示默认是不支持中文表名自动提示的,在源码中写法只是检索字母数字下划线,加上中文匹配的正则后,终于支持中文表了。修改文件只有sql.js,其他文件只是为了方便打断点,格式化了一下方法
资源推荐
资源详情
资源评论
收起资源包目录
codemirror支持中文数据库模式表字段SQL自动代码提示 (325个子文件)
AUTHORS 10KB
ambiance.css 26KB
codemirror.css 8KB
solarized.css 5KB
mdn-like.css 5KB
liquibyte.css 4KB
merge.css 3KB
xq-dark.css 3KB
lint.css 3KB
duotone-light.css 3KB
lesser-dark.css 3KB
duotone-dark.css 3KB
icecoder.css 2KB
material.css 2KB
pastel-on-dark.css 2KB
darcula.css 2KB
shadowfox.css 2KB
ttcn.css 2KB
tomorrow-night-eighties.css 2KB
erlang-dark.css 2KB
oceanic-next.css 2KB
xq-light.css 2KB
monokai.css 2KB
twilight.css 2KB
vibrant-ink.css 2KB
base16-light.css 2KB
mbo.css 2KB
base16-dark.css 2KB
paraiso-light.css 2KB
paraiso-dark.css 2KB
3024-night.css 2KB
midnight.css 2KB
dracula.css 2KB
seti.css 2KB
zenburn.css 2KB
3024-day.css 2KB
abcdef.css 2KB
the-matrix.css 2KB
blackboard.css 2KB
lucario.css 2KB
yeti.css 2KB
tern.css 2KB
panda-syntax.css 2KB
rubyblue.css 2KB
tomorrow-night-bright.css 2KB
night.css 2KB
gruvbox-dark.css 2KB
cobalt.css 2KB
colorforth.css 2KB
idea.css 2KB
railscasts.css 1KB
hopscotch.css 1KB
isotope.css 1KB
bespin.css 1KB
simplescrollbars.css 1KB
eclipse.css 1KB
neo.css 947B
elegant.css 781B
ssms.css 751B
neat.css 688B
show-hint.css 623B
dialog.css 507B
tiki.css 439B
foldgutter.css 435B
tiddlywiki.css 220B
matchesonscrollbar.css 188B
fullscreen.css 116B
ambiance-mobile.css 103B
index.html 2KB
codemirror.js 385KB
vim.js 209KB
perl.js 55KB
sql.js 46KB
stylus.js 41KB
css.js 37KB
merge.js 37KB
javascript.js 36KB
clike.js 35KB
markdown.js 30KB
position_measurement.js 28KB
sublime.js 25KB
tern.js 24KB
verilog.js 24KB
methods.js 21KB
erlang.js 18KB
ContentEditableInput.js 18KB
php.js 18KB
slim.js 18KB
haxe.js 17KB
rst.js 17KB
Doc.js 17KB
show-hint.js 16KB
pug.js 16KB
xquery.js 15KB
meta.js 15KB
mouse_events.js 15KB
sas.js 15KB
clojure.js 15KB
idl.js 15KB
python.js 14KB
共 325 条
- 1
- 2
- 3
- 4
资源评论
- weixin_438537852021-07-02谢谢,可以使用
吕驴驴
- 粉丝: 4538
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 重启进行BIOS快捷方式,不需要开机按BIOS键
- 威纶通触摸屏编程软件Easy builder pro V6.09.01.556安装包(2024.04).txt
- WindowsAdminCenter
- 老飞飞搭建基础通用数据库V19数据库.rar
- jquery.js
- 机械设计多工位ACF贴胶带&预压设备sw18可编辑非常好的设计图纸100%好用.zip
- 基于Pytorch复现Point-Transformer,用于ShapeNet数据集点云分割
- 【医学影像分析】2D超声图像的分割检测(Ultrasound Nerve Segmentation - Kaggle数据集)
- 嘎嘎香的五款神仙谷歌插件
- .arch书源导入教程.mp4
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功