Commit 715b8b73 authored by Troy A. Griffitts's avatar Troy A. Griffitts

Added module locale support. Fixed BibleSync crash. Fixed small errors

parent 687c85e2
<?xml version='1.0' encoding='utf-8'?>
<widget id="org.crosswire.bishop" version="1.4.6" 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.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">
<name>Bishop</name>
<description>
A Bible Study App from CrossWire
......
......@@ -116,7 +116,7 @@ body,td,div,span,p,.verse,.currentVerse {
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
margin: 0px 0px 0px 0px;
z-index:10;
z-index:20;
}
.center {
......
This diff is collapsed.
......@@ -81,7 +81,10 @@ var installMgr = {
h += '<td class="instDelta">'+modInfoList[i].delta+'</td>';
}
h += '<td class="instName">'+modInfoList[i].name+'</td>';
h += '<td class="instDesc">'+modInfoList[i].description+'</td>';
var d = modInfoList[i].descriptionLocale;
if (!d) d = modInfoList[i].description;
d = d.replace(/&/g, '&amp;');
h += '<td class="instDesc">' + d + '</td>';
h += '</tr>';
}
modInfoLoop(++i, callback);
......@@ -151,27 +154,39 @@ var installMgr = {
remoteMod.getConfigEntry('UnlockInfo', function(unlockInfo) {
var ciphered = remoteMod.cipherKey !== undefined;
var t = '<div class="about">';
t += '<h4>' + remoteMod.name + ' - ' + remoteMod.description + '</h4>';
if (ciphered) {
t += '<p data-english="The module you have requested for install is locked and requires an unlock key which can be provided below.">The module you have requested for install is locked and requires an unlock key which can be provided below.</p>';
if (unlockInfo && unlockInfo.length) {
t += '<p data-english="Instructions from the publisher on how to obtain an unlock key follow:">Instructions from the publisher on how to obtain an unlock key follow:</p>';
t += '<p>'+unlockInfo+'</p>';
remoteMod.getConfigEntry('Description_'+app.getAppLocale(), function(descriptionLocale) {
var d = descriptionLocale;
if (!d) d = remoteMod.description;
d = d.replace(/&/g, '&amp;');
t += '<h4>' + remoteMod.name + ' - ' + d + '</h4>';
if (ciphered) {
t += '<p data-english="The module you have requested for install is locked and requires an unlock key which can be provided below.">The module you have requested for install is locked and requires an unlock key which can be provided below.</p>';
if (unlockInfo && unlockInfo.length) {
t += '<p data-english="Instructions from the publisher on how to obtain an unlock key follow:">Instructions from the publisher on how to obtain an unlock key follow:</p>';
t += '<p>'+unlockInfo+'</p>';
}
t += '<br/>';
t += '<p><span data-english="Unlock Key:">Unlock Key:</span> <input id="cipherKey"/><button data-english="Install" onclick="installMgr.setCipher(\''+modName+'\', $(\'#cipherKey\').val(), function() { app.popupHide(); installMgr.installModule(\''+sourceName+'\', \''+modName+'\');}); return false;">Install</button></p>';
t += '<p data-english="If you do not yet have an unlock key, you can still install this module now and provide the key later using the \'About\' screen of this application.">If you do not yet have an unlock key, you can still install this module now and provide the key later using the \'About\' screen of this application.</p>';
}
t += '<br/>';
t += '<p><span data-english="Unlock Key:">Unlock Key:</span> <input id="cipherKey"/><button data-english="Install" onclick="installMgr.setCipher(\''+modName+'\', $(\'#cipherKey\').val(), function() { app.popupHide(); installMgr.installModule(\''+sourceName+'\', \''+modName+'\');}); return false;">Install</button></p>';
t += '<p data-english="If you do not yet have an unlock key, you can still install this module now and provide the key later using the \'About\' screen of this application.">If you do not yet have an unlock key, you can still install this module now and provide the key later using the \'About\' screen of this application.</p>';
}
else {
t += '<p><button data-english="Install" onclick="app.popupHide(); installMgr.installModule(\''+sourceName+'\', \''+modName+'\'); return false;">Install</button>';
}
t += '&nbsp;&nbsp;<button data-english="Cancel" onclick="app.popupHide(); return false;">Cancel</button></p>';
remoteMod.getConfigEntry('About', function(about) {
t += '<div>'+(about?about:'')+'</div>';
if (remoteMod.shortPromo && remoteMod.shortPromo.length) t += '<div class="promoLine">' + remoteMod.shortPromo +'</div>';
t += '<br/>';
t += '</div>';
app.popupShow(t);
else {
t += '<p><button data-english="Install" onclick="app.popupHide(); installMgr.installModule(\''+sourceName+'\', \''+modName+'\'); return false;">Install</button>';
}
t += '&nbsp;&nbsp;<button data-english="Cancel" onclick="app.popupHide(); return false;">Cancel</button></p>';
remoteMod.getConfigEntry('About', function(about) {
remoteMod.getConfigEntry('About_'+app.getAppLocale(), function(aboutLocale) {
var a = aboutLocale;
if (!a) a = about;
if (!a) a = '';
t += '<div>' + a + '</div>';
if (remoteMod.shortPromo && remoteMod.shortPromo.length) t += '<div class="promoLine">' + remoteMod.shortPromo +'</div>';
t += '<br/>';
t += '</div>';
app.popupShow(t);
});
});
});
});
});
......@@ -298,15 +313,38 @@ console.log('**** installMgr.installModule. disclaimer accepted. installing modu
},
showInstalled: function(callback) {
SWORD.mgr.getModInfoList(function(modInfoList) {
installMgr.showModules(modInfoList, 'No Modules Installed', false, function() {
if (callback) callback();
});
var enrichMods = function(i) {
if (i >= modInfoList.length) {
installMgr.showModules(modInfoList, 'No Modules Installed', false, function() {
return (callback) ? callback() : false;
});
}
SWORD.mgr.getModuleByName(modInfoList[i].name, function(mod) {
mod.getConfigEntry('Description_'+app.getAppLocale(), function(descLocale) {
modInfoList[i].descriptionLocale = descLocale;
enrichMods(++i);
});
});
};
enrichMods(0);
});
},
showRemoteModules: function(sourceName) {
showRemoteModules: function(sourceName, callback) {
SWORD.installMgr.getRemoteModInfoList(sourceName, function(modInfoList) {
installMgr.showModules(modInfoList, 'No Modules Available. Try pressing the [&#x21bb;] button.', true, function() {
});
var enrichMods = function(i) {
if (i >= modInfoList.length) {
installMgr.showModules(modInfoList, 'No Modules Available. Try pressing the [&#x21bb;] button.', true, function() {
return (callback) ? callback() : false;
});
}
SWORD.installMgr.getRemoteModuleByName(sourceName, modInfoList[i].name, function(mod) {
mod.getConfigEntry('Description_'+app.getAppLocale(), function(descLocale) {
modInfoList[i].descriptionLocale = descLocale;
enrichMods(++i);
});
});
};
enrichMods(0);
});
},
modSourceChanged: function() {
......@@ -372,19 +410,30 @@ console.log('**** installMgr.installModule. disclaimer accepted. installing modu
}
SWORD.installMgr.getRemoteModInfoList(srcs[i], function(sourceMods) {
if (srcs[i] != 'CrossWire Beta' && srcs[i] != 'CrossWire Attic') {
for (var l = 0; l < sourceMods.length; ++l) {
var iterateSourceMods = function(l) {
if (l >= sourceMods.length) return sourcesLoop(srcs, ++i);
if (sourceMods[l].delta == '+') {
++count;
t += '<tr class="row'+((count%2)?'odd':'even')+'" onclick="installMgr.modSelected(this);return false;">';
t += '<td class="instDelta">'+sourceMods[l].delta+'</td>';
t += '<td class="instName">'+sourceMods[l].name+'</td>';
t += '<td class="instDesc">'+sourceMods[l].description+'</td>';
t += '<td style="display:none;" class="sourceName">'+srcs[i]+'</td>';
t += '</tr>';
SWORD.installMgr.getRemoteModuleByName(srcs[i], sourceMods[l].name, function(mod) {
mod.getConfigEntry('Description_'+app.getAppLocale(), function(descriptionLocale) {
var d = descriptionLocale;
if (!d) d = sourceMods[l].description;
d = d.replace(/&/g, '&amp;');
t += '<tr class="row'+((count%2)?'odd':'even')+'" onclick="installMgr.modSelected(this);return false;">';
t += '<td class="instDelta">'+sourceMods[l].delta+'</td>';
t += '<td class="instName">'+sourceMods[l].name+'</td>';
t += '<td class="instDesc">' + d + '</td>';
t += '<td style="display:none;" class="sourceName">'+srcs[i]+'</td>';
t += '</tr>';
iterateSourceMods(++l);
});
});
}
}
else iterateSourceMods(++l);
};
iterateSourceMods(0);
}
sourcesLoop(srcs, ++i);
else sourcesLoop(srcs, ++i);
});
};
sourcesLoop(sources);
......
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