dynamicbible/js/main.js
Jeremy Wall (zaphar) dcd08a2dd1 Add a Tagging module.
* It uses an indexedb datastore.
* Fix the api of the indexeddb wrapper now that I have some real world usage
  examples.
* Implemented API Calls:
   * UpdateTags
   * GetTags
* Exposed but unimplemented API Calls:
   * GetVersesForTag
   * Sync
* Add a tooltip that shows the tags for a reference to the reference link.
2013-04-19 20:13:05 -05:00

70 lines
2.3 KiB
JavaScript

require(["jquery", "db", "common", "jquery.cookie", "jquery.ui"],
function($, db, common) {
$(document).ready(function()
{
$("#searchform").submit(function()
{
common.Search($("#searchvalue").val());
return false;
});
$("#growfont").click(function()
{
common.Settings.IncreaseResultFontSize();
return false;
});
$("#shrinkfont").click(function()
{
common.Settings.DecreaseResultFontSize();
return false;
});
$("#switch-panes").click(function()
{
common.Settings.SwitchPanes();
return false;
});
$("#showhelp").click(function()
{
$("#help").dialog({
draggable:true,
width: 700,
height: 650,
resizable: true
});
});
$("#showhidesearch").click(function()
{
common.Settings.ShowHideSearch();
return false;
});
$("#changefont").change(function()
{
common.Settings.ChangeResultFont($("#changefont").val());
return false;
});
// load querystring
var ref = decodeURIComponent(common.Util.GetUrlVars().r);
if (ref !== "undefined") {
// remember the settings, first, because if you have results, the load process would wipe out the passage you want to load.
common.Settings.Load();
// now load the passage from the querystring.
common.Search(ref);
$("#searchvalue").val(ref);
} else {
common.Settings.Load();
}
// you need to do this last, otherwise the settings load resets the window height.
$(window).bind("resize", function()
{
$("#searchresults").css("height", window.innerHeight - 200);
return false;
});
$("#searchresults").css("height", window.innerHeight - 200);
});
});