diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c44edcb0..062af59c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,16 +7,9 @@ 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://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 +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. -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. +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. -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 +Happy coding, Cloud9 diff --git a/ChangeLog.txt b/ChangeLog.txt index cad1e517..3077d171 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,16 @@ +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 f6f4b42f..0ce7c657 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -307,6 +307,7 @@ function buildAceModuleInternal(opts, callback) { ignore: opts.ignore || [], withRequire: false, basepath: ACE_HOME, + transforms: [normalizeLineEndings], afterRead: [optimizeTextModules] }, write); } @@ -407,6 +408,10 @@ 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) { @@ -452,10 +457,10 @@ function optimizeTextModules(sources) { if (/\.css$/.test(pkg.id)) { // remove unnecessary whitespace from css input = input.replace(/\n\s+/g, "\n"); - input = '"' + input.replace(/\r?\n/g, '\\\n') + '"'; + input = '"' + input.replace(/\n/g, '\\\n') + '"'; } else { // but don't break other files! - input = '"' + input.replace(/\r?\n/g, '\\n\\\n') + '"'; + input = '"' + input.replace(/\n/g, '\\n\\\n') + '"'; } textModules[pkg.id] = input; } diff --git a/Readme.md b/Readme.md index 2195ceda..42e81567 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 = require("ace/mode/javascript").Mode; + var JavaScriptMode = ace.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 88937f35..1ecbb78b 100644 --- a/build_support/mini_require.js +++ b/build_support/mini_require.js @@ -38,69 +38,62 @@ var ACE_NAMESPACE = ""; -var global = (function() { - return this; -})(); +var global = (function() { return this; })(); +if (!global && typeof window != "undefined") global = window; // strict mode if (!ACE_NAMESPACE && typeof requirejs !== "undefined") return; -var _define = function(module, deps, payload) { - if (typeof module !== 'string') { - if (_define.original) - _define.original.apply(window, arguments); +var define = function(module, deps, payload) { + if (typeof module !== "string") { + if (define.original) + define.original.apply(this, 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) { - _define.modules = {}; - _define.payloads = {}; + if (!define.modules[module]) { + define.payloads[module] = payload; + define.modules[module] = null; } - - _define.payloads[module] = payload; - _define.modules[module] = null; }; +define.modules = {}; +define.payloads = {}; + /** * Get at functionality define()ed using the function above */ var _require = function(parentId, module, callback) { - if (Object.prototype.toString.call(module) === "[object Array]") { + 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]") { var params = []; for (var i = 0, l = module.length; i < l; ++i) { var dep = lookup(parentId, module[i]); - if (!dep && _require.original) - return _require.original.apply(window, arguments); + if (dep == undefined && require.original) + return; params.push(dep); } - if (callback) { - callback.apply(null, params); - } + return callback && callback.apply(null, params) || true; } - else if (typeof module === 'string') { - var payload = lookup(parentId, module); - if (!payload && _require.original) - return _require.original.apply(window, arguments); +}; - if (callback) { - callback(); - } - - return payload; - } - else { - if (_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; }; var normalizeModule = function(parentId, moduleName) { @@ -119,7 +112,6 @@ var normalizeModule = function(parentId, moduleName) { moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); } } - return moduleName; }; @@ -128,12 +120,11 @@ 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 = { @@ -149,19 +140,15 @@ 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]) @@ -170,13 +157,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 73a87599..b0464ecd 100644 --- a/demo/autoresize.html +++ b/demo/autoresize.html @@ -7,14 +7,13 @@ @@ -24,6 +23,8 @@
minHeight = 2 lines+ + @@ -46,6 +47,13 @@ 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 122085d9..bd0d4abe 100644 --- a/demo/emmet.html +++ b/demo/emmet.html @@ -23,7 +23,7 @@ - + + + + + + + + + +