Merge branch 'master' of github.com:ajaxorg/ace
This commit is contained in:
commit
ee7a17d5b5
18 changed files with 48 additions and 22 deletions
|
|
@ -16,7 +16,7 @@ Features
|
||||||
* Highlight matching parentheses
|
* Highlight matching parentheses
|
||||||
* Toggle between soft tabs and real tabs
|
* Toggle between soft tabs and real tabs
|
||||||
* Displays hidden characters
|
* Displays hidden characters
|
||||||
* Drap and drop text using the mouse
|
* Drag and drop text using the mouse
|
||||||
* Line wrapping
|
* Line wrapping
|
||||||
* Unstructured / user code folding
|
* Unstructured / user code folding
|
||||||
* Live syntax checker (currently JavaScript/CoffeeScript)
|
* Live syntax checker (currently JavaScript/CoffeeScript)
|
||||||
|
|
|
||||||
|
|
@ -43,16 +43,24 @@
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
|
var global = (function() {
|
||||||
|
return this;
|
||||||
|
})();
|
||||||
|
|
||||||
// if we find an existing require function use it.
|
// if we find an existing require function use it.
|
||||||
if (window.require) {
|
if (global.require && global.define) {
|
||||||
require.packaged = true;
|
require.packaged = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.define = function(module, deps, payload) {
|
var _define = function(module, deps, payload) {
|
||||||
if (typeof module !== 'string') {
|
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();
|
console.trace();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,15 +72,22 @@ window.define = function(module, deps, payload) {
|
||||||
|
|
||||||
define.modules[module] = payload;
|
define.modules[module] = payload;
|
||||||
};
|
};
|
||||||
|
if (global.define)
|
||||||
|
_define.original = global.define;
|
||||||
|
|
||||||
|
global.define = _define;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get at functionality define()ed using the function above
|
* Get at functionality define()ed using the function above
|
||||||
*/
|
*/
|
||||||
window.require = function(module, callback) {
|
var _require = function(module, callback) {
|
||||||
if (Object.prototype.toString.call(module) === "[object Array]") {
|
if (Object.prototype.toString.call(module) === "[object Array]") {
|
||||||
var params = [];
|
var params = [];
|
||||||
for (var i = 0, l = module.length; i < l; ++i) {
|
for (var i = 0, l = module.length; i < l; ++i) {
|
||||||
var dep = lookup(module[i]);
|
var dep = lookup(module[i]);
|
||||||
|
if (!dep && _require.original)
|
||||||
|
return _require.original.apply(window, arguments);
|
||||||
params.push(dep);
|
params.push(dep);
|
||||||
}
|
}
|
||||||
if (callback) {
|
if (callback) {
|
||||||
|
|
@ -81,6 +96,8 @@ window.require = function(module, callback) {
|
||||||
}
|
}
|
||||||
else if (typeof module === 'string') {
|
else if (typeof module === 'string') {
|
||||||
var payload = lookup(module);
|
var payload = lookup(module);
|
||||||
|
if (!payload && _require.original)
|
||||||
|
return _require.original.apply(window, arguments);
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback();
|
callback();
|
||||||
|
|
@ -88,7 +105,16 @@ window.require = function(module, callback) {
|
||||||
|
|
||||||
return payload;
|
return payload;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (_require.original)
|
||||||
|
return _require.original.apply(window, arguments);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (global.require)
|
||||||
|
_require.original = global.require;
|
||||||
|
|
||||||
|
global.require = _require;
|
||||||
require.packaged = true;
|
require.packaged = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -16,7 +16,7 @@ Features
|
||||||
* Highlight matching parentheses
|
* Highlight matching parentheses
|
||||||
* Toggle between soft tabs and real tabs
|
* Toggle between soft tabs and real tabs
|
||||||
* Displays hidden characters
|
* Displays hidden characters
|
||||||
* Drap and drop text using the mouse
|
* Drag and drop text using the mouse
|
||||||
* Line wrapping
|
* Line wrapping
|
||||||
* Unstructured / user code folding
|
* Unstructured / user code folding
|
||||||
* Live syntax checker (currently JavaScript/CoffeeScript)
|
* Live syntax checker (currently JavaScript/CoffeeScript)
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue