<title>MKWS demo client</title>
<script type="text/javascript">
- var mkws_config = {
+ var mkws_config = {
lang: "da",
debug: 1,
use_service_proxy: true,
- switch_menu: false,
- lang_menu: true,
- lang_display: ["da", "en"],
+ switch_menu: false,
+ lang_menu: true,
+ lang_display: ["da", "en"],
sort_default: "relevance",
query_width: 50,
responsive_design: true,
facets: ["authors", "sources", "subjects"],
perpage_default: 20
- };
+ };
</script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
<script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
<script type="text/javascript" src="mkws.js"></script>
<link rel="stylesheet" href="mkwsStyle.css" />
-
- <script type="text/javascript">
- var timeout;
-
- if (mkws_config.responsive_design) {
- $(window).resize( function(e) {
- if (timeout)
- clearTimeout(timeout);
- timeout = setTimeout(function () { mobile_resize() }, 100);
- });
- $(document).ready(function() { mobile_resize() });
- }
-
- function mobile_resize () {
- debug("resize width: " + $(window).height() + ", width: " + $(window).width());
- var list = ["mkwsSwitch"];
- var obj;
- // alert($(window).width());
-
- if ($(window).width() <= 980) {
- for(var i = 0; i < list.length; i++) {
- $("#" + list[i]).hide();
- }
-
- $("#termlist").parent().hide();
- obj = $("#termlist").parent().html();
- $("#mkwsTermlist").html(obj);
- } else {
- for(var i = 0; i < list.length; i++) {
- $("#" + list[i]).show();
- }
- $("#termlist").parent().show();
- $("#mkwsTermlist").html("");
- }
- };
- </script>
</head>
<body>
<!-- These six mkws <div>s are provided by MKWS -->
<div id="footer">
<div id="mkwsStat"></div>
- <span>Powered by MKWS © 2013 <a href="http://www.indexdata.com">Index Data</a></span>
+ <span>Powered by MKWS © 2013 <a href="http://www.indexdata.com">Index Data</a></span>
</div>
</body>
</html>
</table>');
mkws_html_switch(config);
+
if (mkws_config.use_service_proxy)
mkws_service_proxy_auth(config.service_proxy_auth);
+ if (mkws_config.responsive_design)
+ mkws_responsive_design();
+
domReady();
// on first page, hide the termlist
$(document).ready(function() { $("#termlist").parent().hide(); } );
}
+/* Responsive web design - change layout on the fly depending on
+ * the current screen size width/height. Required for mobile devices.
+ */
+function mkws_responsive_design () {
+ var timeout = null;
+
+ $(window).resize( function(e) {
+ if (timeout)
+ clearTimeout(timeout);
+ timeout = setTimeout(function () { mkws_mobile_resize() }, 100);
+ });
+
+ // initial check after page load
+ $(document).ready(function() { mkws_mobile_resize() });
+}
+
function mkws_set_lang(mkws_config) {
var lang = jQuery.parseQuerystring().lang || mkws_config.lang || "";
if (!lang || !mkws_locale_lang[lang]) {
$("#mkwsLang").html(data);
}
+function mkws_mobile_resize () {
+ debug("resize width: " + $(window).height() + ", width: " + $(window).width());
+ var list = ["mkwsSwitch"];
+ var obj;
+ // alert($(window).width());
+
+ if ($(window).width() <= 980) {
+ for(var i = 0; i < list.length; i++) {
+ $("#" + list[i]).hide();
+ }
+
+ $("#termlist").parent().hide();
+ obj = $("#termlist").parent().html();
+ $("#mkwsTermlist").html("<hr/>" + obj);
+ } else {
+ for(var i = 0; i < list.length; i++) {
+ $("#" + list[i]).show();
+ }
+ $("#termlist").parent().show();
+ $("#mkwsTermlist").html("");
+ }
+};
+
/* locale */
function M(word) {
var lang = mkws_config.lang;