mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(dword) add
This commit is contained in:
parent
01656051e2
commit
0603393a52
4 changed files with 46 additions and 13 deletions
|
|
@ -12,6 +12,7 @@
|
|||
"online": true,
|
||||
"cache": true,
|
||||
"showKeysPanel": true,
|
||||
"editor": "dword",
|
||||
"port": 8000,
|
||||
"ip": null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, Format, edward;
|
|||
|
||||
Menu,
|
||||
|
||||
Editor = 'edward',
|
||||
|
||||
Images = DOM.Images,
|
||||
MSG_CHANGED,
|
||||
Element,
|
||||
|
|
@ -38,6 +40,7 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, Format, edward;
|
|||
|
||||
exec.series([
|
||||
CloudCmd.View,
|
||||
getConfig,
|
||||
function(callback) {
|
||||
loadFiles(element, callback);
|
||||
},
|
||||
|
|
@ -70,21 +73,24 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, Format, edward;
|
|||
ConfigView.beforeShow = callback;
|
||||
|
||||
Info.getData(function(error, data) {
|
||||
var isDir = Info.isDir,
|
||||
name = Info.name,
|
||||
path = Info.path;
|
||||
var path = Info.path;
|
||||
|
||||
if (error) {
|
||||
alert(error);
|
||||
} else {
|
||||
edward.once('change', function() {
|
||||
var isDir = Info.isDir,
|
||||
name = Info.name;
|
||||
|
||||
if (isDir)
|
||||
edward.setMode('json');
|
||||
else
|
||||
edward.setModeForPath(name);
|
||||
|
||||
CloudCmd.View.show(Element, ConfigView);
|
||||
});
|
||||
|
||||
edward.setValueFirst(path, data);
|
||||
|
||||
if (isDir)
|
||||
edward.setMode('json');
|
||||
else
|
||||
edward.setModeForPath(name);
|
||||
|
||||
CloudCmd.View.show(Element, ConfigView);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -154,8 +160,19 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, Format, edward;
|
|||
return this;
|
||||
};
|
||||
|
||||
function getConfig(callback) {
|
||||
DOM.Files.get('config', function(error, config) {
|
||||
if (error)
|
||||
alert(error);
|
||||
else if (config.editor)
|
||||
Editor = config.editor;
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
function loadFiles(element, callback) {
|
||||
var url = '/edward/edward.js';
|
||||
var url = '/' + Editor + '/' + Editor + '.js';
|
||||
|
||||
Util.time(Name + ' load');
|
||||
|
||||
|
|
@ -166,6 +183,8 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, Format, edward;
|
|||
|
||||
Loading = false;
|
||||
|
||||
edward = window[Editor];
|
||||
|
||||
edward(element, options, function() {
|
||||
Util.timeEnd(Name + ' load');
|
||||
exec(callback);
|
||||
|
|
|
|||
|
|
@ -19,8 +19,9 @@
|
|||
restafary = require('restafary'),
|
||||
webconsole = require('console-io'),
|
||||
edward = require('edward'),
|
||||
dword = require('dword'),
|
||||
|
||||
emptyFunc = function(req, res, next) {
|
||||
emptyFunc = function(req, res, next) {
|
||||
next();
|
||||
};
|
||||
|
||||
|
|
@ -61,6 +62,10 @@
|
|||
edward.listen(socket, {
|
||||
size: size
|
||||
});
|
||||
|
||||
dword.listen(socket, {
|
||||
size: size
|
||||
});
|
||||
};
|
||||
|
||||
function cloudcmd() {
|
||||
|
|
@ -105,7 +110,14 @@
|
|||
diff : isDiff,
|
||||
zip : isZip
|
||||
}),
|
||||
|
||||
|
||||
dword({
|
||||
minify : isMinify,
|
||||
online : isOnline,
|
||||
diff : isDiff,
|
||||
zip : isZip
|
||||
}),
|
||||
|
||||
mollify({
|
||||
dir : DIR_ROOT,
|
||||
is : isMinify
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
"ashify": "~1.0.0",
|
||||
"console-io": "~2.2.0",
|
||||
"copymitter": "~1.5.0",
|
||||
"dword": "~1.1.2",
|
||||
"edward": "~1.3.0",
|
||||
"execon": "~1.1.0",
|
||||
"express": "~4.12.0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue