X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-main.js;h=51bd5c159951e871f2fa0605ade1b91271c54c9f;hb=d5b0c54c73c244c321cbbb87b5686267f46e5535;hp=41201dd87c711660cf37aa3d6e0aeb33dcaa7f0c;hpb=d2b83a91581809fa14754b891a074f102f9f3400;p=mkws-moved-to-github.git
diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js
index 41201dd..51bd5c1 100644
--- a/src/mkws-widget-main.js
+++ b/src/mkws-widget-main.js
@@ -7,10 +7,7 @@ mkws.registerWidgetType('Targets', function() {
var that = this;
var M = mkws.M;
- $(this.node).html('\
-
\
-No information available yet.\
-
');
+ $(this.node).html('No information available yet.');
$(this.node).css("display", "none");
this.team.queue("targets").subscribe(function(data) {
@@ -24,15 +21,14 @@ No information available yet.\
for (var i = 0; i < data.length; i++) {
table += "" + data[i].id +
- " | " + data[i].hits +
- " | " + data[i].diagnostic +
- " | " + data[i].records +
- " | " + data[i].state + " |
";
+ "" + data[i].hits +
+ " | " + data[i].diagnostic +
+ " | " + data[i].records +
+ " | " + data[i].state + " | ";
}
table += '';
- var subnode = $(that.node).children('.mkwsBytarget');
- subnode.html(table);
+ $(that.node).html(table);
});
});
@@ -45,10 +41,10 @@ mkws.registerWidgetType('Stat', function() {
if (that.node.length === 0) alert("huh?!");
$(that.node).html('' + M('Status info') + '' +
- ' -- ' +
- '' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '' +
- ' -- ' +
- '' + M('Retrieved records') + ': ' + data.records + '/' + data.hits + '');
+ ' -- ' +
+ '' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '' +
+ ' -- ' +
+ '' + M('Retrieved records') + ': ' + data.records + '/' + data.hits + '');
});
});
@@ -63,9 +59,9 @@ mkws.registerWidgetType('Pager', function() {
function drawPager(data) {
var teamName = that.team.name();
var s = '' + M('Displaying') + ': '
- + (data.start + 1) + ' ' + M('to') + ' ' + (data.start + data.num) +
- ' ' + M('of') + ' ' + data.merged + ' (' + M('found') + ': '
- + data.total + ')
';
+ + (data.start + 1) + ' ' + M('to') + ' ' + (data.start + data.num) +
+ ' ' + M('of') + ' ' + data.merged + ' (' + M('found') + ': '
+ + data.total + ')';
//client indexes pages from 1 but pz2 from 0
var onsides = 6;
@@ -73,43 +69,43 @@ mkws.registerWidgetType('Pager', function() {
var currentPage = that.team.currentPage();
var firstClkbl = (currentPage - onsides > 0)
- ? currentPage - onsides
- : 1;
+ ? currentPage - onsides
+ : 1;
var lastClkbl = firstClkbl + 2*onsides < pages
- ? firstClkbl + 2*onsides
- : pages;
+ ? firstClkbl + 2*onsides
+ : pages;
var prev = '<< ' + M('Prev') + ' | ';
if (currentPage > 1)
- prev = ''
- +'<< ' + M('Prev') + ' | ';
+ prev = ''
+ +'<< ' + M('Prev') + ' | ';
var middle = '';
for(var i = firstClkbl; i <= lastClkbl; i++) {
- var numLabel = i;
- if(i == currentPage)
- numLabel = '' + i + '';
+ var numLabel = i;
+ if(i == currentPage)
+ numLabel = '' + i + '';
- middle += ' '
- + numLabel + ' ';
+ middle += ' '
+ + numLabel + ' ';
}
var next = ' | ' + M('Next') + ' >>';
if (pages - currentPage > 0)
- next = ' | '
- + M('Next') + ' >>';
+ next = ' | '
+ + M('Next') + ' >>';
var predots = '';
if (firstClkbl > 1)
- predots = '...';
+ predots = '...';
var postdots = '';
if (lastClkbl < pages)
- postdots = '...';
+ postdots = '...';
s += ''
- + prev + predots + middle + postdots + next + '
';
+ + prev + predots + middle + postdots + next + '';
return s;
}
@@ -132,8 +128,8 @@ mkws.registerWidgetType('Records', function() {
// m_currentRecordId and m_currentRecordData members
// from the team object into this widget.
if (hit.recid == team.currentRecordId()) {
- if (team.currentRecordData())
- html.push(team.renderDetails(team.currentRecordData()));
+ if (team.currentRecordData())
+ html.push(team.renderDetails(team.currentRecordData()));
}
}
$(that.node).html(html.join(''));
@@ -161,15 +157,15 @@ mkws.registerWidgetType('Navi', function() {
filters.visitTargets(function(id, name) {
if (text) text += " | ";
- text += M('source') + ': ' + name + '';
+ text += M('source') + ': ' + name + '';
});
filters.visitFields(function(field, value) {
if (text) text += " | ";
- text += M(field) + ': ' + value + '';
+ text += M(field) + ': ' + value + '';
});
$(that.node).html(text);
@@ -238,7 +234,7 @@ mkws.registerWidgetType('Search', function() {
mkws.registerWidgetType('SearchForm', function() {
- var team = this.team;
+ var team = this.team;
$(this.node).submit(function() {
var val = team.widget('Query').value();
team.newSearch(val);
@@ -279,7 +275,7 @@ mkws.registerWidgetType('Ranking', function() {
var that = this;
var M = mkws.M;
- var s = '