* 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)
+if (mkws_config == null || typeof mkws_config != 'object') {
var mkws_config = {};
+}
// Wrapper for jQuery
(function ($) {
}
var now = $.now();
- var timestamp = (now - mkws.debug_time.start)/1000 + " (+" + (now - mkws.debug_time.last)/1000 + ") "
+ 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!!!
{
+
/* default mkws config */
var config_default = {
use_service_proxy: true,
mkws.debug_level = config_default.debug_level;
}
+ // make sure the mkws_config is a valid hash
+ if (!$.isPlainObject(mkws_config)) {
+ debug("ERROR: mkws_config is not an JS object, ignore it....");
+ mkws_config = {};
+ }
+
/* override standard config values by function parameters */
for (var k in config_default) {
if (typeof mkws_config[k] === 'undefined')
function newSearch(query, sort, targets)
{
debug("newSearch: " + query);
-
+
if (mkws_config.use_service_proxy && !mkws.authenticated) {
alert("searching before authentication");
return;