feature(edward) add

This commit is contained in:
coderaiser 2015-01-13 03:56:31 -05:00
parent c33435b692
commit d66b159793
2 changed files with 64 additions and 27 deletions

View file

@ -561,39 +561,19 @@ var CloudCmd, Util, DOM, CloudFunc, io, ace, Zip, MenuIO, Format;
}
function loadFiles(callback) {
var url = join([
'theme-tomorrow_night_blue',
'ext-language_tools',
'ext-searchbox',
'ext-modelist'
].map(function(name) {
return DIR + name + '.js';
}));
var dir = CloudCmd.LIBDIRCLIENT,
name = 'edward',
url = dir + name + '.js';
Util.time(Name + ' load');
DOM.loadRemote('ace', function() {
DOM.load.js(url, function() {
Loading = false;
DOM.load.js(url, function() {
Loading = false;
window.edward(null, function() {
Util.timeEnd(Name + ' load');
exec(callback);
});
DOM.load.style({
id : 'msg-css',
inner : '#js-view .msg {' +
'z-index' + ': 1;' +
'background-color' + ': #7285B7;' +
'color' + ': #D1F1A9;' +
'position' + ': fixed;' +
'left' + ': 40%;' +
'top' + ': 25px;' +
'padding' + ': 5px;' +
'opacity' + ': 0.9;' +
'transition' + ': ease 0.5s;' +
'}'
});
});
}

57
lib/client/edward.js Normal file
View file

@ -0,0 +1,57 @@
var join, Util, DOM;
(function(global, join, DOM, exec) {
'use strict';
if (typeof module !== 'undefined' && module.exports)
module.exports = edward;
else
global.edward = edward;
function edward(el, callback) {
var Element = el || document.body;
if (!(this instanceof edward))
return new edward(Element, callback);
init(callback);
function init(callback) {
loadFiles(callback);
}
function loadFiles(callback) {
var dir = '/modules/ace-builds/src-noconflict/',
url = join([
'theme-tomorrow_night_blue',
'ext-language_tools',
'ext-searchbox',
'ext-modelist'
].map(function(name) {
return dir + name + '.js';
}));
DOM.loadRemote('ace', function() {
DOM.load.js(url, function() {
exec(callback);
});
DOM.load.style({
id : 'msg-css',
inner : '#js-view .msg {' +
'z-index' + ': 1;' +
'background-color' + ': #7285B7;' +
'color' + ': #D1F1A9;' +
'position' + ': fixed;' +
'left' + ': 40%;' +
'top' + ': 25px;' +
'padding' + ': 5px;' +
'opacity' + ': 0.9;' +
'transition' + ': ease 0.5s;' +
'}'
});
});
}
}
})(this, join, DOM, Util.exec);