<div class="mkdru-detail"></div>
<div class="mkdru-results">
- <div class="mkdru-above mkdru-above-below"><span class="mkdru-pager"></span><span class="mkdru-counts"></span></div>
+ <div class="mkdru-above mkdru-above-below"><span class="mkdru-counts"></span><span class="mkdru-status"></span></div>
<div class="mkdru-navi"></div>
<ul class="mkdru-result-list"></ul>
<div class="mkdru-below mkdru-above-below"><span class="mkdru-pager"></span></div>
+// $Id$
+
+/**
+ * @file
+ * Module config.
+ */
<?php
function mkdru_admin_settings() {
$form['pz2_js_path']=array(
if (mkdru.state.query) {
mkdru.search();
}
- //mkdru.pz2.stat();
+ mkdru.pz2.stat();
//mkdru.pz2.bytarget();
};
mkdru.pz2Show = function (data) {
mkdru.totalRec = data.merged;
$('.mkdru-pager').html(mkdru.generatePager());
- var countsHtml = Drupal.t('Displaying: ') + (data.start + 1) +
- Drupal.t(' to ') + (data.start + data.num) + Drupal.t(' of ')
- + data.merged + Drupal.t(' (found: ') + data.total + ')';
- $('.mkdru-counts').html(countsHtml);
-
+ $('.mkdru-counts').html(Drupal.theme('mkdruCounts', data.start + 1,
+ data.num, data.merged, data.total));
var html = "";
for (var i = 0; i < data.hits.length; i++) {
html += Drupal.theme('mkdruResult', data.hits[i],
};
mkdru.pz2Status = function (data) {
+ $('.mkdru-status').html(Drupal.theme('mkdruStatus', data.activeclients, data.clients));
};
mkdru.pz2Term = function (data) {
border-width: 1px;
}
-.mkdru-counts {
+.mkdru-status {
float: right;
}
function mkdru_schema() {
$schema['mkdru'] = array(
'description' => t('Stores settings for mkdru nodes.'),
- 'fields' => array (
+ 'fields' => array(
'nid' => array(
'description' => t('The primary identifier for a node.'),
'type' => 'int',
// Delete variables
variable_del('pz2_js_path');
}
-?>
/**
* Implementation of hook_init()
*/
-function mkdru_init(){
+function mkdru_init() {
// Applies our module specific CSS to all pages. This works best because
// all CSS is aggregated and cached so we reduce the number of HTTP
// requests and the size is negligible.
return html;
};
+Drupal.theme.prototype.mkdruCounts = function(first, last, available, total) {
+ return first + Drupal.t(' to ') + last + Drupal.t(' of ') + available
+ + Drupal.t(' available (') + total + Drupal.t(' found)');
+};
+
+Drupal.theme.prototype.mkdruStatus = function(activeClients, clients) {
+ return Drupal.t('Waiting on ') + activeClients + Drupal.t(' out of ')
+ + clients + Drupal.t(' targets');
+};
+
Drupal.theme.prototype.mkdruFacet = function (terms, facet, max) {
var html = "";
for (var i = 0; i < terms.length && i < max; i++ ) {