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
Update tests to not expect top-level links in the summary.
[mkws-moved-to-github.git]
/
src
/
mkws-core.js
diff --git
a/src/mkws-core.js
b/src/mkws-core.js
index
fc63469
..
6bb98b3
100644
(file)
--- a/
src/mkws-core.js
+++ b/
src/mkws-core.js
@@
-132,6
+132,11
@@
mkws.getParameterByName = function(name, url) {
mkws.registerWidgetType = function(name, fn) {
mkws.registerWidgetType = function(name, fn) {
+ if(mkws._old2new.hasOwnProperty(name)) {
+ mkws.log("Warning: registerWidgetType old widget name: " + name + " => " + mkws._old2new[name]);
+ name = mkws._old2new[name];
+ }
+
mkws.widgetType2function[name] = fn;
mkws.log("registered widget-type '" + name + "'");
};
mkws.widgetType2function[name] = fn;
mkws.log("registered widget-type '" + name + "'");
};
@@
-143,9
+148,7
@@
mkws.promotionFunction = function(name) {
mkws.setMkwsConfig = function(overrides) {
// Set global log_level flag early so that mkws.log() works
mkws.setMkwsConfig = function(overrides) {
// Set global log_level flag early so that mkws.log() works
- // Fall back to old "debug_level" setting for backwards compatibility
var tmp = overrides.log_level;
var tmp = overrides.log_level;
- if (typeof(tmp) === 'undefined') tmp = overrides.debug_level;
if (typeof(tmp) !== 'undefined') mkws.log_level = tmp;
var config_default = {
if (typeof(tmp) !== 'undefined') mkws.log_level = tmp;
var config_default = {
@@
-295,6
+298,7
@@
mkws.log("Using window.name '" + window.name + "'");
'MOTDContainer': 'motd-container',
'Perpage': 'per-page',
'SearchForm': 'search-form',
'MOTDContainer': 'motd-container',
'Perpage': 'per-page',
'SearchForm': 'search-form',
+ 'ReferenceUniverse': 'reference-universe'
};
// Annoyingly, there is no built-in way to invert a hash
var _new2old = {};
};
// Annoyingly, there is no built-in way to invert a hash
var _new2old = {};
@@
-304,6
+308,7
@@
mkws.log("Using window.name '" + window.name + "'");
}
}
}
}
+ mkws._old2new = _old2new;
function handleNodeWithTeam(node, callback) {
// First branch for DOM objects; second branch for jQuery objects
function handleNodeWithTeam(node, callback) {
// First branch for DOM objects; second branch for jQuery objects
@@
-322,9
+327,13
@@
mkws.log("Using window.name '" + window.name + "'");
for (var i = 0; i < list.length; i++) {
var cname = list[i];
if (cname.match(/^mkws-team-/)) {
for (var i = 0; i < list.length; i++) {
var cname = list[i];
if (cname.match(/^mkws-team-/)) {
+ // New-style teamnames of the form mkws-team-xyz
teamName = cname.replace(/^mkws-team-/, '');
teamName = cname.replace(/^mkws-team-/, '');
+ } else if (cname.match(/^mkwsTeam_/)) {
+ // Old-style teamnames of the form mkwsTeam_xyz
+ teamName = cname.replace(/^mkwsTeam_/, '');
} else if (cname.match(/^mkws-/)) {
} else if (cname.match(/^mkws-/)) {
- // New-style names of the form mkws-foo-bar
+ // New-style names of the from mkws-foo-bar
type = cname.replace(/^mkws-/, '');
} else if (cname.match(/^mkws/)) {
// Old-style names of the form mkwsFooBar
type = cname.replace(/^mkws-/, '');
} else if (cname.match(/^mkws/)) {
// Old-style names of the form mkwsFooBar
@@
-338,7
+347,7
@@
mkws.log("Using window.name '" + window.name + "'");
teamName = "AUTO";
// Autosearch widgets don't join team AUTO if there is already an
// autosearch on the team or the team has otherwise gotten a query
teamName = "AUTO";
// Autosearch widgets don't join team AUTO if there is already an
// autosearch on the team or the team has otherwise gotten a query
- if (node.hasAttribute("autosearch")) {
+ if (node.getAttribute("autosearch")) {
if (mkws.autoHasAuto ||
mkws.teams["AUTO"] && mkws.teams["AUTO"].config["query"]) {
log("AUTO team already has a query, using unique team");
if (mkws.autoHasAuto ||
mkws.teams["AUTO"] && mkws.teams["AUTO"].config["query"]) {
log("AUTO team already has a query, using unique team");
@@
-490,7
+499,6
@@
mkws.log("Using window.name '" + window.name + "'");
var myTeam = mkws.teams[tname];
if (!myTeam) {
myTeam = mkws.teams[tname] = mkws.makeTeam($, tname);
var myTeam = mkws.teams[tname];
if (!myTeam) {
myTeam = mkws.teams[tname] = mkws.makeTeam($, tname);
- log("made MKWS team '" + tname + "'");
}
var oldHTML = this.innerHTML;
}
var oldHTML = this.innerHTML;
@@
-498,7
+506,7
@@
mkws.log("Using window.name '" + window.name + "'");
myTeam.addWidget(myWidget);
var newHTML = this.innerHTML;
if (newHTML !== oldHTML) {
myTeam.addWidget(myWidget);
var newHTML = this.innerHTML;
if (newHTML !== oldHTML) {
- log("widget " + tname + ":" + type + " HTML changed: reparsing");
+ myTeam.log("widget " + type + " HTML changed: reparsing");
makeWidgetsWithin(level+1, $(this));
}
});
makeWidgetsWithin(level+1, $(this));
}
});
@@
-598,7
+606,7
@@
mkws.log("Using window.name '" + window.name + "'");
for (var tName in mkws.teams) {
var myTeam = mkws.teams[tName]
myTeam.makePz2();
for (var tName in mkws.teams) {
var myTeam = mkws.teams[tName]
myTeam.makePz2();
- log("made PZ2 object for team '" + tName + "'");
+ myTeam.log("made PZ2 object");
/*
myTeam.visitWidgets(function(t, w) {
log(" has widget of type '" + t + "': " + w);
/*
myTeam.visitWidgets(function(t, w) {
log(" has widget of type '" + t + "': " + w);