2013-04-27 17:29:36 -04:00
|
|
|
require(["jquery", "db", "common", "reference", "jquery.cookie", "jquery.ui", "jquery.slidePanel"],
|
2013-11-16 17:33:31 -05:00
|
|
|
function($, db, common, ref) {
|
|
|
|
$(document).ready(function()
|
2013-04-17 17:56:22 -05:00
|
|
|
{
|
2013-11-16 17:33:31 -05:00
|
|
|
$("#searchvalue").keypress(function(event) {
|
|
|
|
if (event.which === 13) {
|
|
|
|
common.Search($("#searchvalue").val());
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$("#searchbtn").click(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;
|
2013-04-19 10:35:14 -04:00
|
|
|
});
|
2013-04-17 17:56:22 -05:00
|
|
|
|
2013-11-16 17:33:31 -05:00
|
|
|
// 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();
|
|
|
|
}
|
2013-04-19 17:07:04 -04:00
|
|
|
|
2013-11-16 17:33:31 -05:00
|
|
|
// 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);
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
2013-04-19 17:07:04 -04:00
|
|
|
|
2013-04-19 20:13:05 -05:00
|
|
|
|