var series = record.series();
for( var s in series ) {
debug("Found series entry: " + series[s] );
- this.seriesBox.addItem(
- this.mkSeriesLink(series[s]), series[s] );
+ var ss = normalize(series[s]);
+ this.seriesBox.addItem( this.mkSeriesLink(ss), ss );
}
/* requestBatch will only have one request in it when the current
else throw E;
}
+ /*
var row = getById("hourglass_row");
- if(row)
- row.parentNode.removeChild(row);
+ if(row) row.parentNode.removeChild(row);
+ */
if(obj.hitCount > 0) obj.buildNextLinks();
- else obj.noHits();
+ else {
+ var row = getById("hourglass_row");
+ if(row) row.parentNode.removeChild(row);
+ obj.noHits();
+ return;
+ }
obj.doMRSearch();
debug("Kicking off the record id's request");
- }
+ }
);
creq.send();
}
request.setCompleteCallback(
function(req) {
+
+ var row = getById("hourglass_row");
+ if(row)
+ row.parentNode.removeChild(row);
+
var result = req.getResultObject();
if(result == null) return;
result.count = obj.hitCount;
MRResultPage.prototype.collectRecords = function() {
-
var i = this.searchOffset;
var row = getById("hourglass_row");
MRResultPage.prototype.doCopyCount = function( record, search_id, page_id ) {
- if(record == null) return;
+ if(record==null || !record) return;
var copy_box = getById("record_result_copy_count_box_" + page_id );
+/* split on spaces. capitalize the first /\w/ character in
+ each substring */
function normalize(val) {
+
var newVal = '';
val = val.split(' ');
- for(var c=0; c < val.length; c++) {
- var string = val[c];
+ var reg = /\w/;
+
+ for( var c = 0; c < val.length; c++) {
+ var string = val[c];
+ var cap = false;
for(var x = 0; x != string.length; x++) {
- if(x==0)
- newVal += string.charAt(x).toUpperCase();
- else
- newVal += string.charAt(x).toLowerCase();
+
+ if(!cap) {
+ var ch = string.charAt(x);
+ if(reg.exec(ch + "")) {
+ newVal += string.charAt(x).toUpperCase();
+ cap = true;
+ continue;
+ }
+ }
+
+ newVal += string.charAt(x).toLowerCase();
}
if(c < (val.length-1)) newVal += " ";
}
+
+ newVal = newVal.replace(/\s*\.\s*$/,'');
+ newVal = newVal.replace(/\s*\/\s*\/\s*$/,' / ');
+ newVal = newVal.replace(/\s*\/\s*$/,'');
+
return newVal;
}