/***
Drilldown Addon Javascript Controller for version 1.5x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This version contains further efforts to solidify the
drilldown display.
***/
var DEBUG_OPTION = 1;
var addon_CDdrilldown_errors = "";
// GET SERVER NAME //
var addon_CDdrilldown_base = location.protocol + '//' + location.hostname + location.pathname;
addon_CDdrilldown_base = addon_CDdrilldown_base.substr(0,addon_CDdrilldown_base.lastIndexOf("/")); // Now works for OR installations installed in subdirectories.
// GENERATE A NEW HTTP OBJECT //
function addon_CDdrilldown_getHTTPObject()
{
if( typeof XMLHttpRequest != 'undefined' ){
// W3C-compliant
return new XMLHttpRequest();
}
// IE versions
try {
return new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
return false;
}
// THOUSANDS SEPARATOR //
function addon_CDdrilldown_thousands( val, separator)
{
var regExpRule = new RegExp('(-?[0-9]+)([0-9]{3})');
sVal = val + '';
if(separator === undefined)
{
separator = ",";
}
while(regExpRule.test(sVal))
{
sVal = sVal.replace(regExpRule, '$1'+separator+'$2');
}
return sVal;
}
// CLEAN UP SELECT TAGS //
function addon_CDdrilldown_uninit(){
// This should remove the features we added to the selects
// and re-enable any disabled tags, because they were being
// ignored. Shock horror.
var form = this;
var selects = form.getElementsByTagName( 'select');
for( var x=0; x');
readEachLine: // <-- Label
for (var x=0; x < lines.length; x++){
// READ EACH LINE one by one
var curLine = lines[x];
// END IT, FOR WEBHOSTS WHO APPEND PAGE RENDER TIMES (etc) TO THE OUTPUT //
// OR HANDLE A NEW FIELD (procedure for both is similar)
if( curLine == "~QUERYEND~" || curLine.substr(0,7) == "~FIELD:" ){
// Is there data for a previous field? In which case, sort and apply it before handling new field.
if( dataBuffer.length > 0 ){
// Reference the field's select tag
for (var y=0; y