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
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);
}

View File

@ -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) {

View File

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