From: Wolfram Schneider Date: Wed, 10 Jul 2013 12:16:30 +0000 (+0000) Subject: Merge remote branch 'origin/master' into wosch X-Git-Tag: 0.9.1~297 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=86bf6d896e3e172c9fe5fa5095776e9ee249cfbb;hp=8ad715b3f51335c55c8c7aef24ef8e6fce69711c;p=mkws-moved-to-github.git Merge remote branch 'origin/master' into wosch --- diff --git a/examples/htdocs/index-mike.html b/examples/htdocs/index-mike.html index 930e19a..b3cad34 100644 --- a/examples/htdocs/index-mike.html +++ b/examples/htdocs/index-mike.html @@ -6,7 +6,7 @@ @@ -20,6 +20,5 @@
-
diff --git a/examples/htdocs/index-mobile.html b/examples/htdocs/index-mobile.html index 02f4342..bf1893f 100644 --- a/examples/htdocs/index-mobile.html +++ b/examples/htdocs/index-mobile.html @@ -32,12 +32,6 @@
- -
- - +
diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index f1b3fb1..fc79eb9 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -198,10 +198,6 @@ function my_onterm(data) { var termlist = document.getElementById("mkwsTermlists"); replaceHtml(termlist, acc.join('')); - - // ### I don't believe these lines should be necessary (but they are) - if (mkws_config.responsive_design) - mkws_mobile_resize(); } function add_single_facet(acc, caption, data, max, cclIndex) { @@ -532,7 +528,7 @@ function mkws_html_all(config) { perpage_menu: true, /* show/hide perpage menu */ lang_display: [], /* display languages links for given languages, [] for all */ facets: ["sources", "subjects", "authors"], /* display facets, in this order, [] for none */ - responsive_design_width: 980, /* a page with less pixel width considered as mobile */ + responsive_design_width: 980, /* a page with less pixel width considered as narrow */ debug: 1, /* debug level for development: 0..2 */ dummy: "dummy" @@ -583,7 +579,7 @@ function mkws_html_all(config) { $("#mkwsResults").html('\ \ \ - \ \ \ + \ + \ + \
\ + \
\
\ @@ -593,6 +589,11 @@ function mkws_html_all(config) {
\
\ +
\ +
'); } @@ -618,9 +619,9 @@ function mkws_html_all(config) { if (mkws_config.responsive_design) { // Responsive web design - change layout on the fly based on // current screen width. Required for mobile devices. - $(window).resize( function(e) { mkws_mobile_resize() }); + $(window).resize( function(e) { mkws_resize_page() }); // initial check after page load - $(document).ready(function() { mkws_mobile_resize() }); + $(document).ready(function() { mkws_resize_page() }); } domReady(); @@ -780,28 +781,30 @@ function mkws_html_lang(mkws_config) { $("#mkwsLang").html(data); } -function mkws_mobile_resize () { - debug("resize width: " + $(window).height() + ", width: " + $(window).width()); +function mkws_resize_page () { var list = ["mkwsSwitch"]; - var obj; - // alert($(window).width()); var width = mkws_config.responsive_design_width || 980; - - if ($(window).width() <= width) { + var parentId = $("#mkwsTermlists").parent().attr('id'); + + if ($(window).width() <= width && + parentId === "mkwsTermlistContainer1") { + debug("changing from wide to narrow: " + $(window).width()); + $("#mkwsTermlists").appendTo($("#mkwsTermlistContainer2")); + $("#mkwsTermlistContainer1").hide(); + $("#mkwsTermlistContainer2").show(); for(var i = 0; i < list.length; i++) { $("#" + list[i]).hide(); } - - $("#mkwsTermlists").hide(); - obj = $("#mkwsTermlists").html(); - $("#mkwsShiftedTermlists").html(obj); - } else { + } else if ($(window).width() > width && + parentId === "mkwsTermlistContainer2") { + debug("changing from narrow to wide: " + $(window).width()); + $("#mkwsTermlists").appendTo($("#mkwsTermlistContainer1")); + $("#mkwsTermlistContainer1").show(); + $("#mkwsTermlistContainer2").hide(); for(var i = 0; i < list.length; i++) { $("#" + list[i]).show(); } - $("#mkwsTermlists").show(); - $("#mkwsShiftedTermlists").html(""); } }; diff --git a/tools/htdocs/mkwsStyle.css b/tools/htdocs/mkwsStyle.css index 1571da7..b807ed3 100644 --- a/tools/htdocs/mkwsStyle.css +++ b/tools/htdocs/mkwsStyle.css @@ -8,7 +8,6 @@ #mkwsRecords, #mkwsTargets, #mkwsStat, -#mkwsShiftedTermlists, #mkwsMOTD { font-family: Gill Sans, "Gillius ADF", Gillius, GilliusADF, Verdana, Sans-Serif; } @@ -68,8 +67,7 @@ #mkwsRanking a, #mkwsPager a, #mkwsNavi a, -#mkwsRecords a, -#mkwsShiftedTermlists a { +#mkwsRecords a { color: #005701; text-decoration: none; } @@ -78,8 +76,7 @@ #mkwsLang a:hover, #mkwsTermlists a:hover, #mkwsPager a:hover, -#mkwsRecords a:hover, -#mkwsShiftedTermlists a:hover { +#mkwsRecords a:hover { text-decoration: underline; } @@ -107,15 +104,13 @@ background: #f0f8ff; } -#mkwsTermlists .title, -#mkwsShiftedTermlists .title { +#mkwsTermlists .title { font-size: large; font-weight: bold; text-transform: uppercase; } -#mkwsTermlists, -#mkwsShiftedTermlists div#termlist { +#mkwsTermlists { background: #d0e0ff; padding: 0.7em; font-size: small; @@ -125,8 +120,7 @@ -webkit-border-top-right-radius: 10px; } -#mkwsTermlists div.facet, -#mkwsShiftedTermlists div.facet { +#mkwsTermlists div.facet { background: #e0f0ff; padding: 0.7em; margin-top: 0.7em; @@ -136,13 +130,11 @@ -webkit-border-top-right-radius: 10px; } -#mkwsTermlists div.termtitle, -#mkwsShiftedTermlists div.termtitle { +#mkwsTermlists div.termtitle { font-weight: bold; } -#mkwsRecords div.record, -#mkwsShiftedTermlists div.record { +#mkwsRecords div.record { padding: 5px; } @@ -159,15 +151,13 @@ -webkit-border-top-right-radius: 10px; } -#mkwsRecords div.details th, -#mkwsShiftedTermlists div.details th { +#mkwsRecords div.details th { text-align: right; vertical-align: top; padding-right: 0.6em; } -#mkwsRecords div.details th:after, -#mkwsShiftedTermlists div.details th:after { +#mkwsRecords div.details th:after { content: ":"; }