From 890a71ec131ecd9e24bb1d55b3df944d718ad7f6 Mon Sep 17 00:00:00 2001 From: benweet Date: Sun, 21 Jul 2013 23:18:35 +0100 Subject: [PATCH] Google Drive realtime sync --- css/default.css | 2 +- img/icons.png | Bin 5551 -> 4768 bytes js/classes/AsyncTask.js | 6 ++++ js/core.js | 6 ++-- js/helpers/googleHelper.js | 17 +++++---- js/providers/gdriveProvider.js | 61 +++++++++++++++++++++------------ js/synchronizer.js | 9 ++--- js/utils.js | 1 + 8 files changed, 64 insertions(+), 38 deletions(-) diff --git a/css/default.css b/css/default.css index f648e252..bf47a172 100644 --- a/css/default.css +++ b/css/default.css @@ -480,7 +480,7 @@ div.dropdown-menu textarea { .icon-gdrive.realtime { width: 18px; - background-position: -180px 0; + background-position: -162px 0; } .icon-dropbox { diff --git a/img/icons.png b/img/icons.png index a656096d5a56e99b94ccdaf704ef0076ccb69b73..84b27f79f9c38429b343d25e9cf21fd92ba4cfa5 100644 GIT binary patch delta 4727 zcmV--5{T`uE1)HiRDTu+5sJyT8vpO$Y%(5(ps- z0U_b03=iQ60u|B9U@2ln2o#V?73HBQ_$W)Ov~j=+wTw}#lon+0Sw!Z_&@d!n5Mn~+ zIU$gFxXC?dzdv$sax+1oy!HCl%Wti-?%n(B-?`_WbH3l-?|=8*XAAxxS$KH(2%S#% z3t*BEA^<>2nF}0NRdws7OP9{w&R;G<-p%ic%?Rgq*rcdO6~Q(kg#X!bH&?lDvJCNDYoQT)wlRGsuqB`F)jfv$|`|ah{iHXZ|u+6wY;XShGIkDK$we3aK);aZ`UZ3-B`f>S-+!mEy<60_-xS3xNNWT9hk;Nj<&60F z_`PlX+*^^6k<)-}X0!QlXlUppXA-zq@H>1RB+wrCfBWhpri>rSkjV?$Cz2Mv5lhz@ zf&K2?0z$SwH}&S(wETx+PF*7{uLzs1p5OrgVUG_D=JhE*x;|&)zQqws*G&SZUfi&< z@qb20cyRpSuFBUVRKx zkDk=l)>2(v4S-Ik!(9>FSpOTUN-qNtaN;~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#S5aei<*|~C&p))EJ$cNX<<v z%#Iy9hGfp2yRoZl5x37FG-*Dk?^}ees1vU84DD9}_LTGJX(#l5RsI_T^#raTwD%7H P0000 0 && _.first(_.values(obj)).isRealtime) { + if(_.size(fileDesc.syncLocations) > 0 && _.first(_.values(fileDesc.syncLocations)).isRealtime) { extensionMgr.onError("Realtime collaboration document can't be synchronized with multiple locations"); return; } @@ -344,7 +341,7 @@ define([ // Provider's manual export button $(".action-sync-manual-" + provider.providerId).click(function(event) { var fileDesc = fileMgr.currentFile; - if(_.size(fileDesc.syncLocations) > 0 && _.first(_.values(obj)).isRealtime) { + if(_.size(fileDesc.syncLocations) > 0 && _.first(_.values(fileDesc.syncLocations)).isRealtime) { extensionMgr.onError("Realtime collaboration document can't be synchronized with multiple locations"); return; } diff --git a/js/utils.js b/js/utils.js index d13b4276..faa854a5 100644 --- a/js/utils.js +++ b/js/utils.js @@ -137,6 +137,7 @@ define([ // Reset input control in all modals utils.resetModalInputs = function() { $(".modal input[type=text]:not([disabled]), .modal input[type=password], .modal textarea").val(""); + $(".modal input[type=checkbox]").prop("checked", false); }; // Basic trim function