From 26a3769220afa700762d74b9759aa46ef42ffaae Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 22 Jan 2015 06:44:19 -0500 Subject: [PATCH] feature(edward) rm CloudFunc --- lib/client/edit.js | 2 ++ lib/client/edward.js | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/client/edit.js b/lib/client/edit.js index a9e9010b..0ee2673b 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -103,6 +103,8 @@ 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' }, diff --git a/lib/client/edward.js b/lib/client/edward.js index 4ae6bf14..63737353 100644 --- a/lib/client/edward.js +++ b/lib/client/edward.js @@ -1,4 +1,4 @@ -var join, ace, load, Util, DOM, CloudCmd, Diff, io, Zip, Format, CloudFunc, restafary; +var join, ace, load, Util, DOM, CloudCmd, Diff, io, Zip, Format, restafary; (function(global, join, DOM, exec, loadRemote) { 'use strict'; @@ -19,6 +19,8 @@ var join, ace, load, Util, DOM, CloudCmd, Diff, io, Zip, Format, CloudFunc, rest Emmet, Config, + MAX_FILE_SIZE, + Files = DOM.Files, Storage = DOM.Storage, @@ -190,6 +192,12 @@ var join, ace, load, Util, DOM, CloudCmd, Diff, io, Zip, Format, CloudFunc, rest }); }; + edward.setPatchMaxSize = function(size) { + MAX_FILE_SIZE = size; + + return edward; + }; + edward.selectAll = function() { Ace.selectAll(); }; @@ -253,10 +261,9 @@ var join, ace, load, Util, DOM, CloudCmd, Diff, io, Zip, Format, CloudFunc, rest exec.if(!isDiff, function(patch) { var query = '', - MAX_SIZE = CloudFunc.MAX_FILE_SIZE, patchLength = patch && patch.length || 0, length = Value.length, - isLessMaxLength = length < MAX_SIZE, + isLessMaxLength = length < MAX_FILE_SIZE, isLessLength = isLessMaxLength && patchLength < length, isStr = typeof patch === 'string', isPatch = patch && isStr && isLessLength;