Commit d8ca73c2 authored by Troy A. Griffitts's avatar Troy A. Griffitts

moved some init code from show to main

parent aa026842
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="org.crosswire.bishop" version="1.3.902" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> <widget id="org.crosswire.bishop" version="1.3.903" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<name>Bishop</name> <name>Bishop</name>
<description> <description>
A Bible Study App from CrossWire A Bible Study App from CrossWire
......
var app = { var app = {
version: '1.3.902', // change version here and in config.xml, near top version: '1.3.903', // change version here and in config.xml, near top
backFunction: null, backFunction: null,
enableBibleSync : true, enableBibleSync : true,
enableViewTypes : true, enableViewTypes : true,
...@@ -299,30 +299,12 @@ console.log('******** trying to scroll body to top'); ...@@ -299,30 +299,12 @@ console.log('******** trying to scroll body to top');
} }
}, },
show: function() { show: function() {
if (!window.localStorage.getItem('bibleSyncUserName')) window.localStorage.setItem('bibleSyncUserName', 'BishopUser');
if (!window.localStorage.getItem('bibleSyncPassphrase')) window.localStorage.setItem('bibleSyncPassphrase', 'BibleSync');
if (!window.localStorage.getItem('mainViewType')) window.localStorage.setItem('mainViewType', 'Bibles');
if (!window.localStorage.getItem('appTheme')) window.localStorage.setItem('appTheme', 'wash.css');
if (!window.localStorage.getItem('appLocale') && !app.checkDefaultLocale) {
window.localStorage.setItem('appLocale', app.defaultLocale);
}
if (!window.localStorage.getItem('appLocale') && navigator.globalization) {
navigator.globalization.getLocaleName(function(language) {
var localeName = language.value;
if (localeName.indexOf('-') > -1) localeName = localeName.substring(0,localeName.indexOf('-'));
console.log('*********** Initially setting locale to: ' + localeName);
window.localStorage.setItem('appLocale', localeName);
},
function() {
window.localStorage.setItem('appLocale', app.defaultLocale);
});
}
app.setAppLocale(false, function() { app.setAppLocale(false, function() {
app.mainViewType = window.localStorage.getItem('mainViewType'); app.mainViewType = window.localStorage.getItem('mainViewType');
app.setCurrentKey(app.getCurrentKey()); app.setCurrentKey(app.getCurrentKey());
app.currentWindow = app; app.currentWindow = app;
var main = $('#main'); var main = $('#main');
console.log("*** in show. main.length: " + main.length); console.log("*** in show. main.length: " + main.length);
var t = ''; var t = '';
t += '<div id="textDisplay"></div>'; t += '<div id="textDisplay"></div>';
...@@ -642,6 +624,25 @@ console.log('****************** ------------- ***********************'); ...@@ -642,6 +624,25 @@ console.log('****************** ------------- ***********************');
app.popupHide(); app.popupHide();
if (!window.localStorage.getItem('bibleSyncUserName')) window.localStorage.setItem('bibleSyncUserName', 'BishopUser');
if (!window.localStorage.getItem('bibleSyncPassphrase')) window.localStorage.setItem('bibleSyncPassphrase', 'BibleSync');
if (!window.localStorage.getItem('mainViewType')) window.localStorage.setItem('mainViewType', 'Bibles');
if (!window.localStorage.getItem('appTheme')) window.localStorage.setItem('appTheme', 'wash.css');
if (!window.localStorage.getItem('appLocale') && !app.checkDefaultLocale) {
window.localStorage.setItem('appLocale', app.defaultLocale);
}
if (!window.localStorage.getItem('appLocale') && navigator.globalization) {
navigator.globalization.getLocaleName(function(language) {
var localeName = language.value;
if (localeName.indexOf('-') > -1) localeName = localeName.substring(0,localeName.indexOf('-'));
console.log('*********** Initially setting locale to: ' + localeName);
window.localStorage.setItem('appLocale', localeName);
},
function() {
window.localStorage.setItem('appLocale', app.defaultLocale);
});
}
var installBundledResources = function(callback) { var installBundledResources = function(callback) {
app.copyBundledResources('', '', function() { app.copyBundledResources('', '', function() {
// since we currently just nuke any top-level bundled resource folder, we can do this for mods.d/ // since we currently just nuke any top-level bundled resource folder, we can do this for mods.d/
...@@ -667,15 +668,17 @@ console.log('****************** ------------- ***********************'); ...@@ -667,15 +668,17 @@ console.log('****************** ------------- ***********************');
app.getLastAppVersion(function(lastVersion) { app.getLastAppVersion(function(lastVersion) {
if (lastVersion != app.version) { if (lastVersion != app.version) {
installBundledResources(function() { installBundledResources(function() {
if (lastVersion && lastVersion.length) { app.reInitSWORD(function() {
app.showModuleUpdateOption('You have received an application update since your last run.', 'app.setLastAppVersion(app.firstCheck)'); if (lastVersion && lastVersion.length) {
} app.showModuleUpdateOption('You have received an application update since your last run.', 'app.setLastAppVersion(app.firstCheck)');
else { }
// setting an extraConfig forces a re-init and will pick up newly copied resources else {
app.setLastAppVersion(function() { // setting an extraConfig forces a re-init and will pick up newly copied resources
return app.firstCheck(); app.setLastAppVersion(function() {
}); return app.firstCheck();
} });
}
});
}); });
} }
else app.firstCheck(); else app.firstCheck();
......
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