dynamicbible/js/main.js
jason.wall f9dc9e5819 BUGFIXES: Fixes a variety of the remaining issues
* css formatting issues
 * upgraded to latest jquery
 * removed requirejs because of incompatibility with jquery mobile
 * multiple bug fixes relating to above
 * search now opens automatically when performing a search
2014-12-25 19:18:38 -05:00

67 lines
2.1 KiB
JavaScript

$(document).ready(function()
{
$("#searchvalue").keypress(function(event) {
if (event.which === 13) {
Search($("#searchvalue").val());
return false;
}
});
$("#searchbtn").click(function()
{
Search($("#searchvalue").val());
return false;
});
$("#growfont").click(function()
{
Settings.IncreaseResultFontSize();
return false;
});
$("#shrinkfont").click(function()
{
Settings.DecreaseResultFontSize();
return false;
});
$("#showhelp").click(function()
{
$("#help").dialog({
draggable: true,
width: 700,
height: 650,
resizable: true
});
});
$("#changefont").change(function()
{
Settings.ChangeResultFont($("#changefont").val());
return false;
});
// load querystring
var ref = decodeURIComponent(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.
Settings.Load();
// now load the passage from the querystring.
Search(ref);
$("#searchvalue").val(ref);
} else {
Settings.Load();
}
// you need to do this last, otherwise the settings load resets the window height.
$(window).bind("resize", function()
{
$(".my-breakpoint.ui-grid-c .ui-block-a").css("width", 55);
$(".my-breakpoint.ui-grid-c .ui-block-b").css("width", window.innerWidth - 230);
$(".my-breakpoint.ui-grid-c .ui-block-c").css("width", 100);
$(".my-breakpoint.ui-grid-c .ui-block-d").css("width", 55);
$("#searchresults").css("height", window.innerHeight - 100);
return false;
});
$(".my-breakpoint.ui-grid-c .ui-block-a").css("width", 55);
$(".my-breakpoint.ui-grid-c .ui-block-b").css("width", window.innerWidth - 235);
$(".my-breakpoint.ui-grid-c .ui-block-c").css("width", 100);
$(".my-breakpoint.ui-grid-c .ui-block-d").css("width", 55);
$("#searchresults").css("height", window.innerHeight - 100);
});