Commit 31c0c380 authored by Troy A. Griffitts's avatar Troy A. Griffitts

Fixed check for older phones which don't support lookup of sdcard

parent f9e90790
var app = {
version: '1.3.5', // change version here and in config.xml, near top
version: '1.0.7', // change version here and in config.xml, near top
backFunction: null,
enableBibleSync : true,
enableViewTypes : true,
......@@ -621,8 +621,8 @@ console.log('**** retrieving lastAppVersion: ' + value);
var resPath = cordova.file.applicationDirectory + 'www/bundledResources/' + source;
var checkPath = (dest.indexOf('/') > 0) ? dest.substring(0, dest.indexOf('/')) : dest;
var destPath = [
{ checkPath : cordova.file.documentsDirectory + 'sword/'+checkPath,
targetPath : cordova.file.documentsDirectory + 'sword/'+dest
{ checkPath : (cordova.file.documentsDirectory ? cordova.file.documentsDirectory : 'file:///sdcard/') + 'sword/'+checkPath,
targetPath : (cordova.file.documentsDirectory ? cordova.file.documentsDirectory : 'file:///sdcard/') + 'sword/'+dest
},
{
checkPath : cordova.file.dataDirectory+checkPath,
......@@ -680,14 +680,18 @@ console.log('ERROR: ' + err);
readEntries(); // Start reading dirs.
};
console.log('checking for resource bundle at: ' + resPath);
window.resolveLocalFileSystemURL(resPath, function(resBundle) {
console.log('got resource bundle: ' + JSON.stringify(resBundle));
if (resBundle && resBundle.isDirectory) {
var findDest = function(i) {
if (!i) i = 0;
if (i >= destPath.length) { if (callback) callback(); return; }
console.log('checking destPath: ' + destPath[i].targetPath);
window.resolveLocalFileSystemURL(destPath[i].targetPath, function(destBundle) {
performCopy(resBundle, destBundle);
}, function(err) {
console.log('error: not found');
if (i == destPath.length -1) {
console.log('ERROR resolving path: '+destPath[i].targetPath+' - '+JSON.stringify(err));
if (callback) callback();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment