mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(edward) rm setPatchMaxSize
This commit is contained in:
parent
964f7899e9
commit
19d0baa26f
2 changed files with 20 additions and 15 deletions
|
|
@ -95,8 +95,6 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, edward;
|
|||
this.create = function(element) {
|
||||
Element = element;
|
||||
|
||||
edward.setPatchMaxSize(CloudFunc.MAX_FILE_SIZE);
|
||||
|
||||
edward.addCommand({
|
||||
name : 'hide',
|
||||
bindKey : { win: 'Esc', mac: 'Esc' },
|
||||
|
|
@ -156,9 +154,14 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, edward;
|
|||
Util.time(Name + ' load');
|
||||
|
||||
DOM.load.js(url, function() {
|
||||
var options = {
|
||||
maxSize : CloudFunc.MAX_FILE_SIZE,
|
||||
prefix : CloudCmd.PREFIX
|
||||
};
|
||||
|
||||
Loading = false;
|
||||
|
||||
edward(element, function() {
|
||||
edward(element, options, function() {
|
||||
Util.timeEnd(Name + ' load');
|
||||
exec(callback);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,18 +13,26 @@ var join, ace, load, Util, DOM, CloudCmd, Diff, io, Zip, Format, restafary;
|
|||
Emmet,
|
||||
Value,
|
||||
Config,
|
||||
PREFIX,
|
||||
Element,
|
||||
FileName,
|
||||
Modelist,
|
||||
ElementMsg,
|
||||
JSHintConfig,
|
||||
MAX_FILE_SIZE,
|
||||
|
||||
DIR = '/modules/',
|
||||
Files = DOM.Files,
|
||||
Storage = DOM.Storage,
|
||||
DIR = '/modules/',
|
||||
Files = DOM.Files,
|
||||
Storage = DOM.Storage,
|
||||
MAX_FILE_SIZE = 512000,
|
||||
|
||||
edward = function(el, callback) {
|
||||
edward = function(el, options, callback) {
|
||||
if (!options) {
|
||||
callback = options;
|
||||
} else {
|
||||
MAX_FILE_SIZE = options.maxSize || 512000;
|
||||
PREFIX = options.prefix || '/';
|
||||
}
|
||||
|
||||
Element = el || document.body;
|
||||
|
||||
Element.addEventListener('drop', onDrop);
|
||||
|
|
@ -196,12 +204,6 @@ var join, ace, load, Util, DOM, CloudCmd, Diff, io, Zip, Format, restafary;
|
|||
});
|
||||
};
|
||||
|
||||
edward.setPatchMaxSize = function(size) {
|
||||
MAX_FILE_SIZE = size;
|
||||
|
||||
return edward;
|
||||
};
|
||||
|
||||
edward.selectAll = function() {
|
||||
Ace.selectAll();
|
||||
};
|
||||
|
|
@ -430,7 +432,7 @@ var join, ace, load, Util, DOM, CloudCmd, Diff, io, Zip, Format, restafary;
|
|||
}
|
||||
|
||||
function setJsHintConfig(callback) {
|
||||
var JSHINT_PATH = CloudCmd.PREFIX + '/.jshintrc',
|
||||
var JSHINT_PATH = PREFIX + '/.jshintrc',
|
||||
func = function() {
|
||||
var session = edward.getSession(),
|
||||
worker = session.$worker;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue