...
 
Commits (3)
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.crosswire.bishop" version="1.4.7" 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.5.0" 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.4.7', // change version here and in config.xml, near top
version: '1.5.0', // change version here and in config.xml, near top
backFunction: null,
enableBibleSync : true,
enableGospelParallels : true,
......@@ -138,6 +138,10 @@ console.log('clicked key: ' + key);
activeWindow : null,
initialize: function() {
//
// Polyfills
//
// for old browsers which don't yet support string.startsWith
if (!String.prototype.startsWith) {
Object.defineProperty(String.prototype, 'startsWith', {
......@@ -147,6 +151,17 @@ console.log('clicked key: ' + key);
}
});
}
// for old browsers which don't yet support string.endsWith
if (!String.prototype.endsWith) {
String.prototype.endsWith = function(search, this_len) {
if (this_len === undefined || this_len > this.length) {
this_len = this.length;
}
return this.substring(this_len - search.length, this_len) === search;
};
}
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
if (typeof cordova == 'undefined') app.localFixup(); else console.log('Using real SWORD plugin');
$(document).on('click','a', app.handleAnchorClickEvents);
......@@ -740,7 +755,10 @@ console.log('******************** SWORD reInit ********************************'
SWORD.mgr.getModuleByName(app.mods[i].name, function(mod) {
mod.getConfigEntry('Description_'+app.getAppLocale(), function(descLocale) {
app.mods[i].descriptionLocale = descLocale;
enrichMods(++i);
mod.getConfigEntry('ShortPromo_'+app.getAppLocale(), function(spLocale) {
app.mods[i].shortPromoLocale = spLocale;
enrichMods(++i);
});
});
});
};
......@@ -1946,7 +1964,9 @@ console.log('headerLoopContinue. mods.length: ' + mods.length + '; renderData.le
t += '<td';
var eusLabel = renderData[0][v].eusLabel;
if (eusLabel && eusLabel.length > 0) {
t += ' class="eusnum noBodyClick" style="padding:0;margin:0" valign="top" align="center" onclick="app.showGospelParallel(\''+verseKey.osisRef+'\');return false;">' + eusLabel;
t += ' class="eusnum noBodyClick" style="padding:0;margin:0" valign="top" align="center"';
if (!eusLabel.endsWith('>X')) t+= ' onclick="app.showGospelParallel(\''+verseKey.osisRef+'\');return false;"';
t += '>' + eusLabel;
}
else t += '>';
t += '</td>';
......@@ -1975,7 +1995,8 @@ console.log('headerLoopContinue. mods.length: ' + mods.length + '; renderData.le
for (var i = 0; i < renderData.length; ++i) {
var copyLine = mods[i].shortCopyright;
if (!copyLine) copyLine = '';
var promoLine = mods[i].shortPromo;
var promoLine = mods[i].shortPromoLocale;
if (!promoLine) promoLine = mods[i].shortPromo;
if (!promoLine) promoLine = '';
if (mods[i].category == "Cults / Unorthodox / Questionable Material") {
copyLine = 'WARNING: This text is considered unorthodox by most of Christendom. ' + copyLine;
......@@ -2015,25 +2036,28 @@ console.log('headerLoop : ' + i);
console.log('header module retrieved: ' + mod.description);
mod.getConfigEntry('Description_'+app.getAppLocale(), function(descLocale) {
mod.descriptionLocale = descLocale;
mod.getRenderChapter(masterModule, function(chapterData) {
console.log('got chapter data for: ' + mod.description + '; chapterData.length: ' + chapterData.length);
// only display module if some data for the chapter
for (var j = 0; j < chapterData.length; ++j) {
if (chapterData[j].text && chapterData[j].text.length > 0 && (!onlyOne || !renderData.length)) {
console.log('found some data so we should include mod: ' + mod.description + '; getting renderHeader');
mod.getRenderHeader(function(h) {
console.log('got renderHeader for mod: ' + mod.description);
t += ('<style>' + h + '</style>');
mods.push(mod);
renderData.push(chapterData);
headerLoop(++i, callback);
mod.getConfigEntry('ShortPromo_'+app.getAppLocale(), function(spLocale) {
mod.shortPromoLocale = spLocale;
mod.getRenderChapter(masterModule, function(chapterData) {
console.log('got chapter data for: ' + mod.description + '; chapterData.length: ' + chapterData.length);
// only display module if some data for the chapter
for (var j = 0; j < chapterData.length; ++j) {
if (chapterData[j].text && chapterData[j].text.length > 0 && (!onlyOne || !renderData.length)) {
console.log('found some data so we should include mod: ' + mod.description + '; getting renderHeader');
mod.getRenderHeader(function(h) {
console.log('got renderHeader for mod: ' + mod.description);
t += ('<style>' + h + '</style>');
mods.push(mod);
renderData.push(chapterData);
headerLoop(++i, callback);
return;
});
return;
});
return;
}
}
}
console.log('calling headerLoop : ' + (i + 1));
headerLoop(++i, callback);
console.log('calling headerLoop : ' + (i + 1));
headerLoop(++i, callback);
});
});
});
});
......@@ -2124,14 +2148,18 @@ console.log('About: showing modules, count: ' + app.mods.length);
SWORD.mgr.getModuleByName(modName, function(module) {
module.getConfigEntry('About', function(about) {
module.getConfigEntry('About_'+app.getAppLocale(), function(aboutLocale) {
var a = aboutLocale;
if (!a) a = about;
if (!a) a = '';
var t = a + '<br/>';
if (module.shortPromo && module.shortPromo.length) t += '<div class="promoLine">' + module.shortPromo +'</div>';
t += '<br/>';
$('#'+targetElement).html(t);
callback ? callback() : false;
module.getConfigEntry('ShortPromo_'+app.getAppLocale(), function(spLocale) {
var a = aboutLocale;
if (!a) a = about;
if (!a) a = '';
var t = a + '<br/>';
var s = spLocale;
if (!s) s = module.shortPromo;
if (s && s.length) t += '<div class="promoLine">' + s + '</div>';
t += '<br/>';
$('#'+targetElement).html(t);
callback ? callback() : false;
});
});
});
});
......