New extension pattern

This commit is contained in:
benweet 2013-05-28 00:39:07 +01:00
parent cc01b5af4e
commit 569a52ca21
3 changed files with 4 additions and 5 deletions

View File

@ -174,7 +174,7 @@ define([
} }
// Remove sync attributes // Remove sync attributes
localStorage.removeItem(syncAttributes.syncIndex); localStorage.removeItem(syncAttributes.syncIndex);
fileDesc.syncLocations.removeItem(syncIndex); fileDesc.syncLocations.removeItem(syncAttributes.syncIndex);
if(!skipExtensions) { if(!skipExtensions) {
extensionMgr.onSyncRemoved(fileDesc, syncAttributes); extensionMgr.onSyncRemoved(fileDesc, syncAttributes);
} }
@ -218,7 +218,7 @@ define([
} }
// Remove publish attributes // Remove publish attributes
localStorage.removeItem(publishAttributes.publishIndex); localStorage.removeItem(publishAttributes.publishIndex);
fileDesc.publishLocations.removeItem(publishIndex); fileDesc.publishLocations.removeItem(publishAttributes.publishIndex);
if(!skipExtensions) { if(!skipExtensions) {
extensionMgr.onPublishRemoved(fileDesc, publishAttributes); extensionMgr.onPublishRemoved(fileDesc, publishAttributes);
} }

View File

@ -89,8 +89,7 @@ define([
var content = getPublishContent(publishAttributes); var content = getPublishContent(publishAttributes);
// Call the provider // Call the provider
var provider = providerMap[publishAttributes.provider]; publishAttributes.provider.publish(publishAttributes, publishTitle, content, function(error) {
provider.publish(publishAttributes, publishTitle, content, function(error) {
if(error !== undefined) { if(error !== undefined) {
var errorMsg = error.toString(); var errorMsg = error.toString();
if(errorMsg.indexOf("|removePublish") !== -1) { if(errorMsg.indexOf("|removePublish") !== -1) {

View File

@ -73,7 +73,7 @@ define([
} }
if(uploadFlag) { if(uploadFlag) {
// Update syncAttributes in localStorage // Update syncAttributes in localStorage
localStorage[syncIndex] = utils.serializeAttributes(syncAttributes); localStorage[syncAttributes.syncIndex] = utils.serializeAttributes(syncAttributes);
} }
locationUp(callback); locationUp(callback);
} }