projects
/
mkws-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New API functions registerWidgetType and promotionFunction
[mkws-moved-to-github.git]
/
src
/
mkws-core.js
diff --git
a/src/mkws-core.js
b/src/mkws-core.js
index
b11f53f
..
7df143a
100644
(file)
--- a/
src/mkws-core.js
+++ b/
src/mkws-core.js
@@
-14,6
+14,8
@@
var mkws = {
log_level: 1, // Will be overridden from mkws_config, but
// initial value allows jQuery popup to use logging.
teams: {},
log_level: 1, // Will be overridden from mkws_config, but
// initial value allows jQuery popup to use logging.
teams: {},
+ widgetType2function: {},
+
locale_lang: {
"de": {
"Authors": "Autoren",
locale_lang: {
"de": {
"Authors": "Autoren",
@@
-103,6
+105,16
@@
if (mkws_config == null || typeof mkws_config != 'object') {
mkws.log = log;
mkws.log = 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');
function handleNodeWithTeam(node, callback) {
// First branch for DOM objects; second branch for jQuery objects
var classes = node.className || node.attr('class');
@@
-162,8
+174,9
@@
if (mkws_config == null || typeof mkws_config != 'object') {
// The following functions are dispatchers for team methods that
// The following functions are dispatchers for team methods that
- // are called from the UI using a te3am-name rather than implicit
- // context.
+ // are called from the UI using a team-name rather than implicit
+ // context. Apart from mkws.log, they are the ONLY public UI to
+ // this module.
mkws.switchView = function(tname, view) {
mkws.teams[tname].switchView(view);
}
mkws.switchView = function(tname, view) {
mkws.teams[tname].switchView(view);
}
@@
-296,7
+309,6
@@
if (mkws_config == null || typeof mkws_config != 'object') {
$(document).ready(function() {
$(document).ready(function() {
- log("on load ready");
defaultMkwsConfig();
if (mkws_config.query_width < 5 || mkws_config.query_width > 150) {
defaultMkwsConfig();
if (mkws_config.query_width < 5 || mkws_config.query_width > 150) {