projects
/
mkws-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
43d7ebc
)
Various widgets now use w.jqnode instead of $(w.node), and remaining uses of $(x...
author
Mike Taylor
<mike@indexdata.com>
Thu, 15 May 2014 10:15:52 +0000
(11:15 +0100)
committer
Mike Taylor
<mike@indexdata.com>
Thu, 15 May 2014 10:16:18 +0000
(11:16 +0100)
src/mkws-widget-authname.js
patch
|
blob
|
history
src/mkws-widget-builder.js
patch
|
blob
|
history
src/mkws-widget-categories.js
patch
|
blob
|
history
src/mkws-widget-log.js
patch
|
blob
|
history
src/mkws-widget-main.js
patch
|
blob
|
history
src/mkws-widget-termlists.js
patch
|
blob
|
history
diff --git
a/src/mkws-widget-authname.js
b/src/mkws-widget-authname.js
index
02cce99
..
abca07e
100644
(file)
--- a/
src/mkws-widget-authname.js
+++ b/
src/mkws-widget-authname.js
@@
-2,6
+2,6
@@
mkws.registerWidgetType('Authname', function() {
var that = this;
this.team.queue("authenticated").subscribe(function(authName) {
var that = this;
this.team.queue("authenticated").subscribe(function(authName) {
- $(that.node).html(authName);
+ that.jqnode.html(authName);
});
});
});
});
diff --git
a/src/mkws-widget-builder.js
b/src/mkws-widget-builder.js
index
22f016d
..
2092a75
100644
(file)
--- a/
src/mkws-widget-builder.js
+++ b/
src/mkws-widget-builder.js
@@
-2,11
+2,11
@@
mkws.registerWidgetType('Builder', function() {
var that = this;
var team = this.team;
var that = this;
var team = this.team;
- this.button = $('<button/>', {
+ this.button = mkws.$('<button/>', {
type: 'button',
text: this.config.text || "Build!"
});
type: 'button',
text: this.config.text || "Build!"
});
- $(this.node).append(this.button);
+ this.jqnode.append(this.button);
this.button.click(function() {
var query = team.widget('Query').value();
var sort = team.widget('Sort').value();
this.button.click(function() {
var query = team.widget('Query').value();
var sort = team.widget('Sort').value();
diff --git
a/src/mkws-widget-categories.js
b/src/mkws-widget-categories.js
index
aa25653
..
bec99f5
100644
(file)
--- a/
src/mkws-widget-categories.js
+++ b/
src/mkws-widget-categories.js
@@
-29,7
+29,7
@@
mkws.registerWidgetType('Categories', function() {
text.push("<option value='", id, "'>", name, "</option>");
});
text.push("</select>");
text.push("<option value='", id, "'>", name, "</option>");
});
text.push("</select>");
- $(that.node).html(text.join(''));
+ that.jqnode.html(text.join(''));
});
});
});
});
});
});
diff --git
a/src/mkws-widget-log.js
b/src/mkws-widget-log.js
index
828ac48
..
6f3947f
100644
(file)
--- a/
src/mkws-widget-log.js
+++ b/
src/mkws-widget-log.js
@@
-2,6
+2,6
@@
mkws.registerWidgetType('Log', function() {
var that = this;
this.team.queue("log").subscribe(function(teamName, timestamp, message) {
var that = this;
this.team.queue("log").subscribe(function(teamName, timestamp, message) {
- $(that.node).append(teamName + ": " + timestamp + message + "<br/>");
+ that.jqnode.append(teamName + ": " + timestamp + message + "<br/>");
});
});
});
});
diff --git
a/src/mkws-widget-main.js
b/src/mkws-widget-main.js
index
c3eac87
..
a688eac
100644
(file)
--- 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;
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 ='<table><thead><tr>' +
this.team.queue("targets").subscribe(function(data) {
var table ='<table><thead><tr>' +
@@
-28,7
+28,7
@@
mkws.registerWidgetType('Targets', function() {
}
table += '</tbody></table>';
}
table += '</tbody></table>';
- $(that.node).html(table);
+ that.jqnode.html(table);
});
});
});
});
@@
-38,9
+38,7
@@
mkws.registerWidgetType('Stat', function() {
var M = mkws.M;
this.team.queue("stat").subscribe(function(data) {
var M = mkws.M;
this.team.queue("stat").subscribe(function(data) {
- if (that.node.length === 0) alert("huh?!");
-
- $(that.node).html(' -- ' +
+ that.jqnode.html(' -- ' +
'<span class="mkwsClientCount">' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '</span>' +
' -- ' +
M('Retrieved records') + ': ' + data.records + '/' + data.hits);
'<span class="mkwsClientCount">' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '</span>' +
' -- ' +
M('Retrieved records') + ': ' + data.records + '/' + data.hits);
@@
-53,7
+51,7
@@
mkws.registerWidgetType('Pager', function() {
var M = mkws.M;
this.team.queue("pager").subscribe(function(data) {
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();
function drawPager(data) {
var teamName = that.team.name();
@@
-131,7
+129,7
@@
mkws.registerWidgetType('Records', function() {
html.push(team.renderDetails(team.currentRecordData()));
}
}
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");
function renderSummary(hit) {
var template = team.loadTemplate(that.config.template || "Summary");
@@
-167,7
+165,7
@@
mkws.registerWidgetType('Navi', function() {
');return false;">' + value + '</a>';
});
');return false;">' + value + '</a>';
});
- $(that.node).html(text);
+ that.jqnode.html(text);
});
});
});
});
@@
-178,8
+176,8
@@
mkws.registerWidgetType('Navi', function() {
mkws.registerWidgetType('Sort', function() {
var that = this;
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();
}
if (that.team.submitted()) {
that.team.reShow();
}
@@
-191,8
+189,8
@@
mkws.registerWidgetType('Sort', function() {
mkws.registerWidgetType('Perpage', function() {
var that = this;
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();
}
if (that.team.submitted()) {
that.team.reShow();
}
@@
-205,14
+203,14
@@
mkws.registerWidgetType('Done', function() {
var that = this;
this.team.queue("complete").subscribe(function(n) {
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();
});
});
mkws.registerWidgetType('Switch', function() {
var tname = this.team.name();
- $(this.node).html('\
+ this.jqnode.html('\
<a href="#" onclick="mkws.switchView(\'' + tname + '\', \'records\')">Records</a><span> \
| \
</span><a href="#" onclick="mkws.switchView(\'' + tname + '\', \'targets\')">Targets</a>');
<a href="#" onclick="mkws.switchView(\'' + tname + '\', \'records\')">Records</a><span> \
| \
</span><a href="#" onclick="mkws.switchView(\'' + tname + '\', \'targets\')">Targets</a>');
@@
-224,7
+222,7
@@
mkws.registerWidgetType('Search', function() {
var tname = this.team.name();
var M = mkws.M;
var tname = this.team.name();
var M = mkws.M;
- $(this.node).html('\
+ this.jqnode.html('\
<form name="mkwsSearchForm" class="mkwsSearchForm mkwsTeam_' + tname + '" action="" >\
<input class="mkwsQuery mkwsTeam_' + tname + '" type="text" size="' + this.config.query_width + '" />\
<input class="mkwsButton mkwsTeam_' + tname + '" type="submit" value="' + M('Search') + '" />\
<form name="mkwsSearchForm" class="mkwsSearchForm mkwsTeam_' + tname + '" action="" >\
<input class="mkwsQuery mkwsTeam_' + tname + '" type="text" size="' + this.config.query_width + '" />\
<input class="mkwsButton mkwsTeam_' + tname + '" type="submit" value="' + M('Search') + '" />\
@@
-234,7
+232,7
@@
mkws.registerWidgetType('Search', function() {
mkws.registerWidgetType('SearchForm', function() {
var team = this.team;
mkws.registerWidgetType('SearchForm', function() {
var team = this.team;
- $(this.node).submit(function() {
+ this.jqnode.submit(function() {
var val = team.widget('Query').value();
team.newSearch(val);
return false;
var val = team.widget('Query').value();
team.newSearch(val);
return false;
@@
-245,7
+243,7
@@
mkws.registerWidgetType('SearchForm', function() {
mkws.registerWidgetType('Results', function() {
var tname = this.team.name();
mkws.registerWidgetType('Results', function() {
var tname = this.team.name();
- $(this.node).html('\
+ this.jqnode.html('\
<table width="100%" border="0" cellpadding="6" cellspacing="0">\
<tr>\
<td class="mkwsTermlists-Container-wide mkwsTeam_' + tname + '" width="250" valign="top">\
<table width="100%" border="0" cellpadding="6" cellspacing="0">\
<tr>\
<td class="mkwsTermlists-Container-wide mkwsTeam_' + tname + '" width="250" valign="top">\
@@
-283,7
+281,7
@@
mkws.registerWidgetType('Ranking', function() {
}
s += '</form>';
}
s += '</form>';
- $(this.node).html(s);
+ this.jqnode.html(s);
function mkwsHtmlSort() {
function mkwsHtmlSort() {
@@
-371,7
+369,7
@@
mkws.registerWidgetType('Lang', function() {
}
}
}
}
- $(this.node).html(data);
+ this.jqnode.html(data);
widget.hideWhenNarrow(this);
widget.hideWhenNarrow(this);
@@
-400,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
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
}
});
}
});
diff --git
a/src/mkws-widget-termlists.js
b/src/mkws-widget-termlists.js
index
b282614
..
776ef5b
100644
(file)
--- a/
src/mkws-widget-termlists.js
+++ b/
src/mkws-widget-termlists.js
@@
-2,11
+2,11
@@
mkws.registerWidgetType('Termlists', function() {
var that = this;
// Initially hide the termlists; display when we get results
var that = this;
// Initially hide the termlists; display when we get results
- $(document).ready(function() {
- $(that.node).hide();
+ mkws.$(document).ready(function() {
+ that.jqnode.hide();
});
this.team.queue("termlists").subscribe(function(data) {
});
this.team.queue("termlists").subscribe(function(data) {
- $(that.node).show();
+ that.jqnode.show();
});
var acc = [];
});
var acc = [];
@@
-15,7
+15,7
@@
mkws.registerWidgetType('Termlists', function() {
for (var i = 0; i < facets.length; i++) {
acc.push('<div class="mkwsFacet mkwsTeam_', this.team.name(), '" data-mkws-facet="', facets[i], '">', '</div>');
}
for (var i = 0; i < facets.length; i++) {
acc.push('<div class="mkwsFacet mkwsTeam_', this.team.name(), '" data-mkws-facet="', facets[i], '">', '</div>');
}
- $(this.node).html(acc.join(''));
+ this.jqnode.html(acc.join(''));
widget.autosearch(this);
});
widget.autosearch(this);
});
@@
-63,6
+63,6
@@
mkws.registerWidgetType('Facet', function() {
acc.push('</div>');
}
acc.push('</div>');
}
- $(that.node).html(acc.join(''));
+ that.jqnode.html(acc.join(''));
});
});
});
});