<!-- Test case: using single JS files in the right order, MKWS config in HEAD
before JS files loaded, and a broken jQuery object in BODY section -->
<body>
- <div class="mkwsAuthname"></div>
- <div class="mkwsSwitch"></div>
- <div class="mkwsLang"></div>
- <div class="mkwsProgress"></div>
- <div class="mkwsSearch"></div>
- <div class="mkwsResults"></div>
- <div class="mkwsTargets"></div>
- <div class="mkwsStat"></div>
+ <div class="mkws-authname mkwsAuthname"></div>
+ <div class="mkws-switch mkwsSwitch"></div>
+ <div class="mkws-lang mkwsLang"></div>
+ <div class="mkws-progress mkwsProgress"></div>
+ <div class="mkws-search mkwsSearch"></div>
+ <div class="mkws-results mkwsResults"></div>
+ <div class="mkws-targets mkwsTargets"></div>
+ <div class="mkws-stat mkwsStat"></div>
<!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script> -->
<script type="text/javascript">
debug("init popup window");
var popup_window = $(this.node);
- // var popup_window = $(".mkwsPopup"); // $(document).ready()
+ // var popup_window = $(".mkws-popup mkwsPopup"); // $(document).ready()
if (!popup_window) {
debug("no popup found, skip...");
return;
close: function() {}
});
- // open at search query submit: "input.mkwsButton"
+ // open at search query submit: "input.mkws-button mkwsButton"
var id_botton = that.attr("popup_button");
if (id_botton) {
$(id_botton).button().click(function() {
// Used by the Records widget and onRecord()
function recordElementId(s) {
- return 'mkwsRec_' + s.replace(/[^a-z0-9]/ig, '_');
+ return 'mkws-rec_' + s.replace(/[^a-z0-9]/ig, '_');
}
that.recordElementId = recordElementId;
// Used by onRecord(), showDetails() and renderDetails()
function recordDetailsId(s) {
- return 'mkwsDet_' + s.replace(/[^a-z0-9]/ig, '_');
+ return 'mkws-det_' + s.replace(/[^a-z0-9]/ig, '_');
}
teamName = teamName || m_teamName;
if (teamName === 'AUTO') {
- selector = (selector + '.mkwsTeam_' + teamName + ',' +
- selector + ':not([class^="mkwsTeam"],[class*=" mkwsTeam"])');
+ selector = (selector + '.mkws-team-' + teamName + ',' +
+ selector + ':not([class^="mkws-team"],[class*=" mkws-team"])');
} else {
- selector = selector + '.mkwsTeam_' + teamName;
+ selector = selector + '.mkws-team-' + teamName;
}
var node = $(selector);
function renderDetails(data, marker) {
var template = loadTemplate("Record");
var details = template(data);
- return '<div class="mkwsDetails mkwsTeam_' + m_teamName + '" ' +
+ return '<div class="mkws-details mkwsDetails mkwsTeam_' + m_teamName + '" ' +
'id="' + recordDetailsId(data.recid[0]) + '">' + details + '</div>';
}
that.renderDetails = renderDetails;
node = $(".mkws-template-" + name);
}
if (node && node.length < 1) {
- node = $(".mkwsTemplate_" + name + " .mkwsTeam_" + that.name());
+ node = $(".mkws-template_" + name + " .mkws-team-" + that.name());
}
if (node && node.length < 1) {
- node = $(".mkwsTemplate_" + name);
+ node = $(".mkws-template_" + name);
}
if (node) source = node.html();
if (!source) source = m_templateText[name];
var sort = team.widget('sort').value();
var perpage = team.widget('per-page').value();
- var html = ('<div class="mkwsRecords" ' +
+ var html = ('<div class="mkws-records mkwsRecords" ' +
'autosearch="' + query + '" ' +
'sort="' + sort + '" ' +
'perpage="' + perpage + '"></div>');
var text = [];
text.push("Select category: ");
- text.push("<select name='mkwsCategory' " +
+ text.push("<select name='mkws-category mkwsCategory' " +
"onchange='mkws.limitCategory(\"" + that.team.name() + "\", this.value)'>");
text.push("<option value=''>[All]</option>");
$(data).find('category').each(function() {
that.team.queue("record").publish(hit);
hit.detailLinkId = team.recordElementId(hit.recid[0]);
hit.detailClick = "mkws.showDetails('" + team.name() + "', '" + hit.recid[0] + "');return false;";
- hit.containerClass = "mkwsSummary mkwsTeam_" + team.name();
+ hit.containerClass = "mkws-summary mkwsSummary mkws-team-" + team.name();
hit.containerClass += " " + hit.detailLinkId;
// ### At some point, we may be able to move the
// m_currentRecordId and m_currentRecordData members
<i>{{md-title-responsibility}}</i>
{{/if}}
{{{mkws-paragraphs md-description paragraphs sentences}}}
-<p class="mkwsCredit">Wikipedia</p>
+<p class="mkws-credit mkwsCredit">Wikipedia</p>
}
var s = [];
- s.push('<div class="mkws', type, ' mkwsTeam_', attrs._team, '"');
+ s.push('<div class="mkws', type, ' mkws-team-', attrs._team, '"');
for (var name in attrs) {
if (name !== '_team')
s.push(' ', name, '="', attrs[name], '"');
field - for the xtargets facet ONLY, the opaque identifier of the target
}}
-<div class="mkwsFacetTitle">{{caption}}</div>
+<div class="mkws-facet-title mkwsFacetTitle">{{caption}}</div>
{{#each terms}}
- <div class="mkwsTerm">
+ <div class="mkws-term mkwsTerm">
<a href="#" {{{linkdata}}}>{{term}}</a> <span>{{count}}</span>
</div>
{{/each}}
click - handler script to remove limit
}}
{{#each filters}}
- {{{mkws-translate facet}}}: <a class="mkwsRemovable" href="#" onclick="{{{click}}}">{{value}}</a>
+ {{{mkws-translate facet}}}: <a class="mkws-removable mkwsRemovable" href="#" onclick="{{{click}}}">{{value}}</a>
{{#unless @last}}|{{/unless}}
{{/each}}
<div style="float: clear">
{{#if prevClick}}
- <a href="#" class="mkwsPrev" onclick="{{prevClick}}"><< {{{mkws-translate "Prev"}}}</a> |
+ <a href="#" class="mkws-prev mkwsPrev" onclick="{{prevClick}}"><< {{{mkws-translate "Prev"}}}</a> |
{{else}}
- <span class="mkwsPrev"><< {{{mkws-translate "Prev"}}}</span> |
+ <span class="mkws-prev mkwsPrev"><< {{{mkws-translate "Prev"}}}</span> |
{{/if}}
{{#if morePrev}}...{{/if}}
{{#if click}}
<a href="#" onclick="{{click}}">{{number}}</a>
{{else}}
- <span class="mkwsCurrentPage">{{number}}</span>
+ <span class="mkws-current-page mkwsCurrentPage">{{number}}</span>
{{/if}}
{{/each}}
{{#if moreNext}}...{{/if}}
{{#if nextClick}}
- | <a href="#" class="mkwsNext" onclick="{{nextClick}}">{{{mkws-translate "Next"}}} >></a>
+ | <a href="#" class="mkws-next mkwsNext" onclick="{{nextClick}}">{{{mkws-translate "Next"}}} >></a>
{{else}}
- | <span class="mkwsNext">{{{mkws-translate "Next"}}} >></span>
+ | <span class="mkws-next mkwsNext">{{{mkws-translate "Next"}}} >></span>
{{/if}}
</div>
done - number of targets complete
waiting - number of targets waiting
}}
-<span class="mkws-done mkwsDone">{{#mkws-repeat done}}█{{/mkws-repeat}}</span>
+<span class="mkws-done mkws-done mkwsDone">{{#mkws-repeat done}}█{{/mkws-repeat}}</span>
{{~#if waiting~}}
-<span class="mkws-waiting mkwsWaiting">{{#mkws-repeat waiting}}█{{/mkws-repeat}}</span>
+<span class="mkws-waiting mkws-waiting mkwsWaiting">{{#mkws-repeat waiting}}█{{/mkws-repeat}}</span>
{{~/if~}}
<form>
{{~#if showSort~}}
{{{mkws-translate "Sort by"}}}
- <select class="mkwsSort mkwsTeam_{{team}}">
+ <select class="mkws-sort mkwsSort mkws-team-{{team}}">
{{#each sort}}
{{#if selected}}
<option value="{{{key}}}" selected="selected">{{{mkws-translate label}}}</option>
{{~/if~}}
{{~#if showPerPage}}
{{{mkws-translate "and show"}}}
- <select class="mkwsPerpage mkwsTeam_{{team}}">
+ <select class="mkws-perpage mkwsPerpage mkws-team-{{team}}">
{{#each perPage}}
{{#if selected}}
<option value="{{perPage}}" selected="selected">{{perPage}}</option>
}}
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td class="mkwsTermlists-Container-wide mkwsTeam_{{team}}" width="250" valign="top">
- <div class="mkwsTermlists mkwsTeam_{{team}}"></div>
+ <td class="mkws-termlists-container-wide mkws-team-{{team}}" width="250" valign="top">
+ <div class="mkws-termlists mkwsTermlists mkws-team-{{team}}"></div>
</td>
- <td class="mkwsMOTDContainer mkwsTeam_{{team}}" valign="top">
- <div class="mkwsRanking mkwsTeam_{{team}}"></div>
- <div class="mkwsPager mkwsTeam_{{team}}"></div>
- <div class="mkwsNavi mkwsTeam_{{team}}"></div>
- <div class="mkwsRecords mkwsTeam_{{team}}"></div>
+ <td class="mkws-motd-container mkwsMOTDContainer mkws-team-{{team}}" valign="top">
+ <div class="mkws-ranking mkwsRanking mkws-team-{{team}}"></div>
+ <div class="mkws-pager mkwsPager mkws-team-{{team}}"></div>
+ <div class="mkws-navi mkwsNavi mkws-team-{{team}}"></div>
+ <div class="mkws-records mkwsRecords mkws-team-{{team}}"></div>
</td>
</tr>
<tr>
<td colspan="2">
- <div class="mkwsTermlists-Container-narrow mkwsTeam_{{team}}"></div>
+ <div class="mkws-termlists-container-narrow mkws-team-{{team}}"></div>
</td>
</tr>
</table>
queryWidth - configured width for search box
}}
<form name="mkws-search-form" class="mkws-search-form mkws-team-{{team}}" action="">
- <input class="mkws-query mkwsQuery mkws-team-{{team}}" type="text" size="{{queryWidth}}">
- <input class="mkws-button mkwsButton mkws-team-{{team}}" type="submit" value="{{{mkws-translate "Search"}}}">
+ <input class="mkws-query mkws-query mkwsQuery mkws-team-{{team}}" type="text" size="{{queryWidth}}">
+ <input class="mkws-button mkws-button mkwsButton mkws-team-{{team}}" type="submit" value="{{{mkws-translate "Search"}}}">
</form>
records - number of records returned and available
hits - number of hits across all targets
}}
- -- <span class="mkwsClientCount">{{{mkws-translate "Active clients"}}} : {{activeclients}}/{{clients}}</span> -- {{{mkws-translate "Retrieved records"}}} : {{records}}/{{hits}}
+ -- <span class="mkws-client-count mkwsClientCount">{{{mkws-translate "Active clients"}}} : {{activeclients}}/{{clients}}</span> -- {{{mkws-translate "Retrieved records"}}} : {{records}}/{{hits}}
facets - array of facet names
}}
-<div class="mkwsTermlistsTitle">Termlists</div>
+<div class="mkws-termlists-title mkwsTermlistsTitle">Termlists</div>
{{#each facets}}
- <div class="mkwsFacet mkwsTeam_{{../team}}" data-mkws-facet="{{this}}"></div>
+ <div class="mkws-facet mkwsFacet mkws-team-{{../team}}" data-mkws-facet="{{this}}"></div>
{{/each}}