Commit 542aa864 authored by Troy A. Griffitts's avatar Troy A. Griffitts

Added beginning to Gospel Parallels feature in Bishop

parent f76d92ec
......@@ -382,6 +382,7 @@ console.log('closing topbar');
app.closeFootnotes(true);
}
var textDisplay = $('#textDisplay');
console.log("*** in show. after setting textDisplay.length: " + textDisplay.length);
$(textDisplay)
......@@ -394,6 +395,11 @@ console.log('closing topbar');
SWORD.mgr.getModInfoList(function(mods) {
app.mods = mods;
app.setupMenu(function() {
var showingGospelParallels = window.localStorage.getItem('showingGospelParallels');
console.log('loading: showingGospelParallels: ' + showingGospelParallels);
app.setShowGospelParallels(showingGospelParallels == 'true');
$('#currentMod1').val(app.getCurrentMod1());
$('#currentMod2').val(app.getCurrentMod2());
$('#currentMod3').val(app.getCurrentMod3());
......@@ -691,6 +697,10 @@ console.log('ERROR resolving path: '+JSON.stringify(err));
app.stopBibleSync();
}
},
toggleGospelParallels : function() {
console.log('toggling Gospel Parallels');
app.setShowGospelParallels(($('#gospelParallelsSwitch').is(':checked')));
},
startBibleSync : function() {
console.log('starting BibleSync');
var bibleSyncAppName = 'Bishop'+device.platform;
......@@ -706,6 +716,30 @@ console.log('stopping BibleSync');
app.closeBibleSync();
SWORD.mgr.stopBibleSync();
},
setShowGospelParallels : function(value) {
console.log('setShowGospelParallels: ' + value);
window.localStorage.setItem('showingGospelParallels', value ? 'true':'false');
$('#gospelParallelsSwitch').prop('checked', value);
if (app.isShowGospelParallels()) {
SWORD.mgr.getModuleByName('Eusebian_vs', function(eus) {
if (!eus) {
var t = '<div class="about"><center>';
t += '<p><span data-english="You have asked to show Gospel parallels. For this feature, we need to download a small set of data. Is this OK?">You have asked to show Gospel parallels. For this feature, we need to download a small set of data. Is this OK?</span></p>';
t += '<button onclick="app.popupHide(); app.installModule(\'Eusebian_vs\');return false;" data-english="Install Module">Install Module</button> &nbsp;&nbsp; <button onclick="app.setShowGospelParallels(false); app.popupHide(); return false;" data-english="Cancel">Cancel</button></center>';
t += '</div>';
t += '<br/>';
t += '<br/>';
t += '<br/>';
// app.closeMenu();
app.popupShow(t);
return;
}
});
}
},
isShowGospelParallels : function() {
return $('#gospelParallelsSwitch').is(':checked');
},
popupShow: function(content, skipTranslation) {
app.isPopupShowing = true;
$('#popup').html(content);
......@@ -885,6 +919,7 @@ console.log('Installed module: ' + mods[i].name + '; features.length: ' + mods[i
t += '<tr><td class="menuLabel" onclick="app.toggleSettings(); return false;"><img src="img/ic_action_settings.png" style="height:1em;"/> <span data-english="Settings">Settings</span></td></tr>';
t += '<tr><td style="width:100%;"><div class="settingsPanel toshow">';
t += '<div style="padding-bottom:.5em;line-height:initial;">&nbsp;&nbsp;&nbsp;&nbsp;<span data-english="Word Study Bible">Word Study Bible</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<select style="width:15em;" onchange="app.setWordStudyBible($(this).val()); return false;" id="wordStudyBible"></select></div>';
t += '<div style="padding-bottom:.5em;line-height:initial;"><div style="display:inline-block;">&nbsp;&nbsp;&nbsp;&nbsp;<span data-english="Show Gospel Parallels">Show Gospel Parallels</span></div><label style="float:right;" class="switch"><input id="gospelParallelsSwitch" onchange="app.toggleGospelParallels(); return false;" type="checkbox"><span class="slider round"></span></label></div>';
t += '<div style="padding-bottom:.5em;line-height:initial;">&nbsp;&nbsp;&nbsp;&nbsp;<span data-english="Language">Language</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<select style="width:15em;" onchange="app.setAppLocale($(this).val()); return false;" id="appLocale"></select></div>';
t += '<div style="padding-bottom:.5em;line-height:initial;">&nbsp;&nbsp;&nbsp;&nbsp;<button id="decreaseUIFontButton" onclick="app.decreaseUIFont();return false;" style="width:2em;font-size:130%"> - </button>&nbsp; <span data-english="Font Size">Font Size</span> &nbsp;<button id="increaseUIFontButton" onclick="app.increaseUIFont();return false;" style="width:2em;font-size:130%"> + </button></div>';
t += '<div style="padding-bottom:.5em;line-height:initial;">&nbsp;&nbsp;&nbsp;&nbsp;<span data-english="Theme">Theme</span><br/>&nbsp;&nbsp;&nbsp;&nbsp;<select style="width:15em;" onchange="app.setAppTheme($(this).val()); return false;" id="appTheme"></select></div>';
......
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