Last active
August 29, 2015 14:01
-
-
Save internetbird/cba724fb0e85000ae4ec to your computer and use it in GitHub Desktop.
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
//For simulating PhoneGup | |
M.PhoneGap = {}; | |
//getImage | |
M.PhoneGap.getImage = function (callback) { | |
callback("someImage" + (new Date()).getMilliseconds() + ".jpg"); | |
}; | |
//mapFileName | |
M.PhoneGap.mapFileName = function (fileName, callback) { | |
var result = M.Guide.ServiceConfiguration.getServiceRepositoryFileUrl("Attachment", "Task", fileName); | |
callback(result); | |
}; | |
//copyToDirectory | |
M.PhoneGap.copyToDirectory = function (uri, options) { | |
var fileEntry = { | |
toURL : function() { | |
return uri; | |
} | |
}; | |
options.success(fileEntry); | |
}; | |
M.PhoneGap.uploadFile = function () { | |
//Do nothing | |
}; | |
M.PhoneGap.resolve = function (uri, callback) { | |
var fileEntry = { | |
file : function(next) { | |
var file = { size : 100 }; | |
next(file); | |
} | |
}; | |
callback(fileEntry); | |
}; | |
M.PhoneGap.getRootDirectory = function () { | |
var rootDirectoy = { isDirectory: true, name: "rootDirectory" }; | |
rootDirectoy.getDirectory = function (name, params, callback) { | |
var innerDirectory = { isDirectory: true, name: "innerDirectory" }; | |
callback(innerDirectory); | |
}; | |
rootDirectoy.toURL = function() { | |
return "rootDirectory"; | |
}; | |
return rootDirectoy; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment