From: Mike Taylor Date: Mon, 20 Oct 2014 10:29:56 +0000 (+0100) Subject: Merge X-Git-Tag: 1.0.0~155^2~7 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=d7f7e11af10210fd9872cedc1489fe0b692ca589;hp=f69896a57bf98c06faba50f63a1e6d099b57ac27 Merge --- diff --git a/examples/htdocs/mike.html b/examples/htdocs/mike.html index 69a070a..d6f52d6 100644 --- a/examples/htdocs/mike.html +++ b/examples/htdocs/mike.html @@ -7,7 +7,7 @@ sp_auth_credentials: "mkwstest/mkwstest" } - + diff --git a/examples/htdocs/mike2.html b/examples/htdocs/mike2.html index 21d95f9..99aa581 100644 --- a/examples/htdocs/mike2.html +++ b/examples/htdocs/mike2.html @@ -7,7 +7,7 @@ sp_auth_credentials: "mkwstest/mkwstest" } - + @@ -28,7 +28,7 @@ -
+
diff --git a/src/mkws-core.js b/src/mkws-core.js index 3a4fa5b..12fbcf4 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -286,6 +286,23 @@ mkws.log("Using window.name '" + window.name + "'"); // 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 @@ -306,7 +323,9 @@ mkws.log("Using window.name '" + window.name + "'"); 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(); } } @@ -443,9 +462,14 @@ mkws.log("Using window.name '" + window.name + "'"); 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; } diff --git a/src/mkws-team.js b/src/mkws-team.js index 0879add..2cc27c0 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -340,10 +340,10 @@ mkws.makeTeam = function($, teamName) { // switching view between targets and records function switchView(view) { - var targets = widgetNode('Targets'); - var results = widgetNode('Results') || widgetNode('Records'); - var blanket = widgetNode('Blanket'); - var motd = widgetNode('MOTD'); + var targets = widgetNode('targets'); + var results = widgetNode('results') || widgetNode('records'); + var blanket = widgetNode('blanket'); + var motd = widgetNode('motd'); switch(view) { case 'targets': diff --git a/src/mkws.templates/Progress.handlebars b/src/mkws.templates/Progress.handlebars index 1b08a2c..cb78cae 100644 --- a/src/mkws.templates/Progress.handlebars +++ b/src/mkws.templates/Progress.handlebars @@ -4,8 +4,8 @@ Progress done - number of targets complete waiting - number of targets waiting }} -{{#mkws-repeat done}}█{{/mkws-repeat}} +{{#mkws-repeat done}}█{{/mkws-repeat}} {{~#if waiting~}} -{{#mkws-repeat waiting}}█{{/mkws-repeat}} +{{#mkws-repeat waiting}}█{{/mkws-repeat}} {{~/if~}} diff --git a/src/mkws.templates/Search.handlebars b/src/mkws.templates/Search.handlebars index 5530013..182b852 100644 --- a/src/mkws.templates/Search.handlebars +++ b/src/mkws.templates/Search.handlebars @@ -4,8 +4,8 @@ Search form team - MKWS team queryWidth - configured width for search box }} -
- - + + +
diff --git a/tools/htdocs/mkws.css b/tools/htdocs/mkws.css index cb5f2e7..db7bffa 100644 --- a/tools/htdocs/mkws.css +++ b/tools/htdocs/mkws.css @@ -1,87 +1,87 @@ -.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; @@ -94,20 +94,20 @@ 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; @@ -118,11 +118,11 @@ -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; @@ -132,23 +132,23 @@ -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; @@ -161,47 +161,47 @@ -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; @@ -209,10 +209,10 @@ 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! */ }