Last active
August 29, 2015 14:13
-
-
Save nextend/66709844688f69d1beb8 to your computer and use it in GitHub Desktop.
Aviary: Check if the app has access to the High resolution feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var featherEditorHiRes = -1; | |
var featherEditor = new Aviary.Feather({ | |
... | |
onReady: function(){ | |
if(featherEditorHiRes == -1){ | |
AV.controlsWidgetInstance.serverMessaging.sendMessage({ | |
id: "avpw_auth_form", | |
action: AV.controlsWidgetInstance.assetManager.getManifestURL(), | |
method: "GET", | |
dataType: "json", | |
announcer: AV.build.asyncFeatherTargetAnnounce, | |
origin: AV.build.asyncImgrecvBase, | |
callback: function(response){ | |
featherEditorHiRes = false; | |
for(var i = 0; i < response.permissions.length; i++){ | |
if(response.permissions[i] == "hires"){ | |
featherEditorHiRes = true; | |
break; | |
} | |
} | |
} | |
}); | |
} | |
}, | |
onSaveButtonClicked: function(){ | |
if(featherEditorHiRes === true){ | |
featherEditor.saveHiRes(); | |
return false; | |
} | |
// else leave the processing to the normal Aviary save... | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment