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'?>
<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>
<description>
A Bible Study App from CrossWire
......
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,
enableBibleSync : true,
enableViewTypes : true,
......@@ -299,30 +299,12 @@ console.log('******** trying to scroll body to top');
}
},
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.mainViewType = window.localStorage.getItem('mainViewType');
app.setCurrentKey(app.getCurrentKey());
app.currentWindow = app;
var main = $('#main');
console.log("*** in show. main.length: " + main.length);
var t = '';
t += '<div id="textDisplay"></div>';
......@@ -642,6 +624,25 @@ console.log('****************** ------------- ***********************');
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) {
app.copyBundledResources('', '', function() {
// since we currently just nuke any top-level bundled resource folder, we can do this for mods.d/
......@@ -667,6 +668,7 @@ console.log('****************** ------------- ***********************');
app.getLastAppVersion(function(lastVersion) {
if (lastVersion != app.version) {
installBundledResources(function() {
app.reInitSWORD(function() {
if (lastVersion && lastVersion.length) {
app.showModuleUpdateOption('You have received an application update since your last run.', 'app.setLastAppVersion(app.firstCheck)');
}
......@@ -677,6 +679,7 @@ console.log('****************** ------------- ***********************');
});
}
});
});
}
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