Skip to content

Instantly share code, notes, and snippets.

@Vishwas1
Last active July 25, 2017 16:58
Show Gist options
  • Save Vishwas1/073f88d134ba38995f6a247fefd2d55d to your computer and use it in GitHub Desktop.
Save Vishwas1/073f88d134ba38995f6a247fefd2d55d to your computer and use it in GitHub Desktop.
var Utility = {
onFileSystemSuccess : function(){
fileSystem.getDirectory("batch", {
create: false,
exclusive: false
}, onGetDirectorySuccess, onGetDirectoryFail);
}
};
function onGetDirectorySuccess(dir)
{
dir.getFile('product.json', {
create: false,
exclusive: false
}, gotFileEntry, onError);
}
function onGetDirectoryFail(err)
{
console.log('Direcotory Error :'+err);
}
////////////////////////////////////
function gotFileEntry(dir){
Dialog.create({
title: 'Confirm',
message: 'Select option to progress..',
buttons: [
{
label: 'Synch',
handler () {
console.log('Synching to server...')
}
},
{
label: 'Continue',
handler () {
console.log('Please wait..!')
}
}
]
});
}
function onError(e) {
console.log(e);
Dialog.create({
title: 'Confirm',
message: 'Select option to progress..',
buttons: [
{
label: 'Continue',
handler () {
console.log('Please wait..!')
}
}
]
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment