require(["jquery", "db", "common", "reference", "jquery.cookie", "jquery.ui", "jquery.slidePanel"], function($, db, common, ref) { $(document).ready(function() { $("#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; }); // 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() { $(".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); }); });