diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 062af59c..c44edcb0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,9 +7,16 @@ Feel free to fork and improve/enhance Ace any way you want. If you feel that the There are two versions of the agreement: -1. [The Individual CLA](https://docs.google.com/a/c9.io/forms/d/1MfmfrxqD_PNlNsuK0lC2KSelRLxGLGfh_wEcG0ijVvo/viewform): use this version if you're working on the Cloud9 SDK or open source projects in your spare time, or can clearly claim ownership of copyright in what you'll be submitting. -2. [The Corporate CLA](https://docs.google.com/a/c9.io/forms/d/1vFejn4111GdnCNuQ6BfnJDaxdsUEMD4KCo1ayovAfu0/viewform): have your corporate lawyer review and submit this if your company is going to be contributing to the Cloud9 SDK and/or open source projects. +1. [The Individual CLA](https://github.com/ajaxorg/ace/raw/master/doc/Contributor_License_Agreement-v2.pdf): use this version if you're working on an ajax.org in your spare time, or can clearly claim ownership of copyright in what you'll be submitting. +2. [The Corporate CLA](https://github.com/ajaxorg/ace/raw/master/doc/Corporate_Contributor_License_Agreement-v2.pdf): have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects -If you want to contribute to the Cloud9 SDK and/or open source projects please go to the online form, fill it out and submit it. +If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax to us or send it back scanned (or as a photo) by email. -Happy coding, Cloud9 +Email: ace+cla@c9.io + +Fax: +31 (0) 206388953 + +Address: Ajax.org B.V. + Keizersgracht 241 + 1016 EA, Amsterdam + the Netherlands \ No newline at end of file diff --git a/ChangeLog.txt b/ChangeLog.txt index 3077d171..cad1e517 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,16 +1,3 @@ -Version 1.2.0-pre - -* New Features - - Indented soft wrap (danyaPostfactum) - -* API Changes - - unified delta types `{start, end, action, lines}` (Alden Daniels https://github.com/ajaxorg/ace/pull/1745) - - "change" event listeners on session and editor get delta objects directly - -2015.04.03 Version 1.1.9 - - - Small Enhancements and Bugfixes - 2014.11.08 Version 1.1.8 * API Changes diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 0ce7c657..f6f4b42f 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -307,7 +307,6 @@ function buildAceModuleInternal(opts, callback) { ignore: opts.ignore || [], withRequire: false, basepath: ACE_HOME, - transforms: [normalizeLineEndings], afterRead: [optimizeTextModules] }, write); } @@ -408,10 +407,6 @@ function getLoadedFileList(options, callback, result) { callback(Object.keys(deps)); } -function normalizeLineEndings(module) { - module.source = module.source.replace(/\r\n/g, "\n"); -} - function optimizeTextModules(sources) { var textModules = {}; return sources.filter(function(pkg) { @@ -457,10 +452,10 @@ function optimizeTextModules(sources) { if (/\.css$/.test(pkg.id)) { // remove unnecessary whitespace from css input = input.replace(/\n\s+/g, "\n"); - input = '"' + input.replace(/\n/g, '\\\n') + '"'; + input = '"' + input.replace(/\r?\n/g, '\\\n') + '"'; } else { // but don't break other files! - input = '"' + input.replace(/\n/g, '\\n\\\n') + '"'; + input = '"' + input.replace(/\r?\n/g, '\\n\\\n') + '"'; } textModules[pkg.id] = input; } diff --git a/Readme.md b/Readme.md index 42e81567..2195ceda 100644 --- a/Readme.md +++ b/Readme.md @@ -79,7 +79,7 @@ By default the editor only supports plain text mode; many other languages are av The mode can then be used like this: ```javascript - var JavaScriptMode = ace.require("ace/mode/javascript").Mode; + var JavaScriptMode = require("ace/mode/javascript").Mode; editor.getSession().setMode(new JavaScriptMode()); ``` diff --git a/build_support/mini_require.js b/build_support/mini_require.js index 1ecbb78b..88937f35 100644 --- a/build_support/mini_require.js +++ b/build_support/mini_require.js @@ -38,62 +38,69 @@ var ACE_NAMESPACE = ""; -var global = (function() { return this; })(); -if (!global && typeof window != "undefined") global = window; // strict mode +var global = (function() { + return this; +})(); if (!ACE_NAMESPACE && typeof requirejs !== "undefined") return; -var define = function(module, deps, payload) { - if (typeof module !== "string") { - if (define.original) - define.original.apply(this, arguments); +var _define = function(module, deps, payload) { + if (typeof module !== 'string') { + if (_define.original) + _define.original.apply(window, arguments); else { - console.error("dropping module because define wasn\'t a string."); + console.error('dropping module because define wasn\'t a string.'); console.trace(); } return; } + if (arguments.length == 2) payload = deps; - if (!define.modules[module]) { - define.payloads[module] = payload; - define.modules[module] = null; - } -}; -define.modules = {}; -define.payloads = {}; + if (!_define.modules) { + _define.modules = {}; + _define.payloads = {}; + } + + _define.payloads[module] = payload; + _define.modules[module] = null; +}; /** * Get at functionality define()ed using the function above */ var _require = function(parentId, module, callback) { - if (typeof module === "string") { - var payload = lookup(parentId, module); - if (payload != undefined) { - callback && callback(); - return payload; - } - } else if (Object.prototype.toString.call(module) === "[object Array]") { + if (Object.prototype.toString.call(module) === "[object Array]") { var params = []; for (var i = 0, l = module.length; i < l; ++i) { var dep = lookup(parentId, module[i]); - if (dep == undefined && require.original) - return; + if (!dep && _require.original) + return _require.original.apply(window, arguments); params.push(dep); } - return callback && callback.apply(null, params) || true; + if (callback) { + callback.apply(null, params); + } } -}; + else if (typeof module === 'string') { + var payload = lookup(parentId, module); + if (!payload && _require.original) + return _require.original.apply(window, arguments); -var require = function(module, callback) { - var packagedModule = _require("", module, callback); - if (packagedModule == undefined && require.original) - return require.original.apply(this, arguments); - return packagedModule; + if (callback) { + callback(); + } + + return payload; + } + else { + if (_require.original) + return _require.original.apply(window, arguments); + } }; var normalizeModule = function(parentId, moduleName) { @@ -112,6 +119,7 @@ var normalizeModule = function(parentId, moduleName) { moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); } } + return moduleName; }; @@ -120,11 +128,12 @@ var normalizeModule = function(parentId, moduleName) { * definition function if needed. */ var lookup = function(parentId, moduleName) { + moduleName = normalizeModule(parentId, moduleName); - var module = define.modules[moduleName]; + var module = _define.modules[moduleName]; if (!module) { - module = define.payloads[moduleName]; + module = _define.payloads[moduleName]; if (typeof module === 'function') { var exports = {}; var mod = { @@ -140,15 +149,19 @@ var lookup = function(parentId, moduleName) { var returnValue = module(req, exports, mod); exports = returnValue || mod.exports; - define.modules[moduleName] = exports; - delete define.payloads[moduleName]; + _define.modules[moduleName] = exports; + delete _define.payloads[moduleName]; } - module = define.modules[moduleName] = exports || module; + module = _define.modules[moduleName] = exports || module; } return module; }; function exportAce(ns) { + var require = function(module, callback) { + return _require("", module, callback); + }; + var root = global; if (ns) { if (!global[ns]) @@ -157,13 +170,13 @@ function exportAce(ns) { } if (!root.define || !root.define.packaged) { - define.original = root.define; - root.define = define; + _define.original = root.define; + root.define = _define; root.define.packaged = true; } if (!root.require || !root.require.packaged) { - require.original = root.require; + _require.original = root.require; root.require = require; root.require.packaged = true; } diff --git a/demo/autoresize.html b/demo/autoresize.html index b0464ecd..73a87599 100644 --- a/demo/autoresize.html +++ b/demo/autoresize.html @@ -7,13 +7,14 @@ @@ -23,8 +24,6 @@
minHeight = 2 lines- - @@ -47,13 +46,6 @@ require(["ace/ace"], function(ace) { editor2.setOption("maxLines", 30); editor2.setOption("minLines", 2); - var editor = ace.edit("editor3"); - editor.setOptions({ - autoScrollEditorIntoView: true, - maxLines: 8 - }); - editor.renderer.setScrollMargin(10, 10, 10, 10); - var editor = ace.edit("editor"); editor.setTheme("ace/theme/tomorrow"); editor.session.setMode("ace/mode/html"); diff --git a/demo/emmet.html b/demo/emmet.html index bd0d4abe..122085d9 100644 --- a/demo/emmet.html +++ b/demo/emmet.html @@ -23,7 +23,7 @@ - + - - - - - - - - -