// wrapper to provide local copy of the jQuery object.
(function($) {
var log = mkws.log;
+ var _old2new = { // Maps old-style widget names to new-style
+ 'Authname': 'auth-name',
+ 'ConsoleBuilder': 'console-builder',
+ 'Coverart': 'cover-art',
+ 'GoogleImage': 'google-image',
+ 'MOTD': 'motd',
+ 'MOTDContainer': 'motd-container',
+ 'Perpage': 'per-page',
+ 'SearchForm': 'search-form',
+ };
+ // Annoyingly, there is no built-in way to invert a hash
+ var _new2old = {};
+ for (var key in _old2new) {
+ if(_old2new.hasOwnProperty(key)) {
+ _new2old[_old2new[key]] = key;
+ }
+ }
function handleNodeWithTeam(node, callback) {
// First branch for DOM objects; second branch for jQuery objects
if (cname.match(/^mkwsTeam_/)) {
teamName = cname.replace(/^mkwsTeam_/, '');
} else if (cname.match(/^mkws/)) {
- type = cname.replace(/^mkws/, '');
+ // Old-style names of the form mkwsFooBar
+ var tmp = cname.replace(/^mkws/, '');
+ type = _old2new[tmp] || tmp.toLowerCase();
}
}
var s = "";
for (var type in mkws.widgetType2function) {
if (s) s += ',';
- s += '.mkws' + type;
- s += ',.mkws' + type + "-Container-wide";
- s += ',.mkws' + type + "-Container-narrow";
+ s += '.mkws-' + type;
+ s += ',.mkws-' + type + "-container-wide";
+ s += ',.mkws-' + type + "-container-narrow";
+ // Annoyingly, we also need to recognise old-style names
+ var oldtype = _new2old[type] || type.charAt(0).toUpperCase() + type.slice(1);
+ s += ',.mkws' + oldtype;
+ s += ',.mkws' + oldtype + "-Container-wide";
+ s += ',.mkws' + oldtype + "-Container-narrow";
}
return s;
}
-.mkwsLang,
-.mkwsSwitch,
-.mkwsSearch,
-.mkwsTermlists,
-.mkwsFacet,
-.mkwsRanking,
-.mkwsPager,
-.mkwsNavi,
-.mkwsRecords,
-.mkwsRecord,
-.mkwsTargets,
-.mkwsStat,
-.mkwsMOTD {
+.mkwsLang, .mkws-lang,
+.mkwsSwitch, .mkws-switch,
+.mkwsSearch, .mkws-search,
+.mkwsTermlists, .mkws-termlists,
+.mkwsFacet, .mkws-facet,
+.mkwsRanking, .mkws-ranking,
+.mkwsPager, .mkws-pager,
+.mkwsNavi, .mkws-navi,
+.mkwsRecords, .mkws-records,
+.mkwsRecord, .mkws-record,
+.mkwsTargets, .mkws-targets,
+.mkwsStat, .mkws-stat,
+.mkwsMOTD, .mkws-motd {
font-family: Gill Sans, "Gillius ADF", Gillius, GilliusADF, Verdana, Sans-Serif;
}
-.mkwsLang {
+.mkwsLang, .mkws-lang {
float: left;
padding-left: 1em;
padding-top: 0.4em;
}
-.mkwsLang a {
+.mkwsLang a, .mkws-lang a {
background: #d0e0ff;
padding: 1px 4px;
}
-.mkwsLang span {
+.mkwsLang span, .mkws-lang span {
border: solid 1px #d0e0ff;
padding: 0px 3px;
}
-.mkwsSearch {
+.mkwsSearch, .mkws-search {
float: right;
}
-.mkwsSwitch {
+.mkwsSwitch, .mkws-switch {
float: right;
padding-left: 1em;
padding-top: 0.4em;
}
-.mkwsTargets {
+.mkwsTargets, .mkws-targets {
background-color: #fafafa;
}
-.mkwsStat {
+.mkwsStat, .mkws-stat {
margin-top: 10px;
border-top: 1px solid #156a16;
padding-top: 5px;
font-size: small;
}
-.mkwsStat:before {
+.mkwsStat:before, .mkws-stat:before {
content: "Status info";
font-weight: bold;
}
-.mkwsSwitch a,
-.mkwsLang a,
-.mkwsFacet a,
-.mkwsRanking a,
-.mkwsPager a,
-.mkwsNavi a,
-.mkwsRecords a,
-.mkwsRecord a {
+.mkwsSwitch a, .mkws-switch a,
+.mkwsLang a, .mkws-lang a,
+.mkwsFacet a, .mkws-facet a,
+.mkwsRanking a, .mkws-ranking a,
+.mkwsPager a, .mkws-pager a,
+.mkwsNavi a, .mkws-navi a,
+.mkwsRecords a, .mkws-records a,
+.mkwsRecord a, .mkws-record a {
color: #005701;
text-decoration: none;
}
-.mkwsSwitch a:hover,
-.mkwsLang a:hover,
-.mkwsFacet a:hover,
-.mkwsPager a:hover,
-.mkwsRecords a:hover,
-.mkwsRecord a:hover {
+.mkwsSwitch a:hover, .mkws-switch a:hover,
+.mkwsLang a:hover, .mkws-lang a:hover,
+.mkwsFacet a:hover, .mkws-facet a:hover,
+.mkwsPager a:hover, .mkws-pager a:hover,
+.mkwsRecords a:hover, .mkws-records a:hover,
+.mkwsRecord a:hover, .mkws-record a:hover {
text-decoration: underline;
}
-.mkwsNavi a.mkwsRemovable:hover {
+.mkwsNavi a.mkwsRemovable:hover, .mkws-navi a.mkws-removable:hover {
text-decoration: line-through;
}
-.mkwsSearch input.mkwsButton {
+.mkwsSearch input.mkwsButton, .mkws-search input.mkws-button {
border: 3px outset #132194;
background-color: #132194;
padding: 2px;
cursor: pointer;
}
-.mkwsSearch input.mkwsQuery {
+.mkwsSearch input.mkwsQuery, .mkws-search input.mkws-query {
border: 2px inset #e0f0ff;
padding: 3px;
font-size: 12px;
background: #f0f8ff;
}
-.mkwsTermlistsTitle {
+.mkwsTermlistsTitle, .mkws-termlists-title {
font-size: large;
font-weight: bold;
text-transform: uppercase;
}
-.mkwsTermlists {
+.mkwsTermlists, .mkws-termlists {
background: #d0e0ff;
padding: 0.7em;
font-size: small;
-webkit-border-top-right-radius: 10px;
}
-.mkwsTermlists.active {
+.mkwsTermlists.active, .mkws-termlists.active {
display: block;
}
-.mkwsFacet {
+.mkwsFacet, .mkws-facet {
background: #e0f0ff;
padding: 0.7em;
margin-top: 0.7em;
-webkit-border-top-right-radius: 10px;
}
-.mkwsTerm {
+.mkwsTerm, .mkws-term {
clear: both;
}
-.mkwsTerm span {
+.mkwsTerm span, .mkws-term span {
float: right;
}
-.mkwsFacetTitle {
+.mkwsFacetTitle, .mkws-facet-title {
font-weight: bold;
}
-.mkwsSummary {
+.mkwsSummary, .mkws-summary {
padding: 5px;
}
-.mkwsDetails {
+.mkwsDetails, .mkws-details {
border: 1px solid #404040;
background: #e8e8e8;
color: black;
-webkit-border-top-right-radius: 10px;
}
-.mkwsDetails th {
+.mkwsDetails th, .mkws-details th {
text-align: right;
vertical-align: top;
padding-right: 0.6em;
}
-.mkwsDetails th:after {
+.mkwsDetails th:after, .mkws-details th:after {
content: ":";
}
-.mkwsPager {
+.mkwsPager, .mkws-pager {
background: #e0e0e0;
padding: 0.3em;
}
-.mkwsTargets table thead tr td {
+.mkwsTargets table thead tr td, .mkws-targets table thead tr td {
background-color: #132194;
color: white;
font-weight: bold;
padding: 0.2em 0.5em;
}
-.mkwsTargets table tbody tr:nth-child(odd) {
+.mkwsTargets table tbody tr:nth-child(odd), .mkws-targets table tbody tr:nth-child(odd) {
background-color: #e0f0ff;
}
-.mkwsTargets table tbody tr:nth-child(even) {
+.mkwsTargets table tbody tr:nth-child(even), .mkws-targets table tbody tr:nth-child(even) {
background-color: #d0e0ff;
}
-.mkwsTargets table tbody tr td {
+.mkwsTargets table tbody tr td, .mkws-targets table tbody tr td {
padding: 0.2em 0.5em;
}
-.mkwsCurrentPage {
+.mkwsCurrentPage, .mkws-current-page {
padding: 0.1em 0.5em;
background: #508751;
color: white;
}
-.mkwsProgress {
+.mkwsProgress, .mkws-progress {
border: 1px solid #c0c0c0;
float: left;
margin-left: 2em;
padding: 0 0.3em;
}
-.mkwsProgress .mkwsDone { color: #005701 }
-.mkwsProgress .mkwsWaiting { color: #c0c0c0 }
+.mkwsProgress .mkwsDone, .mkws-progress .mkws-done { color: #005701 }
+.mkwsProgress .mkwsWaiting, .mkws-progress .mkws-waiting { color: #c0c0c0 }
-.mkwsResults table {
+.mkwsResults table, .mkws-results table {
display: inline-table /* only for Firefox! */
}