mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 01:47:35 +00:00
feature(edward) add
This commit is contained in:
parent
c33435b692
commit
d66b159793
2 changed files with 64 additions and 27 deletions
|
|
@ -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
57
lib/client/edward.js
Normal 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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue