<option value="or">any</option>
</select>
<label for="acq-unified-conjunction">
- of the following terms:
- </label>
+ of the following terms
+ </label> (
+ <input type="checkbox" id="acq-unified-build-progressively" />
+ <label for="acq-unified-build-progressively">
+ building the results list progressively
+ </label> )
+
+
</div>
<div id="acq-unified-terms">
<table id="acq-unified-terms-table">
</div>
<table width='100%'><tr>
<td align='left'>
- <button onclick="performSearch(0)">[% l('Search') %]</button>
+ <button onclick="smartSearchSubmitter()">[% l('Search') %]</button>
<button onclick='addSelectedToInvoice()'>
[% l('Add Selected Items to Invoice') %]
</button>
<span id='acq-inv-search-prev'>
- <a href='javascript:performSearch(-1)'>[% l('Previous') %]</a>
+ <a href='javascript:performSearch(-1, true)'>[% l('Previous') %]</a>
</span>
<span>
- <a href='javascript:performSearch(1)'>[% l('Next') %]</a>
+ <a href='javascript:performSearch(1, true)'>[% l('Next') %]</a>
</span>
</td>
<td align='right'>
<button onclick="termManager.addRow()">Add Search Term</button>
</div>
<div>
- <button
- onclick="resultManager.go(termManager.buildSearchObject())">
+ <button onclick="resultManager.submitter();">
Search
</button>
</div>
);
}
-function performSearch(pageDir) {
- clearSearchResTable();
+function performSearch(pageDir, clearFirst) {
+ if (clearFirst)
+ clearSearchResTable();
+
var searchObject = termManager.buildSearchObject();
dojo.cookie('invs', base64Encode(searchObject));
dojo.cookie('invc', dojo.byId("acq-unified-conjunction").getValue());
"no_results": {
"revealer": function() { }
}
+
};
+ resultManager.no_results_popup = true;
+ resultManager.submitter = smartSearchSubmitter;
+
var searchObject = dojo.cookie('invs');
console.log('loaded ' + searchObject);
if (searchObject) {
}
+function smartSearchSubmitter() {
+ performSearch(0, !dojo.byId('acq-unified-build-progressively').checked);
+}
+
openils.Util.addOnLoad(init);
dojo.connect(wStore[widgetKey], 'onkeyup',
function(e) {
if(e.keyCode == dojo.keys.ENTER) {
- resultManager.go(termManager.buildSearchObject());
+ resultManager.submitter();
}
}
);
dojo.connect(w.domNode, 'onkeyup',
function(e) {
if(e.keyCode == dojo.keys.ENTER) {
- resultManager.go(termManager.buildSearchObject());
+ resultManager.submitter();
}
}
);
this.liPager.focusLi();
}
- if (!this.count_results)
- this.show("no_results");
+ if (!this.count_results) {
+ if (this.no_results_popup)
+ alert(localeStrings.NO_RESULTS);
+ else
+ this.show("no_results");
+ }
else this.finish(this.result_type);
};
dijit.byId("acq-unified-inv-grid")
);
+ resultManager.submitter = function() {
+ resultManager.go(termManager.buildSearchObject());
+ };
+
uriManager = new URIManager();
if (uriManager.search_object) {
if (!uriManager.half_search)