From ad048e29264eebef007fdec67ba10e3a52815d7e Mon Sep 17 00:00:00 2001 From: "jwall@VAPPRCSN015.vap.local" Date: Thu, 3 Nov 2011 14:49:40 -0400 Subject: [PATCH] added settings code, increase/decrease font size, change font face, and switch panes. --- css/bible.css | 22 ++++++++------- index.html | 24 ++++++++++++++++ js/common.js | 78 ++++++++++++++++++++++++++++++++++++--------------- 3 files changed, 92 insertions(+), 32 deletions(-) diff --git a/css/bible.css b/css/bible.css index fc2b623d..6ac99e78 100644 --- a/css/bible.css +++ b/css/bible.css @@ -3,6 +3,16 @@ body { margin: 0; font-family: verdana; } +a +{ + color: #000; + text-decoration:none; + border-bottom: 1px dotted darkgray; + _border-bottom: 1px solid lightgray; /* IE */ +} +a:hover { + border-bottom: 1px solid maroon; +} em {font-style: normal;} @@ -94,6 +104,7 @@ h3 { font-size: 21px; font-family: Georgia, Serif; text-decoration: none; + border: 0px; color: Maroon; } #searchresults ul a:hover @@ -120,16 +131,7 @@ h3 { padding: 0 12px 0 0; line-height: 200%; } -#result a { - text-decoration: none; - border-bottom: 1px dotted darkgray; - _border-bottom: 1px solid lightgray; /* IE */ - color: #000; -} -#result a:hover { - border-bottom: 1px solid blue; - color: blue; -} + .result { display: block; diff --git a/index.html b/index.html index ac766b8b..415948b0 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,26 @@ Search($("#searchvalue").val()); return false; }); + $("#growfont").click(function() + { + Settings.IncreaseResultFontSize(); + return false; + }); + $("#shrinkfont").click(function() + { + Settings.DecreaseResultFontSize(); + return false; + }); + $("#switch-panes").click(function() + { + Settings.SwitchPanes(); + return false; + }); + $("#changefont").change(function() + { + Settings.ChangeResultFont($("#changefont").val()); + return false; + }); }); @@ -42,6 +62,10 @@ + + Switch Panes | Select Font: + | + AA | AA
diff --git a/js/common.js b/js/common.js index d13c710e..029b1f56 100644 --- a/js/common.js +++ b/js/common.js @@ -125,6 +125,62 @@ function Search(sv) return false; } + +var Settings = { + SwitchPanes: function() + { + var s = $("#searchresultswrap"); + var r = $("#resultwrap"); + var v = s.css("float"); + if (v == "right") + { + s.css("float", "left"); + r.css("float", "left"); + } + else + { + s.css("float", "right"); + r.css("float", "right"); + } + }, + IncreaseResultFontSize: function() + { + var s = $("#result").css("font-size"); + $("#result").css("font-size", parseInt(s) + 1); + }, + DecreaseResultFontSize: function() + { + var s = $("#result").css("font-size"); + $("#result").css("font-size", parseInt(s) - 1); + }, + ChangeResultFont: function(fontfamily) + { + $("#result").css("font-family", fontfamily); + } +} + +var Util = { + HandleLink: function(e) + { + Search($(e.target).text()); + }, + HandleHiddenLink: function(e) + { + Search($(e.target).find(".searchvalue").text()); + }, + RemoveResult: function(e) + { + $(e.target).parent().parent().remove(); + }, + HandleError: function(e) + { + // for now we're going to put the error in the main result div. + var t = $("
" + e + "
"); + + return false; + } +} + var Bible = { DisplayPassage: function(vs, b, ch, sv, ev, testament) { @@ -212,28 +268,6 @@ var Bible = { } } -var Util = { - HandleLink: function(e) - { - Search($(e.target).text()); - }, - HandleHiddenLink: function(e) - { - Search($(e.target).find(".searchvalue").text()); - }, - RemoveResult: function(e) - { - $(e.target).parent().parent().remove(); - }, - HandleError: function(e) - { - // for now we're going to put the error in the main result div. - var t = $("
"+e+"
"); - - return false; - } -} - var Strongs = { GetStrongs: function(sn, dict) {