X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-core.js;h=c49dc21b06e5afae7ef00c065518acb47caf7b15;hb=982d745f200f2676f5324bab3f360cbdeff3ac71;hp=9cb794fdea7fb056b4c5393c5397f9c71e7ef1e6;hpb=24209a0a9c198492db94011f1cf7862ff80937f2;p=mkws-moved-to-github.git diff --git a/src/mkws-core.js b/src/mkws-core.js index 9cb794f..c49dc21 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -84,39 +84,38 @@ if (mkws_config == null || typeof mkws_config != 'object') { } - mkws.log = function(string) { - if (!mkws.log_level) - return; +mkws.log = function(string) { + if (!mkws.log_level) + return; - if (typeof console === "undefined" || typeof console.log === "undefined") { /* ARGH!!! old IE */ - return; - } + if (typeof console === "undefined" || typeof console.log === "undefined") { /* ARGH!!! old IE */ + return; + } + + // you need to disable use strict at the top of the file!!! + if (mkws.log_level >= 3) { + console.log(arguments.callee.caller); + } else if (mkws.log_level >= 2) { + console.log(">>> called from function " + arguments.callee.caller.name + ' <<<'); + } + console.log(string); +}; - // you need to disable use strict at the top of the file!!! - if (mkws.log_level >= 3) { - console.log(arguments.callee.caller); - } else if (mkws.log_level >= 2) { - console.log(">>> called from function " + arguments.callee.caller.name + ' <<<'); - } - console.log(string); - }; +mkws.registerWidgetType = function(name, fn) { + mkws.widgetType2function[name] = fn; + mkws.log("registered widget-type '" + name + "'"); +}; + +mkws.promotionFunction = function(name) { + return mkws.widgetType2function[name]; +}; // wrapper to call team() after page load (function(j) { var log = mkws.log; - mkws.registerWidgetType = function(name, fn) { - mkws.widgetType2function[name] = fn; - log("registered widget-type '" + name + "'"); - } - - mkws.promotionFunction = function(name) { - return mkws.widgetType2function[name]; - } - - function handleNodeWithTeam(node, callback) { // First branch for DOM objects; second branch for jQuery objects var classes = node.className || node.attr('class'); @@ -125,7 +124,7 @@ if (mkws_config == null || typeof mkws_config != 'object') { // undefined, we don't get an error message, but this // function and its callers, up several stack level, // silently return. What a crock. - mkws.log("handleNodeWithTeam() called on node with no classes"); + log("handleNodeWithTeam() called on node with no classes"); return; } var list = classes.split(/\s+/) @@ -181,39 +180,39 @@ if (mkws_config == null || typeof mkws_config != 'object') { // this module. mkws.switchView = function(tname, view) { mkws.teams[tname].switchView(view); - } + }; mkws.showDetails = function(tname, prefixRecId) { mkws.teams[tname].showDetails(prefixRecId); - } + }; mkws.limitTarget = function(tname, id, name) { mkws.teams[tname].limitTarget(id, name); - } + }; mkws.limitQuery = function(tname, field, value) { mkws.teams[tname].limitQuery(field, value); - } + }; mkws.delimitTarget = function(tname, id) { mkws.teams[tname].delimitTarget(id); - } + }; mkws.delimitQuery = function(tname, field, value) { mkws.teams[tname].delimitQuery(field, value); - } + }; mkws.showPage = function(tname, pageNum) { mkws.teams[tname].showPage(pageNum); - } + }; mkws.pagerPrev = function(tname) { mkws.teams[tname].pagerPrev(); - } + }; mkws.pagerNext = function(tname) { mkws.teams[tname].pagerNext(); - } + }; function defaultMkwsConfig() {