X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-main.js;h=a688eac6b4b98eeba04346ab17e53b5cda0ce6b0;hb=8d43b38a531101963703b6e98681d0de683298ff;hp=cf2c46f553e699428eaffa88b48adaac8ccf3069;hpb=7ae0d57e755ed6b96ae06cae7eb820e72cd270c1;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index cf2c46f..a688eac 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -7,8 +7,8 @@ mkws.registerWidgetType('Targets', function() { var that = this; var M = mkws.M; - $(this.node).html('No information available yet.'); - $(this.node).css("display", "none"); + this.jqnode.html('No information available yet.'); + this.jqnode.css("display", "none"); this.team.queue("targets").subscribe(function(data) { var table ='' + @@ -28,7 +28,7 @@ mkws.registerWidgetType('Targets', function() { } table += '
'; - $(that.node).html(table); + that.jqnode.html(table); }); }); @@ -38,13 +38,10 @@ mkws.registerWidgetType('Stat', function() { var M = mkws.M; this.team.queue("stat").subscribe(function(data) { - if (that.node.length === 0) alert("huh?!"); - - $(that.node).html('' + M('Status info') + '' + - ' -- ' + - '' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '' + + that.jqnode.html(' -- ' + + '' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '' + ' -- ' + - '' + M('Retrieved records') + ': ' + data.records + '/' + data.hits + ''); + M('Retrieved records') + ': ' + data.records + '/' + data.hits); }); }); @@ -54,7 +51,7 @@ mkws.registerWidgetType('Pager', function() { var M = mkws.M; this.team.queue("pager").subscribe(function(data) { - $(that.node).html(drawPager(data)) + that.jqnode.html(drawPager(data)) function drawPager(data) { var teamName = that.team.name(); @@ -123,7 +120,7 @@ mkws.registerWidgetType('Records', function() { var hit = data.hits[i]; that.team.queue("record").publish(hit); var divId = team.recordElementId(hit.recid[0]); - html.push('
', renderSummary(hit), '
'); + html.push('
', renderSummary(hit), '
'); // ### At some point, we may be able to move the // m_currentRecordId and m_currentRecordData members // from the team object into this widget. @@ -132,7 +129,7 @@ mkws.registerWidgetType('Records', function() { html.push(team.renderDetails(team.currentRecordData())); } } - $(that.node).html(html.join('')); + that.jqnode.html(html.join('')); function renderSummary(hit) { var template = team.loadTemplate(that.config.template || "Summary"); @@ -157,18 +154,18 @@ mkws.registerWidgetType('Navi', function() { filters.visitTargets(function(id, name) { if (text) text += " | "; - text += M('source') + ': ' + name + ''; }); filters.visitFields(function(field, value) { if (text) text += " | "; - text += M(field) + ': ' + value + ''; }); - $(that.node).html(text); + that.jqnode.html(text); }); }); @@ -179,8 +176,8 @@ mkws.registerWidgetType('Navi', function() { mkws.registerWidgetType('Sort', function() { var that = this; - $(this.node).change(function() { - that.team.set_sortOrder($(that.node).val()); + this.jqnode.change(function() { + that.team.set_sortOrder(that.jqnode.val()); if (that.team.submitted()) { that.team.reShow(); } @@ -192,8 +189,8 @@ mkws.registerWidgetType('Sort', function() { mkws.registerWidgetType('Perpage', function() { var that = this; - $(this.node).change(function() { - that.team.set_perpage($(that.node).val()); + this.jqnode.change(function() { + that.team.set_perpage(that.jqnode.val()); if (that.team.submitted()) { that.team.reShow(); } @@ -206,14 +203,14 @@ mkws.registerWidgetType('Done', function() { var that = this; this.team.queue("complete").subscribe(function(n) { - $(that.node).html("Search complete: found " + n + " records"); + that.jqnode.html("Search complete: found " + n + " records"); }); }); mkws.registerWidgetType('Switch', function() { var tname = this.team.name(); - $(this.node).html('\ + this.jqnode.html('\ Records \ | \ Targets'); @@ -225,7 +222,7 @@ mkws.registerWidgetType('Search', function() { var tname = this.team.name(); var M = mkws.M; - $(this.node).html('\ + this.jqnode.html('\
\ \ \ @@ -234,8 +231,8 @@ mkws.registerWidgetType('Search', function() { mkws.registerWidgetType('SearchForm', function() { - var team = this.team; - $(this.node).submit(function() { + var team = this.team; + this.jqnode.submit(function() { var val = team.widget('Query').value(); team.newSearch(val); return false; @@ -246,7 +243,7 @@ mkws.registerWidgetType('SearchForm', function() { mkws.registerWidgetType('Results', function() { var tname = this.team.name(); - $(this.node).html('\ + this.jqnode.html('\ \ \
\ @@ -284,7 +281,7 @@ mkws.registerWidgetType('Ranking', function() { } s += ''; - $(this.node).html(s); + this.jqnode.html(s); function mkwsHtmlSort() { @@ -372,7 +369,7 @@ mkws.registerWidgetType('Lang', function() { } } - $(this.node).html(data); + this.jqnode.html(data); widget.hideWhenNarrow(this); @@ -401,7 +398,7 @@ mkws.registerWidgetType('MOTD', function() { var container = this.team.widget('MOTDContainer'); if (container) { // Move the MOTD from the provided element down into the container - $(this.node).appendTo(container.node); + this.jqnode.appendTo(container.node); // #### can this be container.jqnode } });