ace 编辑器 git源码

  • q7_965610
    了解作者
  • 8.2MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-06 01:13
    上传日期
ace js 是一个在线的web编辑器,支持c、java、markdown等多种语言
ace-builds-master.zip
内容介绍
"no use strict"; ;(function(window) { if (typeof window.window != "undefined" && window.document) return; if (window.require && window.define) return; if (!window.console) { window.console = function() { var msgs = Array.prototype.slice.call(arguments, 0); postMessage({type: "log", data: msgs}); }; window.console.error = window.console.warn = window.console.log = window.console.trace = window.console; } window.window = window; window.ace = window; window.onerror = function(message, file, line, col, err) { postMessage({type: "error", data: { message: message, data: err.data, file: file, line: line, col: col, stack: err.stack }}); }; window.normalizeModule = function(parentId, moduleName) { // normalize plugin requires if (moduleName.indexOf("!") !== -1) { var chunks = moduleName.split("!"); return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]); } // normalize relative requires if (moduleName.charAt(0) == ".") { var base = parentId.split("/").slice(0, -1).join("/"); moduleName = (base ? base + "/" : "") + moduleName; while (moduleName.indexOf(".") !== -1 && previous != moduleName) { var previous = moduleName; moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); } } return moduleName; }; window.require = function require(parentId, id) { if (!id) { id = parentId; parentId = null; } if (!id.charAt) throw new Error("worker.js require() accepts only (parentId, id) as arguments"); id = window.normalizeModule(parentId, id); var module = window.require.modules[id]; if (module) { if (!module.initialized) { module.initialized = true; module.exports = module.factory().exports; } return module.exports; } if (!window.require.tlns) return console.log("unable to load " + id); var path = resolveModuleId(id, window.require.tlns); if (path.slice(-3) != ".js") path += ".js"; window.require.id = id; window.require.modules[id] = {}; // prevent infinite loop on broken modules importScripts(path); return window.require(parentId, id); }; function resolveModuleId(id, paths) { var testPath = id, tail = ""; while (testPath) { var alias = paths[testPath]; if (typeof alias == "string") { return alias + tail; } else if (alias) { return alias.location.replace(/\/*$/, "/") + (tail || alias.main || alias.name); } else if (alias === false) { return ""; } var i = testPath.lastIndexOf("/"); if (i === -1) break; tail = testPath.substr(i) + tail; testPath = testPath.slice(0, i); } return id; } window.require.modules = {}; window.require.tlns = {}; window.define = function(id, deps, factory) { if (arguments.length == 2) { factory = deps; if (typeof id != "string") { deps = id; id = window.require.id; } } else if (arguments.length == 1) { factory = id; deps = []; id = window.require.id; } if (typeof factory != "function") { window.require.modules[id] = { exports: factory, initialized: true }; return; } if (!deps.length) // If there is no dependencies, we inject "require", "exports" and // "module" as dependencies, to provide CommonJS compatibility. deps = ["require", "exports", "module"]; var req = function(childId) { return window.require(id, childId); }; window.require.modules[id] = { exports: {}, factory: function() { var module = this; var returnExports = factory.apply(this, deps.map(function(dep) { switch (dep) { // Because "require", "exports" and "module" aren't actual // dependencies, we must handle them seperately. case "require": return req; case "exports": return module.exports; case "module": return module; // But for all other dependencies, we can just go ahead and // require them. default: return req(dep); } })); if (returnExports) module.exports = returnExports; return module; } }; }; window.define.amd = {}; require.tlns = {}; window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { for (var i in topLevelNamespaces) require.tlns[i] = topLevelNamespaces[i]; }; window.initSender = function initSender() { var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter; var oop = window.require("ace/lib/oop"); var Sender = function() {}; (function() { oop.implement(this, EventEmitter); this.callback = function(data, callbackId) { postMessage({ type: "call", id: callbackId, data: data }); }; this.emit = function(name, data) { postMessage({ type: "event", name: name, data: data }); }; }).call(Sender.prototype); return new Sender(); }; var main = window.main = null; var sender = window.sender = null; window.onmessage = function(e) { var msg = e.data; if (msg.event && sender) { sender._signal(msg.event, msg.data); } else if (msg.command) { if (main[msg.command]) main[msg.command].apply(main, msg.args); else if (window[msg.command]) window[msg.command].apply(window, msg.args); else throw new Error("Unknown command:" + msg.command); } else if (msg.init) { window.initBaseUrls(msg.tlns); require("ace/lib/es5-shim"); sender = window.sender = window.initSender(); var clazz = require(msg.module)[msg.classname]; main = window.main = new clazz(sender); } }; })(this); define("ace/lib/oop",["require","exports","module"], function(require, exports, module) { "use strict"; exports.inherits = function(ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; exports.mixin = function(obj, mixin) { for (var key in mixin) { obj[key] = mixin[key]; } return obj; }; exports.implement = function(proto, mixin) { exports.mixin(proto, mixin); }; }); define("ace/range",["require","exports","module"], function(require, exports, module) { "use strict"; var comparePoints = function(p1, p2) { return p1.row - p2.row || p1.column - p2.column; }; var Range = function(startRow, startColumn, endRow, endColumn) { this.start = { row: startRow, column: startColumn }; this.end = { row: endRow, column: endColumn }; }; (function() { this.isEqual = function(range) { return this.start.row === range.start.row && this.end.row === range.end.row && this.start.column === range.start.column && this.end.column === range.end.column; }; this.toString = function() { return ("Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]"); }; this.contains = function(row, column) { return this.compare(row, column)
评论
    相关推荐
    • atombook:Atom.io 编辑器的 Gitbook 集成
      原子书 Atom.io 编辑器的集成。
    • Splitdown, 像 Markdown 编辑器替换一样的Ghost.zip
      Splitdown, 像 Markdown 编辑器替换一样的Ghost #Splitdown WordPress的Markdown 编辑器替换安装将插件克隆到插件目录中,通常位于内容/插件。你需要运行 git submodule init 和 git submodule update 来拉 show
    • svgeditor:SVG模式编辑器上的React
      Svg Shcema编辑器 在react svg + redux上进行的原理图编辑器。 版本转换为Immutable.js 事件处理的概念已经改变。 现在,这些组件不处理事件,而是将其转变为高级操作。 所有mouseDown,mouseUp,mouseMove事件均按...
    • mobile 注册表编辑器
      可以查看mobile手机的注册表,相当于windows上面的redegit
    • atom-git-grep:原子编辑器中的git-grep
      原子编辑器中的git grep 。 安装 apm install git-grep 如何使用 根据需要设置keybind.cson。 ' .workspace ' : ' cmd-k cmd-g ' : ' git-grep:grep ' # default git grep根始终是工作空间的当前根。
    • Atom-git-blame,Atom编辑器插件。切换Git.zip
      Atom-git-blame.zip,Plugin for Atom Editor. Toggle git-blame annotations for the current file in the gutter.怪罪,atom是一个用web技术构建的开源文本编辑器
    • livelesson-git
      git commit :打开文本编辑器以编写提交消息 git commit -m "MESSAGE" :将MESSAGE作为提交写入,而没有文本编辑器 git log :显示我们提交的日志(历史) git log --oneline :显示较短的git log --oneline提交 ...
    • Atom-git-commit-atom,在当前atom窗格中轻松编辑git提交消息.zip
      Atom-git-commit-atom.zip,在当前atom窗格中轻松编辑git提交消息git提交原子,atom是一个用web技术构建的开源文本编辑器
    • git_kv_store_tutorial:探索git
      探索Git:从git init到KV商店 ...如果我们在编辑器中检出.git子目录: $ tree .git .git ├── branches ├── config ├── description ├── HEAD ├── hooks │ ├── applypatch-msg.samp
    • EditAndPublishArticle编辑器
      作者zhaoquntao,源码EditAndPublishArticle,虽然编辑和发布文章,现在很少app用到.由于公司的项目中用到了,我把这部门内容分离出来,写了一个demo分享给大家,还有一些需要完善的地方,多谢理解. gihub:/zhaoquntao/...