mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Use loader.js from bower.
This commit is contained in:
parent
a55bfea5b0
commit
279908df66
3 changed files with 3 additions and 77 deletions
|
@ -488,7 +488,7 @@ var path = require('path'),
|
|||
'dev-ember': {
|
||||
files: {
|
||||
'core/built/scripts/vendor-ember.js': [
|
||||
'core/client/assets/vendor/loader.js',
|
||||
'bower_components/loader.js/loader.js',
|
||||
'bower_components/jquery/dist/jquery.js',
|
||||
'bower_components/handlebars/handlebars.js',
|
||||
'bower_components/ember/ember.js',
|
||||
|
|
|
@ -20,7 +20,8 @@
|
|||
"moment": "2.4.0",
|
||||
"nprogress": "0.1.2",
|
||||
"showdown": "https://github.com/ErisDS/showdown.git#v0.3.2-ghost",
|
||||
"validator-js": "3.4.0"
|
||||
"validator-js": "3.4.0",
|
||||
"loader.js": "stefanpenner/loader.js#1.0.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"ember": "~1.4.0"
|
||||
|
|
75
core/client/assets/vendor/loader.js
vendored
75
core/client/assets/vendor/loader.js
vendored
|
@ -1,75 +0,0 @@
|
|||
var define, requireModule, require, requirejs;
|
||||
|
||||
(function() {
|
||||
var registry = {}, seen = {}, state = {};
|
||||
var FAILED = false;
|
||||
|
||||
define = function(name, deps, callback) {
|
||||
registry[name] = {
|
||||
deps: deps,
|
||||
callback: callback
|
||||
};
|
||||
};
|
||||
|
||||
requirejs = require = requireModule = function(name) {
|
||||
if (state[name] !== FAILED &&
|
||||
seen.hasOwnProperty(name)) {
|
||||
return seen[name];
|
||||
}
|
||||
|
||||
if (!registry.hasOwnProperty(name)) {
|
||||
throw new Error('Could not find module ' + name);
|
||||
}
|
||||
|
||||
var mod = registry[name];
|
||||
var deps = mod.deps;
|
||||
var callback = mod.callback;
|
||||
var reified = [];
|
||||
var exports;
|
||||
var value;
|
||||
var loaded = false;
|
||||
|
||||
seen[name] = { }; // enable run-time cycles
|
||||
|
||||
try {
|
||||
for (var i=0, l=deps.length; i<l; i++) {
|
||||
if (deps[i] === 'exports') {
|
||||
reified.push(exports = {});
|
||||
} else {
|
||||
reified.push(requireModule(resolve(deps[i], name)));
|
||||
}
|
||||
}
|
||||
|
||||
value = callback.apply(this, reified);
|
||||
loaded = true;
|
||||
} finally {
|
||||
if (!loaded) {
|
||||
state[name] = FAILED;
|
||||
}
|
||||
}
|
||||
return seen[name] = exports || value;
|
||||
};
|
||||
|
||||
function resolve(child, name) {
|
||||
if (child.charAt(0) !== '.') { return child; }
|
||||
|
||||
var parts = child.split('/');
|
||||
var parentBase = name.split('/').slice(0, -1);
|
||||
|
||||
for (var i = 0, l = parts.length; i < l; i++) {
|
||||
var part = parts[i];
|
||||
|
||||
if (part === '..') { parentBase.pop(); }
|
||||
else if (part === '.') { continue; }
|
||||
else { parentBase.push(part); }
|
||||
}
|
||||
|
||||
return parentBase.join('/');
|
||||
}
|
||||
|
||||
requirejs._eak_seen = registry;
|
||||
requirejs.clear = function(){
|
||||
requirejs._eak_seen = registry = {};
|
||||
seen = {};
|
||||
};
|
||||
})();
|
Loading…
Reference in a new issue