From 569a52ca21974f836cda446eb0e8883b8a470d08 Mon Sep 17 00:00:00 2001 From: benweet Date: Tue, 28 May 2013 00:39:07 +0100 Subject: [PATCH] New extension pattern --- js/file-manager.js | 4 ++-- js/publisher.js | 3 +-- js/synchronizer.js | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/js/file-manager.js b/js/file-manager.js index 70a3524d..489496d6 100644 --- a/js/file-manager.js +++ b/js/file-manager.js @@ -174,7 +174,7 @@ define([ } // Remove sync attributes localStorage.removeItem(syncAttributes.syncIndex); - fileDesc.syncLocations.removeItem(syncIndex); + fileDesc.syncLocations.removeItem(syncAttributes.syncIndex); if(!skipExtensions) { extensionMgr.onSyncRemoved(fileDesc, syncAttributes); } @@ -218,7 +218,7 @@ define([ } // Remove publish attributes localStorage.removeItem(publishAttributes.publishIndex); - fileDesc.publishLocations.removeItem(publishIndex); + fileDesc.publishLocations.removeItem(publishAttributes.publishIndex); if(!skipExtensions) { extensionMgr.onPublishRemoved(fileDesc, publishAttributes); } diff --git a/js/publisher.js b/js/publisher.js index 579d6e5a..a9fd18fb 100644 --- a/js/publisher.js +++ b/js/publisher.js @@ -89,8 +89,7 @@ define([ var content = getPublishContent(publishAttributes); // Call the provider - var provider = providerMap[publishAttributes.provider]; - provider.publish(publishAttributes, publishTitle, content, function(error) { + publishAttributes.provider.publish(publishAttributes, publishTitle, content, function(error) { if(error !== undefined) { var errorMsg = error.toString(); if(errorMsg.indexOf("|removePublish") !== -1) { diff --git a/js/synchronizer.js b/js/synchronizer.js index 5f43354f..f1c47261 100644 --- a/js/synchronizer.js +++ b/js/synchronizer.js @@ -73,7 +73,7 @@ define([ } if(uploadFlag) { // Update syncAttributes in localStorage - localStorage[syncIndex] = utils.serializeAttributes(syncAttributes); + localStorage[syncAttributes.syncIndex] = utils.serializeAttributes(syncAttributes); } locationUp(callback); }