Skip to content

Instantly share code, notes, and snippets.

@nextend
Last active August 29, 2015 14:13
Show Gist options
  • Save nextend/66709844688f69d1beb8 to your computer and use it in GitHub Desktop.
Save nextend/66709844688f69d1beb8 to your computer and use it in GitHub Desktop.
Aviary: Check if the app has access to the High resolution feature
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