Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /**
  2.  *
  3.  * Phonegap sqlite backup plugin for Android
  4.  * patadejaguar@gmail.com 2012
  5.  *
  6.  */
  7. var ROOTH_PATH  = "/mnt/sdcard/";
  8. var LocalBackup = function() {};
  9.  
  10. if( window.resolveLocalFileSystemURI ){
  11.     window.resolveLocalFileSystemURI(ROOTH_PATH, function(dirEntry) {}, function(evt){ ROOTH_PATH  = "/mnt/extsd/"; });
  12. }
  13. LocalBackup.prototype.run = function(content, success, fail) {
  14.     fail    = (typeof fail != "function") ? function(){} : fail;
  15.     success = (typeof sucess != "function") ? function(){} : success;
  16.     return cordova.exec( function(args) {
  17.         success(args);
  18.     }, function(args) {
  19.         fail(args);
  20.     }, 'LocalBackup', '', [content]);
  21. };
  22.  
  23. if(!window.plugins) {
  24.     window.plugins = {};
  25. }