-// Set up namespace and some state.
-var mkws = {
- sort: 'relevance',
- authenticated: false,
- filters: []
-};
-
-/*
- * global config object: mkws_config
- *
- * Needs to be defined in the HTML header before including this JS file.
- * Define empty mkws_config for simple applications that don't define it.
- */
-if (mkws_config == null || typeof mkws_config != 'object')) {
- var mkws_config = {};
-}
-
-// Wrapper for jQuery
-(function ($) {
-
-mkws.locale_lang = {
- "de": {
- "Authors": "Autoren",
- "Subjects": "Schlagwörter",
- "Sources": "Daten und Quellen",
- "Termlists": "Termlisten",
- "Next": "Weiter",
- "Prev": "Zurück",
- "Search": "Suche",
- "Sort by": "Sortieren nach",
- "and show": "und zeige",
- "per page": "pro Seite",
- "Displaying": "Zeige",
- "to": "von",
- "of": "aus",
- "found": "gefunden",
- "Title": "Titel",
- "Author": "Autor",
- "Date": "Datum",
- "Subject": "Schlagwort",
- "Location": "Ort",
- // ### to add: Records, Targets
-
- "dummy": "dummy"
- },
-
- "da": {
- "Authors": "Forfattere",
- "Subjects": "Emner",
- "Sources": "Kilder",
- "Termlists": "Termlists",
- "Next": "Næste",
- "Prev": "Forrige",
- "Search": "Søg",
- "Sort by": "Sorter efter",
- "and show": "og vis",
- "per page": "per side",
- "Displaying": "Viser",
- "to": "til",
- "of": "ud af",
- "found": "fandt",
- "Title": "Title",
- "Author": "Forfatter",
- "Date": "Dato",
- "Subject": "Emneord",
- "Location": "Lokation",
- // ### to add: Records, Targets
-
- "dummy": "dummy"
- }
-};
-
-// keep time state for debugging
-mkws.debug_time = {
- "start": $.now(),
- "last": $.now()
-};
-
-mkws.debug_function = function (string) {
- if (!mkws.debug_level)
- return;
-
- if (typeof console === "undefined" || typeof console.log === "undefined") { /* ARGH!!! old IE */
- return;
- }
-
- var now = $.now();
- var timestamp = ((now - mkws.debug_time.start)/1000).toFixed(3) + " (+" + ((now - mkws.debug_time.last)/1000).toFixed(3) + ") "
- mkws.debug_time.last = now;
-
- // you need to disable use strict at the top of the file!!!
- if (mkws.debug_level >= 3) {
- console.log(timestamp + arguments.callee.caller);
- } else if (mkws.debug_level >= 2) {
- console.log(timestamp + ">>> called from function " + arguments.callee.caller.name + ' <<<');
- }
- console.log(timestamp + string);
-}
-var debug = mkws.debug_function; // local alias
-