diff --git a/DQM/TrackerCommon/BuildFile.xml b/DQM/TrackerCommon/BuildFile.xml new file mode 100644 index 0000000000000..3d9bd03638622 --- /dev/null +++ b/DQM/TrackerCommon/BuildFile.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/DQM/TrackerCommon/bin/BuildFile.xml b/DQM/TrackerCommon/bin/BuildFile.xml new file mode 100644 index 0000000000000..f889fe57cbd8c --- /dev/null +++ b/DQM/TrackerCommon/bin/BuildFile.xml @@ -0,0 +1,3 @@ + + + diff --git a/DQM/TrackerCommon/bin/TrackerRunCertification.C b/DQM/TrackerCommon/bin/TrackerRunCertification.C new file mode 100644 index 0000000000000..12547e0cc0370 --- /dev/null +++ b/DQM/TrackerCommon/bin/TrackerRunCertification.C @@ -0,0 +1,1311 @@ +// -*- C++ -*- +// +// Package: DQM/TrackerCommon +// +// +/** + \brief Performs DQM offline data certification for SiStrip, Pixel and Tracking + + Purpose: + + The procedure of certifying data of a given run range is automated in order to speed up the procedure and to reduce the Tracker Offline Shift Leader's workload. + + Input: + + - RunRegistry + - DQM output files available in AFS + + Output: + + Text file + - [as explained for command line option '-o'] + to be sent directly to the CMS DQM team as reply to the weekly certification request. + It contains a list of all flags changed with respect to the RunRegistry, including the reason(s) in case the flag is changed to BAD. + + The verbose ('-v') stdout can provide a complete list of all in-/output flags of all analyzed runs and at its end a summary only with the output flags. + It makes sense to pipe the stdout to another text file. + + Usage: + + $ cmsrel CMSSW_RELEASE + $ cd CMSSW_RELEASE/src + $ cmsenv + $ cvs co -r Vxx-yy-zz DQM/TrackerCommon + $ scram b -j 5 + $ rehash + $ cd WORKING_DIRECTORY + $ [create input files] + $ TrackerRunCertification [ARGUMENTOPTION1] [ARGUMENT1] ... [OPTION2] ... + + Valid argument options are: + -d + MANDATORY: dataset as in RunRegistry + no default + -g + MANDATORY: group name as in RunRegistry + no default + -p + path to DQM files + default: /afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/data/OfflineData/Run2010/StreamExpress + -P + pattern of DQM file names in the DQM file path + default: *[DATASET from '-d' option with '/' --> '__'].root + -o + path to output log file + default: ./trackerRunCertification[DATASET from '-d' option with '/' --> '__']-[GROUP from '-g'].txt + -L + path to file with DQM input file list + default: ./fileList[DATASET from '-d' option with '/' --> '__'].txt + -l + lower bound of run numbers to consider + default: 0 + -u + upper bound of run numbers to consider + default: 1073741824 (2^30) + -R + web address of the RunRegistry + default: http://pccmsdqm04.cern.ch/runregistry + The default is used for any option not explicitely given in the command line. + + Valid options are: + -rr + switch on creation of new RR file + -rronly + only create new RR file, do not run certification + -a + certify all runs, not only those in "SIGNOFF" status + -v + switch on verbose logging to stdout + -h + display this help and exit + + \author Volker Adler +*/ + +#include +#include +#include +#include +#include +#include +#include + +// RooT, needs '' in the BuildFile +#include "TROOT.h" +#include "TSystem.h" +#include "TString.h" +#include "TFile.h" +#include "TKey.h" +#include "TXMLEngine.h" // needs '' in the BuildFile + + +using namespace std; + + +// Functions +Bool_t createInputFileList(); +Bool_t createRRFile(); +Bool_t readData( const TString & pathFile ); +Bool_t readRR( const TString & pathFile ); +Bool_t readRRLumis( const TString & pathFile ); +Bool_t readRRTracker( const TString & pathFile ); +Bool_t readDQM( const TString & pathFile ); +void readCertificates( TDirectory * dir ); +void certifyRunRange(); +void certifyRun(); +void writeOutput(); +void displayHelp(); +TString RunNumber( const TString & pathFile ); +Int_t FlagConvert( const TString & flag ); +TString FlagConvert( const Int_t flag ); + +// Configurables +map< TString, TString > sArguments; +map< TString, Bool_t > sOptions; +TString convertDataset_; +Int_t minRange_; +Int_t maxRange_; +Int_t minRun_; +Int_t maxRun_; + +// Global constants +const TString nameFileRR_( "RunRegistry.xml" ); +const TString nameFileRunsRR_( TString( "runs" ).Append( nameFileRR_ ) ); +const TString nameFileLumisRR_( TString( "lumis" ).Append( nameFileRR_ ) ); +const TString nameFileTrackerRR_( TString( "tracker" ).Append( nameFileRR_ ) ); +const TString nameDirHead_( "DQMData" ); +const TString nameDirBase_( "EventInfo" ); +const TString nameDirCert_( "CertificationContents" ); +const TString nameDirReport_( "reportSummaryContents" ); +const TString nameDirDAQ_( "DAQContents" ); +const TString nameDirDCS_( "DCSContents" ); +const TString pathRunFragment_( "/Run /" ); +const UInt_t nSubSys_( 3 ); +const TString sSubSys_[ nSubSys_ ] = { // sub-system directory names in DQM files + "SiStrip", + "Pixel", + "Tracking", +}; +enum SubSystems { // according enumeration + SiStrip, + Pixel, + Tracking +}; +enum Flags { // flags' enumeration + MISSING = -100, + NOTSET = -99, + EXCL = -1, + BAD = 0, + GOOD = 1 +}; +const Double_t minGood_( 0.95 ); +const Double_t maxBad_( 0.85 ); +const Int_t iRunStartDecon_( 110213 ); // first run in deconvolution mode + +// Certificates and flags +vector< TString > sRunNumbers_; +UInt_t nRuns_( 0 ); +UInt_t nRunsNotRR_( 0 ); +UInt_t nRunsNotGroup_( 0 ); +UInt_t nRunsNotDataset_( 0 ); +UInt_t nRunsNotSignoff_( 0 ); +UInt_t nRunsNotRRLumis_( 0 ); +UInt_t nRunsNotDatasetLumis_( 0 ); +UInt_t nRunsSiStripOff_( 0 ); +UInt_t nRunsPixelOff_( 0 ); +UInt_t nRunsNotRRTracker_( 0 ); +UInt_t nRunsNotGroupTracker_( 0 ); +UInt_t nRunsNotDatasetTracker_( 0 ); +UInt_t nRunsExclSiStrip_( 0 ); +UInt_t nRunsMissSiStrip_( 0 ); +UInt_t nRunsBadSiStrip_( 0 ); +UInt_t nRunsChangedSiStrip_( 0 ); +map< TString, TString > sSiStrip_; +map< TString, TString > sRRSiStrip_; +map< TString, TString > sRRTrackerSiStrip_; +map< TString, TString > sDQMSiStrip_; +map< TString, vector< TString > > sRunCommentsSiStrip_; +map< TString, TString > sRRCommentsSiStrip_; +map< TString, TString > sRRTrackerCommentsSiStrip_; +UInt_t nRunsExclPixel_( 0 ); +UInt_t nRunsMissPixel_( 0 ); +UInt_t nRunsBadPixel_( 0 ); +UInt_t nRunsChangedPixel_( 0 ); +map< TString, TString > sPixel_; +map< TString, TString > sRRPixel_; +map< TString, TString > sRRTrackerPixel_; +map< TString, TString > sDQMPixel_; +map< TString, vector< TString > > sRunCommentsPixel_; +map< TString, TString > sRRCommentsPixel_; +map< TString, TString > sRRTrackerCommentsPixel_; +UInt_t nRunsNoTracking_( 0 ); +UInt_t nRunsBadTracking_( 0 ); +UInt_t nRunsChangedTracking_( 0 ); +map< TString, TString > sTracking_; +map< TString, TString > sRRTracking_; +map< TString, TString > sRRTrackerTracking_; +map< TString, TString > sDQMTracking_; +map< TString, vector< TString > > sRunCommentsTracking_; +map< TString, TString > sRRCommentsTracking_; +map< TString, TString > sRRTrackerCommentsTracking_; +// Certificates and flags (run-by-run) +TString sRunNumber_; +TString sVersion_; +map< TString, Double_t > fCertificates_; +map< TString, Int_t > iFlagsRR_; +map< TString, Int_t > iFlagsRRTracker_; +map< TString, Bool_t > bAvailable_; +Bool_t bSiStripOn_; +Bool_t bPixelOn_; + + + +/// Checks arguments and runs input check/creation and run certification incl. output +int main( int argc, char * argv[] ) +{ + + cout << endl; + + // Initialize defaults + sArguments[ "-d" ] = ""; // dataset + sArguments[ "-g" ] = ""; // group + sArguments[ "-p" ] = "/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/data/OfflineData/Run2010/StreamExpress"; // path to DQM files + sArguments[ "-P" ] = ""; // pattern of DQM file names in the DQM file path + sArguments[ "-l" ] = "0"; // lower bound of run numbers to consider + sArguments[ "-u" ] = "1073741824"; // 2^30 // upper bound of run numbers to consider + sArguments[ "-o" ] = ""; // path to main output file + sArguments[ "-L" ] = ""; // path to file with DQM input file list + sArguments[ "-R" ] = "http://pccmsdqm04.cern.ch/runregistry"; // web address of the RunRegistry + minRun_ = sArguments[ "-u" ].Atoi(); + maxRun_ = sArguments[ "-l" ].Atoi(); + sOptions[ "-rr" ] = kFALSE; + sOptions[ "-rronly" ] = kFALSE; + sOptions[ "-a" ] = kFALSE; + sOptions[ "-v" ] = kFALSE; + sOptions[ "-h" ] = kFALSE; + + // Input arguments (very simple) + if ( argc == 1 ) { + displayHelp(); + return 0; + } + for ( int iArgument = 1; iArgument < argc; ++iArgument ) { + if ( sArguments.find( argv[ iArgument ] ) != sArguments.end() ) { + if ( sArguments.find( argv[ iArgument + 1 ] ) == sArguments.end() && sOptions.find( argv[ iArgument + 1 ] ) == sOptions.end() ) { + sArguments[ argv[ iArgument ] ] = argv[ iArgument + 1 ]; + } + } else if ( sOptions.find( argv[ iArgument ] ) != sOptions.end() ) { + sOptions[ argv[ iArgument ] ] = kTRUE; + } + } + if ( sOptions[ "-h" ] ) { + displayHelp(); + return 0; + } + if ( sArguments[ "-d" ] == "" ) { + cerr << " ERROR: no dataset given with '-d' option" << endl; + return 1; + } + if ( sArguments[ "-g" ] == "" && ! sOptions[ "-rronly" ] ) { + cerr << " ERROR: no group name given with '-g' option" << endl; + return 1; + } + convertDataset_ = sArguments[ "-d" ]; + convertDataset_.ReplaceAll( "/", "__" ); + if ( sArguments[ "-o" ] == "" ) { + sArguments[ "-o" ] = TString( "trackerRunCertification" + convertDataset_ + "-" + sArguments[ "-g" ] + ".txt" ); + } + if ( sArguments[ "-L" ] == "" ) { + sArguments[ "-L" ] = TString( "fileList" + convertDataset_ + ".txt" ); + } + if ( sArguments[ "-P" ] == "" ) { + sArguments[ "-P" ] = TString( "*" + convertDataset_ + ".root" ); + } + minRange_ = sArguments[ "-l" ].Atoi(); + maxRange_ = sArguments[ "-u" ].Atoi(); + + // Run + if ( ! createInputFileList() ) return 12; + if ( sOptions[ "-rronly" ] ) { + if ( ! createRRFile() ) return 13; + return 0; + } + if ( sOptions[ "-rr" ] && ! createRRFile() ) return 13; + certifyRunRange(); + + return 0; + +} + + +/// Checks for DQM RooT files in pre-defined directory, compares to optinally given run range and writes the resulting file list to a file +/// Returns 'kTRUE', if DQM files for the given run range and path have been found, 'kFALSE' otherwise. +Bool_t createInputFileList() +{ + + // Create input file list on the fly + gSystem->Exec( TString( "rm -f " + sArguments[ "-L" ] ).Data() ); + gSystem->Exec( TString( "ls -1 " + sArguments[ "-p" ] + "/*/" + sArguments[ "-P" ] + " > " + sArguments[ "-L" ] ).Data() ); + ofstream fileListWrite; + fileListWrite.open( sArguments[ "-L" ].Data(), ios_base::app ); + fileListWrite << "EOF"; + fileListWrite.close(); + + // Loop over input file list and recreate it according to run range + ifstream fileListRead; + fileListRead.open( sArguments[ "-L" ].Data() ); + ofstream fileListNewWrite; + const TString nameFileListNew( sArguments[ "-L" ] + ".new" ); + fileListNewWrite.open( nameFileListNew, ios_base::app ); + UInt_t nFiles( 0 ); + while ( fileListRead.good() ) { + TString pathFile; + fileListRead >> pathFile; + if ( pathFile.Length() == 0 ) continue; + sRunNumber_ = RunNumber( pathFile ); + if ( ! RunNumber( pathFile ).IsDigit() ) continue; + ++nFiles; + const Int_t iRun( RunNumber( pathFile ).Atoi() ); + if ( minRange_ > iRun || iRun > maxRange_ ) continue; + fileListNewWrite << pathFile << endl; + if ( iRun < minRun_ ) minRun_ = iRun; + if ( iRun > maxRun_ ) maxRun_ = iRun; + } + + fileListRead.close(); + fileListNewWrite.close(); + gSystem->Exec( TString( "mv " ).Append( nameFileListNew ).Append( " " ).Append( sArguments[ "-L" ] ) ); + + if ( nFiles == 0 || maxRun_ < minRun_ ) { + cerr << " ERROR: no files to certify" << endl; + cerr << " no files found in " << sArguments[ "-p" ] << " between the run numbers " << minRange_ << " and " << maxRange_ << endl; + return kFALSE; + } + return kTRUE; + +} + + +/// Gets XML file with complete RunRegistry information from the web server +/// Returns 'kTRUE', if XML file is present and not empty, 'kFALSE' otherwise. +Bool_t createRRFile() +{ + + ostringstream minRun; minRun << minRun_; + ostringstream maxRun; maxRun << maxRun_; + cerr << " Extracting RunRegistry output for runs " << minRun.str() << " - " << maxRun.str() << " ..."; + TString commandBase( TString( gSystem->Getenv( "CMSSW_BASE" ) ).Append( "/src/DQM/TrackerCommon/bin/getRunRegistry.py" ).Append( " -s " ).Append( sArguments[ "-R" ] ).Append( "/xmlrpc" ).Append( " ").Append( " -l " ).Append( minRun.str() ).Append( " -u " ).Append( maxRun.str() ) ); + TString commandRuns( commandBase ); + commandRuns.Append( " -f " ).Append( nameFileRunsRR_ ).Append( " -T RUN -t xml_all" ); + if ( sOptions[ "-v" ] ) cerr << endl << endl << " " << commandRuns.Data() << endl; + gSystem->Exec( commandRuns ); + TString commandLumis( commandBase ); + commandLumis.Append( " -f " ).Append( nameFileLumisRR_ ).Append( " -T RUNLUMISECTION -t xml" ); + if ( sOptions[ "-v" ] ) cerr << " " << commandLumis.Data() << endl; + gSystem->Exec( commandLumis ); + TString commandTracker( commandBase ); + commandTracker.Append( " -f " ).Append( nameFileTrackerRR_ ).Append( " -T RUN -t xml_all -w TRACKER" ); + if ( sOptions[ "-v" ] ) cerr << " " << commandTracker.Data() << endl << endl << " ..."; + gSystem->Exec( commandTracker ); + cerr << " done!" << endl + << endl; + + const UInt_t maxLength( 131071 ); // FIXME hard-coding for what? + char xmlLine[ maxLength ]; + UInt_t lines( 0 ); + ifstream fileRunsRR; + fileRunsRR.open( nameFileRunsRR_.Data() ); + if ( ! fileRunsRR ) { + cerr << " ERROR: RR file " << nameFileRunsRR_.Data() << " does not exist" << endl; + cerr << " Please, check access to RR" << endl; + return kFALSE; + } + while ( lines <= 1 && fileRunsRR.getline( xmlLine, maxLength ) ) ++lines; + if ( lines <= 1 ) { + cerr << " ERROR: empty RR file " << nameFileRunsRR_.Data() << endl; + cerr << " Please, check access to RR:" << endl; + cerr << " - DQM/TrackerCommon/bin/getRunRegistry.py" << endl; + cerr << " - https://twiki.cern.ch/twiki/bin/view/CMS/DqmRrApi" << endl; + return kFALSE; + } + fileRunsRR.close(); + ifstream fileLumisRR; + fileLumisRR.open( nameFileLumisRR_.Data() ); + if ( ! fileLumisRR ) { + cerr << " ERROR: RR file " << nameFileLumisRR_.Data() << " does not exist" << endl; + cerr << " Please, check access to RR" << endl; + return kFALSE; + } + while ( lines <= 1 && fileLumisRR.getline( xmlLine, maxLength ) ) ++lines; + if ( lines <= 1 ) { + cerr << " ERROR: empty RR file " << nameFileLumisRR_.Data() << endl; + cerr << " Please, check access to RR:" << endl; + cerr << " - DQM/TrackerCommon/bin/getRunRegistry.py" << endl; + cerr << " - https://twiki.cern.ch/twiki/bin/view/CMS/DqmRrApi" << endl; + return kFALSE; + } + fileLumisRR.close(); + ifstream fileTrackerRR; + fileTrackerRR.open( nameFileTrackerRR_.Data() ); + if ( ! fileTrackerRR ) { + cerr << " ERROR: RR file " << nameFileTrackerRR_.Data() << " does not exist" << endl; + cerr << " Please, check access to RR" << endl; + return kFALSE; + } + while ( lines <= 1 && fileTrackerRR.getline( xmlLine, maxLength ) ) ++lines; + if ( lines <= 1 ) { + cerr << " ERROR: empty RR file " << nameFileTrackerRR_.Data() << endl; + cerr << " Please, check access to RR:" << endl; + cerr << " - DQM/TrackerCommon/bin/getRunRegistry.py" << endl; + cerr << " - https://twiki.cern.ch/twiki/bin/view/CMS/DqmRrApi" << endl; + return kFALSE; + } + fileTrackerRR.close(); + + return kTRUE; + +} + + +/// Loops over runs +void certifyRunRange() +{ + + // Loop over runs + ifstream fileListRead; + fileListRead.open( sArguments[ "-L" ].Data() ); + while ( fileListRead.good() ) { + TString pathFile; + fileListRead >> pathFile; + if ( pathFile.Length() == 0 ) continue; + ++nRuns_; + sRunNumber_ = RunNumber( pathFile ); + cout << " Processing RUN " << sRunNumber_.Data() << endl; + if ( readData( pathFile ) ) { + sRunNumbers_.push_back( sRunNumber_ ); + certifyRun(); + } + } + fileListRead.close(); + writeOutput(); + + return; + +} + + +/// Reads input data for a given run +/// Returns 'kTRUE', if RR and DQM information have been read successfully, 'kFALSE' otherwise. +Bool_t readData( const TString & pathFile ) +{ + + if ( ! readRR( pathFile ) ) return kFALSE; +// if ( ! readRRLumis( pathFile ) ) return kFALSE; // LS currently not used + if ( ! readRRTracker( pathFile ) ) return kFALSE; + if ( ! readDQM( pathFile ) ) return kFALSE; + return kTRUE; + +} + + +/// Reads manually set RR certification flags for a given run +/// Returns 'kTRUE', if a given run is present in RR, 'kFALSE' otherwise. +Bool_t readRR( const TString & pathFile ) +{ + + // Initialize + map< TString, TString > sFlagsRR; + map< TString, TString > sCommentsRR; + iFlagsRR_.clear(); + Bool_t foundRun( kFALSE ); + Bool_t foundGroup( kFALSE ); + Bool_t foundDataset( kFALSE ); + Bool_t foundSignoff( kFALSE ); + vector< TString > nameCmpNode; + nameCmpNode.push_back( "STRIP" ); + nameCmpNode.push_back( "PIX" ); + nameCmpNode.push_back( "TRACK" ); + + // Read RR file corresponding to output format type 'xml_all' + TXMLEngine * xmlRR( new TXMLEngine ); + XMLDocPointer_t xmlRRDoc( xmlRR->ParseFile( nameFileRunsRR_.Data() ) ); + XMLNodePointer_t nodeMain( xmlRR->DocGetRootElement( xmlRRDoc ) ); + XMLNodePointer_t nodeRun( xmlRR->GetChild( nodeMain ) ); + while ( nodeRun ) { + XMLNodePointer_t nodeRunChild( xmlRR->GetChild( nodeRun ) ); + while ( nodeRunChild && TString( xmlRR->GetNodeName( nodeRunChild ) ) != "NUMBER" ) + nodeRunChild = xmlRR->GetNext( nodeRunChild ); + if ( nodeRunChild && xmlRR->GetNodeContent( nodeRunChild ) == sRunNumber_ ) { + foundRun = kTRUE; + nodeRunChild = xmlRR->GetChild( nodeRun ); + while ( nodeRunChild && TString( xmlRR->GetNodeName( nodeRunChild ) ) != "GROUP_NAME" ) + nodeRunChild = xmlRR->GetNext( nodeRunChild ); + if ( nodeRunChild && xmlRR->GetNodeContent( nodeRunChild ) == sArguments[ "-g" ] ) { + foundGroup = kTRUE; + nodeRunChild = xmlRR->GetChild( nodeRun ); + while ( nodeRunChild && TString( xmlRR->GetNodeName( nodeRunChild ) ) != "DATASETS" ) + nodeRunChild = xmlRR->GetNext( nodeRunChild ); + if ( nodeRunChild ) { + XMLNodePointer_t nodeDataset( xmlRR->GetChild( nodeRunChild ) ); + while ( nodeDataset ) { + XMLNodePointer_t nodeDatasetChild( xmlRR->GetChild( nodeDataset ) ); + while ( nodeDatasetChild && TString( xmlRR->GetNodeName( nodeDatasetChild ) ) != "NAME" ) + nodeDatasetChild = xmlRR->GetNext( nodeDatasetChild ); + if ( nodeDatasetChild && TString( xmlRR->GetNodeContent( nodeDatasetChild ) ) == sArguments[ "-d" ] ) { + foundDataset = kTRUE; + nodeDatasetChild = xmlRR->GetChild( nodeDataset ); + while ( nodeDatasetChild && xmlRR->GetNodeName( nodeDatasetChild ) != TString( "STATE" ) ) + nodeDatasetChild = xmlRR->GetNext( nodeDatasetChild ); + if ( sOptions[ "-a" ] || ( nodeDatasetChild && TString( xmlRR->GetNodeContent( nodeDatasetChild ) ) == "SIGNOFF" ) ) { + foundSignoff = kTRUE; + nodeDatasetChild = xmlRR->GetChild( nodeDataset ); + while ( nodeDatasetChild && TString( xmlRR->GetNodeName( nodeDatasetChild ) ) != "CMPS" ) + nodeDatasetChild = xmlRR->GetNext( nodeDatasetChild ); + if ( nodeDatasetChild ) { + XMLNodePointer_t nodeCmp( xmlRR->GetChild( nodeDatasetChild ) ); + while ( nodeCmp ) { + XMLNodePointer_t nodeCmpChild( xmlRR->GetChild( nodeCmp ) ); + while ( nodeCmpChild && TString( xmlRR->GetNodeName( nodeCmpChild ) ) != "NAME" ) + nodeCmpChild = xmlRR->GetNext( nodeCmpChild ); + if ( nodeCmpChild ) { + for ( UInt_t iNameNode = 0; iNameNode < nameCmpNode.size(); ++iNameNode ) { + if ( xmlRR->GetNodeContent( nodeCmpChild ) == nameCmpNode.at( iNameNode ) ) { + TString nameNode( "RR_" + nameCmpNode.at( iNameNode ) ); + XMLNodePointer_t nodeCmpChildNew = xmlRR->GetChild( nodeCmp ); + while ( nodeCmpChildNew && TString( xmlRR->GetNodeName( nodeCmpChildNew ) ) != "VALUE" ) + nodeCmpChildNew = xmlRR->GetNext( nodeCmpChildNew ); + if ( nodeCmpChildNew ) { + sFlagsRR[ nameNode ] = TString( xmlRR->GetNodeContent( nodeCmpChildNew ) ); + if ( sFlagsRR[ nameNode ] == "BAD" ) { + nodeCmpChildNew = xmlRR->GetChild( nodeCmp ); + while ( nodeCmpChildNew && TString( xmlRR->GetNodeName( nodeCmpChildNew ) ) != "COMMENT" ) + nodeCmpChildNew = xmlRR->GetNext( nodeCmpChildNew ); + if ( nodeCmpChildNew ) { + sCommentsRR[ nameNode ] = TString( xmlRR->GetNodeContent( nodeCmpChildNew ) ); + } + } + } + } + } + } + nodeCmp = xmlRR->GetNext( nodeCmp ); + } + } + break; + } + break; + } + nodeDataset = xmlRR->GetNext( nodeDataset ); + } + } + } + break; + } + nodeRun = xmlRR->GetNext( nodeRun ); + } + + if ( ! foundRun ) { + ++nRunsNotRR_; + cout << " Run not found in RR" << endl; + return kFALSE; + } + if ( ! foundGroup ) { + ++nRunsNotGroup_; + cout << " Group " << sArguments[ "-g" ] << " not found in RR" << endl; + return kFALSE; + } + if ( ! foundDataset ) { + ++nRunsNotDataset_; + cout << " Dataset " << sArguments[ "-d" ] << " not found in RR" << endl; + return kFALSE; + } + if ( ! foundSignoff ) { + ++nRunsNotSignoff_; + cout << " Dataset not in SIGNOFF in RR" << endl; + return kFALSE; + } + + if ( sOptions[ "-v" ] ) for ( map< TString, TString >::const_iterator flag = sFlagsRR.begin(); flag != sFlagsRR.end(); ++flag ) cout << " " << flag->first << ": " << flag->second << endl; + for ( UInt_t iNameNode = 0; iNameNode < nameCmpNode.size(); ++iNameNode ) { + TString nameNode( "RR_" + nameCmpNode.at( iNameNode ) ); + if ( sFlagsRR.find( nameNode ) == sFlagsRR.end() ) { + cout << " WARNING: component " << nameCmpNode.at( iNameNode ).Data() << " not found in RR" << endl; + cout << " Automatically set to MISSING" << endl; + sFlagsRR[ nameNode ] = "MISSING"; + } + } + + sRRCommentsSiStrip_[ sRunNumber_ ] = sCommentsRR[ "RR_STRIP" ]; + sRRCommentsPixel_[ sRunNumber_ ] = sCommentsRR[ "RR_PIX" ]; + sRRCommentsTracking_[ sRunNumber_ ] = sCommentsRR[ "RR_TRACK" ]; + iFlagsRR_[ sSubSys_[ SiStrip ] ] = FlagConvert( sFlagsRR[ "RR_STRIP" ] ); + iFlagsRR_[ sSubSys_[ Pixel ] ] = FlagConvert( sFlagsRR[ "RR_PIX" ] ); + iFlagsRR_[ sSubSys_[ Tracking ] ] = FlagConvert( sFlagsRR[ "RR_TRACK" ] ); + if ( iFlagsRR_[ sSubSys_[ SiStrip ] ] == EXCL ) ++nRunsExclSiStrip_; + if ( iFlagsRR_[ sSubSys_[ Pixel ] ] == EXCL ) ++nRunsExclPixel_; + if ( iFlagsRR_[ sSubSys_[ SiStrip ] ] == MISSING ) ++nRunsMissSiStrip_; + if ( iFlagsRR_[ sSubSys_[ Pixel ] ] == MISSING ) ++nRunsMissPixel_; + if ( ( iFlagsRR_[ sSubSys_[ SiStrip ] ] == EXCL || iFlagsRR_[ sSubSys_[ SiStrip ] ] == MISSING ) && + ( iFlagsRR_[ sSubSys_[ Pixel ] ] == EXCL || iFlagsRR_[ sSubSys_[ Pixel ] ] == MISSING ) ) ++nRunsNoTracking_; + + return kTRUE; + +} + + +/// Reads RR HV states for lumi ranges in a given run +/// Returns 'kFALSE', if Tracker was in STANDBY during the run, 'kTRUE' otherwise. +Bool_t readRRLumis( const TString & pathFile ) +{ + + bSiStripOn_ = false ; + bPixelOn_ = false ; + map< TString, Bool_t > bLumiSiStripOn_; + map< TString, Bool_t > bLumiPixelOn_; + Bool_t foundRun( kFALSE ); + Bool_t foundDataset( kFALSE ); + + // Read RR file corresponding to output format type 'xml' + TXMLEngine * xmlRR( new TXMLEngine ); + XMLDocPointer_t xmlRRDoc( xmlRR->ParseFile( nameFileLumisRR_.Data() ) ); + XMLNodePointer_t nodeMain( xmlRR->DocGetRootElement( xmlRRDoc ) ); + XMLNodePointer_t nodeRun( xmlRR->GetChild( nodeMain ) ); + while ( nodeRun ) { + XMLNodePointer_t nodeRunChild( xmlRR->GetChild( nodeRun ) ); + while ( nodeRunChild && TString( xmlRR->GetNodeName( nodeRunChild ) ) != "NUMBER" ) + nodeRunChild = xmlRR->GetNext( nodeRunChild ); + if ( nodeRunChild && xmlRR->GetNodeContent( nodeRunChild ) == sRunNumber_ ) { + foundRun = kTRUE; + nodeRunChild = xmlRR->GetChild( nodeRun ); + while ( nodeRunChild && TString( xmlRR->GetNodeName( nodeRunChild ) ) != "DATASET" ) + nodeRunChild = xmlRR->GetNext( nodeRunChild ); + if ( nodeRunChild ) { + XMLNodePointer_t nodeDatasetChild( xmlRR->GetChild( nodeRunChild ) ); + while ( nodeDatasetChild && TString( xmlRR->GetNodeName( nodeDatasetChild ) ) != "NAME" ) + nodeDatasetChild = xmlRR->GetNext( nodeDatasetChild ); + if ( nodeDatasetChild && xmlRR->GetNodeContent( nodeDatasetChild ) == sArguments[ "-d" ] ) { + foundDataset = kTRUE; + XMLNodePointer_t nodeLumiRange( xmlRR->GetChild( nodeRunChild ) ); + while ( nodeLumiRange ) { + bLumiSiStripOn_[ "DCSTIBTID" ] = kFALSE; + bLumiSiStripOn_[ "DCSTOB" ] = kFALSE; + bLumiSiStripOn_[ "DCSTECM" ] = kFALSE; + bLumiSiStripOn_[ "DCSTECP" ] = kFALSE; + bLumiPixelOn_[ "DCSFPIX" ] = kFALSE; + bLumiPixelOn_[ "DCSBPIX" ] = kFALSE; + if ( TString( xmlRR->GetNodeName( nodeLumiRange ) ) == "LUMI_SECTION_RANGE" ) { + XMLNodePointer_t nodeLumiRangeChild( xmlRR->GetChild( nodeLumiRange ) ); + while ( nodeLumiRangeChild && TString( xmlRR->GetNodeName( nodeLumiRangeChild ) ) != "PARAMETERS") + nodeLumiRangeChild = xmlRR->GetNext( nodeLumiRangeChild ); + if ( nodeLumiRangeChild ) { + XMLNodePointer_t nodeParameter( xmlRR->GetChild( nodeLumiRangeChild ) ); + while ( nodeParameter ) { + if ( xmlRR->GetNodeContent( nodeParameter ) && xmlRR->GetNodeContent( nodeParameter ) == TString( "true" ) ) { + const TString nodeName( xmlRR->GetNodeName( nodeParameter ) ); + if ( bLumiSiStripOn_.find( nodeName ) != bLumiSiStripOn_.end() ) { + bLumiSiStripOn_[ nodeName ] = kTRUE; + } else if ( bLumiPixelOn_.find( nodeName ) != bLumiPixelOn_.end() ) { + bLumiPixelOn_[ nodeName ] = kTRUE; + } + } + nodeParameter = xmlRR->GetNext( nodeParameter ); + } + } + } + Bool_t siStripOn( kTRUE ); + Bool_t pixelOn( kTRUE ); + for ( map< TString, Bool_t >::const_iterator iMap = bLumiSiStripOn_.begin(); iMap != bLumiSiStripOn_.end(); ++iMap ) { + if ( ! iMap->second ) siStripOn = kFALSE; + break; + } + for ( map< TString, Bool_t >::const_iterator iMap = bLumiPixelOn_.begin(); iMap != bLumiPixelOn_.end(); ++iMap ) { + if ( ! iMap->second ) pixelOn = kFALSE; + break; + } + if ( siStripOn ) bSiStripOn_ = kTRUE; + if ( pixelOn ) bPixelOn_ = kTRUE; + if ( bSiStripOn_ && bPixelOn_ ) break; + nodeLumiRange = xmlRR->GetNext( nodeLumiRange ); + } + break; + } + } + break; + } + nodeRun = xmlRR->GetNext( nodeRun ); + } + + if ( ! foundRun ) { + ++nRunsNotRRLumis_; + cout << " Run " << sRunNumber_ << " not found in RR lumis" << endl; + return kFALSE; + } + if ( ! foundDataset ) { + ++nRunsNotDatasetLumis_; + cout << " Dataset " << sArguments[ "-d" ] << " not found in RR lumis" << endl; + return kFALSE; + } + if ( ! bSiStripOn_ ) { + ++nRunsSiStripOff_; + cout << " SiStrip (partially) OFF during the whole run" << endl; + } + if ( ! bPixelOn_ ) { + ++nRunsPixelOff_; + cout << " Pixel (partially) OFF during the whole run" << endl; + } + + return kTRUE; + +} + + +/// Reads RR certification flags for lumi ranges in a given run +/// Returns 'kTRUE', if a given run is present in RR, 'kFALSE' otherwise. +Bool_t readRRTracker( const TString & pathFile ) +{ + + map< TString, TString > sFlagsRRTracker; + map< TString, TString > sCommentsRRTracker; + iFlagsRRTracker_.clear(); + Bool_t foundRun( kFALSE ); + Bool_t foundGroup( kFALSE ); + Bool_t foundDataset( kFALSE ); + vector< TString > nameCmpNode; + nameCmpNode.push_back( "STRIP" ); + nameCmpNode.push_back( "PIXEL" ); + nameCmpNode.push_back( "TRACKING" ); + + // Read RR file corresponding to output format type 'xml' + TXMLEngine * xmlRR( new TXMLEngine ); + XMLDocPointer_t xmlRRDoc( xmlRR->ParseFile( nameFileTrackerRR_.Data() ) ); + XMLNodePointer_t nodeMain( xmlRR->DocGetRootElement( xmlRRDoc ) ); + XMLNodePointer_t nodeRun( xmlRR->GetChild( nodeMain ) ); + while ( nodeRun ) { + XMLNodePointer_t nodeRunChild( xmlRR->GetChild( nodeRun ) ); + while ( nodeRunChild && TString( xmlRR->GetNodeName( nodeRunChild ) ) != "NUMBER" ) + nodeRunChild = xmlRR->GetNext( nodeRunChild ); + if ( nodeRunChild && xmlRR->GetNodeContent( nodeRunChild ) == sRunNumber_ ) { + foundRun = kTRUE; + nodeRunChild = xmlRR->GetChild( nodeRun ); + while ( nodeRunChild && TString( xmlRR->GetNodeName( nodeRunChild ) ) != "GROUP_NAME" ) + nodeRunChild = xmlRR->GetNext( nodeRunChild ); + if ( nodeRunChild && xmlRR->GetNodeContent( nodeRunChild ) == sArguments[ "-g" ] ) { + foundGroup = kTRUE; + nodeRunChild = xmlRR->GetChild( nodeRun ); + while ( nodeRunChild && TString( xmlRR->GetNodeName( nodeRunChild ) ) != "DATASETS" ) + nodeRunChild = xmlRR->GetNext( nodeRunChild ); + if ( nodeRunChild ) { + XMLNodePointer_t nodeDataset( xmlRR->GetChild( nodeRunChild ) ); + while ( nodeDataset ) { + XMLNodePointer_t nodeDatasetChild( xmlRR->GetChild( nodeDataset ) ); + while ( nodeDatasetChild && TString( xmlRR->GetNodeName( nodeDatasetChild ) ) != "NAME" ) + nodeDatasetChild = xmlRR->GetNext( nodeDatasetChild ); +// if ( nodeDatasetChild && TString( xmlRR->GetNodeContent( nodeDatasetChild ) ) == sArguments[ "-d" ] ) { + if ( nodeDatasetChild && TString( xmlRR->GetNodeContent( nodeDatasetChild ) ) == TString( "/Global/Online/ALL" ) ) { // currently cretaed under this dataset name in RR TRACKER + foundDataset = kTRUE; + nodeDatasetChild = xmlRR->GetChild( nodeDataset ); + while ( nodeDatasetChild && TString( xmlRR->GetNodeName( nodeDatasetChild ) ) != "CMPS" ) + nodeDatasetChild = xmlRR->GetNext( nodeDatasetChild ); + if ( nodeDatasetChild ) { + XMLNodePointer_t nodeCmp( xmlRR->GetChild( nodeDatasetChild ) ); + while ( nodeCmp ) { + XMLNodePointer_t nodeCmpChild( xmlRR->GetChild( nodeCmp ) ); + while ( nodeCmpChild && TString( xmlRR->GetNodeName( nodeCmpChild ) ) != "NAME" ) + nodeCmpChild = xmlRR->GetNext( nodeCmpChild ); + if ( nodeCmpChild ) { + for ( UInt_t iNameNode = 0; iNameNode < nameCmpNode.size(); ++iNameNode ) { + if ( xmlRR->GetNodeContent( nodeCmpChild ) == nameCmpNode.at( iNameNode ) ) { + TString nameNode( "RRTracker_" + nameCmpNode.at( iNameNode ) ); + XMLNodePointer_t nodeCmpChildNew( xmlRR->GetChild( nodeCmp ) ); + while ( nodeCmpChildNew && TString( xmlRR->GetNodeName( nodeCmpChildNew ) ) != "VALUE" ) + nodeCmpChildNew = xmlRR->GetNext( nodeCmpChildNew ); + if ( nodeCmpChildNew ) { + sFlagsRRTracker[ nameNode ] = TString( xmlRR->GetNodeContent( nodeCmpChildNew ) ); + if ( sFlagsRRTracker[ nameNode ] == "BAD" ) { + nodeCmpChildNew = xmlRR->GetChild( nodeCmp ); + while ( nodeCmpChildNew && TString( xmlRR->GetNodeName( nodeCmpChildNew ) ) != "COMMENT" ) + nodeCmpChildNew = xmlRR->GetNext( nodeCmpChildNew ); // FIXME Segmentation violation??? + if ( nodeCmpChildNew ) { + sCommentsRRTracker[ nameNode ] = TString( xmlRR->GetNodeContent( nodeCmpChildNew ) ); + } + } + } + } + } + } + nodeCmp = xmlRR->GetNext( nodeCmp ); + } + } + break; + } + nodeDataset = xmlRR->GetNext( nodeDataset ); + } + } + } + break; + } + nodeRun = xmlRR->GetNext( nodeRun ); + } + + if ( ! foundRun ) { + ++nRunsNotRRTracker_; + cout << " Run " << sRunNumber_ << " not found in RR Tracker" << endl; + return kFALSE; + } + if ( ! foundGroup ) { + ++nRunsNotGroupTracker_; + cout << " Group " << sArguments[ "-g" ] << " not found in RR" << endl; + return kFALSE; + } + if ( ! foundDataset ) { + ++nRunsNotDatasetTracker_; + cout << " Dataset " << sArguments[ "-d" ] << " not found in RR Tracker" << endl; + return kFALSE; + } + + sRRTrackerCommentsSiStrip_[ sRunNumber_ ] = sCommentsRRTracker[ "RRTracker_STRIP" ]; + sRRTrackerCommentsPixel_[ sRunNumber_ ] = sCommentsRRTracker[ "RRTracker_PIXEL" ]; + sRRTrackerCommentsTracking_[ sRunNumber_ ] = sCommentsRRTracker[ "RRTracker_TRACKING" ]; + iFlagsRRTracker_[ sSubSys_[ SiStrip ] ] = FlagConvert( sFlagsRRTracker[ "RRTracker_STRIP" ] ); + iFlagsRRTracker_[ sSubSys_[ Pixel ] ] = FlagConvert( sFlagsRRTracker[ "RRTracker_PIXEL" ] ); + iFlagsRRTracker_[ sSubSys_[ Tracking ] ] = FlagConvert( sFlagsRRTracker[ "RRTracker_TRACKING" ] ); + + return kTRUE; + +} + + +/// Reads automatically created certification flags/values from the DQM file for a given run +/// Returns 'kTRUE', if the DQM file is readable, 'kFALSE' otherwise. +Bool_t readDQM( const TString & pathFile ) +{ + + // Initialize + fCertificates_.clear(); + bAvailable_.clear(); + + // Open DQM file + TFile * fileDQM( TFile::Open( pathFile.Data() ) ); + if ( ! fileDQM ) { + cerr << " ERROR: DQM file not found" << endl; + cerr << " Please, check path to DQM files" << endl; + return kFALSE; + } + + // Browse certification folders + vector< TString > nameCertDir; + nameCertDir.push_back( nameDirHead_ ); + for ( UInt_t iSys = 0; iSys < nSubSys_; ++iSys ) { + bAvailable_[ sSubSys_[ iSys ] ] = ( iFlagsRR_[ sSubSys_[ iSys ] ] != EXCL ); + if ( bAvailable_[ sSubSys_[ iSys ] ] ) { + const TString baseDir( nameDirHead_ + pathRunFragment_ + sSubSys_[ iSys ] + "/Run summary/" + nameDirBase_ ); + nameCertDir.push_back( baseDir ); + nameCertDir.push_back( baseDir + "/" + nameDirCert_ ); + nameCertDir.push_back( baseDir + "/" + nameDirReport_ ); + if ( iSys != Tracking ) { + nameCertDir.push_back( baseDir + "/" + nameDirDAQ_ ); + nameCertDir.push_back( baseDir + "/" + nameDirDCS_ ); + } + } + } + for ( UInt_t iDir = 0; iDir < nameCertDir.size(); ++iDir ) { + const TString nameCurDir( nameCertDir.at( iDir ).Contains( pathRunFragment_ ) ? nameCertDir.at( iDir ).Insert( nameCertDir.at( iDir ).Index( "Run " ) + 4, sRunNumber_ ) : nameCertDir.at( iDir ) ); + TDirectory * dirSub( ( TDirectory * )fileDQM->Get( nameCurDir.Data() ) ); + if ( ! dirSub ) { + cout << " WARNING: " << nameCurDir.Data() << " does not exist" << endl; + continue; + } + readCertificates( dirSub ); + } + + fileDQM->Close(); + + if ( sOptions[ "-v" ] ) { + cout << " " << sVersion_ << endl; + for ( map< TString, Double_t >::const_iterator cert = fCertificates_.begin(); cert != fCertificates_.end(); ++cert ) cout << " " << cert->first << ": " << cert->second << endl; + } + + return kTRUE; + +} + + +/// Extract run certificates from DQM file +void readCertificates( TDirectory * dir ) +{ + + TIter nextKey( dir->GetListOfKeys() ); + TKey * key; + while ( ( key = ( TKey * )nextKey() ) ) { + const TString nameKey( key->GetName() ); + const Int_t index1( nameKey.Index( ">" ) ); + if ( index1 == kNPOS ) continue; + TString nameCert( nameKey( 1, index1 - 1 ) ); + if ( TString( dir->GetName() ) == nameDirHead_ ) { + if ( nameCert.CompareTo( "ReleaseTag" ) == 0 ) { + const Ssiz_t indexKey( nameKey.Index( "s=" ) + 2 ); + const TString nameKeyBrake( nameKey( indexKey, nameKey.Length() - indexKey ) ); + sVersion_ = nameKeyBrake( 0, nameKeyBrake.Index( "<" ) ); + } + continue; + } + TString nameCertFirst( nameCert( 0, 1 ) ); + nameCertFirst.ToUpper(); + nameCert.Replace( 0, 1, nameCertFirst ); + if ( TString( dir->GetName() ) == nameDirBase_ ) { // indicates summaries + if ( ! nameCert.Contains( "Summary" ) ) continue; + const TString nameDir( dir->GetPath() ); + const UInt_t index2( nameDir.Index( "/", nameDir.Index( ":" ) + 10 ) ); + const TString nameSub( nameDir( index2 + 1, nameDir.Index( "/", index2 + 1 ) - index2 - 1 ) ); + nameCert.Prepend( nameSub ); + } else if ( TString( dir->GetName() ) == nameDirCert_ ) { + nameCert.Prepend( "Cert" ); + } else if ( TString( dir->GetName() ) == nameDirDAQ_ ) { + nameCert.Prepend( "DAQ" ); + } else if ( TString( dir->GetName() ) == nameDirDCS_ ) { + nameCert.Prepend( "DCS" ); + } else { + nameCert.Prepend( "Report" ); + } + const Ssiz_t indexKey( nameKey.Index( "f=" ) + 2 ); + const TString nameKeyBrake( nameKey( indexKey, nameKey.Length() - indexKey ) ); + const TString nameKeyBrakeAll( nameKeyBrake( 0, nameKeyBrake.Index( "<" ) ) ); + fCertificates_[ nameCert ] = atof( nameKeyBrakeAll.Data() ); + } + + return; + +} + + +/// Determine actual certification flags per run and sub-system +void certifyRun() +{ + + // FIXME Currently, LS-wise HV information from the RR is not determined correctly + // So, it is not used for the certification yet. + + // Initialize + map< TString, Int_t > iFlags; + + // SiStrip + sRRSiStrip_[ sRunNumber_ ] = FlagConvert( iFlagsRR_[ sSubSys_[ SiStrip ] ] ); + sRRTrackerSiStrip_[ sRunNumber_ ] = FlagConvert( iFlagsRRTracker_[ sSubSys_[ SiStrip ] ] ); + if ( bAvailable_[ sSubSys_[ SiStrip ] ] ) { + Bool_t flagDet( fCertificates_[ "SiStripReportSummary" ] > minGood_ ); + Bool_t flagDAQ( fCertificates_[ "SiStripDAQSummary" ] == ( Double_t )EXCL || fCertificates_[ "SiStripDAQSummary" ] > minGood_ ); + Bool_t flagDCS( fCertificates_[ "SiStripDCSSummary" ] == ( Double_t )EXCL || fCertificates_[ "SiStripDCSSummary" ] == ( Double_t )GOOD ); + Bool_t flagDQM( flagDet * flagDAQ * flagDCS ); + Bool_t flagCert( iFlagsRRTracker_[ sSubSys_[ SiStrip ] ] ); +// iFlags[ sSubSys_[ SiStrip ] ] = ( Int_t )( flagDQM * bSiStripOn_ * flagCert ); + iFlags[ sSubSys_[ SiStrip ] ] = ( Int_t )( flagDQM * flagCert ); + sDQMSiStrip_[ sRunNumber_ ] = FlagConvert( ( Int_t )( flagDQM ) ); + sSiStrip_[ sRunNumber_ ] = FlagConvert( iFlags[ sSubSys_[ SiStrip ] ] ); + vector< TString > comments; + if ( ! flagDet ) comments.push_back( "too low overall fraction of good modules" ); + if ( ! flagDAQ ) comments.push_back( "DAQSummary BAD" ); + if ( ! flagDCS ) comments.push_back( "DCSSummary BAD" ); +// if ( ! bSiStripOn_ ) comments.push_back( "HV off" ); + if ( ! flagCert ) comments.push_back( TString( "Tracker shifter: " + sRRTrackerCommentsSiStrip_[ sRunNumber_ ] ) ); + if ( iFlags[ sSubSys_[ SiStrip ] ] == BAD ) { + ++nRunsBadSiStrip_; + if ( flagCert ) comments.push_back( TString( "Tracker shifter differs (GOOD): " + sRRTrackerCommentsSiStrip_[ sRunNumber_ ] ) ); + sRunCommentsSiStrip_[ sRunNumber_ ] = comments; + } + } else { + sDQMSiStrip_[ sRunNumber_ ] = sRRSiStrip_[ sRunNumber_ ]; + sSiStrip_[ sRunNumber_ ] = sRRSiStrip_[ sRunNumber_ ]; + } + + // Pixel + sRRPixel_[ sRunNumber_ ] = FlagConvert( iFlagsRR_[ sSubSys_[ Pixel ] ] ); + sRRTrackerPixel_[ sRunNumber_ ] = FlagConvert( iFlagsRRTracker_[ sSubSys_[ Pixel ] ] ); + if ( bAvailable_[ sSubSys_[ Pixel ] ] ) { + Bool_t flagReportSummary( fCertificates_[ "PixelReportSummary" ] > maxBad_ ); + Bool_t flagDAQ( ( fCertificates_[ "DAQPixelBarrelFraction" ] == ( Double_t )EXCL || fCertificates_[ "DAQPixelBarrelFraction" ] > 0. ) && ( fCertificates_[ "DAQPixelEndcapFraction" ] == ( Double_t )EXCL || fCertificates_[ "DAQPixelEndcapFraction" ] > 0. ) ); // unidentified bug in Pixel DAQ fraction determination + Bool_t flagDCS( fCertificates_[ "PixelDCSSummary" ] == ( Double_t )EXCL || fCertificates_[ "PixelDCSSummary" ] > maxBad_ ); +// Bool_t flagDQM( flagReportSummary * flagDAQ * flagDCS ); + Bool_t flagDQM( flagDCS ); // bugs in DAQ fraction and report summary + Bool_t flagCert( iFlagsRRTracker_[ sSubSys_[ Pixel ] ] ); +// iFlags[ sSubSys_[ Pixel ] ] = ( Int_t )( flagDQM * bPixelOn_ * flagCert ); + iFlags[ sSubSys_[ Pixel ] ] = ( Int_t )( flagDQM * flagCert ); + sDQMPixel_[ sRunNumber_ ] = FlagConvert( ( Int_t )( flagDQM ) ); + sPixel_[ sRunNumber_ ] = FlagConvert( iFlags[ sSubSys_[ Pixel ] ] ); + vector< TString > comments; + if ( ! flagReportSummary ) comments.push_back( "ReportSummary BAD" ); + if ( ! flagDAQ ) comments.push_back( "DAQSummary BAD" ); + if ( ! flagDCS ) comments.push_back( "DCSSummary BAD" ); +// if ( ! bPixelOn_ ) comments.push_back( "HV off" ); + if ( ! flagCert ) comments.push_back( TString( "Tracker shifter: " + sRRTrackerCommentsPixel_[ sRunNumber_ ] ) ); + if ( iFlags[ sSubSys_[ Pixel ] ] == BAD ) { + ++nRunsBadPixel_; + if ( flagCert ) comments.push_back( TString( "Tracker shifter differs (GOOD): " + sRRTrackerCommentsPixel_[ sRunNumber_ ] ) ); + sRunCommentsPixel_[ sRunNumber_ ] = comments; + } + } else { + sDQMPixel_[ sRunNumber_ ] = sRRPixel_[ sRunNumber_ ]; + sPixel_[ sRunNumber_ ] = sRRPixel_[ sRunNumber_ ]; + } + + // Tracking + sRRTracking_[ sRunNumber_ ] = FlagConvert( iFlagsRR_[ sSubSys_[ Tracking ] ] ); + sRRTrackerTracking_[ sRunNumber_ ] = FlagConvert( iFlagsRRTracker_[ sSubSys_[ Tracking ] ] ); + if ( bAvailable_[ sSubSys_[ Tracking ] ] ) { + Bool_t flagCert( iFlagsRRTracker_[ sSubSys_[ Pixel ] ] ); + Bool_t flagDQM( kFALSE ); + vector< TString > comments; + if ( iFlagsRR_[ sSubSys_[ SiStrip ] ] == EXCL && iFlagsRR_[ sSubSys_[ Pixel ] ] == EXCL ) { + comments.push_back( "SiStrip and Pixel EXCL: no reasonable Tracking" ); + } else { + Bool_t flagChi2( fCertificates_[ "ReportTrackChi2" ] > maxBad_ ); + Bool_t flagRate( fCertificates_[ "ReportTrackRate" ] > maxBad_ ); + Bool_t flagRecHits( fCertificates_[ "ReportTrackRecHits" ] > maxBad_ ); + flagDQM = flagChi2 * flagRate * flagRecHits; + if ( ! flagChi2 ) comments.push_back( "Chi2/DoF too low" ); + if ( ! flagRate ) comments.push_back( "Track rate too low" ); + if ( ! flagRecHits ) comments.push_back( "Too few RecHits" ); +// if ( ! bSiStripOn_ ) comments.push_back( "HV SiStrip off" ); + if ( ! flagCert ) comments.push_back( TString( "Tracker shifter: " + sRRTrackerCommentsTracking_[ sRunNumber_ ] ) ); + } +// iFlags[ sSubSys_[ Tracking ] ] = ( Int_t )( flagDQM * bSiStripOn_ * flagCert ); + iFlags[ sSubSys_[ Tracking ] ] = ( Int_t )( flagDQM * flagCert ); + sDQMTracking_[ sRunNumber_ ] = FlagConvert( ( Int_t )( flagDQM ) ); + sTracking_[ sRunNumber_ ] = FlagConvert( iFlags[ sSubSys_[ Tracking ] ] ); + if ( iFlags[ sSubSys_[ Tracking ] ] == BAD ) { + ++nRunsBadTracking_; + if ( flagCert ) comments.push_back( TString( "Tracker shifter differs (GOOD): " + sRRTrackerCommentsTracking_[ sRunNumber_ ] ) ); + sRunCommentsTracking_[ sRunNumber_ ] = comments; + } + } else { + sDQMTracking_[ sRunNumber_ ] = sRRTracking_[ sRunNumber_ ]; + sTracking_[ sRunNumber_ ] = sRRTracking_[ sRunNumber_ ]; + } + + for ( map< TString, Int_t >::const_iterator iSys = iFlags.begin(); iSys != iFlags.end(); ++iSys ) { + cout << " " << iSys->first << ": "; + if ( iSys->second != iFlagsRR_[ iSys->first ] ) { + if ( iSys->first == sSubSys_[ SiStrip ] ) ++nRunsChangedSiStrip_; + if ( iSys->first == sSubSys_[ Pixel ] ) ++nRunsChangedPixel_; + if ( iSys->first == sSubSys_[ Tracking ] ) ++nRunsChangedTracking_; + cout << FlagConvert( iFlagsRR_[ iSys->first ] ) << " --> "; + } + cout << FlagConvert( iSys->second ) << endl; + if ( sOptions[ "-v" ] ) { + if ( iSys->first == sSubSys_[ SiStrip ] ) { + for ( UInt_t iCom = 0; iCom < sRunCommentsSiStrip_[ sRunNumber_ ].size(); ++iCom ) { + cout << " " << sRunCommentsSiStrip_[ sRunNumber_ ].at( iCom ).Data() << endl; + } + } + if ( iSys->first == sSubSys_[ Pixel ] ) { + for ( UInt_t iCom = 0; iCom < sRunCommentsPixel_[ sRunNumber_ ].size(); ++iCom ) { + cout << " " << sRunCommentsPixel_[ sRunNumber_ ].at( iCom ).Data() << endl; + } + } + if ( iSys->first == sSubSys_[ Tracking ] ) { + for ( UInt_t iCom = 0; iCom < sRunCommentsTracking_[ sRunNumber_ ].size(); ++iCom ) { + cout << " " << sRunCommentsTracking_[ sRunNumber_ ].at( iCom ).Data() << endl; + } + } + } + } + + return; + +} + + +/// Print summary +void writeOutput() +{ + + // Initialize + ofstream fileLog; + fileLog.open( sArguments[ "-o" ].Data() ); + fileLog << "Tracker Certification runs " << minRun_ << " - " << maxRun_ << endl + << "==========================================" << endl + << endl + << "Used DQM files found in " << sArguments[ "-p" ] << endl + << "for dataset " << sArguments[ "-d" ] << endl + << "and group name " << sArguments[ "-g" ] << endl + << endl + << "# of runs total : " << nRuns_ << endl + << "------------------------------------------ " << endl + << "# of runs certified : " << sRunNumbers_.size() << endl + << "# of runs not found in RR : " << nRunsNotRR_ << endl + << "# of runs group not found in RR : " << nRunsNotGroup_ << endl + << "# of runs dataset not found in RR : " << nRunsNotDataset_ << endl; + if ( ! sOptions[ "-a" ] ) fileLog << "# of runs not in SIGNOFF in RR : " << nRunsNotSignoff_ << endl; + fileLog << "# of runs not found in RR Tracker : " << nRunsNotRRTracker_ << endl + << "# of runs group not found in RR Tracker : " << nRunsNotGroupTracker_ << endl +// << "# of runs dataset not found in RR Tracker: " << nRunsNotDatasetTracker_ << endl + << "# of runs not found in RR lumis : " << nRunsNotRRLumis_ << endl + << "# of runs dataset not found in RR lumis : " << nRunsNotDatasetLumis_ << endl + << endl + << "# of runs w/o SiStrip : " << nRunsExclSiStrip_ << endl + << "# of bad runs SiStrip : " << nRunsBadSiStrip_ << endl + << "# of changed runs SiStrip : " << nRunsChangedSiStrip_ << endl + << "# of runs w/o Pixel : " << nRunsExclPixel_ << endl + << "# of bad runs Pixel : " << nRunsBadPixel_ << endl + << "# of changed runs Pixel : " << nRunsChangedPixel_ << endl + << "# of runs w/o Tracking (BAD): " << nRunsNoTracking_ << endl + << "# of bad runs Tracking : " << nRunsBadTracking_ << endl + << "# of changed runs Tracking : " << nRunsChangedTracking_ << endl; + + // SiStrip + fileLog << endl + << sSubSys_[ 0 ] << ":" << endl + << endl; + for ( UInt_t iRun = 0; iRun < sRunNumbers_.size(); ++iRun ) { + if ( sRRSiStrip_[ sRunNumbers_.at( iRun ) ] != sSiStrip_[ sRunNumbers_.at( iRun ) ] ) { + fileLog << " " << sRunNumbers_.at( iRun ) << ": " << sRRSiStrip_[ sRunNumbers_.at( iRun ) ] << " --> " << sSiStrip_[ sRunNumbers_.at( iRun ) ] << endl; + if ( sRRSiStrip_[ sRunNumbers_.at( iRun ) ] == TString( "BAD" ) ) { + fileLog << " RR was: " << sRRCommentsSiStrip_[ sRunNumbers_.at( iRun ) ] << endl; + } + for ( UInt_t iCom = 0; iCom < sRunCommentsSiStrip_[ sRunNumbers_.at( iRun ) ].size(); ++iCom ) { + fileLog << " " << sRunCommentsSiStrip_[ sRunNumbers_.at( iRun ) ].at( iCom ).Data() << endl; + } + } + } + + // Pixel + fileLog << endl + << sSubSys_[ 1 ] << ":" << endl + << endl; + for ( UInt_t iRun = 0; iRun < sRunNumbers_.size(); ++iRun ) { + if ( sRRPixel_[ sRunNumbers_.at( iRun ) ] != sPixel_[ sRunNumbers_.at( iRun ) ] ) { + fileLog << " " << sRunNumbers_.at( iRun ) << ": " << sRRPixel_[ sRunNumbers_.at( iRun ) ] << " --> " << sPixel_[ sRunNumbers_.at( iRun ) ] << endl; + if ( sRRPixel_[ sRunNumbers_.at( iRun ) ] == TString( "BAD" ) ) { + fileLog << " RR was: " << sRRCommentsPixel_[ sRunNumbers_.at( iRun ) ] << endl; + } + for ( UInt_t iCom = 0; iCom < sRunCommentsPixel_[ sRunNumbers_.at( iRun ) ].size(); ++iCom ) { + fileLog << " " << sRunCommentsPixel_[ sRunNumbers_.at( iRun ) ].at( iCom ).Data() << endl; + } + } + } + + // Tracking + fileLog << endl + << sSubSys_[ 2 ] << ":" << endl + << endl; + for ( UInt_t iRun = 0; iRun < sRunNumbers_.size(); ++iRun ) { + if ( sRRTracking_[ sRunNumbers_.at( iRun ) ] != sTracking_[ sRunNumbers_.at( iRun ) ] ) { + fileLog << " " << sRunNumbers_.at( iRun ) << ": " << sRRTracking_[ sRunNumbers_.at( iRun ) ] << " --> " << sTracking_[ sRunNumbers_.at( iRun ) ] << endl; + if ( sRRTracking_[ sRunNumbers_.at( iRun ) ] == TString( "BAD" ) ) { + fileLog << " RR was: " << sRRCommentsTracking_[ sRunNumbers_.at( iRun ) ] << endl; + } + for ( UInt_t iCom = 0; iCom < sRunCommentsTracking_[ sRunNumbers_.at( iRun ) ].size(); ++iCom ) { + fileLog << " " << sRunCommentsTracking_[ sRunNumbers_.at( iRun ) ].at( iCom ).Data() << endl; + } + } + } + + fileLog.close(); + + cout << endl + << "SUMMARY:" << endl + << endl; + for ( UInt_t iRun = 0; iRun < sRunNumbers_.size(); ++iRun ) { + cout << " " << sRunNumbers_.at( iRun ) << ":" << endl; + cout << " " << sSubSys_[ 0 ] << ": " << sSiStrip_[ sRunNumbers_.at( iRun ) ] << endl; + for ( UInt_t iCom = 0; iCom < sRunCommentsSiStrip_[ sRunNumbers_.at( iRun ) ].size(); ++iCom ) { + cout << " " << sRunCommentsSiStrip_[ sRunNumbers_.at( iRun ) ].at( iCom ).Data() << endl; + } + cout << " " << sSubSys_[ 1 ] << ": " << sPixel_[ sRunNumbers_.at( iRun ) ] << endl; + for ( UInt_t iCom = 0; iCom < sRunCommentsPixel_[ sRunNumbers_.at( iRun ) ].size(); ++iCom ) { + cout << " " << sRunCommentsPixel_[ sRunNumbers_.at( iRun ) ].at( iCom ).Data() << endl; + } + cout << " " << sSubSys_[ 2 ] << ": " << sTracking_[ sRunNumbers_.at( iRun ) ] << endl; + for ( UInt_t iCom = 0; iCom < sRunCommentsTracking_[ sRunNumbers_.at( iRun ) ].size(); ++iCom ) { + cout << " " << sRunCommentsTracking_[ sRunNumbers_.at( iRun ) ].at( iCom ).Data() << endl; + } + } + + cout << endl + << "Certification SUMMARY to be sent to CMS DQM team available in ./" << sArguments[ "-o" ].Data() << endl + << endl; + + return; + +} + + +/// Print help +void displayHelp() +{ + + cerr << " TrackerRunCertification" << endl + << endl + << " CMSSW package: DQM/TrackerCommon" << endl + << endl + << " Purpose:" << endl + << endl + << " The procedure of certifying data of a given run range is automated in order to speed up the procedure and to reduce the Tracker Offline Shift Leader's workload." << endl + << endl + << " Input:" << endl + << endl + << " - RunRegistry" << endl + << " - DQM output files available in AFS" << endl + << endl + << " Output:" << endl + << endl + << " Text file" << endl + << " - [as explained for command line option '-o']" << endl + << " to be sent directly to the CMS DQM team as reply to the weekly certification request." << endl + << " It contains a list of all flags changed with respect to the RunRegistry, including the reason(s) in case the flag is changed to BAD." << endl + << endl + << " The verbose ('-v') stdout can provide a complete list of all in-/output flags of all analyzed runs and at its end a summary only with the output flags." << endl + << " It makes sense to pipe the stdout to another text file." << endl + << endl + << " Usage:" << endl + << endl + << " $ cmsrel CMSSW_RELEASE" << endl + << " $ cd CMSSW_RELEASE/src" << endl + << " $ cmsenv" << endl + << " $ cvs co -r Vxx-yy-zz DQM/TrackerCommon" << endl + << " $ scram b -j 5" << endl + << " $ rehash" << endl + << " $ cd WORKING_DIRECTORY" << endl + << " $ [create input files]" << endl + << " $ TrackerRunCertification [ARGUMENTOPTION1] [ARGUMENT1] ... [OPTION2] ..." << endl + << endl + << " Valid argument options are:" << endl + << " -d" << endl + << " MANDATORY: dataset as in RunRegistry" << endl + << " no default" << endl + << " -g" << endl + << " MANDATORY: group name as in RunRegistry" << endl + << " no default" << endl + << " -p" << endl + << " path to DQM files" << endl + << " default: /afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/data/OfflineData/Run2010/StreamExpress" << endl + << " -P" << endl + << " pattern of DQM file names in the DQM file path" << endl + << " default: *[DATASET from '-d' option with '/' --> '__'].root" << endl + << " -o" << endl + << " path to output log file" << endl + << " default: trackerRunCertification[DATASET from '-d' option with '/' --> '__']-[GROUP from '-g'].txt" << endl + << " -l" << endl + << " lower bound of run numbers to consider" << endl + << " default: 0" << endl + << " -u" << endl + << " upper bound of run numbers to consider" << endl + << " default: 1073741824 (2^30)" << endl + << " -R" << endl + << " web address of the RunRegistry" << endl + << " default: http://pccmsdqm04.cern.ch/runregistry" << endl + << " The default is used for any option not explicitely given in the command line." << endl + << endl + << " Valid options are:" << endl + << " -rr" << endl + << " switch on creation of new RR file" << endl + << " -rronly" << endl + << " only create new RR file, do not run certification" << endl + << " -a" << endl + << " certify all runs, not only those in \"SIGNOFF\" status" << endl + << " -v" << endl + << " switch on verbose logging to stdout" << endl + << " -h" << endl + << " display this help and exit" << endl + << endl; + return; +} + + +/// Little helper to determine run number (TString) from file name/path +TString RunNumber( const TString & pathFile ) +{ + + const TString sPrefix( "DQM_V" ); + const TString sNumber( pathFile( pathFile.Index( sPrefix ) + sPrefix.Length() + 6, 9 ) ); + UInt_t index( ( string( sNumber.Data() ) ).find_first_not_of( '0' ) ); + return sNumber( index, sNumber.Length() - index ); + +} + + +/// Little helper to convert RR flags from TString into Int_t +Int_t FlagConvert( const TString & flag ) +{ + + map< TString, Int_t > flagSToI; + flagSToI[ "MISSING" ] = MISSING; + flagSToI[ "NOTSET" ] = NOTSET; + flagSToI[ "EXCL" ] = EXCL; + flagSToI[ "BAD" ] = BAD; + flagSToI[ "GOOD" ] = GOOD; + return flagSToI[ flag ]; + +} +/// Little helper to convert RR flags from Int_t into TString +TString FlagConvert( const Int_t flag ) +{ + + map< Int_t, TString > flagIToS; + flagIToS[ MISSING ] = "MISSING"; + flagIToS[ NOTSET ] = "NOTSET"; + flagIToS[ EXCL ] = "EXCL"; + flagIToS[ BAD ] = "BAD"; + flagIToS[ GOOD ] = "GOOD"; + return flagIToS[ flag ]; + +} diff --git a/DQM/TrackerCommon/bin/getRunRegistry.py b/DQM/TrackerCommon/bin/getRunRegistry.py new file mode 100755 index 0000000000000..7b04cbbc8d48f --- /dev/null +++ b/DQM/TrackerCommon/bin/getRunRegistry.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python + +# For documentation of the RR XML-RPC handler, look into https://twiki.cern.ch/twiki//bin/view/CMS/DqmRrApi + +import sys +import xmlrpclib + + +def displayHelp(): + print """ + getRunRegistry.py + + CMSSW package DQM/TrackerCommon + + Usage: + $ getRunRegistry.py [ARGUMENTOPTION1] [ARGUMENT1] ... [OPTION2] ... + + Valid argument options are: + -s + API address of RunRegistry server + default: 'http://pccmsdqm04.cern.ch/runregistry/xmlrpc' + -T + table identifier + available: 'RUN', 'RUNLUMISECTION' + default: 'RUN' + -w + work space identifier + available: 'RPC', 'HLT', 'L1T', 'TRACKER', 'CSC', 'GLOBAL', 'ECAL' + default: 'GLOBAL' + -t + output format type + available: + - table 'RUN' : 'chart_runs_cum_evs_vs_bfield', 'chart_runs_cum_l1_124_vs_bfield', 'chart_stacked_component_status', 'csv_datasets', 'csv_run_numbers', 'csv_runs', 'tsv_datasets', 'tsv_runs', 'xml_all', 'xml_datasets' + - table 'RUNLUMISECTION': 'json', 'xml' + default: 'xml_all' (for table 'RUN') + -f + output file + default: 'runRegistry.xml' + -l + lower bound of run numbers to consider + default: '0' + -u + upper bound of run numbers to consider + default: '1073741824' + + Valid options are: + -h + display this help and exit + """ + + +# Option handling (very simple, no validity checks) +sOptions = { + '-s': 'http://pccmsdqm04.cern.ch/runregistry/xmlrpc' # RunRegistry API proxy server +, '-T': 'RUN' # table +, '-w': 'GLOBAL' # workspace +, '-t': 'xml_all' # output format type +, '-f': 'runRegistry.xml' # output file +, '-l': '0' # lower bound of run numbers to consider +, '-u': '1073741824' # upper bound of run numbers to consider +} +bOptions = { + '-h': False # help option +} +iArgument = 0 +for token in sys.argv[ 1:-1 ]: + iArgument = iArgument + 1 + if token in sOptions.keys(): + if not sys.argv[ iArgument + 1 ] in sOptions.keys() and not sys.argv[ iArgument + 1 ] in bOptions.keys(): + del sOptions[ token ] + sOptions[ token ] = sys.argv[ iArgument + 1 ] +for token in sys.argv[ 1: ]: + if token in bOptions.keys(): + del bOptions[ token ] + bOptions[ token ] = True +if bOptions[ '-h' ]: + displayHelp() + sys.exit( 0 ) + +# Data extraction and local storage +# initialise API access to defined RunRegistry proxy +server = xmlrpclib.ServerProxy( sOptions[ '-s' ] ) +# get data according to defined table, workspace and output format type +runs = '{runNumber} >= ' + sOptions[ '-l' ] + 'and {runNumber} <= ' + sOptions[ '-u' ] +data = server.DataExporter.export( sOptions[ '-T' ], sOptions[ '-w' ], sOptions[ '-t' ], runs ) +# write data to file +file = open( sOptions[ '-f' ], 'w' ) +file.write( data ) +file.close() diff --git a/DQM/TrackerCommon/doc/html/index.html b/DQM/TrackerCommon/doc/html/index.html new file mode 100644 index 0000000000000..efbb96db1c1f7 --- /dev/null +++ b/DQM/TrackerCommon/doc/html/index.html @@ -0,0 +1,11 @@ + + + + + + + + +This Text Inserted from File doc/html/index.html + + diff --git a/DQM/TrackerCommon/doc/html/overview.html b/DQM/TrackerCommon/doc/html/overview.html new file mode 100644 index 0000000000000..fca463bf7ad70 --- /dev/null +++ b/DQM/TrackerCommon/doc/html/overview.html @@ -0,0 +1,12 @@ + + + +This Text Inserted from File doc/html/overview.html + + + + + +
Status : +Unknown +
diff --git a/DQM/TrackerCommon/interface/TriggerHelper.h b/DQM/TrackerCommon/interface/TriggerHelper.h new file mode 100644 index 0000000000000..bebc38fcd6ef1 --- /dev/null +++ b/DQM/TrackerCommon/interface/TriggerHelper.h @@ -0,0 +1,108 @@ +#ifndef TriggerHelper_H +#define TriggerHelper_H + + +// -*- C++ -*- +// +// Package: DQM/TrackerCommon +// Class: TriggerHelper +// +// +/** + \class TriggerHelper TriggerHelper.h "DQM/TrackerCommon/interface/TriggerHelper.h" + \brief Provides a code based selection for trigger and DCS information in order to have no failing filters in the CMSSW path. + + [...] + + \author Volker Adler +*/ + + + +#include "FWCore/Framework/interface/Run.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/ESWatcher.h" +#include "CondFormats/DataRecord/interface/AlCaRecoTriggerBitsRcd.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "DataFormats/Scalers/interface/DcsStatus.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h" +#include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtUtils.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" + +class TriggerHelper { + + // Utility classes + edm::ESWatcher< AlCaRecoTriggerBitsRcd > * watchDB_; + L1GtUtils l1Gt_; + HLTConfigProvider hltConfig_; + bool hltConfigInit_; + // Configuration parameters + bool andOr_; + bool andOrDcs_; + edm::InputTag dcsInputTag_; + std::vector< int > dcsPartitions_; + bool errorReplyDcs_; + bool andOrGt_; + edm::InputTag gtInputTag_; + std::string gtDBKey_; + std::vector< std::string > gtLogicalExpressions_; + bool errorReplyGt_; + bool andOrL1_; + std::string l1DBKey_; + std::vector< std::string > l1LogicalExpressions_; + bool errorReplyL1_; + bool andOrHlt_; + edm::InputTag hltInputTag_; + std::string hltDBKey_; + std::vector< std::string > hltLogicalExpressions_; + bool errorReplyHlt_; + // Switches + bool on_; + bool onDcs_; + bool onGt_; + bool onL1_; + bool onHlt_; + // Member constants + const std::string configError_; + + public: + + // Constructors and destructor + TriggerHelper( const edm::ParameterSet & config ); // To be called from the ED module's c'tor + ~TriggerHelper(); + + // Public methods + bool on() { return on_ ; } + bool off() { return ( ! on_ ); } + void initRun( const edm::Run & run, const edm::EventSetup & setup ); // To be called from beginRun() methods + bool accept( const edm::Event & event, const edm::EventSetup & setup ); // To be called from analyze/filter() methods + + private: + + // Private methods + + // DCS + bool acceptDcs( const edm::Event & event ); + bool acceptDcsPartition( const edm::Handle< DcsStatusCollection > & dcsStatus, int dcsPartition ) const; + + // GT status bits + bool acceptGt( const edm::Event & event ); + bool acceptGtLogicalExpression( const edm::Handle< L1GlobalTriggerReadoutRecord > & gtReadoutRecord, std::string gtLogicalExpression ); + + // L1 + bool acceptL1( const edm::Event & event, const edm::EventSetup & setup ); + bool acceptL1LogicalExpression( const edm::Event & event, std::string l1LogicalExpression ); + + // HLT + bool acceptHlt( const edm::Event & event ); + bool acceptHltLogicalExpression( const edm::Handle< edm::TriggerResults > & hltTriggerResults, std::string hltLogicalExpression ) const; + + // Algos + std::vector< std::string > expressionsFromDB( const std::string & key, const edm::EventSetup & setup ); + bool negate( std::string & word ) const; + +}; + + +#endif diff --git a/DQM/TrackerCommon/plugins/BuildFile.xml b/DQM/TrackerCommon/plugins/BuildFile.xml new file mode 100644 index 0000000000000..0354d3dac5e99 --- /dev/null +++ b/DQM/TrackerCommon/plugins/BuildFile.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/DQM/TrackerCommon/plugins/DetectorStateFilter.cc b/DQM/TrackerCommon/plugins/DetectorStateFilter.cc new file mode 100644 index 0000000000000..abfb15061934a --- /dev/null +++ b/DQM/TrackerCommon/plugins/DetectorStateFilter.cc @@ -0,0 +1,82 @@ +#include "DQM/TrackerCommon/plugins/DetectorStateFilter.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Scalers/interface/DcsStatus.h" + +#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h" +#include "DataFormats/FEDRawData/interface/FEDRawData.h" +#include "DataFormats/FEDRawData/interface/FEDNumbering.h" + +#include + +// +// -- Constructor +// +DetectorStateFilter::DetectorStateFilter( const edm::ParameterSet & pset ) { + verbose_ = pset.getUntrackedParameter( "DebugOn", false ); + detectorType_ = pset.getUntrackedParameter( "DetectorType", "sistrip"); + dcsStatusLabel_ = pset.getUntrackedParameter( "DcsStatusLabel", edm::InputTag("scalersRawToDigi") ); + + nEvents_ = 0; + nSelectedEvents_ = 0; + detectorOn_ = false; +} +// +// -- Destructor +// +DetectorStateFilter::~DetectorStateFilter() { +} + +bool DetectorStateFilter::filter( edm::Event & evt, edm::EventSetup const& es) { + + nEvents_++; + // Check Detector state Only for Real Data and return true for MC + if (evt.isRealData()) { + edm::Handle dcsStatus; + evt.getByLabel(dcsStatusLabel_, dcsStatus); + if (dcsStatus.isValid()) { + if (detectorType_ == "pixel" && dcsStatus->size() > 0 ) { + if ((*dcsStatus)[0].ready(DcsStatus::BPIX) && + (*dcsStatus)[0].ready(DcsStatus::FPIX)) { + detectorOn_ = true; + nSelectedEvents_++; + } else detectorOn_ = false; + if ( verbose_ ) std::cout << " Total Events " << nEvents_ + << " Selected Events " << nSelectedEvents_ + << " DCS States : " << " BPix " << (*dcsStatus)[0].ready(DcsStatus::BPIX) + << " FPix " << (*dcsStatus)[0].ready(DcsStatus::FPIX) + << " Detector State " << detectorOn_<< std::endl; + } else if (detectorType_ == "sistrip" && dcsStatus->size() > 0) { + if ((*dcsStatus)[0].ready(DcsStatus::TIBTID) && + (*dcsStatus)[0].ready(DcsStatus::TOB) && + (*dcsStatus)[0].ready(DcsStatus::TECp) && + (*dcsStatus)[0].ready(DcsStatus::TECm)) { + detectorOn_ = true; + nSelectedEvents_++; + } else detectorOn_ = false; + if ( verbose_ ) std::cout << " Total Events " << nEvents_ + << " Selected Events " << nSelectedEvents_ + << " DCS States : " << " TEC- " << (*dcsStatus)[0].ready(DcsStatus::TECm) + << " TEC+ " << (*dcsStatus)[0].ready(DcsStatus::TECp) + << " TIB/TID " << (*dcsStatus)[0].ready(DcsStatus::TIBTID) + << " TOB " << (*dcsStatus)[0].ready(DcsStatus::TOB) + << " Detector States " << detectorOn_<< std::endl; + } + } else { + edm::LogError("DetectorStatusFilter")<<"ERROR: DcsStatusCollection not found !"; + } + } else { + detectorOn_ = true; + nSelectedEvents_++; + if ( verbose_ ) std::cout << "Total MC Events " << nEvents_ + << " Selected Events " << nSelectedEvents_ + << " Detector States " << detectorOn_<< std::endl; + } + return detectorOn_; +} + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(DetectorStateFilter); + + diff --git a/DQM/TrackerCommon/plugins/DetectorStateFilter.h b/DQM/TrackerCommon/plugins/DetectorStateFilter.h new file mode 100644 index 0000000000000..ec4afd2e280b4 --- /dev/null +++ b/DQM/TrackerCommon/plugins/DetectorStateFilter.h @@ -0,0 +1,21 @@ +#ifndef DetectorStateFilter_H +#define DetectorStateFilter_H + +#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +class DetectorStateFilter : public edm::EDFilter { + public: + DetectorStateFilter( const edm::ParameterSet & ); + ~DetectorStateFilter(); + private: + bool filter( edm::Event &, edm::EventSetup const& ); + + uint64_t nEvents_, nSelectedEvents_; + bool verbose_; + bool detectorOn_; + std::string detectorType_; + edm:: InputTag dcsStatusLabel_; +}; + +#endif diff --git a/DQM/TrackerCommon/plugins/SimpleEventFilter.cc b/DQM/TrackerCommon/plugins/SimpleEventFilter.cc new file mode 100644 index 0000000000000..4755ddce54532 --- /dev/null +++ b/DQM/TrackerCommon/plugins/SimpleEventFilter.cc @@ -0,0 +1,29 @@ +#include "DQM/TrackerCommon/plugins/SimpleEventFilter.h" +#include + +// +// -- Constructor +// +SimpleEventFilter::SimpleEventFilter( const edm::ParameterSet & pset ) { + nInterval_ = pset.getUntrackedParameter( "EventsToSkip", 10 ); + verbose_ = pset.getUntrackedParameter( "DebugOn", false ); + nEvent_ = 0; +} +// +// -- Destructor +// +SimpleEventFilter::~SimpleEventFilter() { +} + +bool SimpleEventFilter::filter( edm::Event &, edm::EventSetup const& ) { + nEvent_++; + bool ret = true; + if (nEvent_ % nInterval_ != 0) ret = false; + if ( verbose_ && !ret) std::cout << ">>> filtering event" << nEvent_ << std::endl; + return ret; +} + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(SimpleEventFilter); + + diff --git a/DQM/TrackerCommon/plugins/SimpleEventFilter.h b/DQM/TrackerCommon/plugins/SimpleEventFilter.h new file mode 100644 index 0000000000000..39d620e7a2ec2 --- /dev/null +++ b/DQM/TrackerCommon/plugins/SimpleEventFilter.h @@ -0,0 +1,18 @@ +#ifndef SimpleEventFilter_H +#define SimpleEventFilter_H + +#include "FWCore/Framework/interface/EDFilter.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +class SimpleEventFilter : public edm::EDFilter { + public: + SimpleEventFilter( const edm::ParameterSet & ); + ~SimpleEventFilter(); + private: + bool filter( edm::Event &, edm::EventSetup const& ); + int nEvent_; + int nInterval_; + bool verbose_; +}; + +#endif diff --git a/DQM/TrackerCommon/python/TrackerFilterConfiguration_cfi.py b/DQM/TrackerCommon/python/TrackerFilterConfiguration_cfi.py new file mode 100644 index 0000000000000..2b0f43a8da7c0 --- /dev/null +++ b/DQM/TrackerCommon/python/TrackerFilterConfiguration_cfi.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms +#----------------------------------- +# Detector State Filter +#----------------------------------- +detectorStateFilter = cms.EDFilter("DetectorStateFilter", + DetectorType = cms.untracked.string('sistrip'), + DebugOn = cms.untracked.bool(False), + DcsStatusLabel = cms.untracked.InputTag('scalersRawToDigi') +) +#----------------------------------- +# Simple Event Filter +#----------------------------------- +simpleEventFilter = cms.EDFilter("SimpleEventFilter", + EventsToSkip = cms.untracked.int32(10), + DebugOn = cms.untracked.bool(True) + +) diff --git a/DQM/TrackerCommon/src/TriggerHelper.cc b/DQM/TrackerCommon/src/TriggerHelper.cc new file mode 100644 index 0000000000000..bce3821b85308 --- /dev/null +++ b/DQM/TrackerCommon/src/TriggerHelper.cc @@ -0,0 +1,464 @@ +// +// + + +#include "DQM/TrackerCommon/interface/TriggerHelper.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" + +#include "FWCore/Framework/interface/ESHandle.h" +#include "CondFormats/HLTObjects/interface/AlCaRecoTriggerBits.h" +#include "DataFormats/L1GlobalTrigger/interface/L1GtLogicParser.h" +#include +#include + + + +/// To be called from the ED module's c'tor +TriggerHelper::TriggerHelper( const edm::ParameterSet & config ) + : watchDB_( 0 ) + , gtDBKey_( "" ) + , l1DBKey_( "" ) + , hltDBKey_( "" ) + , on_( true ) + , onDcs_( true ) + , onGt_( true ) + , onL1_( true ) + , onHlt_( true ) + , configError_( "CONFIG_ERROR" ) +{ + + // General switch(es) + if ( config.exists( "andOr" ) ) { + andOr_ = config.getParameter< bool >( "andOr" ); + } else { + on_ = false; + onDcs_ = false; + onGt_ = false; + onL1_ = false; + onHlt_ = false; + } + + if ( on_ ) { + if ( config.exists( "andOrDcs" ) ) { + andOrDcs_ = config.getParameter< bool >( "andOrDcs" ); + dcsInputTag_ = config.getParameter< edm::InputTag >( "dcsInputTag" ); + dcsPartitions_ = config.getParameter< std::vector< int > >( "dcsPartitions" ); + errorReplyDcs_ = config.getParameter< bool >( "errorReplyDcs" ); + } else { + onDcs_ = false; + } + if ( config.exists( "andOrGt" ) ) { + andOrGt_ = config.getParameter< bool >( "andOrGt" ); + gtInputTag_ = config.getParameter< edm::InputTag >( "gtInputTag" ); + gtLogicalExpressions_ = config.getParameter< std::vector< std::string > >( "gtStatusBits" ); + errorReplyGt_ = config.getParameter< bool >( "errorReplyGt" ); + if ( config.exists( "gtDBKey" ) ) gtDBKey_ = config.getParameter< std::string >( "gtDBKey" ); + } else { + onGt_ = false; + } + if ( config.exists( "andOrL1" ) ) { + andOrL1_ = config.getParameter< bool >( "andOrL1" ); + l1LogicalExpressions_ = config.getParameter< std::vector< std::string > >( "l1Algorithms" ); + errorReplyL1_ = config.getParameter< bool >( "errorReplyL1" ); + if ( config.exists( "l1DBKey" ) ) l1DBKey_ = config.getParameter< std::string >( "l1DBKey" ); + } else { + onL1_ = false; + } + if ( config.exists( "andOrHlt" ) ) { + andOrHlt_ = config.getParameter< bool >( "andOrHlt" ); + hltInputTag_ = config.getParameter< edm::InputTag >( "hltInputTag" ); + hltLogicalExpressions_ = config.getParameter< std::vector< std::string > >( "hltPaths" ); + errorReplyHlt_ = config.getParameter< bool >( "errorReplyHlt" ); + if ( config.exists( "hltDBKey" ) ) hltDBKey_ = config.getParameter< std::string >( "hltDBKey" ); + } else { + onHlt_ = false; + } + if ( ! onDcs_ && ! onGt_ && ! onL1_ && ! onHlt_ ) on_ = false; + else watchDB_ = new edm::ESWatcher< AlCaRecoTriggerBitsRcd> ; + } + +} + + +/// To be called from d'tors by 'delete' +TriggerHelper::~TriggerHelper() +{ + + if ( on_ ) delete watchDB_; + +} + + +/// To be called from beginedm::Run() methods +void TriggerHelper::initRun( const edm::Run & run, const edm::EventSetup & setup ) +{ + + // FIXME Can this stay safely in the run loop, or does it need to go to the event loop? + // Means: Are the event setups identical? + if ( watchDB_->check( setup ) ) { + if ( onGt_ && gtDBKey_.size() > 0 ) { + const std::vector< std::string > exprs( expressionsFromDB( gtDBKey_, setup ) ); + if ( exprs.empty() || exprs.at( 0 ) != configError_ ) gtLogicalExpressions_ = exprs; + } + if ( onL1_ && l1DBKey_.size() > 0 ) { + const std::vector< std::string > exprs( expressionsFromDB( l1DBKey_, setup ) ); + if ( exprs.empty() || exprs.at( 0 ) != configError_ ) l1LogicalExpressions_ = exprs; + } + if ( onHlt_ && hltDBKey_.size() > 0 ) { + const std::vector< std::string > exprs( expressionsFromDB( hltDBKey_, setup ) ); + if ( exprs.empty() || exprs.at( 0 ) != configError_ ) hltLogicalExpressions_ = exprs; + } + } + + hltConfigInit_ = false; + if ( onHlt_ ) { + if ( hltInputTag_.process().size() == 0 ) { + edm::LogError( "TriggerHelper" ) << "HLT TriggerResults InputTag \"" << hltInputTag_.encode() << "\" specifies no process"; + } else { + bool hltChanged( false ); + if ( ! hltConfig_.init( run, setup, hltInputTag_.process(), hltChanged ) ) { + edm::LogError( "TriggerHelper" ) << "HLT config initialization error with process name \"" << hltInputTag_.process() << "\""; + } else if ( hltConfig_.size() <= 0 ) { + edm::LogError( "TriggerHelper" ) << "HLT config size error"; + } else hltConfigInit_ = true; + } + } + +} + + +/// To be called from analyze/filter() methods +bool TriggerHelper::accept( const edm::Event & event, const edm::EventSetup & setup ) +{ + + if ( ! on_ ) return true; + + // Determine decision + if ( andOr_ ) return ( acceptDcs( event ) || acceptGt( event ) || acceptL1( event, setup ) || acceptHlt( event ) ); + return ( acceptDcs( event ) && acceptGt( event ) && acceptL1( event, setup ) && acceptHlt( event ) ); + +} + + +bool TriggerHelper::acceptDcs( const edm::Event & event ) +{ + + // An empty DCS partitions list acts as switch. + if ( ! onDcs_ || dcsPartitions_.empty() ) return ( ! andOr_ ); // logically neutral, depending on base logical connective + + // Accessing the DcsStatusCollection + edm::Handle< DcsStatusCollection > dcsStatus; + event.getByLabel( dcsInputTag_, dcsStatus ); + if ( ! dcsStatus.isValid() ) { + edm::LogError( "TriggerHelper" ) << "DcsStatusCollection product with InputTag \"" << dcsInputTag_.encode() << "\" not in event ==> decision: " << errorReplyDcs_; + return errorReplyDcs_; + } + + // Determine decision of DCS partition combination and return + if ( andOrDcs_ ) { // OR combination + for ( std::vector< int >::const_iterator partitionNumber = dcsPartitions_.begin(); partitionNumber != dcsPartitions_.end(); ++partitionNumber ) { + if ( acceptDcsPartition( dcsStatus, *partitionNumber ) ) return true; + } + return false; + } + for ( std::vector< int >::const_iterator partitionNumber = dcsPartitions_.begin(); partitionNumber != dcsPartitions_.end(); ++partitionNumber ) { + if ( ! acceptDcsPartition( dcsStatus, *partitionNumber ) ) return false; + } + return true; + +} + + +bool TriggerHelper::acceptDcsPartition( const edm::Handle< DcsStatusCollection > & dcsStatus, int dcsPartition ) const +{ + + // Error checks + switch( dcsPartition ) { + case DcsStatus::EBp : + case DcsStatus::EBm : + case DcsStatus::EEp : + case DcsStatus::EEm : + case DcsStatus::HBHEa : + case DcsStatus::HBHEb : + case DcsStatus::HBHEc : + case DcsStatus::HF : + case DcsStatus::HO : + case DcsStatus::RPC : + case DcsStatus::DT0 : + case DcsStatus::DTp : + case DcsStatus::DTm : + case DcsStatus::CSCp : + case DcsStatus::CSCm : + case DcsStatus::CASTOR: + case DcsStatus::TIBTID: + case DcsStatus::TOB : + case DcsStatus::TECp : + case DcsStatus::TECm : + case DcsStatus::BPIX : + case DcsStatus::FPIX : + case DcsStatus::ESp : + case DcsStatus::ESm : + break; + default: + edm::LogError( "TriggerHelper" ) << "DCS partition number \"" << dcsPartition << "\" does not exist ==> decision: " << errorReplyDcs_; + return errorReplyDcs_; + } + + // Determine decision + return dcsStatus->at( 0 ).ready( dcsPartition ); + +} + + +/// Does this event fulfill the configured GT status logical expression combination? +bool TriggerHelper::acceptGt( const edm::Event & event ) +{ + + // An empty GT status bits logical expressions list acts as switch. + if ( ! onGt_ || gtLogicalExpressions_.empty() ) return ( ! andOr_ ); // logically neutral, depending on base logical connective + + // Accessing the L1GlobalTriggerReadoutRecord + edm::Handle< L1GlobalTriggerReadoutRecord > gtReadoutRecord; + event.getByLabel( gtInputTag_, gtReadoutRecord ); + if ( ! gtReadoutRecord.isValid() ) { + edm::LogError( "TriggerHelper" ) << "L1GlobalTriggerReadoutRecord product with InputTag \"" << gtInputTag_.encode() << "\" not in event ==> decision: " << errorReplyGt_; + return errorReplyGt_; + } + + // Determine decision of GT status bits logical expression combination and return + if ( andOrGt_ ) { // OR combination + for ( std::vector< std::string >::const_iterator gtLogicalExpression = gtLogicalExpressions_.begin(); gtLogicalExpression != gtLogicalExpressions_.end(); ++gtLogicalExpression ) { + if ( acceptGtLogicalExpression( gtReadoutRecord, *gtLogicalExpression ) ) return true; + } + return false; + } + for ( std::vector< std::string >::const_iterator gtLogicalExpression = gtLogicalExpressions_.begin(); gtLogicalExpression != gtLogicalExpressions_.end(); ++gtLogicalExpression ) { + if ( ! acceptGtLogicalExpression( gtReadoutRecord, *gtLogicalExpression ) ) return false; + } + return true; + +} + + +/// Does this event fulfill this particular GT status bits' logical expression? +bool TriggerHelper::acceptGtLogicalExpression( const edm::Handle< L1GlobalTriggerReadoutRecord > & gtReadoutRecord, std::string gtLogicalExpression ) +{ + + // Check empty std::strings + if ( gtLogicalExpression.empty() ) { + edm::LogError( "TriggerHelper" ) << "Empty logical expression ==> decision: " << errorReplyGt_; + return errorReplyGt_; + } + + // Negated paths + bool negExpr( negate( gtLogicalExpression ) ); + if ( negExpr && gtLogicalExpression.empty() ) { + edm::LogError( "TriggerHelper" ) << "Empty (negated) logical expression ==> decision: " << errorReplyGt_; + return errorReplyGt_; + } + + // Parse logical expression and determine GT status bit decision + L1GtLogicParser gtAlgoLogicParser( gtLogicalExpression ); + // Loop over status bits + for ( size_t iStatusBit = 0; iStatusBit < gtAlgoLogicParser.operandTokenVector().size(); ++iStatusBit ) { + const std::string gtStatusBit( gtAlgoLogicParser.operandTokenVector().at( iStatusBit ).tokenName ); + // Manipulate status bit decision as stored in the parser + bool decision; + // Hard-coded status bits!!! + if ( gtStatusBit == "PhysDecl" || gtStatusBit == "PhysicsDeclared" ) { + decision = ( gtReadoutRecord->gtFdlWord().physicsDeclared() == 1 ); + } else { + edm::LogError( "TriggerHelper" ) << "GT status bit \"" << gtStatusBit << "\" is not defined ==> decision: " << errorReplyGt_; + decision = errorReplyDcs_; + } + gtAlgoLogicParser.operandTokenVector().at( iStatusBit ).tokenResult = decision; + } + + // Determine decision + const bool gtDecision( gtAlgoLogicParser.expressionResult() ); + return negExpr ? ( ! gtDecision ) : gtDecision; + +} + + +/// Was this event accepted by the configured L1 logical expression combination? +bool TriggerHelper::acceptL1( const edm::Event & event, const edm::EventSetup & setup ) +{ + + // An empty L1 logical expressions list acts as switch. + if ( ! onL1_ || l1LogicalExpressions_.empty() ) return ( ! andOr_ ); // logically neutral, depending on base logical connective + + // Getting the L1 event setup + l1Gt_.retrieveL1EventSetup( setup ); // FIXME This can possibly go to initRun() + + // Determine decision of L1 logical expression combination and return + if ( andOrL1_ ) { // OR combination + for ( std::vector< std::string >::const_iterator l1LogicalExpression = l1LogicalExpressions_.begin(); l1LogicalExpression != l1LogicalExpressions_.end(); ++l1LogicalExpression ) { + if ( acceptL1LogicalExpression( event, *l1LogicalExpression ) ) return true; + } + return false; + } + for ( std::vector< std::string >::const_iterator l1LogicalExpression = l1LogicalExpressions_.begin(); l1LogicalExpression != l1LogicalExpressions_.end(); ++l1LogicalExpression ) { + if ( ! acceptL1LogicalExpression( event, *l1LogicalExpression ) ) return false; + } + return true; + +} + + +/// Was this event accepted by this particular L1 algorithms' logical expression? +bool TriggerHelper::acceptL1LogicalExpression( const edm::Event & event, std::string l1LogicalExpression ) +{ + + // Check empty std::strings + if ( l1LogicalExpression.empty() ) { + edm::LogError( "TriggerHelper" ) << "Empty logical expression ==> decision: " << errorReplyL1_; + return errorReplyL1_; + } + + // Negated logical expression + bool negExpr( negate( l1LogicalExpression ) ); + if ( negExpr && l1LogicalExpression.empty() ) { + edm::LogError( "TriggerHelper" ) << "Empty (negated) logical expression ==> decision: " << errorReplyL1_; + return errorReplyL1_; + } + + // Parse logical expression and determine L1 decision + L1GtLogicParser l1AlgoLogicParser( l1LogicalExpression ); + // Loop over algorithms + for ( size_t iAlgorithm = 0; iAlgorithm < l1AlgoLogicParser.operandTokenVector().size(); ++iAlgorithm ) { + const std::string l1AlgoName( l1AlgoLogicParser.operandTokenVector().at( iAlgorithm ).tokenName ); + int error( -1 ); + const bool decision( l1Gt_.decision( event, l1AlgoName, error ) ); + // Error checks + if ( error != 0 ) { + if ( error == 1 ) edm::LogError( "TriggerHelper" ) << "L1 algorithm \"" << l1AlgoName << "\" does not exist in the L1 menu ==> decision: " << errorReplyL1_; + else edm::LogError( "TriggerHelper" ) << "L1 algorithm \"" << l1AlgoName << "\" received error code " << error << " from L1GtUtils::decisionBeforeMask ==> decision: " << errorReplyL1_; + l1AlgoLogicParser.operandTokenVector().at( iAlgorithm ).tokenResult = errorReplyL1_; + continue; + } + // Manipulate algo decision as stored in the parser + l1AlgoLogicParser.operandTokenVector().at( iAlgorithm ).tokenResult = decision; + } + + // Return decision + const bool l1Decision( l1AlgoLogicParser.expressionResult() ); + return negExpr ? ( ! l1Decision ) : l1Decision; + +} + + +/// Was this event accepted by the configured HLT logical expression combination? +bool TriggerHelper::acceptHlt( const edm::Event & event ) +{ + + // An empty HLT logical expressions list acts as switch. + if ( ! onHlt_ || hltLogicalExpressions_.empty() ) return ( ! andOr_ ); // logically neutral, depending on base logical connective + + // Checking the HLT configuration, + if ( ! hltConfigInit_ ) { + edm::LogError( "TriggerHelper" ) << "HLT config error ==> decision: " << errorReplyHlt_; + return errorReplyHlt_; + } + + // Accessing the TriggerResults + edm::Handle< edm::TriggerResults > hltTriggerResults; + event.getByLabel( hltInputTag_, hltTriggerResults ); + if ( ! hltTriggerResults.isValid() ) { + edm::LogError( "TriggerHelper" ) << "TriggerResults product with InputTag \"" << hltInputTag_.encode() << "\" not in event ==> decision: " << errorReplyHlt_; + return errorReplyHlt_; + } + + // Determine decision of HLT logical expression combination and return + if ( andOrHlt_ ) { // OR combination + for ( std::vector< std::string >::const_iterator hltLogicalExpression = hltLogicalExpressions_.begin(); hltLogicalExpression != hltLogicalExpressions_.end(); ++hltLogicalExpression ) { + if ( acceptHltLogicalExpression( hltTriggerResults, *hltLogicalExpression ) ) return true; + } + return false; + } + for ( std::vector< std::string >::const_iterator hltLogicalExpression = hltLogicalExpressions_.begin(); hltLogicalExpression != hltLogicalExpressions_.end(); ++hltLogicalExpression ) { + if ( ! acceptHltLogicalExpression( hltTriggerResults, *hltLogicalExpression ) ) return false; + } + return true; + +} + + +/// Was this event accepted by this particular HLT paths' logical expression? +bool TriggerHelper::acceptHltLogicalExpression( const edm::Handle< edm::TriggerResults > & hltTriggerResults, std::string hltLogicalExpression ) const +{ + + // Check empty std::strings + if ( hltLogicalExpression.empty() ) { + edm::LogError( "TriggerHelper" ) << "Empty logical expression ==> decision: " << errorReplyHlt_; + return errorReplyHlt_; + } + + // Negated paths + bool negExpr( negate( hltLogicalExpression ) ); + if ( negExpr && hltLogicalExpression.empty() ) { + edm::LogError( "TriggerHelper" ) << "Empty (negated) logical expression ==> decision: " << errorReplyHlt_; + return errorReplyHlt_; + } + + // Parse logical expression and determine HLT decision + L1GtLogicParser hltAlgoLogicParser( hltLogicalExpression ); + // Loop over paths + for ( size_t iPath = 0; iPath < hltAlgoLogicParser.operandTokenVector().size(); ++iPath ) { + const std::string hltPathName( hltAlgoLogicParser.operandTokenVector().at( iPath ).tokenName ); + const unsigned indexPath( hltConfig_.triggerIndex( hltPathName ) ); + // Further error checks + if ( indexPath == hltConfig_.size() ) { + edm::LogError( "TriggerHelper" ) << "HLT path \"" << hltPathName << "\" is not found in process " << hltInputTag_.process() << " ==> decision: " << errorReplyHlt_; + hltAlgoLogicParser.operandTokenVector().at( iPath ).tokenResult = errorReplyHlt_; + continue; + } + if ( hltTriggerResults->error( indexPath ) ) { + edm::LogError( "TriggerHelper" ) << "HLT path \"" << hltPathName << "\" in error ==> decision: " << errorReplyHlt_; + hltAlgoLogicParser.operandTokenVector().at( iPath ).tokenResult = errorReplyHlt_; + continue; + } + // Manipulate algo decision as stored in the parser + const bool decision( hltTriggerResults->accept( indexPath ) ); + hltAlgoLogicParser.operandTokenVector().at( iPath ).tokenResult = decision; + } + + // Determine decision + const bool hltDecision( hltAlgoLogicParser.expressionResult() ); + return negExpr ? ( ! hltDecision ) : hltDecision; + +} + + + +/// Reads and returns logical expressions from DB +std::vector< std::string > TriggerHelper::expressionsFromDB( const std::string & key, const edm::EventSetup & setup ) +{ + + edm::ESHandle< AlCaRecoTriggerBits > logicalExpressions; + setup.get< AlCaRecoTriggerBitsRcd >().get( logicalExpressions ); + const std::map< std::string, std::string > & expressionMap = logicalExpressions->m_alcarecoToTrig; + std::map< std::string, std::string >::const_iterator listIter = expressionMap.find( key ); + if ( listIter == expressionMap.end() ) { + edm::LogError( "TriggerHelper" ) << "No logical expressions found under key " << key << " in 'AlCaRecoTriggerBitsRcd'"; + return std::vector< std::string >( 1, configError_ ); + } + return logicalExpressions->decompose( listIter->second ); + +} + + + +/// Checks for negated words +bool TriggerHelper::negate( std::string & word ) const +{ + + bool negate( false ); + if ( word.at( 0 ) == '~' ) { + negate = true; + word.erase( 0, 1 ); + } + return negate; + +} diff --git a/DQM/TrackerCommon/test/AlCaRecoTriggerBits_SiStripDQM_create_cfg.py b/DQM/TrackerCommon/test/AlCaRecoTriggerBits_SiStripDQM_create_cfg.py new file mode 100644 index 0000000000000..e0a7a9c6e0ede --- /dev/null +++ b/DQM/TrackerCommon/test/AlCaRecoTriggerBits_SiStripDQM_create_cfg.py @@ -0,0 +1,61 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process( "CREATE" ) + +process.load( "FWCore.MessageLogger.MessageLogger_cfi" ) +process.MessageLogger.cerr = cms.untracked.PSet( + placeholder = cms.untracked.bool( True ) +) +process.MessageLogger.cout = cms.untracked.PSet( + INFO = cms.untracked.PSet( + reportEvery = cms.untracked.int32( 1 ) + ) +) + +process.SiStripDQMCreate = cms.EDAnalyzer( "AlCaRecoTriggerBitsRcdUpdate" +, firstRunIOV = cms.uint32( 1 ) +, lastRunIOV = cms.int32( -1 ) +, startEmpty = cms.bool( True ) +, listNamesRemove = cms.vstring() +, triggerListsAdd = cms.VPSet( + cms.PSet( + listName = cms.string( 'SiStripDQM_L1' ) + , hltPaths = cms.vstring( + 'NOT L1Tech_BSC_halo_beam2_inner.v0' # NOT 36 + , 'NOT L1Tech_BSC_halo_beam2_outer.v0' # NOT 37 + , 'NOT L1Tech_BSC_halo_beam1_inner.v0' # NOT 38 + , 'NOT L1Tech_BSC_halo_beam1_outer.v0' # NOT 39 + , 'NOT (L1Tech_BSC_splash_beam1.v0 AND NOT L1Tech_BSC_splash_beam2.v0)' # NOT (42 AND NOT 43) + , 'NOT (L1Tech_BSC_splash_beam2.v0 AND NOT L1Tech_BSC_splash_beam1.v0)' # NOT (43 AND NOT 42) + ) + ) + ) +) + +process.source = cms.Source( "EmptySource" +# , firstRun = cms.untracked.uint32( 1 ) +) +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32( 1 ) +) + +import CondCore.DBCommon.CondDBSetup_cfi +# CondCore.DBCommon.CondDBSetup_cfi.CondDBSetup.DBParameters.messageLevel = cms.untracked.int32( 3 ) +process.PoolDBOutputService = cms.Service( "PoolDBOutputService" +, CondCore.DBCommon.CondDBSetup_cfi.CondDBSetup +# , logconnect = cms.untracked.string( 'sqlite_file:AlCaRecoTriggerBits_SiStripDQM_create_log.db' ) +, timetype = cms.untracked.string( 'runnumber' ) +, connect = cms.string( 'sqlite_file:AlCaRecoTriggerBits_SiStripDQM.db' ) +, toPut = cms.VPSet( + cms.PSet( + record = cms.string( 'AlCaRecoTriggerBitsRcd' ) + , tag = cms.string( 'AlCaRecoTriggerBits_SiStripDQM_v2_test' ) + ) + ) +) + +process.p = cms.Path( + process.SiStripDQMCreate +) + + diff --git a/DQM/TrackerCommon/test/AlCaRecoTriggerBits_SiStripDQM_read_cfg.py b/DQM/TrackerCommon/test/AlCaRecoTriggerBits_SiStripDQM_read_cfg.py new file mode 100644 index 0000000000000..d5409f3f94b61 --- /dev/null +++ b/DQM/TrackerCommon/test/AlCaRecoTriggerBits_SiStripDQM_read_cfg.py @@ -0,0 +1,42 @@ +import FWCore.ParameterSet.Config as cms + +process = cms.Process( "READ" ) + +process.load( "FWCore.MessageLogger.MessageLogger_cfi" ) +process.MessageLogger.cerr = cms.untracked.PSet( + placeholder = cms.untracked.bool( True ) +) +process.MessageLogger.cout = cms.untracked.PSet( + INFO = cms.untracked.PSet( + reportEvery = cms.untracked.int32( 250 ) + ) +) + +process.SiStripDQMRead = cms.EDAnalyzer( "AlCaRecoTriggerBitsRcdRead" +, outputType = cms.untracked.string( 'text' ) +, rawFileName = cms.untracked.string( 'AlCaRecoTriggerBits_SiStripDQM' ) +) + +process.source = cms.Source( "EmptySource" +, numberEventsInRun = cms.untracked.uint32( 1 ) # do not change! +, firstRun = cms.untracked.uint32( 132000 ) +) +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32( 1000 ) +) + +import CondCore.DBCommon.CondDBSetup_cfi +process.dbInput = cms.ESSource( "PoolDBESSource" +, CondCore.DBCommon.CondDBSetup_cfi.CondDBSetup +, connect = cms.string( 'sqlite_file:AlCaRecoTriggerBits_SiStripDQM.db' ) +, toGet = cms.VPSet( + cms.PSet( + record = cms.string( 'AlCaRecoTriggerBitsRcd' ) + , tag = cms.string( 'AlCaRecoTriggerBits_SiStripDQM_v2_test' ) + ) + ) +) + +process.p = cms.Path( + process.SiStripDQMRead +) diff --git a/DQM/TrackerCommon/test/DQMXMLFile_SiPixelDQM_create_cfg.py b/DQM/TrackerCommon/test/DQMXMLFile_SiPixelDQM_create_cfg.py new file mode 100644 index 0000000000000..19b542196c6c0 --- /dev/null +++ b/DQM/TrackerCommon/test/DQMXMLFile_SiPixelDQM_create_cfg.py @@ -0,0 +1,56 @@ +import FWCore.ParameterSet.Config as cms + +import os + +process = cms.Process( "CREATE" ) + +process.MessageLogger=cms.Service( "MessageLogger" +, cout = cms.untracked.PSet( + threshold = cms.untracked.string( 'INFO' ) + ) +, destinations = cms.untracked.vstring( + 'cout' + ) +) + +process.source = cms.Source( "EmptyIOVSource" +, timetype = cms.string( 'runnumber' ) +, firstValue = cms.uint64( 1 ) +, lastValue = cms.uint64( 1 ) +, interval = cms.uint64( 1 ) +) + +process.dqmXmlFileTest = cms.EDAnalyzer( "DQMXMLFilePopConAnalyzer" +, record = cms.string( 'FileBlob' ) +, loggingOn = cms.untracked.bool( True ) +, SinceAppendMode = cms.bool( False ) +, Source = cms.PSet( + XMLFile = cms.untracked.string( os.getenv( 'CMSSW_RELEASE_BASE' ) + '/src/DQM/SiPixelMonitorClient/test/sipixel_tier0_qualitytest.xml' ) + , firstSince = cms.untracked.uint64( 1 ) + , debug = cms.untracked.bool( False ) + , zip = cms.untracked.bool( False ) + ) +) +print "Used XML file: " + process.dqmXmlFileTest.Source.XMLFile.pythonValue() + +process.load( "CondCore.DBCommon.CondDBCommon_cfi" ) +process.CondDBCommon.connect = cms.string( 'sqlite_file:DQMXMLFile_SiPixelDQM.db' ) +process.CondDBCommon.BlobStreamerName = cms.untracked.string( 'TBufferBlobStreamingService' ) +process.CondDBCommon.DBParameters.authenticationPath = cms.untracked.string( '' ) +# process.CondDBCommon.DBParameters.messageLevel = cms.untracked.int32( 3 ) + +process.PoolDBOutputService = cms.Service( "PoolDBOutputService" +, process.CondDBCommon +, logconnect = cms.untracked.string( 'sqlite_file:DQMXMLFile_SiPixelDQM_create_log.db' ) +, timetype = cms.untracked.string( 'runnumber' ) +, toPut = cms.VPSet( + cms.PSet( + record = cms.string( 'FileBlob' ) + , tag = cms.string( 'DQMXMLFile_SiPixelDQM_v1_test' ) + ) + ) +) + +process.p = cms.Path( + process.dqmXmlFileTest +) diff --git a/DQM/TrackerCommon/test/DQMXMLFile_SiStripDQM_create_cfg.py b/DQM/TrackerCommon/test/DQMXMLFile_SiStripDQM_create_cfg.py new file mode 100644 index 0000000000000..c44cdea8f4303 --- /dev/null +++ b/DQM/TrackerCommon/test/DQMXMLFile_SiStripDQM_create_cfg.py @@ -0,0 +1,56 @@ +import FWCore.ParameterSet.Config as cms + +import os + +process = cms.Process( "CREATE" ) + +process.MessageLogger=cms.Service( "MessageLogger" +, cout = cms.untracked.PSet( + threshold = cms.untracked.string( 'INFO' ) + ) +, destinations = cms.untracked.vstring( + 'cout' + ) +) + +process.source = cms.Source( "EmptyIOVSource" +, timetype = cms.string( 'runnumber' ) +, firstValue = cms.uint64( 1 ) +, lastValue = cms.uint64( 1 ) +, interval = cms.uint64( 1 ) +) + +process.dqmXmlFileTest = cms.EDAnalyzer( "DQMXMLFilePopConAnalyzer" +, record = cms.string( 'FileBlob' ) +, loggingOn = cms.untracked.bool( True ) +, SinceAppendMode = cms.bool( False ) +, Source = cms.PSet( + XMLFile = cms.untracked.string( os.getenv( 'CMSSW_RELEASE_BASE' ) + '/src/DQM/SiStripMonitorClient/data/sistrip_qualitytest_config_tier0.xml' ) + , firstSince = cms.untracked.uint64( 1 ) + , debug = cms.untracked.bool( False ) + , zip = cms.untracked.bool( False ) + ) +) +print "Used XML file: " + process.dqmXmlFileTest.Source.XMLFile.pythonValue() + +process.load( "CondCore.DBCommon.CondDBCommon_cfi" ) +process.CondDBCommon.connect = cms.string( 'sqlite_file:DQMXMLFile_SiStripDQM.db' ) +process.CondDBCommon.BlobStreamerName = cms.untracked.string( 'TBufferBlobStreamingService' ) +process.CondDBCommon.DBParameters.authenticationPath = cms.untracked.string( '' ) +# process.CondDBCommon.DBParameters.messageLevel = cms.untracked.int32( 3 ) + +process.PoolDBOutputService = cms.Service( "PoolDBOutputService" +, process.CondDBCommon +, logconnect = cms.untracked.string( 'sqlite_file:DQMXMLFile_SiStripDQM_create_log.db' ) +, timetype = cms.untracked.string( 'runnumber' ) +, toPut = cms.VPSet( + cms.PSet( + record = cms.string( 'FileBlob' ) + , tag = cms.string( 'DQMXMLFile_SiStripDQM_v1_test' ) + ) + ) +) + +process.p = cms.Path( + process.dqmXmlFileTest +) diff --git a/DQM/TrackerCommon/test/DQM_Tier0_HarvestTest.txt b/DQM/TrackerCommon/test/DQM_Tier0_HarvestTest.txt new file mode 100644 index 0000000000000..4a9fb3c9a625b --- /dev/null +++ b/DQM/TrackerCommon/test/DQM_Tier0_HarvestTest.txt @@ -0,0 +1,22 @@ +### + +eval `scramv1 r -csh` + +### + +cmsDriver.py step3_DT2_1 -s HARVESTING:dqmHarvesting --conditions FrontierConditions_GlobalTag,GR_R_37X_V5::All --filein file:step2_DT2_1_RAW2DIGI_RECO_DQM.root --data --scenario=pp >& q2.1.log ; mv DQM_V0001_R000136100__Global__CMSSW_X_Y_Z__RECO.root DQM_V0001_R000136100__Global__CMSSW_X_Y_Z__RECO_1.root + +cmsDriver.py step3_DT2_2 -s HARVESTING:dqmHarvesting --conditions FrontierConditions_GlobalTag,GR_R_37X_V5::All --filein file:step2_DT2_2_RAW2DIGI_RECO_DQM.root --data --scenario=pp >& q2.2.log ; mv DQM_V0001_R000136100__Global__CMSSW_X_Y_Z__RECO.root DQM_V0001_R000136100__Global__CMSSW_X_Y_Z__RECO_2.root + +cmsDriver.py step3_DT2_3 -s HARVESTING:dqmHarvesting --conditions FrontierConditions_GlobalTag,GR_R_37X_V5::All --filein file:step2_DT2_3_RAW2DIGI_RECO_DQM.root --data --scenario=pp >& q2.3.log ; mv DQM_V0001_R000136100__Global__CMSSW_X_Y_Z__RECO.root DQM_V0001_R000136100__Global__CMSSW_X_Y_Z__RECO_3.root + +sed -e "s/'file:step2_DT2_1_RAW2DIGI_RECO_DQM.root'/'file:step2_DT2_1_RAW2DIGI_RECO_DQM.root','file:step2_DT2_2_RAW2DIGI_RECO_DQM.root'/" step3_DT2_1_HARVESTING_GR.py > step3_DT2_12_HARVESTING_GR.py + +cmsRun step3_DT2_12_HARVESTING_GR.py >& q2.12.log ; mv DQM_V0001_R000136100__Global__CMSSW_X_Y_Z__RECO.root DQM_V0001_R000136100__Global__CMSSW_X_Y_Z__RECO_12.root + +sed -e "s/'file:step2_DT2_1_RAW2DIGI_RECO_DQM.root'/'file:step2_DT2_1_RAW2DIGI_RECO_DQM.root','file:step2_DT2_2_RAW2DIGI_RECO_DQM.root','file:step2_DT2_3_RAW2DIGI_RECO_DQM.root'/" step3_DT2_1_HARVESTING_GR.py > step3_DT2_123_HARVESTING_GR.py + +cmsRun step3_DT2_123_HARVESTING_GR.py >& q2.123.log ; mv DQM_V0001_R000136100__Global__CMSSW_X_Y_Z__RECO.root DQM_V0001_R000136100__Global__CMSSW_X_Y_Z__RECO_123.root + +### + diff --git a/DQM/TrackerCommon/test/DQM_Tier0_Test.txt b/DQM/TrackerCommon/test/DQM_Tier0_Test.txt new file mode 100644 index 0000000000000..756ae7ee03af4 --- /dev/null +++ b/DQM/TrackerCommon/test/DQM_Tier0_Test.txt @@ -0,0 +1,11 @@ +### + +eval `scramv1 r -csh` + +cmsDriver.py step2_DT2_1 -s RAW2DIGI,RECO,DQM -n 1000 --eventcontent RECO --conditions FrontierConditions_GlobalTag,GR_R_37X_V5::All --geometry Ideal --filein /store/data/Run2010A/MinimumBias/RAW/v1/000/136/100/0A93D3C4-C767-DF11-B4A5-001D09F251FE.root --data >& p2.1.log & + +cmsDriver.py step2_DT2_2 -s RAW2DIGI,RECO,DQM -n 1000 --eventcontent RECO --conditions FrontierConditions_GlobalTag,GR_R_37X_V5::All --geometry Ideal --filein /store/data/Run2010A/MinimumBias/RAW/v1/000/136/100/248B8BA0-B867-DF11-A515-001D09F28755.root --data >& p2.2.log & + +cmsDriver.py step2_DT2_3 -s RAW2DIGI,RECO,DQM -n 1000 --eventcontent RECO --conditions FrontierConditions_GlobalTag,GR_R_37X_V5::All --geometry Ideal --filein /store/data/Run2010A/MinimumBias/RAW/v1/000/136/100/2C46D0E2-AF67-DF11-9766-0030487A3C9A.root --data >& p2.3.log & + +### diff --git a/DQM/TrackerCommon/test/TimingProfiler_Cosmics.cpp b/DQM/TrackerCommon/test/TimingProfiler_Cosmics.cpp new file mode 100644 index 0000000000000..ccf385be4d00c --- /dev/null +++ b/DQM/TrackerCommon/test/TimingProfiler_Cosmics.cpp @@ -0,0 +1,422 @@ +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv) { + + //std::string file = "TimingInfo.txt"; + std::string file; + file.assign(argv[1]); + std::map timingPerModule, timingPerLabel; + std::map timingPerEvent; + std::ifstream myTimingFile(file.c_str(),std::ifstream::in); + std::string dummy1, label, module; + double timing; + unsigned idummy1,evt; + int nbofevts = 0; + + // If the machine is busy, the factor is not 100%. + double factor = 0.995; + + if ( myTimingFile ) { + while ( !myTimingFile.eof() ) { + myTimingFile >> dummy1 >> evt >> idummy1 >> label >> module >> timing ; + // std::cout << evt << " " << module << " " << timing << std::endl; + timingPerEvent[evt] += timing * factor * 1000.; + timingPerModule[module] += timing * factor * 1000.; + timingPerLabel[module+":"+label] += timing * factor * 1000.; + } + nbofevts = (int) timingPerEvent.size(); + } else { + std::cout << "File " << file << " does not exist!" << std::endl; + } + + std::map::const_iterator modIt = timingPerModule.begin(); + std::map::const_iterator labIt = timingPerLabel.begin(); + std::map::const_iterator modEnd = timingPerModule.end(); + std::map::const_iterator labEnd = timingPerLabel.end(); + std::map modulePerTiming; + std::map labelPerTiming; + + for ( ; modIt != modEnd; ++modIt ) { + double time = modIt->second/((double)nbofevts-1.); + std::string name = modIt->first; + modulePerTiming[time] = name; + } + + for ( ; labIt != labEnd; ++labIt ) { + double time = labIt->second/((double)nbofevts-1.); + std::string name = labIt->first; + labelPerTiming[time] = name; + } + + std::map::const_reverse_iterator timeIt = modulePerTiming.rbegin(); + std::map::const_reverse_iterator timeEnd = modulePerTiming.rend(); + std::map::const_reverse_iterator timeIt2 = labelPerTiming.rbegin(); + std::map::const_reverse_iterator timeEnd2 = labelPerTiming.rend(); + + std::cout << "Timing per module " << std::endl; + std::cout << "================= " << std::endl; + double totalTime = 0.; + unsigned i=1; + for ( ; timeIt != timeEnd; ++timeIt ) { + + totalTime += timeIt->first; + std::cout << std::setw(3) << i++ + << std::setw(50) << timeIt->second << " : " + << std::setw(7) << std::setprecision(3) << timeIt-> first << " ms/event" + << std::endl; + } + std::cout << "Total time = " << totalTime << " ms/event " << std::endl; + +/* + std::cout << "================= " << std::endl; + std::cout << "Timing per label " << std::endl; + std::cout << "================= " << std::endl; + totalTime = 0.; + i = 1; + for ( ; timeIt2 != timeEnd2; ++timeIt2 ) { + + totalTime += timeIt2->first; + std::cout << std::setw(3) << i++ + << std::setw(100) << timeIt2->second << " : " + << std::setw(7) << std::setprecision(3) << timeIt2-> first << " ms/event" + << std::endl; + } +*/ + + double subtotaltimepermodule = 0; + double cumulativetimepermodule = 0; + + std::cout << "================= " << std::endl; + std::cout << " DQM for collision : Timing per step " << std::endl; + std::cout << "================= " << std::endl; + + std::cout << "1. Reconstruction " << std::endl; + + std::cout << " 1.1 Raw2Digi+LocalReco : " << std::endl; + std::cout << " 1.1.1 : Raw2Digi " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiPixelRawToDigi" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelRawToDigi"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelRawToDigi"]; + cumulativetimepermodule += timingPerModule["SiPixelRawToDigi"]; + std::cout << " - " << std::setw(40) << "SiStripRawToDigi" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripRawToDigiModule"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripRawToDigiModule"]; + cumulativetimepermodule += timingPerModule["SiStripRawToDigiModule"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 1.1.2 : LocalReco" << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiPixelClusterProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelClusterProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelClusterProducer"]; + cumulativetimepermodule += timingPerModule["SiPixelClusterProducer"]; + std::cout << " - " << std::setw(40) << "SiPixelRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"]; + std::cout << " - " << std::setw(40) << "SiStripZeroSuppression" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripZeroSuppression"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripZeroSuppression"]; + cumulativetimepermodule += timingPerModule["SiStripZeroSuppression"]; + std::cout << " - " << std::setw(40) << "SiStripClusterizer" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripClusterizer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripClusterizer"]; + cumulativetimepermodule += timingPerModule["SiStripClusterizer"]; + std::cout << " - " << std::setw(40) << "SiStripRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + + std::cout << " 1.2 BeamSpot+CkfTracks :" << std::endl; + std::cout << " 1.2.1 : BeamSpot " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "BeamSpotProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["BeamSpotProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["BeamSpotProducer"]; + cumulativetimepermodule += timingPerModule["BeamSpotProducer"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 1.2.2 : Tracks " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "CosmicSeedGenerator" << std::setw(30) << "" << std::setw(8) << timingPerModule["CosmicSeedGenerator"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["CosmicSeedGenerator"]; + cumulativetimepermodule += timingPerModule["CosmicSeedGenerator"]; +/* + - cosmicseedfinderP5 + - cosmicseedfinderP5Top + - cosmicseedfinderP5Bottom +*/ + std::cout << " - " << std::setw(40) << "SimpleCosmicBONSeeder" << std::setw(30) << "" << std::setw(8) << timingPerModule["SimpleCosmicBONSeeder"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SimpleCosmicBONSeeder"]; + cumulativetimepermodule += timingPerModule["SimpleCosmicBONSeeder"]; +/* + - simpleCosmicBONSeeds + - simpleCosmicBONSeedsTop + - simpleCosmicBONSeedsBottom +*/ + std::cout << " - " << std::setw(40) << "SeedCombiner" << std::setw(30) << "" << std::setw(8) << timingPerModule["SeedCombiner"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SeedCombiner"]; + cumulativetimepermodule += timingPerModule["SeedCombiner"]; +/* + - combinedP5SeedsForCTF + - combinedP5SeedsForCTFTop + - combinedP5SeedsForCTFBottom +*/ + std::cout << " - " << std::setw(40) << "CtfSpecialSeedGenerator" << std::setw(30) << "" << std::setw(8) << timingPerModule["CtfSpecialSeedGenerator"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["CtfSpecialSeedGenerator"]; + cumulativetimepermodule += timingPerModule["CtfSpecialSeedGenerator"]; +/* + - combinatorialcosmicseedfinderP5 + - combinatorialcosmicseedfinderP5Top + - combinatorialcosmicseedfinderP5Bottom +*/ + std::cout << " - " << std::setw(40) << "RoadSearchSeedFinder" << std::setw(30) << "" << std::setw(8) << timingPerModule["RoadSearchSeedFinder"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["RoadSearchSeedFinder"]; + cumulativetimepermodule += timingPerModule["RoadSearchSeedFinder"]; +/* + - roadSearchSeedsP5 + - roadSearchSeedsP5Top + - roadSearchSeedsP5Bottom +*/ + std::cout << " - " << std::setw(40) << "RoadSearchCloudMaker" << std::setw(30) << "" << std::setw(8) << timingPerModule["RoadSearchCloudMaker"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["RoadSearchCloudMaker"]; + cumulativetimepermodule += timingPerModule["RoadSearchCloudMaker"]; +/* + - roadSearchCloudsP5 + - roadSearchCloudsP5Top + - roadSearchCloudsP5Bottom +*/ + std::cout << " - " << std::setw(40) << "CosmicTrackFinder" << std::setw(30) << "" << std::setw(8) << timingPerModule["CosmicTrackFinder"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["CosmicTrackFinder"]; + cumulativetimepermodule += timingPerModule["CosmicTrackFinder"]; +/* + - cosmicCandidateFinderP5 + - cosmicCandidateFinderP5Top + - cosmicCandidateFinderP5Bottom +*/ + std::cout << " - " << std::setw(40) << "CosmicTrackSplitter" << std::setw(30) << "" << std::setw(8) << timingPerModule["CosmicTrackSplitter"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["CosmicTrackSplitter"]; + cumulativetimepermodule += timingPerModule["CosmicTrackSplitter"]; +/* + - cosmicTrackSplitter +*/ + std::cout << " - " << std::setw(40) << "CkfTrackCandidateMaker" << std::setw(30) << "" << std::setw(8) << timingPerModule["CkfTrackCandidateMaker"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["CkfTrackCandidateMaker"]; + cumulativetimepermodule += timingPerModule["CkfTrackCandidateMaker"]; +/* + - ckfTrackCandidatesP5 + - ckfTrackCandidatesP5LHCNavigation + - ckfTrackCandidatesP5Top + - ckfTrackCandidatesP5Bottom +*/ + std::cout << " - " << std::setw(40) << "RoadSearchTrackCandidateMaker" << std::setw(30) << "" << std::setw(8) << timingPerModule["RoadSearchTrackCandidateMaker"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["RoadSearchTrackCandidateMaker"]; + cumulativetimepermodule += timingPerModule["RoadSearchTrackCandidateMaker"]; +/* + - rsTrackCandidatesP5 + - rsTrackCandidatesP5Top + - rsTrackCandidatesP5Bottom +*/ + std::cout << " - " << std::setw(40) << "TrackProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["TrackProducer"]; + cumulativetimepermodule += timingPerModule["TrackProducer"]; +/* + - cosmictrackfinderP5 + - cosmictrackfinderP5Top + - cosmictrackfinderP5Bottom + - splittedTracksP5 + - ctfWithMaterialTracksP5LHCNavigation + - ctfWithMaterialTracksP5 + - ctfWithMaterialTracksP5Top + - ctfWithMaterialTracksP5Bottom + - rsWithMaterialTracksP5 + - rsWithMaterialTracksP5Top + - rsWithMaterialTracksP5Bottom +*/ + std::cout << " - " << std::setw(40) << "PixelClusterSelectorTopBottom" << std::setw(30) << "" << std::setw(8) << timingPerModule["PixelClusterSelectorTopBottom"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["PixelClusterSelectorTopBottom"]; + cumulativetimepermodule += timingPerModule["PixelClusterSelectorTopBottom"]; +/* + - siPixelClustersTop + - siPixelClustersBottom +*/ + std::cout << " - " << std::setw(40) << "SiPixelRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiPixelRecHitConverter:siPixelRecHitsTop"]/((double)nbofevts-1.) + +timingPerLabel["SiPixelRecHitConverter:siPixelRecHitsBottom"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHitsTop"]; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHitsBottom"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHitsTop"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHitsBottom"]; +/* + - siPixelRecHitsTop + - siPixelRecHitsBottom +*/ + std::cout << " - " << std::setw(40) << "StripClusterSelectorTopBottom" << std::setw(30) << "" << std::setw(8) << timingPerModule["StripClusterSelectorTopBottom"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["StripClusterSelectorTopBottom"]; + cumulativetimepermodule += timingPerModule["StripClusterSelectorTopBottom"]; +/* + - siStripClustersTop + - siStripClustersBottom +*/ + std::cout << " - " << std::setw(40) << "SiStripRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHitsTop"]/((double)nbofevts-1.) + +timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHitsBottom"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHitsTop"]; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHitsBottom"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHitsTop"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHitsBottom"]; +/* + - siStripMatchedRecHitsTop + - siStripMatchedRecHitsBottom +*/ + std::cout << " - " << std::setw(40) << "TopBottomClusterInfoProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["TopBottomClusterInfoProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["TopBottomClusterInfoProducer"]; + cumulativetimepermodule += timingPerModule["TopBottomClusterInfoProducer"]; +/* + - topBottomClusterInfoProducerBottom +*/ + std::cout << " - " << std::setw(40) << "DeDxEstimatorProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["DeDxEstimatorProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["DeDxEstimatorProducer"]; + cumulativetimepermodule += timingPerModule["DeDxEstimatorProducer"]; +/* + - dedxMedian + - dedxHarmonic2 +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + + std::cout << "2. Data quality monitoring : " << std::endl; + + std::cout << " 2.1 DQM common modules " << std::endl; + std::cout << " 2.1.1 : Quality tests " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "" << std::setw(30) << "" << std::setw(8) << timingPerModule["QualityTester"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["QualityTester"]; + cumulativetimepermodule += timingPerModule["QualityTester"]; +/* + - qTester +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.1.2 : DQM playback environment " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "DQMEventInfo" << std::setw(30) << "" << std::setw(8) << timingPerLabel["DQMEventInfo:dqmEnv"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["DQMEventInfo:dqmEnv"]; + cumulativetimepermodule += timingPerLabel["DQMEventInfo:dqmEnv"]; +/* + - dqmEnv +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.1.3 : DQM playback for Tracking info " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "DQMEventInfo" << std::setw(30) << "" << std::setw(8) << timingPerLabel["DQMEventInfo:dqmEnvTr"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["DQMEventInfo:dqmEnvTr"]; + cumulativetimepermodule += timingPerLabel["DQMEventInfo:dqmEnvTr"]; +/* + - dqmEnvTr +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.1.4 : DQM file saver " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "DQMFileSaver" << std::setw(30) << "" << std::setw(8) << timingPerModule["DQMFileSaver"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["DQMFileSaver"]; + cumulativetimepermodule += timingPerModule["DQMFileSaver"]; +/* + - dqmSaver +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + std::cout << " 2.2 DQM monitor " << std::endl; + std::cout << " 2.2.1 : SiStripMonitor " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiStripFEDMonitorPlugin" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripFEDMonitorPlugin"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripFEDMonitorPlugin"]; + cumulativetimepermodule += timingPerModule["SiStripFEDMonitorPlugin"]; +/* + - siStripFEDMonitor +*/ + std::cout << " - " << std::setw(40) << "SiStripMonitorDigi" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripMonitorDigi"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripMonitorDigi"]; + cumulativetimepermodule += timingPerModule["SiStripMonitorDigi"]; +/* + - SiStripMonitorDigi +*/ + std::cout << " - " << std::setw(40) << "SiStripMonitorCluster" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripMonitorCluster"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripMonitorCluster"]; + cumulativetimepermodule += timingPerModule["SiStripMonitorCluster"]; +/* + - SiStripMonitorClusterReal +*/ + std::cout << " - " << std::setw(40) << "SiStripMonitorTrack" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripMonitorTrack"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripMonitorTrack"]; + cumulativetimepermodule += timingPerModule["SiStripMonitorTrack"]; +/* + - SiStripMonitorTrack_cosmicTk +*/ + std::cout << " - " << std::setw(40) << "MonitorTrackResiduals" << std::setw(30) << "" << std::setw(8) << timingPerModule["MonitorTrackResiduals"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["MonitorTrackResiduals"]; + cumulativetimepermodule += timingPerModule["MonitorTrackResiduals"]; +/* + - MonitorTrackResiduals_cosmicTk +*/ + std::cout << " - " << std::setw(40) << "TrackingMonitor" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackingMonitor"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["TrackingMonitor"]; + cumulativetimepermodule += timingPerModule["TrackingMonitor"]; +/* + - TrackMon_cosmicTk +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.2.2 : SiStripAnalyser " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiStripAnalyser" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripAnalyser"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripAnalyser"]; + cumulativetimepermodule += timingPerModule["SiStripAnalyser"]; +/* + - SiStripAnalyser +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + std::cout << " 2.2.3 : Miscellaneous " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "TriggerResultInserter" << std::setw(30) << "" << std::setw(8) << timingPerModule["TriggerResultInserter"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["TriggerResultInserter"]; + cumulativetimepermodule += timingPerModule["TriggerResultInserter"]; +/* + - TriggerResults +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + std::cout << "Total nb of events read = " << nbofevts << std::endl; + std::cout << "Total time = " << totalTime << " ms/event " << std::endl; + + std::map::const_iterator eventIt = timingPerEvent.begin(); + std::map::const_iterator eventEnd = timingPerEvent.end(); + double minEv = 99999999.; + double maxEv = 0.; + double rms = 0.; + double mean = 0.; + double timeEv = 0; + for ( ; eventIt != eventEnd; ++eventIt ) { + if ( eventIt->first == 1 ) continue; + timeEv = eventIt->second; + //std::cout << "Evt nr : " << eventIt->first << " / " << timeEv << " ms" << std::endl; + if ( timeEv > maxEv ) maxEv = timeEv; + if ( timeEv < minEv ) minEv = timeEv; + mean += timeEv; + rms += timeEv*timeEv; + } + + mean /= ((double)nbofevts-1.); + rms /= ((double)nbofevts-1.); + rms = std::sqrt(rms-mean*mean); + std::cout << "Total time = " << mean << " +/- " << rms << " ms/event" << std::endl; + std::cout << "Min. time = " << minEv << " ms/event" << std::endl; + std::cout << "Max. time = " << maxEv << " ms/event" << std::endl; +} + diff --git a/DQM/TrackerCommon/test/TimingProfiler_SiPixel.cpp b/DQM/TrackerCommon/test/TimingProfiler_SiPixel.cpp new file mode 100644 index 0000000000000..a5b80a53a72f2 --- /dev/null +++ b/DQM/TrackerCommon/test/TimingProfiler_SiPixel.cpp @@ -0,0 +1,457 @@ +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv) { + + //std::string file = "TimingInfo.txt"; + std::string file; + file.assign(argv[1]); + std::map timingPerModule, timingPerLabel; + std::map timingPerEvent; + std::ifstream myTimingFile(file.c_str(),std::ifstream::in); + std::string dummy1, label, module; + double timing; + unsigned idummy1,evt; + int nbofevts = 0; + + // If the machine is busy, the factor is not 100%. + double factor = 0.995; + + if ( myTimingFile ) { + while ( !myTimingFile.eof() ) { + myTimingFile >> dummy1 >> evt >> idummy1 >> label >> module >> timing ; + // std::cout << evt << " " << module << " " << timing << std::endl; + timingPerEvent[evt] += timing * factor * 1000.; + timingPerModule[module] += timing * factor * 1000.; + timingPerLabel[module+":"+label] += timing * factor * 1000.; + } + nbofevts = (int) timingPerEvent.size(); + } else { + std::cout << "File " << file << " does not exist!" << std::endl; + } + + std::map::const_iterator modIt = timingPerModule.begin(); + std::map::const_iterator labIt = timingPerLabel.begin(); + std::map::const_iterator modEnd = timingPerModule.end(); + std::map::const_iterator labEnd = timingPerLabel.end(); + std::map modulePerTiming; + std::map labelPerTiming; + + for ( ; modIt != modEnd; ++modIt ) { + double time = modIt->second/((double)nbofevts-1.); + std::string name = modIt->first; + modulePerTiming[time] = name; + } + + for ( ; labIt != labEnd; ++labIt ) { + double time = labIt->second/((double)nbofevts-1.); + std::string name = labIt->first; + labelPerTiming[time] = name; + } + + std::map::const_reverse_iterator timeIt = modulePerTiming.rbegin(); + std::map::const_reverse_iterator timeEnd = modulePerTiming.rend(); + std::map::const_reverse_iterator timeIt2 = labelPerTiming.rbegin(); + std::map::const_reverse_iterator timeEnd2 = labelPerTiming.rend(); + + std::cout << "Timing per module " << std::endl; + std::cout << "================= " << std::endl; + double totalTime = 0.; + unsigned i=1; + for ( ; timeIt != timeEnd; ++timeIt ) { + + totalTime += timeIt->first; + std::cout << std::setw(3) << i++ + << std::setw(50) << timeIt->second << " : " + << std::setw(7) << std::setprecision(3) << timeIt-> first << " ms/event" + << std::endl; + } + std::cout << "Total time = " << totalTime << " ms/event " << std::endl; + +/* + std::cout << "================= " << std::endl; + std::cout << "Timing per label " << std::endl; + std::cout << "================= " << std::endl; + totalTime = 0.; + i = 1; + for ( ; timeIt2 != timeEnd2; ++timeIt2 ) { + + totalTime += timeIt2->first; + std::cout << std::setw(3) << i++ + << std::setw(100) << timeIt2->second << " : " + << std::setw(7) << std::setprecision(3) << timeIt2-> first << " ms/event" + << std::endl; + } +*/ + + double subtotaltimepermodule = 0; + double cumulativetimepermodule = 0; + + std::cout << "================= " << std::endl; + std::cout << " DQM for collision : Timing per step " << std::endl; + std::cout << "================= " << std::endl; + + std::cout << "1. Reconstruction " << std::endl; + + std::cout << " 1.1 Raw2Digi+LocalReco : " << std::endl; + std::cout << " 1.1.1 : Raw2Digi " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiPixelRawToDigi" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelRawToDigi"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelRawToDigi"]; + cumulativetimepermodule += timingPerModule["SiPixelRawToDigi"]; + std::cout << " - " << std::setw(40) << "SiStripRawToDigi" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripRawToDigiModule"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripRawToDigiModule"]; + cumulativetimepermodule += timingPerModule["SiStripRawToDigiModule"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 1.1.2 : LocalReco" << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiPixelClusterProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelClusterProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelClusterProducer"]; + cumulativetimepermodule += timingPerModule["SiPixelClusterProducer"]; + std::cout << " - " << std::setw(40) << "SiPixelRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"]; + std::cout << " - " << std::setw(40) << "SiStripZeroSuppression" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripZeroSuppression"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripZeroSuppression"]; + cumulativetimepermodule += timingPerModule["SiStripZeroSuppression"]; + std::cout << " - " << std::setw(40) << "SiStripClusterizer" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripClusterizer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripClusterizer"]; + cumulativetimepermodule += timingPerModule["SiStripClusterizer"]; + std::cout << " - " << std::setw(40) << "SiStripRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + + std::cout << " 1.2 BeamSpot+RecoPixelVertexing+CkfTracks :" << std::endl; + std::cout << " 1.2.1 : BeamSpot " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "BeamSpotProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["BeamSpotProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["BeamSpotProducer"]; + cumulativetimepermodule += timingPerModule["BeamSpotProducer"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 1.2.2 : RecoPixelVertexing " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "PixelTrackProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["PixelTrackProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["PixelTrackProducer"]; + cumulativetimepermodule += timingPerModule["PixelTrackProducer"]; + std::cout << " - " << std::setw(40) << "PixelVertexProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["PixelVertexProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["PixelVertexProducer"]; + cumulativetimepermodule += timingPerModule["PixelVertexProducer"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 1.2.3 : CkfTracks " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SeedGeneratorFromRegionHitsEDProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["SeedGeneratorFromRegionHitsEDProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SeedGeneratorFromRegionHitsEDProducer"]; + cumulativetimepermodule += timingPerModule["SeedGeneratorFromRegionHitsEDProducer"]; +/* + - newSeedFromTriplets + - newSeedFromPairs + - secTriplets + - thPLSeeds + - fourthPLSeeds + - fifthSeeds +*/ + std::cout << " - " << std::setw(40) << "CkfTrackCandidateMaker" << std::setw(30) << "" << std::setw(8) << timingPerModule["CkfTrackCandidateMaker"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["CkfTrackCandidateMaker"]; + cumulativetimepermodule += timingPerModule["CkfTrackCandidateMaker"]; +/* + - newTrackCandidateMaker + - secTrackCandidates + - thTrackCandidates + - fourthTrackCandidates + - fifthTrackCandidates +*/ + std::cout << " - " << std::setw(40) << "TrackProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["TrackProducer"]; + cumulativetimepermodule += timingPerModule["TrackProducer"]; +/* + - preFilterZeroStepTracks + - preFilterStepOneTracks + - secWithMaterialTracks + - thWithMaterialTracks + - fourthWithMaterialTracks + - fifthWithMaterialTracks +*/ + std::cout << " - " << std::setw(40) << "AnalyticalTrackSelector" << std::setw(30) << "" << std::setw(8) << timingPerModule["AnalyticalTrackSelector"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["AnalyticalTrackSelector"]; + cumulativetimepermodule += timingPerModule["AnalyticalTrackSelector"]; +/* + - zeroStepWithLooseQuality + - zeroStepWithTightQuality + - zeroStepTracksWithQuality + - firstStepWithLooseQuality + - firstStepWithTightQuality + - preMergingFirstStepTracksWithQuality + - secStepVtxLoose + - secStepTrkLoose + - secStepVtxTight + - secStepTrkTight + - secStepVtx + - secStepTrk + - thStepVtxLoose + - thStepTrkLoose + - thStepVtxTight + - thStepTrkTight + - thStepVtx + - thStepTrk + - pixellessStepLoose + - pixellessStepTight + - pixellessStep + - tobtecStepLoose + - tobtecStepTight + - tobtecStep +*/ + std::cout << " - " << std::setw(40) << "QualityFilter" << std::setw(30) << "" << std::setw(8) << timingPerModule["QualityFilter"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["QualityFilter"]; + cumulativetimepermodule += timingPerModule["QualityFilter"]; +/* + - zeroStepFilter + - firstfilter + - secfilter + - thfilter + - fourthfilter +*/ + std::cout << " - " << std::setw(40) << "TrackClusterRemover" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackClusterRemover"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["TrackClusterRemover"]; + cumulativetimepermodule += timingPerModule["TrackClusterRemover"]; +/* + - newClusters + - secClusters + - thClusters + - fourthClusters + - fifthClusters +*/ + std::cout << " - " << std::setw(40) << "SiPixelRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiPixelRecHitConverter:newPixelRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiPixelRecHitConverter:secPixelRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiPixelRecHitConverter:thPixelRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiPixelRecHitConverter:fourthPixelRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiPixelRecHitConverter:fifthPixelRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:newPixelRecHits"]; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:secPixelRecHits"]; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:thPixelRecHits"]; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:fourthPixelRecHits"]; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:fifthPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:newPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:secPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:thPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:fourthPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:fifthPixelRecHits"]; +/* + - newPixelRecHits + - secPixelRecHits + - thPixelRecHits + - fourthPixelRecHits + - fifthPixelRecHits +*/ + std::cout << " - " << std::setw(40) << "SiStripRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiStripRecHitConverter:newStripRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiStripRecHitConverter:secStripRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiStripRecHitConverter:thStripRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiStripRecHitConverter:fourthStripRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiStripRecHitConverter:fifthStripRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:newStripRecHits"]; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:secStripRecHits"]; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:thStripRecHits"]; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:fourthStripRecHits"]; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:fifthStripRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:newStripRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:secStripRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:thStripRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:fourthStripRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:fifthStripRecHits"]; +/* + - newStripRecHits + - secStripRecHits + - thStripRecHits + - fourthStripRecHits + - fifthStripRecHits +*/ + std::cout << " - " << std::setw(40) << "SimpleTrackListMerger" << std::setw(30) << "" << std::setw(8) << timingPerModule["SimpleTrackListMerger"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SimpleTrackListMerger"]; + cumulativetimepermodule += timingPerModule["SimpleTrackListMerger"]; +/* + - merge2nd3rdTracks + - merge4th5thTracks + - iterTracks + - generalTracks +*/ + std::cout << " - " << std::setw(40) << "SeedCombiner" << std::setw(30) << "" << std::setw(8) << timingPerModule["SeedCombiner"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SeedCombiner"]; + cumulativetimepermodule += timingPerModule["SeedCombiner"]; +/* + - newCombinedSeeds +*/ + std::cout << " - " << std::setw(40) << "DeDxEstimatorProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["DeDxEstimatorProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["DeDxEstimatorProducer"]; + cumulativetimepermodule += timingPerModule["DeDxEstimatorProducer"]; +/* + - dedxMedian + - dedxHarmonic2 +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + + std::cout << "2. Data quality monitoring : " << std::endl; + + std::cout << " 2.1 DQM common modules " << std::endl; + std::cout << " 2.1.1 : Quality tests " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "QualityTester" << std::setw(30) << "" << std::setw(8) << timingPerModule["QualityTester"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["QualityTester"]; + cumulativetimepermodule += timingPerModule["QualityTester"]; +/* + - qTester +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.1.2 : DQM playback environment " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "DQMEventInfo" << std::setw(30) << "" << std::setw(8) << timingPerLabel["DQMEventInfo:dqmEnv"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["DQMEventInfo:dqmEnv"]; + cumulativetimepermodule += timingPerLabel["DQMEventInfo:dqmEnv"]; +/* + - dqmEnv +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; +// std::cout << " 2.1.3 : DQM playback for Tracking info " << std::endl; +// subtotaltimepermodule = 0; +// std::cout << " - " << std::setw(40) << "DQMEventInfo" << std::setw(30) << "" << std::setw(8) << timingPerLabel["DQMEventInfo:dqmEnvTr"]/((double)nbofevts-1.) << " ms/event" << std::endl; +// subtotaltimepermodule += timingPerLabel["DQMEventInfo:dqmEnvTr"]; +// cumulativetimepermodule += timingPerLabel["DQMEventInfo:dqmEnvTr"]; +// /* +// - dqmEnvTr +// */ +// std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; +// std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.1.3 : DQM file saver " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "DQMFileSaver" << std::setw(30) << "" << std::setw(8) << timingPerModule["DQMFileSaver"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["DQMFileSaver"]; + cumulativetimepermodule += timingPerModule["DQMFileSaver"]; +/* + - dqmSaver +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + std::cout << " 2.2 DQM monitoring " << std::endl; + std::cout << " 2.2.1 : Raw data error monitor" << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiPixelRawDataErrorSource" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelRawDataErrorSource"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelRawDataErrorSource"]; + cumulativetimepermodule += timingPerModule["SiPixelRawDataErrorSource"]; +/* + - SiPixelRawDataErrorSource +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + +// std::cout << " - " << std::setw(40) << "SiStripMonitorCluster" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripMonitorCluster"]/((double)nbofevts-1.) << " ms/event" << std::endl; +// subtotaltimepermodule += timingPerModule["SiStripMonitorCluster"]; +// cumulativetimepermodule += timingPerModule["SiStripMonitorCluster"]; +// /* +// - SiStripMonitorClusterReal +// */ +// std::cout << " - " << std::setw(40) << "SiStripMonitorTrack" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripMonitorTrack"]/((double)nbofevts-1.) << " ms/event" << std::endl; +// subtotaltimepermodule += timingPerModule["SiStripMonitorTrack"]; +// cumulativetimepermodule += timingPerModule["SiStripMonitorTrack"]; +// /* +// - SiStripMonitorTrack_gentk +// */ +// std::cout << " - " << std::setw(40) << "MonitorTrackResiduals" << std::setw(30) << "" << std::setw(8) << timingPerModule["MonitorTrackResiduals"]/((double)nbofevts-1.) << " ms/event" << std::endl; +// subtotaltimepermodule += timingPerModule["MonitorTrackResiduals"]; +// cumulativetimepermodule += timingPerModule["MonitorTrackResiduals"]; +// /* +// - MonitorTrackResiduals_gentk +// */ +// std::cout << " - " << std::setw(40) << "TrackingMonitor" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackingMonitor"]/((double)nbofevts-1.) << " ms/event" << std::endl; +// subtotaltimepermodule += timingPerModule["TrackingMonitor"]; +// cumulativetimepermodule += timingPerModule["TrackingMonitor"]; +// /* +// - TrackMon_gentk +// */ +// std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; +// std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.2.2 : Digi/Cluster/RecHit monitor " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiPixelDigiSource" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelDigiSource"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelDigiSource"]; + cumulativetimepermodule += timingPerModule["SiPixelDigiSource"]; +/* + - SiPixelDigiSource +*/ + std::cout << " - " << std::setw(40) << "SiPixelRecHitSource" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelRecHitSource"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelRecHitSource"]; + cumulativetimepermodule += timingPerModule["SiPixelRecHitSource"]; +/* + - SiPixelRecHitSource +*/ + std::cout << " - " << std::setw(40) << "SiPixelClusterSource" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelClusterSource"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelClusterSource"]; + cumulativetimepermodule += timingPerModule["SiPixelClusterSource"]; +/* + - SiPixelClusterSource +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + std::cout << " 2.2.3 : Track monitor " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiPixelTrackResidualSource" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelTrackResidualSource"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelTrackResidualSource"]; + cumulativetimepermodule += timingPerModule["SiPixelTrackResidualSource"]; +/* + - SiPixelTrackResidualSource +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + std::cout << " 2.2.4 : Pixel EDA client " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiPixelEDAClient" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelEDAClient"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelEDAClient"]; + cumulativetimepermodule += timingPerModule["SiPixelEDAClient"]; +/* + - sipixelEDAClientP5 +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + std::cout << "Total nb of events read = " << nbofevts << std::endl; + std::cout << "Total time = " << totalTime << " ms/event " << std::endl; + + std::map::const_iterator eventIt = timingPerEvent.begin(); + std::map::const_iterator eventEnd = timingPerEvent.end(); + double minEv = 99999999.; + double maxEv = 0.; + double rms = 0.; + double mean = 0.; + double timeEv = 0; + for ( ; eventIt != eventEnd; ++eventIt ) { + if ( eventIt->first == 1 ) continue; + timeEv = eventIt->second; + //std::cout << "Evt nr : " << eventIt->first << " / " << timeEv << " ms" << std::endl; + if ( timeEv > maxEv ) maxEv = timeEv; + if ( timeEv < minEv ) minEv = timeEv; + mean += timeEv; + rms += timeEv*timeEv; + } + + mean /= ((double)nbofevts-1.); + rms /= ((double)nbofevts-1.); + rms = std::sqrt(rms-mean*mean); + std::cout << "Total time = " << mean << " +/- " << rms << " ms/event" << std::endl; + std::cout << "Min. time = " << minEv << " ms/event" << std::endl; + std::cout << "Max. time = " << maxEv << " ms/event" << std::endl; +} + diff --git a/DQM/TrackerCommon/test/TimingProfiler_SiStrip.cpp b/DQM/TrackerCommon/test/TimingProfiler_SiStrip.cpp new file mode 100644 index 0000000000000..ae82868f031ee --- /dev/null +++ b/DQM/TrackerCommon/test/TimingProfiler_SiStrip.cpp @@ -0,0 +1,437 @@ +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv) { + + //std::string file = "TimingInfo.txt"; + std::string file; + file.assign(argv[1]); + std::map timingPerModule, timingPerLabel; + std::map timingPerEvent; + std::ifstream myTimingFile(file.c_str(),std::ifstream::in); + std::string dummy1, label, module; + double timing; + unsigned idummy1,evt; + int nbofevts = 0; + + // If the machine is busy, the factor is not 100%. + double factor = 0.995; + + if ( myTimingFile ) { + while ( !myTimingFile.eof() ) { + myTimingFile >> dummy1 >> evt >> idummy1 >> label >> module >> timing ; + // std::cout << evt << " " << module << " " << timing << std::endl; + timingPerEvent[evt] += timing * factor * 1000.; + timingPerModule[module] += timing * factor * 1000.; + timingPerLabel[module+":"+label] += timing * factor * 1000.; + } + nbofevts = (int) timingPerEvent.size(); + } else { + std::cout << "File " << file << " does not exist!" << std::endl; + } + + std::map::const_iterator modIt = timingPerModule.begin(); + std::map::const_iterator labIt = timingPerLabel.begin(); + std::map::const_iterator modEnd = timingPerModule.end(); + std::map::const_iterator labEnd = timingPerLabel.end(); + std::map modulePerTiming; + std::map labelPerTiming; + + for ( ; modIt != modEnd; ++modIt ) { + double time = modIt->second/((double)nbofevts-1.); + std::string name = modIt->first; + modulePerTiming[time] = name; + } + + for ( ; labIt != labEnd; ++labIt ) { + double time = labIt->second/((double)nbofevts-1.); + std::string name = labIt->first; + labelPerTiming[time] = name; + } + + std::map::const_reverse_iterator timeIt = modulePerTiming.rbegin(); + std::map::const_reverse_iterator timeEnd = modulePerTiming.rend(); + std::map::const_reverse_iterator timeIt2 = labelPerTiming.rbegin(); + std::map::const_reverse_iterator timeEnd2 = labelPerTiming.rend(); + + std::cout << "Timing per module " << std::endl; + std::cout << "================= " << std::endl; + double totalTime = 0.; + unsigned i=1; + for ( ; timeIt != timeEnd; ++timeIt ) { + + totalTime += timeIt->first; + std::cout << std::setw(3) << i++ + << std::setw(50) << timeIt->second << " : " + << std::setw(7) << std::setprecision(3) << timeIt-> first << " ms/event" + << std::endl; + } + std::cout << "Total time = " << totalTime << " ms/event " << std::endl; + +/* + std::cout << "================= " << std::endl; + std::cout << "Timing per label " << std::endl; + std::cout << "================= " << std::endl; + totalTime = 0.; + i = 1; + for ( ; timeIt2 != timeEnd2; ++timeIt2 ) { + + totalTime += timeIt2->first; + std::cout << std::setw(3) << i++ + << std::setw(100) << timeIt2->second << " : " + << std::setw(7) << std::setprecision(3) << timeIt2-> first << " ms/event" + << std::endl; + } +*/ + + double subtotaltimepermodule = 0; + double cumulativetimepermodule = 0; + + std::cout << "================= " << std::endl; + std::cout << " DQM for collision : Timing per step " << std::endl; + std::cout << "================= " << std::endl; + + std::cout << "1. Reconstruction " << std::endl; + + std::cout << " 1.1 Raw2Digi+LocalReco : " << std::endl; + std::cout << " 1.1.1 : Raw2Digi " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiPixelRawToDigi" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelRawToDigi"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelRawToDigi"]; + cumulativetimepermodule += timingPerModule["SiPixelRawToDigi"]; + std::cout << " - " << std::setw(40) << "SiStripRawToDigi" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripRawToDigiModule"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripRawToDigiModule"]; + cumulativetimepermodule += timingPerModule["SiStripRawToDigiModule"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 1.1.2 : LocalReco" << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiPixelClusterProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelClusterProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiPixelClusterProducer"]; + cumulativetimepermodule += timingPerModule["SiPixelClusterProducer"]; + std::cout << " - " << std::setw(40) << "SiPixelRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"]; + std::cout << " - " << std::setw(40) << "SiStripZeroSuppression" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripZeroSuppression"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripZeroSuppression"]; + cumulativetimepermodule += timingPerModule["SiStripZeroSuppression"]; + std::cout << " - " << std::setw(40) << "SiStripClusterizer" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripClusterizer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripClusterizer"]; + cumulativetimepermodule += timingPerModule["SiStripClusterizer"]; + std::cout << " - " << std::setw(40) << "SiStripRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + + std::cout << " 1.2 BeamSpot+RecoPixelVertexing+CkfTracks :" << std::endl; + std::cout << " 1.2.1 : BeamSpot " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "BeamSpotProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["BeamSpotProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["BeamSpotProducer"]; + cumulativetimepermodule += timingPerModule["BeamSpotProducer"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 1.2.2 : RecoPixelVertexing " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "PixelTrackProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["PixelTrackProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["PixelTrackProducer"]; + cumulativetimepermodule += timingPerModule["PixelTrackProducer"]; + std::cout << " - " << std::setw(40) << "PixelVertexProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["PixelVertexProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["PixelVertexProducer"]; + cumulativetimepermodule += timingPerModule["PixelVertexProducer"]; + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 1.2.3 : CkfTracks " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SeedGeneratorFromRegionHitsEDProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["SeedGeneratorFromRegionHitsEDProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SeedGeneratorFromRegionHitsEDProducer"]; + cumulativetimepermodule += timingPerModule["SeedGeneratorFromRegionHitsEDProducer"]; +/* + - newSeedFromTriplets + - newSeedFromPairs + - secTriplets + - thPLSeeds + - fourthPLSeeds + - fifthSeeds +*/ + std::cout << " - " << std::setw(40) << "CkfTrackCandidateMaker" << std::setw(30) << "" << std::setw(8) << timingPerModule["CkfTrackCandidateMaker"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["CkfTrackCandidateMaker"]; + cumulativetimepermodule += timingPerModule["CkfTrackCandidateMaker"]; +/* + - newTrackCandidateMaker + - secTrackCandidates + - thTrackCandidates + - fourthTrackCandidates + - fifthTrackCandidates +*/ + std::cout << " - " << std::setw(40) << "TrackProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["TrackProducer"]; + cumulativetimepermodule += timingPerModule["TrackProducer"]; +/* + - preFilterZeroStepTracks + - preFilterStepOneTracks + - secWithMaterialTracks + - thWithMaterialTracks + - fourthWithMaterialTracks + - fifthWithMaterialTracks +*/ + std::cout << " - " << std::setw(40) << "AnalyticalTrackSelector" << std::setw(30) << "" << std::setw(8) << timingPerModule["AnalyticalTrackSelector"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["AnalyticalTrackSelector"]; + cumulativetimepermodule += timingPerModule["AnalyticalTrackSelector"]; +/* + - zeroStepWithLooseQuality + - zeroStepWithTightQuality + - zeroStepTracksWithQuality + - firstStepWithLooseQuality + - firstStepWithTightQuality + - preMergingFirstStepTracksWithQuality + - secStepVtxLoose + - secStepTrkLoose + - secStepVtxTight + - secStepTrkTight + - secStepVtx + - secStepTrk + - thStepVtxLoose + - thStepTrkLoose + - thStepVtxTight + - thStepTrkTight + - thStepVtx + - thStepTrk + - pixellessStepLoose + - pixellessStepTight + - pixellessStep + - tobtecStepLoose + - tobtecStepTight + - tobtecStep +*/ + std::cout << " - " << std::setw(40) << "QualityFilter" << std::setw(30) << "" << std::setw(8) << timingPerModule["QualityFilter"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["QualityFilter"]; + cumulativetimepermodule += timingPerModule["QualityFilter"]; +/* + - zeroStepFilter + - firstfilter + - secfilter + - thfilter + - fourthfilter +*/ + std::cout << " - " << std::setw(40) << "TrackClusterRemover" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackClusterRemover"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["TrackClusterRemover"]; + cumulativetimepermodule += timingPerModule["TrackClusterRemover"]; +/* + - newClusters + - secClusters + - thClusters + - fourthClusters + - fifthClusters +*/ + std::cout << " - " << std::setw(40) << "SiPixelRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiPixelRecHitConverter:newPixelRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiPixelRecHitConverter:secPixelRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiPixelRecHitConverter:thPixelRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiPixelRecHitConverter:fourthPixelRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiPixelRecHitConverter:fifthPixelRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:newPixelRecHits"]; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:secPixelRecHits"]; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:thPixelRecHits"]; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:fourthPixelRecHits"]; + subtotaltimepermodule += timingPerLabel["SiPixelRecHitConverter:fifthPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:newPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:secPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:thPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:fourthPixelRecHits"]; + cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:fifthPixelRecHits"]; +/* + - newPixelRecHits + - secPixelRecHits + - thPixelRecHits + - fourthPixelRecHits + - fifthPixelRecHits +*/ + std::cout << " - " << std::setw(40) << "SiStripRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiStripRecHitConverter:newStripRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiStripRecHitConverter:secStripRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiStripRecHitConverter:thStripRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiStripRecHitConverter:fourthStripRecHits"]/((double)nbofevts-1.) + +timingPerLabel["SiStripRecHitConverter:fifthStripRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:newStripRecHits"]; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:secStripRecHits"]; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:thStripRecHits"]; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:fourthStripRecHits"]; + subtotaltimepermodule += timingPerLabel["SiStripRecHitConverter:fifthStripRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:newStripRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:secStripRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:thStripRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:fourthStripRecHits"]; + cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:fifthStripRecHits"]; +/* + - newStripRecHits + - secStripRecHits + - thStripRecHits + - fourthStripRecHits + - fifthStripRecHits +*/ + std::cout << " - " << std::setw(40) << "SimpleTrackListMerger" << std::setw(30) << "" << std::setw(8) << timingPerModule["SimpleTrackListMerger"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SimpleTrackListMerger"]; + cumulativetimepermodule += timingPerModule["SimpleTrackListMerger"]; +/* + - merge2nd3rdTracks + - merge4th5thTracks + - iterTracks + - generalTracks +*/ + std::cout << " - " << std::setw(40) << "SeedCombiner" << std::setw(30) << "" << std::setw(8) << timingPerModule["SeedCombiner"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SeedCombiner"]; + cumulativetimepermodule += timingPerModule["SeedCombiner"]; +/* + - newCombinedSeeds +*/ + std::cout << " - " << std::setw(40) << "DeDxEstimatorProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["DeDxEstimatorProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["DeDxEstimatorProducer"]; + cumulativetimepermodule += timingPerModule["DeDxEstimatorProducer"]; +/* + - dedxMedian + - dedxHarmonic2 +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + + std::cout << "2. Data quality monitoring : " << std::endl; + + std::cout << " 2.1 DQM common modules " << std::endl; + std::cout << " 2.1.1 : Quality tests " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "" << std::setw(30) << "" << std::setw(8) << timingPerModule["QualityTester"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["QualityTester"]; + cumulativetimepermodule += timingPerModule["QualityTester"]; +/* + - qTester +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.1.2 : DQM playback environment " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "DQMEventInfo" << std::setw(30) << "" << std::setw(8) << timingPerLabel["DQMEventInfo:dqmEnv"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["DQMEventInfo:dqmEnv"]; + cumulativetimepermodule += timingPerLabel["DQMEventInfo:dqmEnv"]; +/* + - dqmEnv +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.1.3 : DQM playback for Tracking info " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "DQMEventInfo" << std::setw(30) << "" << std::setw(8) << timingPerLabel["DQMEventInfo:dqmEnvTr"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerLabel["DQMEventInfo:dqmEnvTr"]; + cumulativetimepermodule += timingPerLabel["DQMEventInfo:dqmEnvTr"]; +/* + - dqmEnvTr +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.1.4 : DQM file saver " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "DQMFileSaver" << std::setw(30) << "" << std::setw(8) << timingPerModule["DQMFileSaver"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["DQMFileSaver"]; + cumulativetimepermodule += timingPerModule["DQMFileSaver"]; +/* + - dqmSaver +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + std::cout << " 2.2 DQM monitor " << std::endl; + std::cout << " 2.2.1 : SiStripMonitor " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiStripFEDMonitorPlugin" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripFEDMonitorPlugin"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripFEDMonitorPlugin"]; + cumulativetimepermodule += timingPerModule["SiStripFEDMonitorPlugin"]; +/* + - siStripFEDMonitor +*/ + std::cout << " - " << std::setw(40) << "SiStripMonitorDigi" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripMonitorDigi"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripMonitorDigi"]; + cumulativetimepermodule += timingPerModule["SiStripMonitorDigi"]; +/* + - SiStripMonitorDigi +*/ + std::cout << " - " << std::setw(40) << "SiStripMonitorCluster" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripMonitorCluster"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripMonitorCluster"]; + cumulativetimepermodule += timingPerModule["SiStripMonitorCluster"]; +/* + - SiStripMonitorClusterReal +*/ + std::cout << " - " << std::setw(40) << "SiStripMonitorTrack" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripMonitorTrack"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripMonitorTrack"]; + cumulativetimepermodule += timingPerModule["SiStripMonitorTrack"]; +/* + - SiStripMonitorTrack_gentk +*/ + std::cout << " - " << std::setw(40) << "MonitorTrackResiduals" << std::setw(30) << "" << std::setw(8) << timingPerModule["MonitorTrackResiduals"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["MonitorTrackResiduals"]; + cumulativetimepermodule += timingPerModule["MonitorTrackResiduals"]; +/* + - MonitorTrackResiduals_gentk +*/ + std::cout << " - " << std::setw(40) << "TrackingMonitor" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackingMonitor"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["TrackingMonitor"]; + cumulativetimepermodule += timingPerModule["TrackingMonitor"]; +/* + - TrackMon_gentk +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + std::cout << " 2.2.2 : SiStripAnalyser " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "SiStripAnalyser" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripAnalyser"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["SiStripAnalyser"]; + cumulativetimepermodule += timingPerModule["SiStripAnalyser"]; +/* + - SiStripAnalyser +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + std::cout << " 2.2.3 : Miscellaneous " << std::endl; + subtotaltimepermodule = 0; + std::cout << " - " << std::setw(40) << "TriggerResultInserter" << std::setw(30) << "" << std::setw(8) << timingPerModule["TriggerResultInserter"]/((double)nbofevts-1.) << " ms/event" << std::endl; + subtotaltimepermodule += timingPerModule["TriggerResultInserter"]; + cumulativetimepermodule += timingPerModule["TriggerResultInserter"]; +/* + - TriggerResults +*/ + std::cout << " " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl; + std::cout << " " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl; + + std::cout << "Total nb of events read = " << nbofevts << std::endl; + std::cout << "Total time = " << totalTime << " ms/event " << std::endl; + + std::map::const_iterator eventIt = timingPerEvent.begin(); + std::map::const_iterator eventEnd = timingPerEvent.end(); + double minEv = 99999999.; + double maxEv = 0.; + double rms = 0.; + double mean = 0.; + double timeEv = 0; + for ( ; eventIt != eventEnd; ++eventIt ) { + if ( eventIt->first == 1 ) continue; + timeEv = eventIt->second; + //std::cout << "Evt nr : " << eventIt->first << " / " << timeEv << " ms" << std::endl; + if ( timeEv > maxEv ) maxEv = timeEv; + if ( timeEv < minEv ) minEv = timeEv; + mean += timeEv; + rms += timeEv*timeEv; + } + + mean /= ((double)nbofevts-1.); + rms /= ((double)nbofevts-1.); + rms = std::sqrt(rms-mean*mean); + std::cout << "Total time = " << mean << " +/- " << rms << " ms/event" << std::endl; + std::cout << "Min. time = " << minEv << " ms/event" << std::endl; + std::cout << "Max. time = " << maxEv << " ms/event" << std::endl; +} + diff --git a/DQM/TrackerCommon/test/css_files/IMGC.css b/DQM/TrackerCommon/test/css_files/IMGC.css new file mode 100644 index 0000000000000..ce16736bad72d --- /dev/null +++ b/DQM/TrackerCommon/test/css_files/IMGC.css @@ -0,0 +1,69 @@ +body +{ + margin: 0px ; + background: #414141; + font-family: arial ; + font-size: 10px ; + width: 100% ; +} + +#canvasBorder +{ + border: 6px solid #283274; + background: black; +} + +#theCanvas .theCanvas +{ + left: 1px ; + right: 1px ; + background-color: red ; +} + +#theCanvasField .theCanvasField +{ + background: #225587; + background-color: #225587; +} + +#controls +{ + width: 90%; + text-align: center; +} + +.controlButton +{ + font-family: arial; + font-size: 10px; +} + +#imgTitle +{ + width: 90%; + font-family: arial; + font-size: 10px; + color: white; + text-align: center; + background: #414141; +} + +.someText +{ + font-family: arial; + font-size: 8pt; + color: maroon; + text-align: left; + background: #fff4d8; +} + +a:link, a:visited +{ + text-decoration: none; + color: #336699; +} + +a:hover +{ + color: black; +} diff --git a/DQM/TrackerCommon/test/css_files/context-menu.css b/DQM/TrackerCommon/test/css_files/context-menu.css new file mode 100644 index 0000000000000..c7aade3abf2c6 --- /dev/null +++ b/DQM/TrackerCommon/test/css_files/context-menu.css @@ -0,0 +1,65 @@ +#contextMenu{ /* The menu container */ + border:1px solid #202867; /* Border around the entire menu */ + background-color:#FFF; /* White background color of the menu */ + margin:0px; + padding:0px; + width:175px; /* Width of context menu */ + font-family:arial; + font-size:12px; + background-image:url('../images/gradient.gif'); + background-repeat:repeat-y; + + /* Never change these two values */ + display:none; + position:absolute; + +} +#contextMenu a{ /* Links in the context menu */ + color: #000; + text-decoration:none; + line-height:25px; + vertical-align:middle; + height:28px; + + /* Don't change these 3 values */ + display:block; + width:100%; + clear:both; + +} +#contextMenu li{ /* Each menu item */ + list-style-type:none; + padding:1px; + margin:1px; + cursor:pointer; + clear:both; +} +#contextMenu li div{ /* Dynamically created divs */ + cursor:pointer; +} +#contextMenu .contextMenuHighlighted{ /* Highlighted context menu item */ + border:1px solid #000; + padding:0px; + background-color:#E2EBED; + +} +#contextMenu img{ + border:0px; +} +#contextMenu .imageBox{ /* Dynamically created divs for images in the menu */ + + float:left; + padding-left:2px; + padding-top:3px; + vertical-align:middle; + + width: 30px; /* IE 5.x */ + width/* */:/**/28px; /* Other browsers */ + width: /**/28px; +} +#contextMenu .itemTxt{ + float:left; + width: 120px; /* IE 5.x */ + width/* */:/**/140px; /* Other browsers */ + width: /**/140px; +} diff --git a/DQM/TrackerCommon/test/css_files/folder-tree-static.css b/DQM/TrackerCommon/test/css_files/folder-tree-static.css new file mode 100644 index 0000000000000..32bca2747dbc8 --- /dev/null +++ b/DQM/TrackerCommon/test/css_files/folder-tree-static.css @@ -0,0 +1,31 @@ +p{ + font-family:arial; + +} +a{ + color:#000; + font-family:arial; + font-size:0.8em; +} + +.dhtmlgoodies_tree{ + margin:0px; + padding:0px; +} +.dhtmlgoodies_tree ul{ /* Sub menu groups */ + margin-left:20px; /* Left spacing */ + padding-left:0px; + display:none; /* Initially hide sub nodes */ +} +.dhtmlgoodies_tree li{ /* Nodes */ + list-style-type:none; + vertical-align:middle; + +} +.dhtmlgoodies_tree li a{ /* Node links */ + color:#000; + text-decoration:none; + font-family:arial; + font-size:0.8em; + padding-left:2px; +} diff --git a/DQM/TrackerCommon/test/css_files/tab-view.css b/DQM/TrackerCommon/test/css_files/tab-view.css new file mode 100644 index 0000000000000..c88e0b29775ec --- /dev/null +++ b/DQM/TrackerCommon/test/css_files/tab-view.css @@ -0,0 +1,59 @@ +.dhtmlgoodies_tabPane { + height:21px; /* Height of tabs */ + border-bottom:1px solid #919b9c; +} +.dhtmlgoodies_aTab { + border-left:1px solid #919b9c; + border-right:1px solid #919b9c; + border-bottom:1px solid #919b9c; + font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif; + padding:5px; +} +.dhtmlgoodies_tabPane DIV { + float:left; + height:100%; /* Height of tabs */ + padding-left:3px; + vertical-align:middle; + background-repeat:no-repeat; + background-position:bottom left; + cursor:pointer; + position:relative; + bottom:-1px; + margin-left:0px; + margin-right:0px; +} +.dhtmlgoodies_tabPane .tabActive { + background-image:url('../images/tab_left_active.gif'); + margin-left:0px; + margin-right:0px; + z-index:10; +} +.dhtmlgoodies_tabPane .tabInactive { + background-image:url('../images/tab_left_inactive.gif'); + margin-left:0px; + margin-right:0px; + z-index:1; +} + +.dhtmlgoodies_tabPane .inactiveTabOver { + background-image:url('../images/tab_left_over.gif'); + margin-left:0px; + margin-right:0px; +} +.dhtmlgoodies_tabPane span { + font-family:arial; + vertical-align:top; + font-size:11px; + padding-left:3px; + padding-right:3px; + line-height:21px; + float:left; +} +.dhtmlgoodies_tabPane .tabActive span { + padding-bottom:1px; + line-height:20px; +} + +.dhtmlgoodies_tabPane img { + float:left; +} diff --git a/DQM/TrackerCommon/test/css_files/tooltip.css b/DQM/TrackerCommon/test/css_files/tooltip.css new file mode 100644 index 0000000000000..532ebd18067eb --- /dev/null +++ b/DQM/TrackerCommon/test/css_files/tooltip.css @@ -0,0 +1,15 @@ +#dhtmltooltip +{ + font-family: sans-serif; + font-size: 9pt; + font-weight: normal; + position: absolute; + width: 150px; + border: 0px solid black; + padding: 2px; + background-color: #eeeeee; + visibility: hidden; + z-index: 100; + /*Remove below line to remove shadow. Below line should always appear last within this CSS*/ + /* filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135); */ +} diff --git a/DQM/TrackerCommon/test/images/EmptyPlot.png b/DQM/TrackerCommon/test/images/EmptyPlot.png new file mode 100644 index 0000000000000..dce380a4f8234 Binary files /dev/null and b/DQM/TrackerCommon/test/images/EmptyPlot.png differ diff --git a/DQM/TrackerCommon/test/images/LI_blue.gif b/DQM/TrackerCommon/test/images/LI_blue.gif new file mode 100644 index 0000000000000..4ef7bbdde3ec3 Binary files /dev/null and b/DQM/TrackerCommon/test/images/LI_blue.gif differ diff --git a/DQM/TrackerCommon/test/images/LI_green.gif b/DQM/TrackerCommon/test/images/LI_green.gif new file mode 100644 index 0000000000000..9826bf3d7afeb Binary files /dev/null and b/DQM/TrackerCommon/test/images/LI_green.gif differ diff --git a/DQM/TrackerCommon/test/images/LI_orange.gif b/DQM/TrackerCommon/test/images/LI_orange.gif new file mode 100644 index 0000000000000..4026b6e732044 Binary files /dev/null and b/DQM/TrackerCommon/test/images/LI_orange.gif differ diff --git a/DQM/TrackerCommon/test/images/LI_red.gif b/DQM/TrackerCommon/test/images/LI_red.gif new file mode 100644 index 0000000000000..7f762b2d1d5ed Binary files /dev/null and b/DQM/TrackerCommon/test/images/LI_red.gif differ diff --git a/DQM/TrackerCommon/test/images/LI_yellow.gif b/DQM/TrackerCommon/test/images/LI_yellow.gif new file mode 100644 index 0000000000000..a1213eb053ec9 Binary files /dev/null and b/DQM/TrackerCommon/test/images/LI_yellow.gif differ diff --git a/DQM/TrackerCommon/test/images/blank.png b/DQM/TrackerCommon/test/images/blank.png new file mode 100644 index 0000000000000..eb0e6e4c3760b Binary files /dev/null and b/DQM/TrackerCommon/test/images/blank.png differ diff --git a/DQM/TrackerCommon/test/images/dhtmlgoodies_folder.gif b/DQM/TrackerCommon/test/images/dhtmlgoodies_folder.gif new file mode 100644 index 0000000000000..3bbc972318a96 Binary files /dev/null and b/DQM/TrackerCommon/test/images/dhtmlgoodies_folder.gif differ diff --git a/DQM/TrackerCommon/test/images/dhtmlgoodies_minus.gif b/DQM/TrackerCommon/test/images/dhtmlgoodies_minus.gif new file mode 100644 index 0000000000000..8271907097b82 Binary files /dev/null and b/DQM/TrackerCommon/test/images/dhtmlgoodies_minus.gif differ diff --git a/DQM/TrackerCommon/test/images/dhtmlgoodies_plus.gif b/DQM/TrackerCommon/test/images/dhtmlgoodies_plus.gif new file mode 100644 index 0000000000000..bdf0572eab5d5 Binary files /dev/null and b/DQM/TrackerCommon/test/images/dhtmlgoodies_plus.gif differ diff --git a/DQM/TrackerCommon/test/images/dhtmlgoodies_sheet.gif b/DQM/TrackerCommon/test/images/dhtmlgoodies_sheet.gif new file mode 100644 index 0000000000000..6e1af7b7e576e Binary files /dev/null and b/DQM/TrackerCommon/test/images/dhtmlgoodies_sheet.gif differ diff --git a/DQM/TrackerCommon/test/images/filesList.lis b/DQM/TrackerCommon/test/images/filesList.lis new file mode 100644 index 0000000000000..576ac3eb85a1f --- /dev/null +++ b/DQM/TrackerCommon/test/images/filesList.lis @@ -0,0 +1,17 @@ +["images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png", +"images/EmptyPlot.png" +] diff --git a/DQM/TrackerCommon/test/images/filesTitles.lis b/DQM/TrackerCommon/test/images/filesTitles.lis new file mode 100644 index 0000000000000..4989442e91b9b --- /dev/null +++ b/DQM/TrackerCommon/test/images/filesTitles.lis @@ -0,0 +1,17 @@ +["EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png", +"EmptyPlot.png" +] diff --git a/DQM/TrackerCommon/test/images/loading.gif b/DQM/TrackerCommon/test/images/loading.gif new file mode 100644 index 0000000000000..5cabfe3485713 Binary files /dev/null and b/DQM/TrackerCommon/test/images/loading.gif differ diff --git a/DQM/TrackerCommon/test/images/note.gif b/DQM/TrackerCommon/test/images/note.gif new file mode 100644 index 0000000000000..63f15634a73b8 Binary files /dev/null and b/DQM/TrackerCommon/test/images/note.gif differ diff --git a/DQM/TrackerCommon/test/images/player_end.png b/DQM/TrackerCommon/test/images/player_end.png new file mode 100644 index 0000000000000..b90b101e6b273 Binary files /dev/null and b/DQM/TrackerCommon/test/images/player_end.png differ diff --git a/DQM/TrackerCommon/test/images/player_fwd.png b/DQM/TrackerCommon/test/images/player_fwd.png new file mode 100644 index 0000000000000..af17156947a5c Binary files /dev/null and b/DQM/TrackerCommon/test/images/player_fwd.png differ diff --git a/DQM/TrackerCommon/test/images/player_pause.png b/DQM/TrackerCommon/test/images/player_pause.png new file mode 100644 index 0000000000000..ea74bbed07867 Binary files /dev/null and b/DQM/TrackerCommon/test/images/player_pause.png differ diff --git a/DQM/TrackerCommon/test/images/player_play.png b/DQM/TrackerCommon/test/images/player_play.png new file mode 100644 index 0000000000000..e42006033438e Binary files /dev/null and b/DQM/TrackerCommon/test/images/player_play.png differ diff --git a/DQM/TrackerCommon/test/images/player_rew.png b/DQM/TrackerCommon/test/images/player_rew.png new file mode 100644 index 0000000000000..48369002830b9 Binary files /dev/null and b/DQM/TrackerCommon/test/images/player_rew.png differ diff --git a/DQM/TrackerCommon/test/images/player_start.png b/DQM/TrackerCommon/test/images/player_start.png new file mode 100644 index 0000000000000..f95c90f5cb6d6 Binary files /dev/null and b/DQM/TrackerCommon/test/images/player_start.png differ diff --git a/DQM/TrackerCommon/test/images/player_stop.png b/DQM/TrackerCommon/test/images/player_stop.png new file mode 100644 index 0000000000000..ba1b9c609c89c Binary files /dev/null and b/DQM/TrackerCommon/test/images/player_stop.png differ diff --git a/DQM/TrackerCommon/test/images/tab_left_active.gif b/DQM/TrackerCommon/test/images/tab_left_active.gif new file mode 100644 index 0000000000000..556aac384e1f2 Binary files /dev/null and b/DQM/TrackerCommon/test/images/tab_left_active.gif differ diff --git a/DQM/TrackerCommon/test/images/tab_left_inactive.gif b/DQM/TrackerCommon/test/images/tab_left_inactive.gif new file mode 100644 index 0000000000000..051a7ef2bee78 Binary files /dev/null and b/DQM/TrackerCommon/test/images/tab_left_inactive.gif differ diff --git a/DQM/TrackerCommon/test/images/tab_left_over.gif b/DQM/TrackerCommon/test/images/tab_left_over.gif new file mode 100644 index 0000000000000..d612f0a6c8910 Binary files /dev/null and b/DQM/TrackerCommon/test/images/tab_left_over.gif differ diff --git a/DQM/TrackerCommon/test/images/tab_right_active.gif b/DQM/TrackerCommon/test/images/tab_right_active.gif new file mode 100644 index 0000000000000..672ac75384a45 Binary files /dev/null and b/DQM/TrackerCommon/test/images/tab_right_active.gif differ diff --git a/DQM/TrackerCommon/test/images/tab_right_inactive.gif b/DQM/TrackerCommon/test/images/tab_right_inactive.gif new file mode 100644 index 0000000000000..c2f5987f23903 Binary files /dev/null and b/DQM/TrackerCommon/test/images/tab_right_inactive.gif differ diff --git a/DQM/TrackerCommon/test/images/tab_right_over.gif b/DQM/TrackerCommon/test/images/tab_right_over.gif new file mode 100644 index 0000000000000..652762bb1b1aa Binary files /dev/null and b/DQM/TrackerCommon/test/images/tab_right_over.gif differ diff --git a/DQM/TrackerCommon/test/jquery/cluetip/jquery-cluetip.css b/DQM/TrackerCommon/test/jquery/cluetip/jquery-cluetip.css new file mode 100644 index 0000000000000..eb97b138026a0 --- /dev/null +++ b/DQM/TrackerCommon/test/jquery/cluetip/jquery-cluetip.css @@ -0,0 +1,230 @@ +/* global */ +#cluetip-close img { + border: 0; +} +#cluetip-title { + overflow: hidden; +} +#cluetip-title #cluetip-close { + float: right; + position: relative; +} +#cluetip-waitimage { + width: 43px; + height: 11px; + position: absolute; + background-image: url(wait.gif); +} +.cluetip-arrows { + display: none; + position: absolute; + top: 0; + left: -11px; + height: 22px; + width: 11px; + background-repeat: no-repeat; + background-position: 0 0; +} +#cluetip-extra { + display: none; +} +/*************************************** + =cluetipClass: 'default' +-------------------------------------- */ + +.cluetip-default { + background-color: #d9d9c2; +} +.cluetip-default #cluetip-outer { + position: relative; + margin: 0; + background-color: #d9d9c2; +} +.cluetip-default h3#cluetip-title { + margin: 0 0 5px; + padding: 8px 10px 4px; + font-size: 1.1em; + font-weight: normal; + background-color: #87876a; + color: #fff; +} +.cluetip-default #cluetip-title a { + color: #d9d9c2; + font-size: 0.95em; +} +.cluetip-default #cluetip-inner { + padding: 10px; +} +.cluetip-default div#cluetip-close { + text-align: right; + margin: 0 5px 5px; + color: #900; +} + +/* default arrows */ + +.clue-right-default .cluetip-arrows { + background-image: url(images/darrowleft.gif); +} +.clue-left-default .cluetip-arrows { + background-image: url(images/darrowright.gif); + left: 100%; + margin-right: -11px; +} +.clue-top-default .cluetip-arrows { + background-image: url(images/darrowdown.gif); + top: 100%; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} +.clue-bottom-default .cluetip-arrows { + background-image: url(images/darrowup.gif); + top: -11px; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} + +/*************************************** + =cluetipClass: 'jtip' +-------------------------------------- */ +.cluetip-jtip { + background-color: transparent; +} +.cluetip-jtip #cluetip-outer { + border: 2px solid #ccc; + position: relative; + background-color: #fff; +} + +.cluetip-jtip h3#cluetip-title { + margin: 0 0 5px; + padding: 2px 5px; + font-size: 16px; + font-weight: normal; + background-color: #ccc; + color: #333; +} + +.cluetip-jtip #cluetip-inner { + padding: 0 5px 5px; + display: inline-block; +} +.cluetip-jtip div#cluetip-close { + text-align: right; + margin: 0 5px 5px; + color: #900; +} + +/* jtip arrows */ + +.clue-right-jtip .cluetip-arrows { + background-image: url(images/arrowleft.gif); +} +.clue-left-jtip .cluetip-arrows { + background-image: url(images/arrowright.gif); + left: 100%; + margin-right: -11px; +} +.clue-top-jtip .cluetip-arrows { + background-image: url(images/arrowdown.gif); + top: 100%; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} +.clue-bottom-jtip .cluetip-arrows { + background-image: url(images/arrowup.gif); + top: -11px; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} + +/*************************************** + =cluetipClass: 'rounded' +-------------------------------------- */ + +.cluetip-rounded { + background: transparent url(images/bl.gif) no-repeat 0 100%; + margin-top: 10px; + margin-left: 12px; +} + +.cluetip-rounded #cluetip-outer { + background: transparent url(images/tl.gif) no-repeat 0 0; + margin-top: -12px; +} + +.cluetip-rounded #cluetip-title { + background-color: transparent; + padding: 12px 12px 0; + margin: 0 -12px 0 0; + position: relative; +} +.cluetip-rounded #cluetip-extra { + position: absolute; + display: block; + background: transparent url(images/tr.gif) no-repeat 100% 0; + top: 0; + right: 0; + width: 12px; + height: 30px; + margin: -12px -12px 0 0; +} +.cluetip-rounded #cluetip-inner { + background: url(images/br.gif) no-repeat 100% 100%; + padding: 5px 12px 12px; + margin: -18px -12px 0 0; + position: relative; +} + +.cluetip-rounded div#cluetip-close { + text-align: right; + margin: 0 5px 5px; + color: #009; + background: transparent; +} +.cluetip-rounded div#cluetip-close a { + color: #777; +} + +/* rounded arrows */ + +.clue-right-rounded .cluetip-arrows { + background-image: url(images/rarrowleft.gif); +} +.clue-left-rounded .cluetip-arrows { + background-image: url(images/rarrowright.gif); + left: 100%; + margin-left: 12px; +} +.clue-top-rounded .cluetip-arrows { + background-image: url(images/rarrowdown.gif); + top: 100%; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} +.clue-bottom-rounded .cluetip-arrows { + background-image: url(images/rarrowup.gif); + top: -23px; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} + + + +/* stupid IE6 HasLayout hack */ +.cluetip-rounded #cluetip-title, +.cluetip-rounded #cluetip-inner { + zoom: 1; +} \ No newline at end of file diff --git a/DQM/TrackerCommon/test/jquery/cluetip/jquery.cluetip.js b/DQM/TrackerCommon/test/jquery/cluetip/jquery.cluetip.js new file mode 100644 index 0000000000000..87a64ec698bb9 --- /dev/null +++ b/DQM/TrackerCommon/test/jquery/cluetip/jquery.cluetip.js @@ -0,0 +1,513 @@ +/* + * jQuery clueTip plugin + * Version 0.9.9pre4 (02/12/2009) + * @requires jQuery v1.1.4+ + * @requires Dimensions plugin IF USED WITH jQuery VERSIONS PRIOR TO 1.2.5) + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +/* + * + * Full list of options/settings can be found at the bottom of this file and at http://plugins.learningjquery.com/cluetip/ + * + * Examples can be found at http://plugins.learningjquery.com/cluetip/demo/ + * +*/ + +;(function($) { + + var $cluetip, $cluetipInner, $cluetipOuter, $cluetipTitle, $cluetipArrows, $dropShadow, imgCount; + $.fn.cluetip = function(js, options) { + if (typeof js == 'object') { + options = js; + js = null; + } + return this.each(function(index) { + var $this = $(this); + + // support metadata plugin (v1.0 and 2.0) + var opts = $.extend(true, {}, $.fn.cluetip.defaults, options || {}, $.metadata ? $this.metadata() : $.meta ? $this.data() : {}); + + // start out with no contents (for ajax activation) + var cluetipContents = false; + var cluezIndex = parseInt(opts.cluezIndex, 10)-1; + var isActive = false, closeOnDelay = 0; + + // create the cluetip divs + if (!$('#cluetip').length) { + $cluetipInner = $('
'); + $cluetipTitle = $('

'); + $cluetipOuter = $('
').append($cluetipInner).prepend($cluetipTitle); + $cluetip = $('
').css({zIndex: opts.cluezIndex}) + .append($cluetipOuter).append('
')[insertionType](insertionElement).hide(); + $('
').css({position: 'absolute', zIndex: cluezIndex-1}) + .insertBefore('#cluetip').hide(); + $cluetip.css({position: 'absolute', zIndex: cluezIndex}); + $cluetipOuter.css({position: 'relative', zIndex: cluezIndex+1}); + $cluetipArrows = $('
').css({zIndex: cluezIndex+1}).appendTo('#cluetip'); + } + var dropShadowSteps = (opts.dropShadow) ? +opts.dropShadowSteps : 0; + if (!$dropShadow) { + $dropShadow = $([]); + for (var i=0; i < dropShadowSteps; i++) { + $dropShadow = $dropShadow.add($('
').css({zIndex: cluezIndex-i-1, opacity:.1, top: 1+i, left: 1+i})); + }; + $dropShadow.css({position: 'absolute', backgroundColor: '#000'}) + .prependTo($cluetip); + } + var tipAttribute = $this.attr(opts.attribute), ctClass = opts.cluetipClass; + if (!tipAttribute && !opts.splitTitle && !js) return true; + // if hideLocal is set to true, on DOM ready hide the local content that will be displayed in the clueTip + if (opts.local && opts.localPrefix) {tipAttribute = opts.localPrefix + tipAttribute;} + if (opts.local && opts.hideLocal) { $(tipAttribute + ':first').hide(); } + var tOffset = parseInt(opts.topOffset, 10), lOffset = parseInt(opts.leftOffset, 10); + // vertical measurement variables + var tipHeight, wHeight; + var defHeight = isNaN(parseInt(opts.height, 10)) ? 'auto' : (/\D/g).test(opts.height) ? opts.height : opts.height + 'px'; + var sTop, linkTop, posY, tipY, mouseY, baseline; + // horizontal measurement variables + var tipInnerWidth = isNaN(parseInt(opts.width, 10)) ? 275 : parseInt(opts.width, 10); + var tipWidth = tipInnerWidth + (parseInt($cluetip.css('paddingLeft'),10)||0) + (parseInt($cluetip.css('paddingRight'),10)||0) + dropShadowSteps; + var linkWidth = this.offsetWidth; + var linkLeft, posX, tipX, mouseX, winWidth; + + // parse the title + var tipParts; + var tipTitle = (opts.attribute != 'title') ? $this.attr(opts.titleAttribute) : ''; + if (opts.splitTitle) { + if(tipTitle == undefined) {tipTitle = '';} + tipParts = tipTitle.split(opts.splitTitle); + tipTitle = tipParts.shift(); + } + if (opts.escapeTitle) { + tipTitle = tipTitle.replace(/&/g,'&').replace(/>/g,'>').replace(/ linkLeft && linkLeft > tipWidth) + || linkLeft + linkWidth + tipWidth + lOffset > winWidth + ? linkLeft - tipWidth - lOffset + : linkWidth + linkLeft + lOffset; + if ($this[0].tagName.toLowerCase() == 'area' || opts.positionBy == 'mouse' || linkWidth + tipWidth > winWidth) { // position by mouse + if (mouseX + 20 + tipWidth > winWidth) { + $cluetip.addClass(' cluetip-' + ctClass); + posX = (mouseX - tipWidth - lOffset) >= 0 ? mouseX - tipWidth - lOffset - parseInt($cluetip.css('marginLeft'),10) + parseInt($cluetipInner.css('marginRight'),10) : mouseX - (tipWidth/2); + } else { + posX = mouseX + lOffset; + } + } + var pY = posX < 0 ? event.pageY + tOffset : event.pageY; + $cluetip.css({left: (posX > 0 && opts.positionBy != 'bottomTop') ? posX : (mouseX + (tipWidth/2) > winWidth) ? winWidth/2 - tipWidth/2 : Math.max(mouseX - (tipWidth/2),0)}); + } + wHeight = $(window).height(); + +/*************************************** +* load a string from cluetip method's first argument +***************************************/ + if (js) { + $cluetipInner.html(js); + cluetipShow(pY); + } +/*************************************** +* load the title attribute only (or user-selected attribute). +* clueTip title is the string before the first delimiter +* subsequent delimiters place clueTip body text on separate lines +***************************************/ + + else if (tipParts) { + var tpl = tipParts.length; + for (var i=0; i < tpl; i++){ + if (i == 0) { + $cluetipInner.html(tipParts[i]); + } else { + $cluetipInner.append('
' + tipParts[i] + '
'); + } + }; + cluetipShow(pY); + } +/*************************************** +* load external file via ajax +***************************************/ + + else if (!opts.local && tipAttribute.indexOf('#') != 0) { + if (/\.(jpe?g|tiff?|gif|png)$/i.test(tipAttribute)) { + $cluetipInner.html('' + tipTitle + ''); + cluetipShow(pY); + } else if (cluetipContents && opts.ajaxCache) { + $cluetipInner.html(cluetipContents); + cluetipShow(pY); + } else { + var ajaxSettings = opts.ajaxSettings; + ajaxSettings.url = tipAttribute; + ajaxSettings.beforeSend = function() { + $cluetipOuter.children().empty(); + if (opts.waitImage) { + $('#cluetip-waitimage') + .css({top: mouseY+20, left: mouseX+20}) + .show(); + } + }; + ajaxSettings.error = function() { + if (isActive) { + $cluetipInner.html('sorry, the contents could not be loaded'); + } + }; + ajaxSettings.success = function(data) { + cluetipContents = opts.ajaxProcess(data); + if (isActive) { + $cluetipInner.html(cluetipContents); + } + }; + ajaxSettings.complete = function() { + imgCount = $('#cluetip-inner img').length; + if (imgCount && !$.browser.opera) { + $('#cluetip-inner img').load(function() { + imgCount--; + if (imgCount<1) { + $('#cluetip-waitimage').hide(); + if (isActive) cluetipShow(pY); + } + }); + } else { + $('#cluetip-waitimage').hide(); + if (isActive) cluetipShow(pY); + } + }; + $.ajax(ajaxSettings); + } + +/*************************************** +* load an element from the same page +***************************************/ + } else if (opts.local){ + var $localContent = $(tipAttribute + ':eq(' + index + ')').clone(true).show(); + $cluetipInner.html($localContent); + cluetipShow(pY); + } + }; + +// get dimensions and options for cluetip and prepare it to be shown + var cluetipShow = function(bpY) { + $cluetip.addClass('cluetip-' + ctClass); + + if (opts.truncate) { + var $truncloaded = $cluetipInner.text().slice(0,opts.truncate) + '...'; + $cluetipInner.html($truncloaded); + } + function doNothing() {}; //empty function + tipTitle ? $cluetipTitle.show().html(tipTitle) : (opts.showTitle) ? $cluetipTitle.show().html(' ') : $cluetipTitle.hide(); + if (opts.sticky) { + var $closeLink = $(''); + (opts.closePosition == 'bottom') ? $closeLink.appendTo($cluetipInner) : (opts.closePosition == 'title') ? $closeLink.prependTo($cluetipTitle) : $closeLink.prependTo($cluetipInner); + $closeLink.click(function() { + cluetipClose(); + return false; + }); + if (opts.mouseOutClose) { + if ($.fn.hoverIntent && opts.hoverIntent) { + $cluetip.hoverIntent({ + over: doNothing, + timeout: opts.hoverIntent.timeout, + out: function() { $closeLink.trigger('click'); } + }); + } else { + $cluetip.hover(doNothing, + function() {$closeLink.trigger('click'); }); + } + } else { + $cluetip.unbind('mouseout'); + } + } +// now that content is loaded, finish the positioning + var direction = ''; + $cluetipOuter.css({overflow: defHeight == 'auto' ? 'visible' : 'auto', height: defHeight}); + tipHeight = defHeight == 'auto' ? Math.max($cluetip.outerHeight(),$cluetip.height()) : parseInt(defHeight,10); + tipY = posY; + baseline = sTop + wHeight; + if (opts.positionBy == 'fixed') { + tipY = posY - opts.dropShadowSteps + tOffset; + } else if ( (posX < mouseX && Math.max(posX, 0) + tipWidth > mouseX) || opts.positionBy == 'bottomTop') { + if (posY + tipHeight + tOffset > baseline && mouseY - sTop > tipHeight + tOffset) { + tipY = mouseY - tipHeight - tOffset; + direction = 'top'; + } else { + tipY = mouseY + tOffset; + direction = 'bottom'; + } + } else if ( posY + tipHeight + tOffset > baseline ) { + tipY = (tipHeight >= wHeight) ? sTop : baseline - tipHeight - tOffset; + } else if ($this.css('display') == 'block' || $this[0].tagName.toLowerCase() == 'area' || opts.positionBy == "mouse") { + tipY = bpY - tOffset; + } else { + tipY = posY - opts.dropShadowSteps; + } + if (direction == '') { + posX < linkLeft ? direction = 'left' : direction = 'right'; + } + $cluetip.css({top: tipY + 'px'}).removeClass().addClass('clue-' + direction + '-' + ctClass).addClass(' cluetip-' + ctClass); + if (opts.arrows) { // set up arrow positioning to align with element + var bgY = (posY - tipY - opts.dropShadowSteps); + $cluetipArrows.css({top: (/(left|right)/.test(direction) && posX >=0 && bgY > 0) ? bgY + 'px' : /(left|right)/.test(direction) ? 0 : ''}).show(); + } else { + $cluetipArrows.hide(); + } + +// (first hide, then) ***SHOW THE CLUETIP*** + $dropShadow.hide(); + $cluetip.hide()[opts.fx.open](opts.fx.open != 'show' && opts.fx.openSpeed); + if (opts.dropShadow) $dropShadow.css({height: tipHeight, width: tipInnerWidth}).show(); + if ($.fn.bgiframe) { $cluetip.bgiframe(); } + // delayed close (not fully tested) + if (opts.delayedClose > 0) { + closeOnDelay = setTimeout(cluetipClose, opts.delayedClose); + } + // trigger the optional onShow function + opts.onShow($cluetip, $cluetipInner); + + }; + +/*************************************** + =INACTIVATION +-------------------------------------- */ + var inactivate = function(event) { + isActive = false; + $('#cluetip-waitimage').hide(); + if (!opts.sticky || (/click|toggle/).test(opts.activation) ) { + cluetipClose(); +clearTimeout(closeOnDelay); + }; + if (opts.hoverClass) { + $this.removeClass(opts.hoverClass); + } + }; +// close cluetip and reset some things + var cluetipClose = function() { + $cluetipOuter + .parent().hide().removeClass(); + opts.onHide($cluetip, $cluetipInner); + $this.removeClass('cluetip-clicked'); + if (tipTitle) { + $this.attr(opts.titleAttribute, tipTitle); + } + $this.css('cursor',''); + if (opts.arrows) $cluetipArrows.css({top: ''}); + }; + +/*************************************** + =BIND EVENTS +-------------------------------------- */ + // activate by click + if ( (/click|toggle/).test(opts.activation) ) { + $this.click(function(event) { + if ($cluetip.is(':hidden') || !$this.is('.cluetip-clicked')) { + activate(event); + $('.cluetip-clicked').removeClass('cluetip-clicked'); + $this.addClass('cluetip-clicked'); + } else { + inactivate(event); + } + this.blur(); + return false; + }); + // activate by focus; inactivate by blur + } else if (opts.activation == 'focus') { + $this.focus(function(event) { + activate(event); + }); + $this.blur(function(event) { + inactivate(event); + }); + // activate by hover + // clicking is returned false if cluetip url is same as href url + } else { + $this.click(function() { + if ($this.attr('href') && $this.attr('href') == tipAttribute && !opts.clickThrough) { + return false; + } + }); + //set up mouse tracking + var mouseTracks = function(evt) { + if (opts.tracking == true) { + var trackX = posX - evt.pageX; + var trackY = tipY ? tipY - evt.pageY : posY - evt.pageY; + $this.mousemove(function(evt) { + $cluetip.css({left: evt.pageX + trackX, top: evt.pageY + trackY }); + }); + } + }; + if ($.fn.hoverIntent && opts.hoverIntent) { + $this.mouseover(function() {$this.attr('title',''); }) + .hoverIntent({ + sensitivity: opts.hoverIntent.sensitivity, + interval: opts.hoverIntent.interval, + over: function(event) { + activate(event); + mouseTracks(event); + }, + timeout: opts.hoverIntent.timeout, + out: function(event) {inactivate(event); $this.unbind('mousemove');} + }); + } else { + $this.hover(function(event) { + activate(event); + mouseTracks(event); + }, function(event) { + inactivate(event); + $this.unbind('mousemove'); + }); + } + } + }); + }; + +/* + * options for clueTip + * + * each one can be explicitly overridden by changing its value. + * for example: $.fn.cluetip.defaults.width = 200; + * would change the default width for all clueTips to 200. + * + * each one can also be overridden by passing an options map to the cluetip method. + * for example: $('a.example').cluetip({width: 200}); + * would change the default width to 200 for clueTips invoked by a link with class of "example" + * + */ + + $.fn.cluetip.defaults = { // set up default options + width: 275, // The width of the clueTip + height: 'auto', // The height of the clueTip + cluezIndex: 97, // Sets the z-index style property of the clueTip + positionBy: 'auto', // Sets the type of positioning: 'auto', 'mouse','bottomTop', 'fixed' + topOffset: 15, // Number of px to offset clueTip from top of invoking element + leftOffset: 15, // Number of px to offset clueTip from left of invoking element + local: false, // Whether to use content from the same page for the clueTip's body + localPrefix: null, // string to be prepended to the tip attribute if local is true + hideLocal: true, // If local option is set to true, this determines whether local content + // to be shown in clueTip should be hidden at its original location + attribute: 'rel', // the attribute to be used for fetching the clueTip's body content + titleAttribute: 'title', // the attribute to be used for fetching the clueTip's title + splitTitle: '', // A character used to split the title attribute into the clueTip title and divs + // within the clueTip body. more info below [6] + escapeTitle: false, // whether to html escape the title attribute + showTitle: true, // show title bar of the clueTip, even if title attribute not set + cluetipClass: 'default',// class added to outermost clueTip div in the form of 'cluetip-' + clueTipClass. + hoverClass: '', // class applied to the invoking element onmouseover and removed onmouseout + waitImage: true, // whether to show a "loading" img, which is set in jquery.cluetip.css + cursor: 'help', + arrows: false, // if true, displays arrow on appropriate side of clueTip + dropShadow: true, // set to false if you don't want the drop-shadow effect on the clueTip + dropShadowSteps: 6, // adjusts the size of the drop shadow + sticky: false, // keep visible until manually closed + mouseOutClose: false, // close when clueTip is moused out + activation: 'hover', // set to 'click' to force user to click to show clueTip + // set to 'focus' to show on focus of a form element and hide on blur + clickThrough: false, // if true, and activation is not 'click', then clicking on link will take user to the link's href, + // even if href and tipAttribute are equal + tracking: false, // if true, clueTip will track mouse movement (experimental) + delayedClose: 0, // close clueTip on a timed delay (experimental) + closePosition: 'top', // location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title' + closeText: 'Close', // text (or HTML) to to be clicked to close sticky clueTips + truncate: 0, // number of characters to truncate clueTip's contents. if 0, no truncation occurs + + // effect and speed for opening clueTips + fx: { + open: 'show', // can be 'show' or 'slideDown' or 'fadeIn' + openSpeed: '' + }, + + // settings for when hoverIntent plugin is used + hoverIntent: { + sensitivity: 3, + interval: 50, + timeout: 0 + }, + + // function to run just before clueTip is shown. + onActivate: function(e) {return true;}, + + // function to run just after clueTip is shown. + onShow: function(ct, c){}, + // function to run just after clueTip is hidden. + onHide: function(ct, c){}, + // whether to cache results of ajax request to avoid unnecessary hits to server + ajaxCache: true, + + // process data retrieved via xhr before it's displayed + ajaxProcess: function(data) { + data = data.replace(//g, '').replace(/<(link|title)(.|\s)*?\/(link|title)>/g,''); + return data; + }, + + // can pass in standard $.ajax() parameters, not including error, complete, success, and url + ajaxSettings: { + dataType: 'html' + }, + debug: false + }; + + +/* + * Global defaults for clueTips. Apply to all calls to the clueTip plugin. + * + * @example $.cluetip.setup({ + * insertionType: 'prependTo', + * insertionElement: '#container' + * }); + * + * @property + * @name $.cluetip.setup + * @type Map + * @cat Plugins/tooltip + * @option String insertionType: Default is 'appendTo'. Determines the method to be used for inserting the clueTip into the DOM. Permitted values are 'appendTo', 'prependTo', 'insertBefore', and 'insertAfter' + * @option String insertionElement: Default is 'body'. Determines which element in the DOM the plugin will reference when inserting the clueTip. + * + */ + + var insertionType = 'appendTo', insertionElement = 'body'; + $.cluetip = {}; + $.cluetip.setup = function(options) { + if (options && options.insertionType && (options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)) { + insertionType = options.insertionType; + } + if (options && options.insertionElement) { + insertionElement = options.insertionElement; + } + }; + +})(jQuery); diff --git a/DQM/TrackerCommon/test/jquery/css/screen.css b/DQM/TrackerCommon/test/jquery/css/screen.css new file mode 100644 index 0000000000000..965653c8eb2f3 --- /dev/null +++ b/DQM/TrackerCommon/test/jquery/css/screen.css @@ -0,0 +1,24 @@ +html, body {height:100%; margin: 0; padding: 0; } + +html>body { + font-size: 16px; + font-size: 68.75%; +} /* Reset Base Font Size */ + +body { + font-family: Verdana, helvetica, arial, sans-serif; + font-size: 68.75%; + background: #fff; + color: #333; +} + +h1, h2 { font-family: 'trebuchet ms', verdana, arial; padding: 10px; margin: 0 } +h1 { font-size: large } + +#banner { padding: 15px; background-color: #06b; color: white; font-size: large; border-bottom: 1px solid #ccc; + background: url(bg.gif) repeat-x; text-align: center } +#banner a { color: white; } + +#main { padding: 1em; } + +a img { border: none; } \ No newline at end of file diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 0000000000000..5b5dab2ab7b1c Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 0000000000000..ac8b229af950c Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 0000000000000..ad3d6346e00f2 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000000000..42ccba269b6e9 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 0000000000000..5a46b47cb1663 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 0000000000000..86c2baa655eac Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 0000000000000..4443fdc1a156b Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 0000000000000..7c9fa6c6edcfc Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_222222_256x240.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_222222_256x240.png new file mode 100644 index 0000000000000..67560da9be4ec Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_222222_256x240.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png new file mode 100644 index 0000000000000..b425c446d2444 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_2e83ff_256x240.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_454545_256x240.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_454545_256x240.png new file mode 100644 index 0000000000000..0cd64a21a929e Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_454545_256x240.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_888888_256x240.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_888888_256x240.png new file mode 100644 index 0000000000000..2e5180e473486 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_888888_256x240.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000000000..2db88b796a36d Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/css/smoothness/images/ui-icons_cd0a0a_256x240.png differ diff --git a/DQM/TrackerCommon/test/jquery/css/smoothness/jquery-ui-1-7-custom.css b/DQM/TrackerCommon/test/jquery/css/smoothness/jquery-ui-1-7-custom.css new file mode 100644 index 0000000000000..b2d67e20f58bc --- /dev/null +++ b/DQM/TrackerCommon/test/jquery/css/smoothness/jquery-ui-1-7-custom.css @@ -0,0 +1,405 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +*/ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; outline: none; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; outline: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; outline: none; } +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; outline: none; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; outline: none; text-decoration: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } +.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; }/* Resizable +----------------------------------*/ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Accordion +----------------------------------*/ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } +.ui-accordion .ui-accordion-content-active { display: block; }/* Dialog +----------------------------------*/ +.ui-dialog { position: relative; padding: .2em; width: 300px; } +.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* Slider +----------------------------------*/ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs +----------------------------------*/ +.ui-tabs { padding: .2em; zoom: 1; } +.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } +.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* Datepicker +----------------------------------*/ +.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* Progressbar +----------------------------------*/ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/DQM/TrackerCommon/test/jquery/index.html b/DQM/TrackerCommon/test/jquery/index.html new file mode 100644 index 0000000000000..dec628cceb439 --- /dev/null +++ b/DQM/TrackerCommon/test/jquery/index.html @@ -0,0 +1,367 @@ + + + + + jQuery UI Example Page + + + + + + + +

Welcome to jQuery UI!

+

This page demonstrates the widgets you downloaded using the theme you selected in the download builder. We've included and linked to uncompressed versions of jQuery, your personalized copy of jQuery UI (js/jquery-ui-1.7.custom.min.js), and css/smoothness/jquery-ui-1.7.custom.css which imports the entire jQuery UI CSS Framework. You can choose to link a subset of the CSS Framework depending on your needs.

+

You've downloaded components and a theme that are compatible with jQuery 1.3+. Please make sure you are using jQuery 1.3+ in your production environment. If you need jQuery UI components that work with an earlier version of jQuery, you can choose an older version in the jQuery UI download builder.

+ +

YOUR COMPONENTS:

+ + +

Accordion

+
+
+

First

+
Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
+
+
+

Second

+
Phasellus mattis tincidunt nibh.
+
+
+

Third

+
Nam dui erat, auctor a, dignissim quis.
+
+
+ + +

Tabs

+
+ +
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.
+
Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.
+
+ + +

Dialog

+

Open Dialog

+ + +

Overlay and Shadow Classes (not currently used in UI widgets)

+
+

Lorem ipsum dolor sit amet, Nulla nec tortor. Donec id elit quis purus consectetur consequat.

Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci.

Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat.

Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante. Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam.

Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi. Aliquam ante.

Suspendisse scelerisque dui nec velit. Duis augue augue, gravida euismod, vulputate ac, facilisis id, sem. Morbi in orci. Nulla purus lacus, pulvinar vel, malesuada ac, mattis nec, quam. Nam molestie scelerisque quam. Nullam feugiat cursus lacus.orem ipsum dolor sit amet, consectetur adipiscing elit. Donec libero risus, commodo vitae, pharetra mollis, posuere eu, pede. Nulla nec tortor. Donec id elit quis purus consectetur consequat. Nam congue semper tellus. Sed erat dolor, dapibus sit amet, venenatis ornare, ultrices ut, nisi.

+ + +
+
+
+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

+
+
+ +
+ + + +
+

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

+
+ + + +

Framework Icons (content color preview)

+
    + +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • + +
  • +
  • +
  • +
  • +
  • +
+ + + +

Slider

+
+ + +

Datepicker

+
+ + +

Progressbar

+
+ + +

Highlight / Error

+
+
+

+ Hey! Sample ui-state-highlight style.

+
+
+
+
+
+

+ Alert: Sample ui-state-error style.

+
+
+ + + + + diff --git a/DQM/TrackerCommon/test/jquery/js/jquery-1.3.2.min.js b/DQM/TrackerCommon/test/jquery/js/jquery-1.3.2.min.js new file mode 100644 index 0000000000000..b1ae21d8b23f2 --- /dev/null +++ b/DQM/TrackerCommon/test/jquery/js/jquery-1.3.2.min.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/DQM/TrackerCommon/test/jquery/js/jquery-ui-1.7.custom.min.js b/DQM/TrackerCommon/test/jquery/js/jquery-ui-1.7.custom.min.js new file mode 100644 index 0000000000000..9831410c1ae2b --- /dev/null +++ b/DQM/TrackerCommon/test/jquery/js/jquery-ui-1.7.custom.min.js @@ -0,0 +1,273 @@ +/* + * jQuery UI 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + */ jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* + * jQuery UI Draggable 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * ui.core.js + */ (function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.leftthis.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y=p&&n<=k)||(m>=p&&m<=k)||(nk))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(ec));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=h._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/h.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*h.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);;/* + * jQuery UI Selectable 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * ui.core.js + */ (function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a("body").append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.rightg||j.bottomd&&j.righth&&j.bottom=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)f&&(e+h)m[this.floating?"width":"height"])){return g}else{return(f0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.topthis.containment[3])?g:(!(g-this.offset.click.topthis.containment[2])?f:(!(f-this.offset.click.left=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;/* + * jQuery UI Accordion 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Accordion + * + * Depends: + * ui.core.js + */ (function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-parseInt(i.css("borderLeftWidth"),10)-parseInt(i.css("borderRightWidth"),10));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;/* + * jQuery UI Dialog 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * ui.core.js + * ui.draggable.js + * ui.resizable.js + */ (function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||" ",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("
")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("
")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(e){var d=this;if(false===d._trigger("beforeclose",e)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",e)}):d.uiDialog.hide()&&d._trigger("close",e));c.ui.dialog.overlay.resize();d._isOpen=false},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("
").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("
").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove()},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e
");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("
")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('
').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(c,b){this._trigger("start",c,this._uiHash(b))},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((e==0&&d>=b)||(e==1&&d<=b)){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,this._uiHash(e,d,c));var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,this._uiHash(e,d));if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(c,b){this._trigger("stop",c,this._uiHash(b))},_change:function(c,b){this._trigger("change",c,this._uiHash(b))},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(bthis._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(cthis._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}},_uiHash:function(d,e,c){var b=this.options.values&&this.options.values.length;return{handle:this.handles[d],value:e||(b?this.values(d):this.value()),values:c||(b&&this.values())}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/* + * jQuery UI Tabs 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * ui.core.js + */ (function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"
",spinner:"Loading…",tabTemplate:'
  • #{label}
  • '}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('
    '))}},_connectDatepicker:function(target,inst){var input=$(target);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){input[isRTL?"before":"after"](''+appendText+"")}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");var trigger=$(this._get(inst,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](trigger);trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){$target.siblings("."+this._appendClass).remove().end().siblings("."+this._triggerClass).remove().end().removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;$target.siblings("button."+this._triggerClass).each(function(){this.disabled=false}).end().siblings("img."+this._triggerClass).css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;$target.siblings("button."+this._triggerClass).each(function(){this.disabled=true}).end().siblings("img."+this._triggerClass).css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDatenew Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)0&&iValue="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j0&&iValue-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormatmaxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDrawmaxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?''+prevText+"":(hideIfNoPrevNext?"":''+prevText+""));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?''+nextText+"":(hideIfNoPrevNext?"":''+nextText+""));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'":"");var buttonPanel=(showButtonPanel)?'
    '+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'":"")+(isRTL?"":controls)+"
    ":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="=5?' class="ui-datepicker-week-end"':"")+'>'+dayNamesMin[day]+""}calender+=thead+"";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDatemaxDate);tbody+='";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+""}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="
    =currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?''+printDate.getDate()+"":'=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+""))+"
    "+(isMultiMonth?""+((numMonths[0]>0&&col==numMonths[1]-1)?'
    ':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+=''+drawYear+""}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&datemaxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7";window.DP_jQuery=$})(jQuery);;/* + * jQuery UI Progressbar 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * ui.core.js + */ (function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('
    ').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){arguments.length&&this._setData("value",b);return this._value()},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(bthis._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7",defaults:{value:0}})})(jQuery);;/* + * jQuery UI Effects 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/ + */ jQuery.effects||(function(d){d.effects={version:"1.7",save:function(g,h){for(var f=0;f');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(arguments[0].constructor==Function)){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/* + * jQuery UI Effects Fold 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * effects.core.js + */ (function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1],10)/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/* + * jQuery UI Effects Highlight 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * effects.core.js + */ (function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Pulsate 1.7 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * effects.core.js + */ (function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/ajax-loader.gif b/DQM/TrackerCommon/test/jquery/treeview/images/ajax-loader.gif new file mode 100644 index 0000000000000..bc545850add6b Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/ajax-loader.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/file.gif b/DQM/TrackerCommon/test/jquery/treeview/images/file.gif new file mode 100644 index 0000000000000..6e1af7b7e576e Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/file.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/folder-closed.gif b/DQM/TrackerCommon/test/jquery/treeview/images/folder-closed.gif new file mode 100644 index 0000000000000..541107888e673 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/folder-closed.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/folder.gif b/DQM/TrackerCommon/test/jquery/treeview/images/folder.gif new file mode 100644 index 0000000000000..2b31631ca2bfe Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/folder.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/minus.gif b/DQM/TrackerCommon/test/jquery/treeview/images/minus.gif new file mode 100644 index 0000000000000..47fb7b767c4e4 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/minus.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/plus.gif b/DQM/TrackerCommon/test/jquery/treeview/images/plus.gif new file mode 100644 index 0000000000000..6906621627d48 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/plus.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/treeview-black-line.gif b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-black-line.gif new file mode 100644 index 0000000000000..e5496877a0748 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-black-line.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/treeview-black.gif b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-black.gif new file mode 100644 index 0000000000000..d549b9fc56ced Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-black.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/treeview-default-line.gif b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-default-line.gif new file mode 100644 index 0000000000000..37114d3068e0a Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-default-line.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/treeview-default.gif b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-default.gif new file mode 100644 index 0000000000000..a12ac52ffe4d0 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-default.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/treeview-famfamfam-line.gif b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-famfamfam-line.gif new file mode 100644 index 0000000000000..6e289cecc51b5 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-famfamfam-line.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/treeview-famfamfam.gif b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-famfamfam.gif new file mode 100644 index 0000000000000..0cb178e89925d Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-famfamfam.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/treeview-gray-line.gif b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-gray-line.gif new file mode 100644 index 0000000000000..37600447dc002 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-gray-line.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/treeview-gray.gif b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-gray.gif new file mode 100644 index 0000000000000..cfb8a2f0961b8 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-gray.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/treeview-red-line.gif b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-red-line.gif new file mode 100644 index 0000000000000..df9e749a8f1f5 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-red-line.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/images/treeview-red.gif b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-red.gif new file mode 100644 index 0000000000000..3bbb3a157f156 Binary files /dev/null and b/DQM/TrackerCommon/test/jquery/treeview/images/treeview-red.gif differ diff --git a/DQM/TrackerCommon/test/jquery/treeview/jquery-treeview.css b/DQM/TrackerCommon/test/jquery/treeview/jquery-treeview.css new file mode 100644 index 0000000000000..3acdf30c92c09 --- /dev/null +++ b/DQM/TrackerCommon/test/jquery/treeview/jquery-treeview.css @@ -0,0 +1,74 @@ +.treeview, .treeview ul { + padding: 0; + margin: 0; + list-style: none; +} + +.treeview ul { + background-color: white; + margin-top: 4px; +} + +.treeview .hitarea { + background: url(images/treeview-default.gif) -64px -25px no-repeat; + height: 16px; + width: 16px; + margin-left: -16px; + float: left; + cursor: pointer; +} +/* fix for IE6 */ +* html .hitarea { + display: inline; + float:none; +} + +.treeview li { + margin: 0; + padding: 3px 0pt 3px 16px; +} + +.treeview a.selected { + background-color: #eee; +} + +#treecontrol { margin: 1em 0; display: none; } + +.treeview .hover { color: red; cursor: pointer; } + +.treeview li { background: url(images/treeview-default-line.gif) 0 0 no-repeat; } +.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; } + +.treeview .expandable-hitarea { background-position: -80px -3px; } + +.treeview li.last { background-position: 0 -1766px } +.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(images/treeview-default.gif); } +.treeview li.lastCollapsable { background-position: 0 -111px } +.treeview li.lastExpandable { background-position: -32px -67px } + +.treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; } + +.treeview-red li { background-image: url(images/treeview-red-line.gif); } +.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(images/treeview-red.gif); } + +.treeview-black li { background-image: url(images/treeview-black-line.gif); } +.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(images/treeview-black.gif); } + +.treeview-gray li { background-image: url(images/treeview-gray-line.gif); } +.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(images/treeview-gray.gif); } + +.treeview-famfamfam li { background-image: url(images/treeview-famfamfam-line.gif); } +.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(images/treeview-famfamfam.gif); } + +.treeview .placeholder { + background: url(images/ajax-loader.gif) 0 0 no-repeat; + height: 16px; + width: 16px; + display: block; +} + +.filetree li { padding: 3px 0 2px 16px; } +.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; } +.filetree span.folder { background: url(images/folder.gif) 0 0 no-repeat; } +.filetree li.expandable span.folder { background: url(images/folder-closed.gif) 0 0 no-repeat; } +.filetree span.file { background: url(images/file.gif) 0 0 no-repeat; } diff --git a/DQM/TrackerCommon/test/jquery/treeview/jquery.treeview.js b/DQM/TrackerCommon/test/jquery/treeview/jquery.treeview.js new file mode 100644 index 0000000000000..b6e3406883cce --- /dev/null +++ b/DQM/TrackerCommon/test/jquery/treeview/jquery.treeview.js @@ -0,0 +1,244 @@ +/* + * Treeview pre-1.4.1 - jQuery plugin to hide and show branches of a tree + * + * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ + * http://docs.jquery.com/Plugins/Treeview + * + * Copyright (c) 2007 Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * + */ + +;(function($) { + + $.extend($.fn, { + swapClass: function(c1, c2) { + var c1Elements = this.filter('.' + c1); + this.filter('.' + c2).removeClass(c2).addClass(c1); + c1Elements.removeClass(c1).addClass(c2); + return this; + }, + replaceClass: function(c1, c2) { + return this.filter('.' + c1).removeClass(c1).addClass(c2).end(); + }, + hoverClass: function(className) { + className = className || "hover"; + return this.hover(function() { + $(this).addClass(className); + }, function() { + $(this).removeClass(className); + }); + }, + heightToggle: function(animated, callback) { + animated ? + this.animate({ height: "toggle" }, animated, callback) : + this.each(function(){ + jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ](); + if(callback) + callback.apply(this, arguments); + }); + }, + heightHide: function(animated, callback) { + if (animated) { + this.animate({ height: "hide" }, animated, callback); + } else { + this.hide(); + if (callback) + this.each(callback); + } + }, + prepareBranches: function(settings) { + if (!settings.prerendered) { + // mark last tree items + this.filter(":last-child:not(ul)").addClass(CLASSES.last); + // collapse whole tree, or only those marked as closed, anyway except those marked as open + this.filter((settings.collapsed ? "" : "." + CLASSES.closed) + ":not(." + CLASSES.open + ")").find(">ul").hide(); + } + // return all items with sublists + return this.filter(":has(>ul)"); + }, + applyClasses: function(settings, toggler) { + this.filter(":has(>ul):not(:has(>a))").find(">span").unbind("click.treeview").bind("click.treeview", function(event) { + // don't handle click events on children, eg. checkboxes + if ( this == event.target ) + toggler.apply($(this).next()); + }).add( $("a", this) ).hoverClass(); + + if (!settings.prerendered) { + // handle closed ones first + this.filter(":has(>ul:hidden)") + .addClass(CLASSES.expandable) + .replaceClass(CLASSES.last, CLASSES.lastExpandable); + + // handle open ones + this.not(":has(>ul:hidden)") + .addClass(CLASSES.collapsable) + .replaceClass(CLASSES.last, CLASSES.lastCollapsable); + + // create hitarea if not present + var hitarea = this.find("div." + CLASSES.hitarea); + if (!hitarea.length) + hitarea = this.prepend("
    ").find("div." + CLASSES.hitarea); + hitarea.removeClass().addClass(CLASSES.hitarea).each(function() { + var classes = ""; + $.each($(this).parent().attr("class").split(" "), function() { + classes += this + "-hitarea "; + }); + $(this).addClass( classes ); + }) + } + + // apply event to hitarea + this.find("div." + CLASSES.hitarea).click( toggler ); + }, + treeview: function(settings) { + + settings = $.extend({ + cookieId: "treeview" + }, settings); + + if ( settings.toggle ) { + var callback = settings.toggle; + settings.toggle = function() { + return callback.apply($(this).parent()[0], arguments); + }; + } + + // factory for treecontroller + function treeController(tree, control) { + // factory for click handlers + function handler(filter) { + return function() { + // reuse toggle event handler, applying the elements to toggle + // start searching for all hitareas + toggler.apply( $("div." + CLASSES.hitarea, tree).filter(function() { + // for plain toggle, no filter is provided, otherwise we need to check the parent element + return filter ? $(this).parent("." + filter).length : true; + }) ); + return false; + }; + } + // click on first element to collapse tree + $("a:eq(0)", control).click( handler(CLASSES.collapsable) ); + // click on second to expand tree + $("a:eq(1)", control).click( handler(CLASSES.expandable) ); + // click on third to toggle tree + $("a:eq(2)", control).click( handler() ); + } + + // handle toggle event + function toggler() { + $(this) + .parent() + // swap classes for hitarea + .find(">.hitarea") + .swapClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea ) + .swapClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea ) + .end() + // swap classes for parent li + .swapClass( CLASSES.collapsable, CLASSES.expandable ) + .swapClass( CLASSES.lastCollapsable, CLASSES.lastExpandable ) + // find child lists + .find( ">ul" ) + // toggle them + .heightToggle( settings.animated, settings.toggle ); + if ( settings.unique ) { + $(this).parent() + .siblings() + // swap classes for hitarea + .find(">.hitarea") + .replaceClass( CLASSES.collapsableHitarea, CLASSES.expandableHitarea ) + .replaceClass( CLASSES.lastCollapsableHitarea, CLASSES.lastExpandableHitarea ) + .end() + .replaceClass( CLASSES.collapsable, CLASSES.expandable ) + .replaceClass( CLASSES.lastCollapsable, CLASSES.lastExpandable ) + .find( ">ul" ) + .heightHide( settings.animated, settings.toggle ); + } + } + this.data("toggler", toggler); + + function serialize() { + function binary(arg) { + return arg ? 1 : 0; + } + var data = []; + branches.each(function(i, e) { + data[i] = $(e).is(":has(>ul:visible)") ? 1 : 0; + }); + $.cookie(settings.cookieId, data.join(""), settings.cookieOptions ); + } + + function deserialize() { + var stored = $.cookie(settings.cookieId); + if ( stored ) { + var data = stored.split(""); + branches.each(function(i, e) { + $(e).find(">ul")[ parseInt(data[i]) ? "show" : "hide" ](); + }); + } + } + + // add treeview class to activate styles + this.addClass("treeview"); + + // prepare branches and find all tree items with child lists + var branches = this.find("li").prepareBranches(settings); + + switch(settings.persist) { + case "cookie": + var toggleCallback = settings.toggle; + settings.toggle = function() { + serialize(); + if (toggleCallback) { + toggleCallback.apply(this, arguments); + } + }; + deserialize(); + break; + case "location": + var current = this.find("a").filter(function() { return this.href.toLowerCase() == location.href.toLowerCase(); }); + if ( current.length ) { + current.addClass("selected").parents("ul, li").add( current.next() ).show(); + } + break; + } + + branches.applyClasses(settings, toggler); + + // if control option is set, create the treecontroller and show it + if ( settings.control ) { + treeController(this, settings.control); + $(settings.control).show(); + } + + return this; + } + }); + + // classes used by the plugin + // need to be styled via external stylesheet, see first example + $.treeview = {}; + var CLASSES = ($.treeview.classes = { + open: "open", + closed: "closed", + expandable: "expandable", + expandableHitarea: "expandable-hitarea", + lastExpandableHitarea: "lastExpandable-hitarea", + collapsable: "collapsable", + collapsableHitarea: "collapsable-hitarea", + lastCollapsableHitarea: "lastCollapsable-hitarea", + lastCollapsable: "lastCollapsable", + lastExpandable: "lastExpandable", + last: "last", + hitarea: "hitarea" + }); + + // provide backwards compability + $.fn.Treeview = $.fn.treeview; + +})(jQuery); \ No newline at end of file diff --git a/DQM/TrackerCommon/test/js_files/ConfigBox.js b/DQM/TrackerCommon/test/js_files/ConfigBox.js new file mode 100644 index 0000000000000..68e83ed9f81f1 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/ConfigBox.js @@ -0,0 +1,29 @@ +function submitConfigure(url, myform) +{ + navigator_form = false; + url = url + "/Request"; + url = url + "?" + "RequestID=Configure"; + url = url + "&" + "Hostname=" + myform.Hostname.value; + url = url + "&" + "Port=" + myform.Port.value; + url = url + "&" + "Clientname=" + myform.Name.value; + + var funct = alertContents; + makeRequest(url, funct); +} + +//*************************************************************/ + +function alertContents() +{ + if (http_request.readyState == 4) + { + if (http_request.status == 200) + { + alert("Configuration Submitted"); + } + else + { + alert('There was a problem with the request.'); + } + } +} \ No newline at end of file diff --git a/DQM/TrackerCommon/test/js_files/ContentViewer.js b/DQM/TrackerCommon/test/js_files/ContentViewer.js new file mode 100644 index 0000000000000..68cf96401b831 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/ContentViewer.js @@ -0,0 +1,197 @@ +var contentViewer_current = "top"; + +/* + This function updates the ContentViewer "Unview" field + after the user chooses to view or stop viewing something +*/ + +function updateContentViewerNoRequest() +{ + var form = document.getElementById("ContentViewerForm"); + var view = form.View; + var unview = form.Unview; + + // first updated the list of viewed MEs + updateViewedList(); + + // then update the Unview menu, based on the updated list: + unview.options.length = 0; + unview.options[0] = new Option("", "", true, true); + var viewed_from_current = getViewedFromDir(contentViewer_current); + for (var i = 0; i < viewed_from_current.length; i++) + { + unview.options[i + 1] = new Option(viewed_from_current[i], viewed_from_current[i], false, false); + } + unview.selectedIndex = 0; + + // clear the lingering selection from the "View" menu + view.selectedIndex = 0; +} + +function updateViewedList() +{ + var form = document.getElementById("ContentViewerForm"); + var view = form.View; + var unview = form.Unview; + + if (view.value != "") + { + var addition = view.value; + viewedListAdd(addition); + } + else if (unview.value != "") + { + var removal = unview.value; + viewedListRemove(removal); + } +} + +//*************************************************************/ + +/* + These functions add/remove something to/from the viewed_l. +*/ + +function viewedListAdd(addition) +{ + for (i = 0; i < current_display.viewed_l.length; i++) + { + if (addition == current_display.viewed_l[i]) + { + return; + } + } + current_display.viewed_l[current_display.viewed_l.length] = addition; +} + +function viewedListRemove(removal) +{ + for (i = 0; i < current_display.viewed_l.length; i++) + { + if (removal == current_display.viewed_l[i]) + { + current_display.viewed_l.splice(i, 1); + } + } +} + +//*************************************************************/ + +function makeContentViewerRequest() +{ + url = getContentViewerRequestURL(); + makeRequest(url, updateContentViewer); +} + +//*************************************************************/ + +function getContentViewerRequestURL() +{ + var form = document.getElementById("ContentViewerForm"); + var open = form.Open; + + url = getApplicationURL(); + + if (open.value != "") + { + url = url + "/Request"; + url = url + "?RequestID=ContentsOpen"; + url = url + "&" + "Current=" + contentViewer_current; + url = url + "&" + "Open=" + open.value; + } + + return url; +} + +//*************************************************************/ + +/* + This function updates the fields of the content viewer widget + after an "ContentViewerOpen" request. +*/ + +function updateContentViewer() +{ + if (http_request.readyState == 4) + { + if (http_request.status == 200) + { + var xmldoc; + var subdirs_l; + var view_l; + var unview_l; + + // Load the xml elements on javascript lists: + if (http_request != false) + { + xmldoc = http_request.responseXML; + + // set the contentViewer_current first: + contentViewer_current = xmldoc.getElementsByTagName('current').item(0).firstChild.data; + + subdirs_l = xmldoc.getElementsByTagName('open'); + view_l = xmldoc.getElementsByTagName('view'); + } + + // get references to the form elements so that we can update them + var form = document.getElementById("ContentViewerForm"); + var open = form.Open; + var view = form.View; + var unview = form.Unview; + + // Update the Open menu: + open.options.length = 0; + open.options[0] = new Option("", "", true, true); + open.options[1] = new Option("top", "top", false, false); + for(var i = 0; i < subdirs_l.length; i++) + { + var to_open = subdirs_l.item(i).firstChild.data; + open.options[i + 2] = new Option(to_open, to_open, false, false); + } + open.selectedIndex = 0; + + // Update the View menu: + view.options.length = 0; + view.options[0] = new Option("", "", true, true); + for(var i = 0; i < view_l.length; i++) + { + var to_view = view_l.item(i).firstChild.data; + view.options[i + 1] = new Option(to_view, to_view, false, false); + } + view.selectedIndex = 0; + + // Update the Unview menu: + unview.options.length = 0; + unview.options[0] = new Option("", "", true, true); + var viewed_from_current = getViewedFromDir(contentViewer_current); + for (var i = 0; i < viewed_from_current.length; i++) + { + unview.options[i + 1] = new Option(viewed_from_current[i], viewed_from_current[i], false, false); + } + unview.selectedIndex = 0; + } + } +} + +//*************************************************************/ + +/* + This function returns an array with all files in viewed_l that + also reside in the directory dir, supplied as a parameter. +*/ + +function getViewedFromDir(dir) +{ + var viewed_l = current_display.viewed_l; + var in_dir_l = new Array(); + for (var i = 0; i < current_display.viewed_l.length; i++) + { + var entry = viewed_l[i]; + var index = entry.lastIndexOf("/"); + if (entry.substring(0, index) == dir) + { + in_dir_l[in_dir_l.length] = entry; + } + } + return in_dir_l; +} diff --git a/DQM/TrackerCommon/test/js_files/GifDisplay.js b/DQM/TrackerCommon/test/js_files/GifDisplay.js new file mode 100644 index 0000000000000..7dfaa139dd0e9 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/GifDisplay.js @@ -0,0 +1,180 @@ +var gif_url; + +// strings containing the names of all active GifDisplays +var active_displays_l = new Array(); + +// the current displayFrame +var current_display; + +// the list of displayFrame objects +var displays_l = new Array(); + +function displayFrame(name) +{ + this.name = name; + this.is_viewed = false; + this.viewed_l = new Array(); +} + +/* + This function is called onload. It creates the list of + displayFrame objects. +*/ + +function fillDisplayList() +{ + var iframes_l = document.getElementsByTagName("iframe"); + for (i = 0; i < iframes_l.length; i++) + { + displays_l[i] = new displayFrame(iframes_l[i].id); + } + + // the default current is the first: + current_display = displays_l[0]; +} + +function makeCurrent(display_frame_name) +{ + for (i = 0; i < displays_l.length; i++) + { + if (displays_l[i].name == display_frame_name) + { + break; + } + } + current_display = displays_l[i]; +} + +/* + Returns true if the display frame provided as an argument + is currently being viewed. +*/ + +function isViewed(display_frame_name) +{ + for (i = 0; i < active_displays_l.length; i++) + { + if (active_displays_l[i] == display_frame_name) + { + return true; + } + } + return false; +} + +//*************************************************************/ + +/* + These functions get called if the user clicks on the "start viewing" + or "stop viewing" buttons of a display frame. They set the is_viewed + field of the displayFrame object. +*/ + +function getDisplayFrame(display_frame_name) +{ + for (i = 0; i < displays_l.length; i++) + { + if (displays_l[i].name == display_frame_name) + return displays_l[i]; + } +} + +function startViewing(display_frame_name) +{ + var display = getDisplayFrame(display_frame_name); + + if (display.is_viewed) + { + alert('This GifViewer is already active'); + return; + } + + display.is_viewed = true; + updateDisplay(display_frame_name); +} + +function stopViewing(display_frame_name) +{ + var display = getDisplayFrame(display_frame_name); + display.is_viewed = false; +} + +/* + This function is initially called when the "start viewing" button + of a display frame is pressed and keeps calling itself every + [interval] msec, refreshing the frame until it becomes inactive. +*/ + +function updateDisplay(display_frame_name) +{ + var interval = 5000; + var display_frame = getDisplayFrame(display_frame_name); + + if (display_frame.is_viewed == true) + { + makeDisplayRequest(display_frame_name); + if (display_frame.viewed_l.length != 0) + { + window.frames[display_frame_name].location.href = getGifURL(display_frame_name); + } + } + var this_function_call = "updateDisplay('" + display_frame_name + "')"; + setTimeout(this_function_call, interval); +} + +//*************************************************************/ + +function getGifURL(display_frame_name) +{ + var url = getContextURL(); + url = url + "/temporary/" + display_frame_name + ".gif"; + return url; +} + +//*************************************************************/ + +function getDisplayRequestURL(display_frame_name) +{ + url = getApplicationURL(); + url = url + "/Request" + url = url + "?" + "RequestID=Draw" + url = url + "&" + "Current=" + contentViewer_current; + url = url + "&" + "DisplayFrameName=" + display_frame_name; + + var display_frame = getDisplayFrame(display_frame_name); + for (i = 0; i < display_frame.viewed_l.length; i++) + { + url = url + "&" + "View=" + display_frame.viewed_l[i]; + } + return url; +} + +//*************************************************************/ + +function makeDisplayRequest(display_frame_name) +{ + url = getDisplayRequestURL(display_frame_name); + // pass a reference to the updateGifURL function: + makeRequest(url, updateGifURL); +} + +//*************************************************************/ + +function updateGifURL() +{ + if (http_request.readyState == 4) + { + if (http_request.status == 200) + { + var xmldoc; + + // Load the xml elements on javascript lists: + if (http_request != false) + { + xmldoc = http_request.responseXML; + gif_url = xmldoc.getElementsByTagName('fileURL').item(0).firstChild.data; + } + } + } +} + diff --git a/DQM/TrackerCommon/test/js_files/IMGC.js b/DQM/TrackerCommon/test/js_files/IMGC.js new file mode 100644 index 0000000000000..03b1ddc81acf6 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/IMGC.js @@ -0,0 +1,1021 @@ +//_______________________________________________________________________ +// Author: D. Menasce | +// | +// A dynamic canvas to display pictures on a customizibale grid (nxm). | +// Each picture responds to mouse actions: | +// - when the mouse hovers on a picture, this is highlighted (it gets | +// slightly enlarged) | +// - when the user clicks on a picture, this is magnified to bring it to | +// full resolution | +//_______________________________________________________________________| + +// Crate an IMGC namespace (all local variables or functions belonging to this namespace +// have the IMGC prefixed to them) +var IMGC = {} ; + +// Initialize local variables +IMGC.IMAGE_LIST_URL = '/images/filesList.lis'; +IMGC.IMAGE_LIST_TITLES = '/images/filesTitles.lis'; +IMGC.PATH_TO_PICTURES = '/images/'; +IMGC.IMAGES_PER_ROW = 2; +IMGC.IMAGES_PER_COL = 2; +IMGC.IMAGES_PER_PAGE = IMGC.IMAGES_PER_ROW * IMGC.IMAGES_PER_COL; +IMGC.THUMB_MICROFICATION = 4; +IMGC.INACTIVE_OPACITY = 0.7; +IMGC.DEF_IMAGE_WIDTH = 600; +IMGC.ASPECT_RATIO = 1.5 ; +IMGC.BASE_IMAGE_WIDTH = IMGC.DEF_IMAGE_WIDTH; +IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO) ; +IMGC.THUMB_IMAGE_WIDTH = IMGC.BASE_IMAGE_WIDTH / IMGC.IMAGES_PER_ROW; +IMGC.THUMB_IMAGE_HEIGHT = IMGC.BASE_IMAGE_HEIGHT / IMGC.IMAGES_PER_COL; +IMGC.GLOBAL_RATIO = .6 ; +IMGC.lastSource = "" ; + +//__________________________________________________________________________________________________________________________________ +// When the HTML document that requests this script is fully loaded, this functions is +// called and proper initialization occurs. +// Initialization will create a canvas with all the necessary buttons and decorations +// and will trigger an Ajax request to the server to get the list of available +// plots. It will further subscribe buttons to their appropriate call-back function +// to provide users with navigation tools. +// +Event.observe(window, 'load', function() +{ + IMGC.initialize(); + + IMGC.loadingProgress('visible') ; + + IMGC.getImageList() ; + + Event.observe($('firstPage'), 'click', function() + { + IMGC.updatePage('first'); + }, false); + Event.observe($('previousPage'), 'click', function() + { + IMGC.updatePage('previous'); + }, false); + Event.observe($('nextPage'), 'click', function() + { + IMGC.updatePage('next'); + }, false); + Event.observe($('lastPage'), 'click', function() + { + IMGC.updatePage('last'); + }, false); + Event.observe($('normalSize'), 'click', function() + { + IMGC.changeSize('='); + }, false); + Event.observe($('smallerSize'), 'click', function() + { + IMGC.changeSize('-'); + }, false); + Event.observe($('largerSize'), 'click', function() + { + IMGC.changeSize('+'); + }, false); + Event.observe($('maximizeSize'), 'click', function() + { + IMGC.changeSize('M'); + }, false); + Event.observe($('oneXone'), 'click', function() + { + IMGC.IMAGES_PER_ROW = 1 ; + IMGC.IMAGES_PER_COL = 1; + IMGC.IMAGES_PER_PAGE = IMGC.IMAGES_PER_ROW * IMGC.IMAGES_PER_COL; + IMGC.IMAGES_PER_PAGE = 1 ; + IMGC.ASPECT_RATIO = 1.5 ; + IMGC.THUMB_MICROFICATION = 4 ; + IMGC.BASE_IMAGE_WIDTH = IMGC.DEF_IMAGE_WIDTH ; + IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO); + IMGC.setBorderSize() ; + IMGC.paintImages(); + }, false); + Event.observe($('twoXtwo'), 'click', function() + { + IMGC.IMAGES_PER_ROW = 2 ; + IMGC.IMAGES_PER_COL = 2; + IMGC.IMAGES_PER_PAGE = IMGC.IMAGES_PER_ROW * IMGC.IMAGES_PER_COL; + IMGC.IMAGES_PER_PAGE = 4 ; + IMGC.ASPECT_RATIO = 1.5 ; + IMGC.THUMB_MICROFICATION = 4 ; + IMGC.BASE_IMAGE_WIDTH = IMGC.DEF_IMAGE_WIDTH ; + IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO); + IMGC.setBorderSize() ; + IMGC.paintImages(); + }, false); + Event.observe($('fourXfour'), 'click', function() + { + IMGC.IMAGES_PER_ROW = 4 ; + IMGC.IMAGES_PER_COL = 4; + IMGC.IMAGES_PER_PAGE = IMGC.IMAGES_PER_ROW * IMGC.IMAGES_PER_COL; + IMGC.ASPECT_RATIO = 1.5 ; + IMGC.THUMB_MICROFICATION = 4 ; + IMGC.BASE_IMAGE_WIDTH = IMGC.DEF_IMAGE_WIDTH ; + IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO) ; + IMGC.setBorderSize() ; + IMGC.paintImages(); + }, false); + Event.observe($('twoXone'), 'click', function() + { + IMGC.IMAGES_PER_ROW = 2 ; + IMGC.IMAGES_PER_COL = 1; + IMGC.IMAGES_PER_PAGE = IMGC.IMAGES_PER_ROW * IMGC.IMAGES_PER_COL; + IMGC.ASPECT_RATIO = 1.5 ; + IMGC.THUMB_MICROFICATION = 4 ; + IMGC.BASE_IMAGE_WIDTH = IMGC.DEF_IMAGE_WIDTH ; + IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO) ; + IMGC.setBorderSize() ; + IMGC.paintImages(); + }, false); + + IMGC.loadingProgress('hidden') ; + +}, false); + +//__________________________________________________________________________________________________________________________________ +// Create the canvas buttons and decorations. This is implemented by dynamically adding +// HTML statements to the current document as childrens of the 'theCanvas'
    element +IMGC.initialize = function () +{ + try + { + var tmp = $('theCanvas').getAttribute("style") ; + } catch(errorMessage) { + alert("[IMGC.js::IMGC.initialize()]\nNo
    element found with ID='theCanvas' in the current HTML file") ; + return ; + } + var theCanvas = $('theCanvas') ; + var theFieldset = document.createElement("fieldset") ; + var theLegend = document.createElement("legend") ; + var theMainContainer = document.createElement("div") ; + var theControls = document.createElement("div") ; + var theNormalSize = document.createElement("button") ; + var theSpan1 = document.createElement("span") ; + var theSmallerSize = document.createElement("button") ; + var theSpan2 = document.createElement("span") ; + var theFirstPage = document.createElement("button") ; + var theSpan3 = document.createElement("span") ; + var thePreviousPage = document.createElement("button") ; + var theSpan4 = document.createElement("span") ; + var theNextPage = document.createElement("button") ; + var theSpan5 = document.createElement("span") ; + var theLastPage = document.createElement("button") ; + var theSpan6 = document.createElement("span") ; + var theLargerSize = document.createElement("button") ; + var theSpan7 = document.createElement("span") ; + var theMaximizeSize = document.createElement("button") ; + var theSpan8 = document.createElement("span") ; + var thefourXfour = document.createElement("button") ; + var theSpan9 = document.createElement("span") ; + var thetwoXtwo = document.createElement("button") ; + var theSpan10 = document.createElement("span") ; + var thetwoXone = document.createElement("button") ; + var theSpan11 = document.createElement("span") ; + var theoneXone = document.createElement("button") ; + var thePar1 = document.createElement("p") ; + var theImgTitleDiv = document.createElement("div") ; + var theImgTitle = document.createElement("input") ; + var thePar2 = document.createElement("p") ; + var theCanvasBorder = document.createElement("div") ; + var theImageCanvas = document.createElement("div") ; + + theLegend.textContent = " Dynamic drawing canvas " ; + theNormalSize.textContent = "=" ; + theSpan1.textContent = " | " ; + theSmallerSize.textContent = "-" ; + theSpan2.textContent = " | " ; + theFirstPage.textContent = "<<" ; + theSpan3.textContent = " | " ; + thePreviousPage.textContent = "<" ; + theSpan4.textContent = " | " ; + theNextPage.textContent = ">" ; + theSpan5.textContent = " | " ; + theLastPage.textContent = ">>" ; + theSpan6.textContent = " | " ; + theLargerSize.textContent = "+" ; + theSpan7.textContent = " | " ; + theMaximizeSize.textContent = "M" ; + theSpan8.textContent = " | " ; + thefourXfour.textContent = "4x4" ; + theSpan9.textContent = " | " ; + thetwoXtwo.textContent = "2x2" ; + theSpan10.textContent = " | " ; + thetwoXone.textContent = "2x1" ; + theSpan11.textContent = " | " ; + theoneXone.textContent = "1x1" ; + + theFieldset.setAttribute( "id", "theCanvasField" ); + theFieldset.setAttribute( "style", "background: #225587; width: 95%; height: 100%;" ); + theLegend.setAttribute( "id", "theLegend" ); + theLegend.setAttribute( "style", "background: #225587; font-family: Verdana, Arial; font-size: 12px; color: #ffb400;" ); + theMainContainer.setAttribute("id", "mainContainer") ; + theMainContainer.setAttribute("align", "center") ; + theNormalSize.setAttribute( "type", "submit") ; + theNormalSize.setAttribute( "class", "controlButton") ; + theNormalSize.setAttribute( "id", "normalSize") ; + theNormalSize.setAttribute( "value", "=") ; + theSmallerSize.setAttribute( "type", "submit") ; + theSmallerSize.setAttribute( "class", "controlButton") ; + theSmallerSize.setAttribute( "id", "smallerSize") ; + theSmallerSize.setAttribute( "value", "-") ; + theFirstPage.setAttribute( "type", "submit") ; + theFirstPage.setAttribute( "class", "controlButton") ; + theFirstPage.setAttribute( "id", "firstPage") ; + theFirstPage.setAttribute( "value", "<<") ; + thePreviousPage.setAttribute( "type", "submit") ; + thePreviousPage.setAttribute( "class", "controlButton") ; + thePreviousPage.setAttribute( "id", "previousPage") ; + thePreviousPage.setAttribute( "value", "<") ; + theNextPage.setAttribute( "type", "submit") ; + theNextPage.setAttribute( "class", "controlButton") ; + theNextPage.setAttribute( "id", "nextPage") ; + theNextPage.setAttribute( "value", ">") ; + theLastPage.setAttribute( "type", "submit") ; + theLastPage.setAttribute( "class", "controlButton") ; + theLastPage.setAttribute( "id", "lastPage") ; + theLastPage.setAttribute( "value", ">>") ; + theLargerSize.setAttribute( "type", "submit") ; + theLargerSize.setAttribute( "class", "controlButton") ; + theLargerSize.setAttribute( "id", "largerSize") ; + theLargerSize.setAttribute( "value", "+") ; + theMaximizeSize.setAttribute( "type", "submit") ; + theMaximizeSize.setAttribute( "class", "controlButton") ; + theMaximizeSize.setAttribute( "id", "maximizeSize") ; + theMaximizeSize.setAttribute( "value", "M") ; + thefourXfour.setAttribute( "type", "submit") ; + thefourXfour.setAttribute( "class", "controlButton") ; + thefourXfour.setAttribute( "id", "fourXfour") ; + thefourXfour.setAttribute( "value", "4x4") ; + thetwoXtwo.setAttribute( "type", "submit") ; + thetwoXtwo.setAttribute( "class", "controlButton") ; + thetwoXtwo.setAttribute( "id", "twoXtwo") ; + thetwoXtwo.setAttribute( "value", "2x2") ; + thetwoXone.setAttribute( "type", "submit") ; + thetwoXone.setAttribute( "class", "controlButton") ; + thetwoXone.setAttribute( "id", "twoXone") ; + thetwoXone.setAttribute( "value", "2x1") ; + theoneXone.setAttribute( "type", "submit") ; + theoneXone.setAttribute( "class", "controlButton") ; + theoneXone.setAttribute( "id", "oneXone") ; + theoneXone.setAttribute( "value", "1x1") ; + theImgTitleDiv.setAttribute( "id", "imgTitleDiv") ; + theImgTitle.setAttribute( "id", "imgTitle") ; + theImgTitle.setAttribute( "class", "inputText") ; + theImgTitle.setAttribute( "type", "text") ; + theImgTitle.setAttribute( "value", "") ; + theCanvasBorder.setAttribute( "id", "canvasBorder") ; + theImageCanvas.setAttribute( "id", "imageCanvas") ; + theImageCanvas.setAttribute( "style", "position: relative") ; + + theCanvas.appendChild(theFieldset) ; + theFieldset.appendChild(theLegend) ; + theFieldset.appendChild(theMainContainer) ; + theMainContainer.appendChild(theControls) ; + theControls.appendChild(theNormalSize) ; + theControls.appendChild(theSpan1) ; + theControls.appendChild(theSmallerSize) ; + theControls.appendChild(theSpan2) ; + theControls.appendChild(theFirstPage) ; + theControls.appendChild(theSpan3) ; + theControls.appendChild(thePreviousPage) ; + theControls.appendChild(theSpan4) ; + theControls.appendChild(theNextPage) ; + theControls.appendChild(theSpan5) ; + theControls.appendChild(theLastPage) ; + theControls.appendChild(theSpan6) ; + theControls.appendChild(theLargerSize) ; + theControls.appendChild(theSpan7) ; + theControls.appendChild(theMaximizeSize) ; + theControls.appendChild(theSpan8) ; + theControls.appendChild(thefourXfour) ; + theControls.appendChild(theSpan9) ; + theControls.appendChild(thetwoXtwo) ; + theControls.appendChild(theSpan10) ; + theControls.appendChild(thetwoXone) ; + theControls.appendChild(theSpan11) ; + theControls.appendChild(theoneXone) ; + theControls.appendChild(thePar1) ; + theMainContainer.appendChild(theImgTitleDiv) ; + theImgTitleDiv.appendChild(theImgTitle) ; + theMainContainer.appendChild(thePar2) ; + theMainContainer.appendChild(theCanvasBorder ) ; + theCanvasBorder.appendChild(theImageCanvas) ; + +} + +//__________________________________________________________________________________________________________________________________ +// Function called once during initialization: takes the list of inital pictures from the +// IMGC.IMAGE_LIST_URL vector and issues a request to the web server to provide those for +// first time display +IMGC.getImageList = function () +{ + try + { + var url = IMGC.getURL() ; + var urlTitleList = url + IMGC.IMAGE_LIST_TITLES; + var urlImageList = url + IMGC.IMAGE_LIST_URL ; + var getTitles = new Ajax.Request(urlTitleList, // Load titles first, because they are + { // used by the IMGC.processImageList + method: 'get', // which fires later on + parameters: '', + onComplete: IMGC.processTitlesList // <-- call back function + }); + var getFiles = new Ajax.Request(urlImageList, + { + method: 'get', + parameters: '', + onComplete: IMGC.processImageList // <-- call back function + }); + } catch(errorMessage) { + alert("[IMGC.js::IMGC.getImageList()]\nExecution/syntax error: " + error.errorMessage ) ; + } +} + +//__________________________________________________________________________________________________________________________________ +// Internal Utility Function: returns the full path to the current HTML document with the document file +// name stripped from it +IMGC.getURL = function() +{ + try + { + var url = window.location.href; + var list = url.split(/\//) ; + var match = list[list.length-1].match(/.*\.html/) ; + if( match != null ) + { + url = url.replace(match,"") ; + } + return url; + } catch(errorMessage) { + alert("[IMGC.js::IMGC.getURL()]\nExecution/syntax error: " + error.errorMessage ) ; + } +} + +//__________________________________________________________________________________________________________________________________ +// This is were user requests are forwarded to the web server: input is the full path-name to the +// DQM directory containing the required Monitoring Elements. The QUERY STRING of the request +// contains the full path-name: the server will respond with a list of ME names that will be +// used to prepare hyperlink addresses on the canvas. The answer of the web server is dealt by +// IMGC.processIMGCPlots Ajax callback function. +IMGC.updateIMGC = function (source) +{ + if( !source ) + { + source = IMGC.lastSource ; + if( source == "" ) return ; + } else { + IMGC.lastSource = source ; + } + + var url = IMGC.getApplicationURL(); + url = url + + 'RequestID=updateIMGCPlots&MEFolder=' + + source; + + // Ajax request to get back the list of ME that will be displayed by the call-back function + var getMEURLS = new Ajax.Request(url, + { + method: 'get', + parameters: '', + onComplete: IMGC.processIMGCPlots // <-- call-back function + }); +} + +//__________________________________________________________________________________________________________________________________ +// Unused function (it remains here as a reference for possibile future uses) +IMGC.updateAlarmsIMGC = function (path) +{ + var url = IMGC.getApplicationURL(); + url += "/Request?"; + queryString = 'RequestID=PlotHistogramFromPath'; + queryString += '&Path=' + path; + queryString += '&width=' + IMGC.BASE_IMAGE_WIDTH + + '&height=' + IMGC.BASE_IMAGE_HEIGHT ; + queryString += '&histotype=qtest'; + url += queryString; + + var getMEURLS = new Ajax.Request(url, + { + method: 'get', + parameters: '', + onComplete: IMGC.processIMGCPlots // <-- call-back function + }); +} + +//__________________________________________________________________________________________________________________________________ +// This is an Ajax callback function. It is activated when the web server responds to the request of +// providing a list of ME available in a particular DQM folder. The response is packaged by the server +// as a vector of strings containing the ME names. This list is explored and a new vector is created +// with each element containing the complete QUERY-STRING to ask the server to provide the corresponding +// ME plot in the form of a PNG chunk of data. Once this vector is ready (imageURLs) the canvas is +// refreshed with a call to IMGC.computeCanvasSize(). +IMGC.processIMGCPlots = function (ajax) +{ + var imageURLs; + var url = IMGC.getApplicationURL(); +// var url = ""; + + try + { + imageURLs = ajax.responseText.split(/\s+/) ; + } catch(errorMessage) { + alert('[IMGC.js::IMGC.processIMGCPlots()]\nImage URLs list load failed. Reason: '+error.errorMessage); + return 0; + } + + + try + { + date = new Date() ; // This is extremely important: adding a date to the QUERY_STRING of the + // URL, forces the browser to reload the picture even if the Plot, Folder + // and canvas size are the same (e.g. by clicking twice the same plot) + // The reload is forced because the browser is faked to think that the + // URL is ALWAYS different from an already existing one. + // This was rather tricky... (Dario) + date = date.toString() ; + date = date.replace(/\s+/g,"_") ; + + var canvasW = window.innerWidth * IMGC.GLOBAL_RATIO ; + IMGC.DEF_IMAGE_WIDTH = parseInt(canvasW); + IMGC.BASE_IMAGE_WIDTH = IMGC.DEF_IMAGE_WIDTH; + IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO) ; + IMGC.THUMB_IMAGE_WIDTH = IMGC.BASE_IMAGE_WIDTH / IMGC.IMAGES_PER_ROW; + IMGC.THUMB_IMAGE_HEIGHT = IMGC.BASE_IMAGE_HEIGHT / IMGC.IMAGES_PER_COL; + + var theFolder = imageURLs[0] ; + var tempURLs = new Array() ; + var tempTitles = new Array() ; + for( var i=1; i= 0) + { + url = url.substring(0, index); + } + + index = url.lastIndexOf("temporary"); + url = url.substring(0, index); + + // add the cgi request + var s0 = (url.lastIndexOf(":")+1); + var s1 = url.lastIndexOf("/"); + var port_number = url.substring(s0, s1); + if (port_number == "40000") { + url += "urn:xdaq-application:lid=27/moduleWeb?module=SiStripAnalyser&"; + } else if (port_number == "1972") { + url += "urn:xdaq-application:lid=15/Request?"; + } + return url; + } catch(errorMessage) { + alert("[IMGC.js::IMGC.getApplicationURL()]\nExecution/syntax error: " + error.errorMessage ) ; + } +} +//__________________________________________________________________________________________________________________________________ +// This is an Ajax callback function. It is activated when the web server responds to the request of +// providing the list of images to display in the startup canvas +// (this is called only once by IMGC.getImageList). +IMGC.processImageList = function (ajax) +{ + var imageList; + try + { + imageList = eval('(' + ajax.responseText + ')'); + } catch(errorMessage) { + alert('[IMGC.js::IMGC.processImageList()]\nImage list load failed. Error: '+error.errorMessage); + return 0; + } + + $('imageCanvas').imageList = imageList; +// $('imageCanvas').ChandraURLs = imageList; + $('imageCanvas').current_start = 0; + + IMGC.computeCanvasSize() ; +} + +//__________________________________________________________________________________________________________________________________ +IMGC.processTitlesList = function (ajax) +// This is an Ajax callback function. It is activated when the web server responds to the request of +// providing the list of image titles to display in the startup canvas +// (this is called only once by IMGC.getImageList). +{ + var titlesList; + + try + { + titlesList = eval('(' + ajax.responseText + ')'); + } catch(errorMessage) { + alert('[IMGC.js::IMGC.processTitlesList()]\nImage titles list load failed. Error: '+error.errorMessage); + titlesList = "No text collected" ; + return 0; + } + + $('imageCanvas').titlesList = titlesList; +} + +//__________________________________________________________________________________________________________________________________ +// Internal Utility Function: refreshes the size attributes of the canvas (these may change upon a +// user-generated resize of the browser's window) +IMGC.setBorderSize = function () +{ + var theBorder = $('canvasBorder') ; + var theBorderS = "width: " + IMGC.BASE_IMAGE_WIDTH + "px; " + + "height: " + IMGC.BASE_IMAGE_HEIGHT + "px" ; + theBorder.setAttribute("style",theBorderS) ; +} + +//__________________________________________________________________________________________________________________________________ +// Obsolete function: was just a switchyard to the IMGC.changeSize method specialized to the +// same-size resize +IMGC.resize = function () +{ + IMGC.changeSize('=') ; +} + +//__________________________________________________________________________________________________________________________________ +// Refreshes the internal variables with the current size of the browser's window (which might have +// changed after a user's resize) and calls IMGC.paintImages() to refresh the canvas with new plots +// provided by the web server with the newly adjusted pixel resolution. +IMGC.computeCanvasSize = function () +{ + var canvasW = window.innerWidth * IMGC.GLOBAL_RATIO ; + IMGC.DEF_IMAGE_WIDTH = parseInt(canvasW); + IMGC.BASE_IMAGE_WIDTH = IMGC.DEF_IMAGE_WIDTH; + IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO) ; + IMGC.THUMB_IMAGE_WIDTH = IMGC.BASE_IMAGE_WIDTH / IMGC.IMAGES_PER_ROW; + IMGC.THUMB_IMAGE_HEIGHT = IMGC.BASE_IMAGE_HEIGHT / IMGC.IMAGES_PER_COL; + IMGC.setBorderSize() ; + IMGC.paintImages(); +} + +//__________________________________________________________________________________________________________________________________ +// Callback function associated with some of the IMGC canvas control button's. +IMGC.changeSize = function (direction) +{ + if( direction == '-') + { + IMGC.BASE_IMAGE_WIDTH = parseInt(IMGC.BASE_IMAGE_WIDTH * .9) ; // Scale down by 10% + IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO) ; // Keep fixed aspect ratio + } else if(direction == '+') { + IMGC.BASE_IMAGE_WIDTH = parseInt(IMGC.BASE_IMAGE_WIDTH / .9) ; // Scale upby 10% + IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO) ; // Keep fixed aspect ratio + } else if(direction == '=') { + IMGC.BASE_IMAGE_WIDTH = IMGC.DEF_IMAGE_WIDTH ; // Restore default size + IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO) ; // Keep fixed aspect ratio + } else if(direction == 'M') { + var headerH = IMGC.getStyleValue('header', 'height') ; // Scales up to completely fill + var headerTextH = IMGC.getStyleValue('headerText', 'height') ; // the available area of the canvas + var controlsH = IMGC.getStyleValue('controls', 'height') ; + var borderH = IMGC.getStyleValue('border', 'height') ; + var dimX = window.innerWidth - 100; + var dimY = window.innerHeight - (controlsH+headerH+headerTextH) ; + IMGC.BASE_IMAGE_WIDTH = dimX ; + IMGC.BASE_IMAGE_HEIGHT = dimY ; + } + + IMGC.setBorderSize() ; + IMGC.paintImages(); +} + +//__________________________________________________________________________________________________________________________________ +// Internal Utility Function: returns the numerical part of the style attribute (specified by styleType) +// for the HTML element specified by tagName +IMGC.getStyleValue = function (tagName,styleType) +{ + var style = $(tagName).getStyle(styleType) ; + var parts = style.split("px") ; + return parseInt(parts[0]) ; +} + +//__________________________________________________________________________________________________________________________________ +// Callback function associated to the onresize action in the HTML body of the calling document +IMGC.repaintUponResize = function() +{ + IMGC.updateIMGC() ; +} +//__________________________________________________________________________________________________________________________________ +// This is were the canvas gets filled with plot content. Each plot is contained is an element +// which is created here on the fly (one for every plot in the current nxm grid). Before each +// element is created, previously existing ones are removed. The style of each element is then +// initialized to a somewhat reduced opacity and callback functions are dynamically registered: these +// control the behaviour of the image when the mouse hovers on them or the user clicks one. +IMGC.paintImages = function () +{ +// new Effect.Fade($('demo-all')) ; + + var imageList = $('imageCanvas').imageList; + var titlesList = $('imageCanvas').titlesList; + var imageCanvas = $('imageCanvas'); + + IMGC.THUMB_IMAGE_WIDTH = IMGC.BASE_IMAGE_WIDTH / IMGC.IMAGES_PER_ROW; + IMGC.THUMB_IMAGE_HEIGHT = IMGC.BASE_IMAGE_HEIGHT / IMGC.IMAGES_PER_COL; + + while(imageCanvas.hasChildNodes()) + { + imageCanvas.removeChild(imageCanvas.firstChild); // Remove pre-existing elements in the current canvas + } + + // Create a new element for each picture and define it's initial style + for(var i = imageCanvas.current_start; i < imageList.length && i < IMGC.IMAGES_PER_PAGE + imageCanvas.current_start; i++) + { + var img = document.createElement('img'); +// img.src = IMGC.getURL() + imageList[i]; + img.src = imageList[i]; + img.style.width = IMGC.THUMB_IMAGE_WIDTH + 'px'; + img.style.height = IMGC.THUMB_IMAGE_HEIGHT + 'px'; + img.image_index = i - imageCanvas.current_start ; + img.style.position = 'absolute'; + img.style.cursor = 'pointer'; + img.style.left = img.image_index % IMGC.IMAGES_PER_ROW * IMGC.THUMB_IMAGE_WIDTH + 'px'; + img.style.top = parseInt(img.image_index / IMGC.IMAGES_PER_COL) * IMGC.THUMB_IMAGE_HEIGHT + 'px'; + img.style.zIndex = 1; + img.style.opacity = IMGC.INACTIVE_OPACITY; + img.style.filter = 'alpha(opacity=' + IMGC.INACTIVE_OPACITY * 100 + ')'; + + imageCanvas.appendChild(img); + } + + var markup = imageCanvas.innerHTML; + imageCanvas.innerHTML = ''; + imageCanvas.innerHTML = markup; + + // Associate a transition behaviour to each plot in the canvas and register appropriate callback functions + // to deal with mouse events + for(var i = 0; i < imageCanvas.childNodes.length; i++) + { + var img = imageCanvas.childNodes[i]; + img.image_index = i; + img.imageNumber = i + imageCanvas.current_start; + img.slide_fx = new Fx.Styles(img, {duration: 300, transition: Fx.Transitions.expoOut}); + img.opacity_fx = new Fx.Styles(img, {duration: 300, transition: Fx.Transitions.quadOut}); + + Event.observe(img, 'mouseover', function() + { +// $('traceRegion').slideDown = new Effect.SlideDown($('demo-all')) ; + var imageList = $('imageCanvas').imageList; + var element = window.event ? window.event.srcElement : this; + var thisPlot = $('imageCanvas').titlesList[element.imageNumber]; +// var thisPlot = $('imageCanvas').titlesList[element.imageNumber].split("Plot=") ; +// var plotName = "" ; +// var plotFolder = "" ; +// var temp ; +// try +// { +// temp = thisPlot[1].split(/&/g) ; +// plotName = temp[0] ; +// plotFolder = temp[1] ; +// temp = plotFolder.split("Folder=" ); +// plotFolder = temp[1] ; +// plotFolder.replace(/Collector\/(FU\d+)\/Tracker/,"$1/") ; +// plotFolder.replace(/Collector/,"") ; +// plotFolder.replace(/Collated/,"") ; +// plotFolder.replace(/Tracker/,"") ; +// } catch(e) {} + +// $('traceRegion').value = "Plot: " + element.imageNumber + " " + plotName + " | " + plotFolder; + + element.opacity_fx.clearTimer(); + element.opacity_fx.custom({ + 'opacity' : [parseFloat(element.style.opacity), 1] + }); + + element.slide_fx.clearTimer(); + element.slide_fx.custom({ + 'width' : [element.offsetWidth, IMGC.THUMB_IMAGE_WIDTH * 1.05], + 'height' : [element.offsetHeight, IMGC.THUMB_IMAGE_HEIGHT * 1.05], + 'left' : [element.offsetLeft, element.offsetLeft - IMGC.THUMB_IMAGE_WIDTH * .01], + 'top' : [element.offsetTop, element.offsetTop - IMGC.THUMB_IMAGE_WIDTH * .01] + }); +// $('imgTitle').value = element.imageNumber + "] " + plotFolder + " | " + plotName;; + $('imgTitle').value = element.imageNumber + "] " + thisPlot; + + }, false); + + Event.observe(img, 'mouseout', function() + { + var element = window.event ? window.event.srcElement : this;; + element.opacity_fx.clearTimer(); + element.opacity_fx.custom({ + 'opacity' : [parseFloat(element.style.opacity), IMGC.INACTIVE_OPACITY] + }); + + element.slide_fx.clearTimer(); + element.slide_fx.custom({ + 'width' : [element.offsetWidth, IMGC.THUMB_IMAGE_WIDTH], + 'height' : [element.offsetHeight, IMGC.THUMB_IMAGE_HEIGHT], + 'left' : [element.offsetLeft, element.image_index % IMGC.IMAGES_PER_ROW * IMGC.THUMB_IMAGE_WIDTH], + 'top' : [element.offsetTop, parseInt(element.image_index / IMGC.IMAGES_PER_ROW) * IMGC.THUMB_IMAGE_HEIGHT] + }); + $('imgTitle').value = "" ; + }, false); + + Event.observe(img, 'click', IMGC.handleImageClick, false); + } +} + +//__________________________________________________________________________________________________________________________________ +// Handles the display of a specific page in the canvas: this is a callback function associated to the canvas +// control buttons +IMGC.updatePage = function (direction) +{ + if( direction == 'next') + { + $('imageCanvas').current_start += IMGC.IMAGES_PER_PAGE; + } else if(direction == 'previous') { + $('imageCanvas').current_start -= IMGC.IMAGES_PER_PAGE; + } else if(direction == 'first') { + $('imageCanvas').current_start = 0; + } else if(direction == 'last') { + var numberOfPages = parseInt($('imageCanvas').imageList.length / IMGC.IMAGES_PER_PAGE) ; + var lastPage = parseInt(numberOfPages * IMGC.IMAGES_PER_PAGE ) ; + $('imageCanvas').current_start = lastPage; + } + + if($('imageCanvas').current_start > $('imageCanvas').imageList.length) + { + alert('[IMGC.js::IMGC.updatePage()]\nNo more images!'); + $('imageCanvas').current_start -= IMGC.IMAGES_PER_PAGE; + return 0; + } + + if($('imageCanvas').current_start < 0) + { + alert('[IMGC.js::IMGC.updatePage()]\nYou\'re already at the beginning!'); + $('imageCanvas').current_start += IMGC.IMAGES_PER_PAGE; + return 0; + } + + IMGC.paintImages(); +} + +//__________________________________________________________________________________________________________________________________ +// This is were the dynamic behaviour of the canvas is implemented. The picture clicked by the +// user fills up the entire canvas. +IMGC.handleImageClick = function () +{ + var element = window.event ? window.event.srcElement : this; + + element.slide_fx = new Fx.Styles(element, {duration: 300, transition: Fx.Transitions.expoOut}); + element.opacity_fx = new Fx.Styles(element, {duration: 300, transition: Fx.Transitions.quadOut}); + + if(element.offsetWidth != IMGC.BASE_IMAGE_WIDTH) + { +// new Effect.Fade($('demo-all')) ; + element.style.zIndex = 2; + + element.slide_fx.clearTimer(); + element.slide_fx.custom({ + 'width' : [element.offsetWidth, IMGC.BASE_IMAGE_WIDTH], + 'height' : [element.offsetHeight, IMGC.BASE_IMAGE_HEIGHT], + 'left' : [element.offsetLeft, 0], + 'top' : [element.offsetTop, Math.max(0, Math.min($('imageCanvas').offsetHeight - IMGC.BASE_IMAGE_HEIGHT, element.offsetTop - (IMGC.BASE_IMAGE_HEIGHT / 2) + (IMGC.BASE_IMAGE_HEIGHT / (IMGC.THUMB_MICROFICATION * 2))))] + }); + + element.opacity_fx.clearTimer(); + element.opacity_fx.custom({ + 'opacity' : [IMGC.INACTIVE_OPACITY, 1] + }); + + for(var i = 0; i < element.parentNode.childNodes.length; i++) + { + var sibling = element.parentNode.childNodes[i]; + + if(sibling != element) + { + sibling.style.zIndex = 1; + if( sibling.offsetWidth != IMGC.THUMB_IMAGE_WIDTH || + sibling.offsetHeight != IMGC.THUMB_IMAGE_HEIGHT ) + { + sibling.slide_fx.clearTimer(); + sibling.slide_fx.custom({ + 'width' : [sibling.offsetWidth, IMGC.THUMB_IMAGE_WIDTH], + 'height' : [sibling.offsetHeight, IMGC.THUMB_IMAGE_HEIGHT], + 'left' : [sibling.offsetLeft, sibling.image_index % IMGC.IMAGES_PER_ROW * IMGC.THUMB_IMAGE_WIDTH], + 'top' : [sibling.offsetTop, parseInt(sibling.image_index / IMGC.IMAGES_PER_ROW) * IMGC.THUMB_IMAGE_HEIGHT] + }); + } + } + } + } else { + element.style.zIndex = 1; + + element.slide_fx.clearTimer(); + element.slide_fx.custom({ + 'width' : [element.offsetWidth, IMGC.THUMB_IMAGE_WIDTH], + 'height' : [element.offsetHeight, IMGC.THUMB_IMAGE_HEIGHT], + 'left' : [element.offsetLeft, element.image_index % IMGC.IMAGES_PER_ROW * IMGC.THUMB_IMAGE_WIDTH], + 'top' : [element.offsetTop, parseInt(element.image_index / IMGC.IMAGES_PER_ROW) * IMGC.THUMB_IMAGE_HEIGHT] + }); + + } + + +} + +//__________________________________________________________________________________________________________________________________ +// This is an obsolete function (it's here just for future reference) +IMGC.changeHeaderOpacity = function (state) +{ + var element = $('headerText') ; + element.slide_fx = new Fx.Styles(element, {duration: 200, transition: Fx.Transitions.expoOut}); + element.opacity_fx = new Fx.Styles(element, {duration: 400, transition: Fx.Transitions.quadOut}); + + element.opacity_fx.clearTimer(); + if( state == 'mouseover' ) + { + element.opacity_fx.custom({ + 'opacity' : [1, IMGC.INACTIVE_OPACITY] + }); + } else if (state == 'mouseout') { + element.opacity_fx.custom({ + 'opacity' : [IMGC.INACTIVE_OPACITY, 1] + }); + } +} + +//__________________________________________________________________________________________________________________________________ +// This is were the progress bar is made visible or invisible: this works only if the calling HTML +// page contains a
    element identified by ID=progressIcon. Usually this
    element contains +// an element with a spinning animated gif +IMGC.loadingProgress = function (state) +{ + try + { + var tmp = $('progressIcon').getAttribute("style") ; + } catch(errorMessage) { + return ; + } + + var element = $('progressIcon') ; + element.opacity_fx = new Fx.Styles(element, {duration: 1000, transition: Fx.Transitions.quadOut}); + element.opacity_fx.clearTimer(); + if( state == 'visible') + { + element.opacity_fx.custom({ + 'opacity' : [0, 1] + }); + } else { + element.opacity_fx.custom({ + 'opacity' : [1, 0] + }); + } +} + +//__________________________________________________________________________________________________________________________________ +// This functions is triggered each time a user clicks on a check-button connected to a ME. +// It explores the checked status of each check-button and prepares an appropriate QUERY-STRING +// for the display of the plot. +IMGC.selectedIMGCItems = function () +{ + var url = IMGC.getApplicationURL(); + var imageURLs = new Array(); + var selection = document.getElementsByName("selected") ; + date = new Date() ; // This is extremely important: adding a date to the QUERY_STRING of the + // URL, forces the browser to reload the picture even if the Plot, Folder + // and canvas size are the same (e.g. by clicking twice the same plot) + // The reload is forced because the browser is faked to think that the + // URL is ALWAYS different from an already existing one. + // This was rather tricky... (Dario) + date = date.toString() ; + date = date.replace(/\s+/g,"_") ; + + var canvasW = window.innerWidth * IMGC.GLOBAL_RATIO ; + IMGC.DEF_IMAGE_WIDTH = parseInt(canvasW); + IMGC.BASE_IMAGE_WIDTH = IMGC.DEF_IMAGE_WIDTH; + IMGC.BASE_IMAGE_HEIGHT = parseInt(IMGC.BASE_IMAGE_WIDTH / IMGC.ASPECT_RATIO) ; + IMGC.THUMB_IMAGE_WIDTH = IMGC.BASE_IMAGE_WIDTH / IMGC.IMAGES_PER_ROW; + IMGC.THUMB_IMAGE_HEIGHT = IMGC.BASE_IMAGE_HEIGHT / IMGC.IMAGES_PER_COL; + + for( var i=0; i (document.documentElement.offsetWidth-20)){ + xPos = xPos + (document.documentElement.offsetWidth - (xPos + contextMenuObj.offsetWidth)) - 20; + } + + var yPos = e.clientY; + if(yPos + contextMenuObj.offsetHeight > (document.documentElement.offsetHeight-20)){ + yPos = yPos + (document.documentElement.offsetHeight - (yPos + contextMenuObj.offsetHeight)) - 20; + } + contextMenuObj.style.left = xPos + 'px'; + contextMenuObj.style.top = yPos + 'px'; + contextMenuObj.style.display='block'; + return false; +} + +function hideContextMenu(e) +{ + if(document.all) e = event; + if(e.button==0 && !MSIE){ + + }else{ + contextMenuObj.style.display='none'; + } +} + +function initContextMenu() +{ + contextMenuObj = document.getElementById('contextMenu'); + contextMenuObj.style.display = 'block'; + var menuItems = contextMenuObj.getElementsByTagName('LI'); + for(var no=0;no0 && subItems[0].style.display!='block'){ + showHideNode(false,menuItems[no].id.replace(/[^0-9]/g,'')); + } + } +} + +function collapseAll(treeId) +{ + var menuItems = document.getElementById(treeId).getElementsByTagName('LI'); + for(var no=0;no0 && subItems[0].style.display=='block'){ + showHideNode(false,menuItems[no].id.replace(/[^0-9]/g,'')); + } + } +} + +function getNodeDataFromServer(ajaxIndex,ulId,parentId) +{ + document.getElementById(ulId).innerHTML = ajaxObjectArray[ajaxIndex].response; + ajaxObjectArray[ajaxIndex] = false; + parseSubItems(ulId,parentId); +} + + +function parseSubItems(ulId,parentId) +{ + + if (initExpandedNodes){ + var nodes = initExpandedNodes.split(','); + } + var branchObj = document.getElementById(ulId); + var menuItems = branchObj.getElementsByTagName('LI'); // Get an array of all menu items + for (var no=0; no0)continue; + nodeId++; + var subItems = menuItems[no].getElementsByTagName('UL'); + var img = document.createElement('IMG'); + img.src = imageFolder + plusImage; + img.onclick = showHideNode; + if (subItems.length==0) img.style.visibility='hidden'; + else { + subItems[0].id = 'tree_ul_' + treeUlCounter; + treeUlCounter++; + } + var aTag = menuItems[no].getElementsByTagName('A')[0]; + aTag.onclick = showHideNode; + if(contextMenuActive)aTag.oncontextmenu = showContextMenu; + + menuItems[no].insertBefore(img, aTag); + menuItems[no].id = 'dhtmlgoodies_treeNode' + nodeId; + var folderImg = document.createElement('IMG'); + if(menuItems[no].className){ + folderImg.src = imageFolder + menuItems[no].className; + }else{ + folderImg.src = imageFolder + folderImage; + } + menuItems[no].insertBefore(folderImg,aTag); + + var tmpParentId = menuItems[no].getAttribute('parentId'); + if(!tmpParentId)tmpParentId = menuItems[no].tmpParentId; + if(tmpParentId && nodes[tmpParentId])showHideNode(false,nodes[no]); + } +} + + +function showHideNode(e,inputId) +{ + if(inputId){ + if(!document.getElementById('dhtmlgoodies_treeNode'+inputId))return; + thisNode = document.getElementById('dhtmlgoodies_treeNode'+inputId).getElementsByTagName('IMG')[0]; + }else { + thisNode = this; + if(this.tagName=='A')thisNode = this.parentNode.getElementsByTagName('IMG')[0]; + } + if(thisNode.style.visibility=='hidden')return; + var parentNode = thisNode.parentNode; + inputId = parentNode.id.replace(/[^0-9]/g,''); + if(thisNode.src.indexOf(plusImage)>=0){ + thisNode.src = thisNode.src.replace(plusImage,minusImage); + var ul = parentNode.getElementsByTagName('UL')[0]; + ul.style.display='block'; + if(!initExpandedNodes)initExpandedNodes = ','; + if(initExpandedNodes.indexOf(',' + inputId + ',')<0) initExpandedNodes = initExpandedNodes + inputId + ','; + + if(useAjaxToLoadNodesDynamically){ // Using AJAX/XMLHTTP to get data from the server + var firstLi = ul.getElementsByTagName('LI')[0]; + var parentId = firstLi.getAttribute('parentId'); + if(!parentId)parentId = firstLi.parentId; + if(parentId){ + ajaxObjectArray[ajaxObjectArray.length] = new sack(); + var ajaxIndex = ajaxObjectArray.length-1; + ajaxObjectArray[ajaxIndex].requestFile = ajaxRequestFile + '?parentId=' + parentId; + ajaxObjectArray[ajaxIndex].onCompletion = function() + { + getNodeDataFromServer(ajaxIndex,ul.id,parentId); + }; // Specify function that will be executed after file has been found + ajaxObjectArray[ajaxIndex].runAJAX(); // Execute AJAX function + } + } + + }else{ + thisNode.src = thisNode.src.replace(minusImage,plusImage); + parentNode.getElementsByTagName('UL')[0].style.display='none'; + initExpandedNodes = initExpandedNodes.replace(',' + inputId,''); + } + Set_Cookie('dhtmlgoodies_expandedNodes',initExpandedNodes,500); + + return false; +} + +var okToCreateSubNode = true; +function addNewNode(e) +{ + if(!okToCreateSubNode)return; + setTimeout('okToCreateSubNode=true',200); + contextMenuObj.style.display='none'; + okToCreateSubNode = false; + source = contextMenuSource; + while(source.tagName.toLowerCase()!='li')source = source.parentNode; + + + /* + if (e.target) source = e.target; + else if (e.srcElement) source = e.srcElement; + if (source.nodeType == 3) // defeat Safari bug + source = source.parentNode; */ + //while(source.tagName.toLowerCase()!='li')source = source.parentNode; + var nameOfNewNode = prompt('Name of new node'); + if(!nameOfNewNode)return; + + uls = source.getElementsByTagName('UL'); + if(uls.length==0){ + var ul = document.createElement('UL'); + source.appendChild(ul); + + }else{ + ul = uls[0]; + ul.style.display='block'; + } + var img = source.getElementsByTagName('IMG'); + img[0].style.visibility='visible'; + var li = document.createElement('LI'); + li.className='dhtmlgoodies_sheet.gif'; + var a = document.createElement('A'); + a.href = '#'; + a.innerHTML = nameOfNewNode; + li.appendChild(a); + ul.id = 'newNode' + Math.round(Math.random()*1000000); + ul.appendChild(li); + parseSubItems(ul.id); + saveNewNode(nameOfNewNode,source.getElementsByTagName('A')[0].id); + +} + +/* Save a new node */ +function saveNewNode(nodeText,parentId) +{ + self.status = 'Ready to save node ' + nodeText + ' which is a sub item of ' + parentId; + // Use an ajax method here to save this new node. example below: + /* + ajaxObjectArray[ajaxObjectArray.length] = new sack(); + var ajaxIndex = ajaxObjectArray.length-1; + ajaxObjectArray[ajaxIndex].requestFile = ajaxRequestFile + '?newNode=' + nodeText + '&parendId=' + parentId + ajaxObjectArray[ajaxIndex].onCompletion = function() { self.status = 'New node has been saved'; }; // Specify function that will be executed after file has been found + ajaxObjectArray[ajaxIndex].runAJAX(); // Execute AJAX function + */ +} + +function deleteNode() +{ + if(!okToCreateSubNode)return; + setTimeout('okToCreateSubNode=true',200); + contextMenuObj.style.display='none'; + source = contextMenuSource; + + if(!confirm('Click OK to delete the node ' + source.innerHTML))return; + okToCreateSubNode = false; + + var parentLi = source.parentNode.parentNode.parentNode; + while(source.tagName.toLowerCase()!='li')source = source.parentNode; + + var lis = source.parentNode.getElementsByTagName('LI'); + source.parentNode.removeChild(source); + if(lis.length==0)parentLi.getElementsByTagName('IMG')[0].style.visibility='hidden'; + deleteNodeOnServer(source.id); +} + +function deleteNodeOnServer(nodeId) +{ + self.status = 'Ready to delete node' + nodeId; + // Use an ajax method here to save this new node. example below: + /* + ajaxObjectArray[ajaxObjectArray.length] = new sack(); + var ajaxIndex = ajaxObjectArray.length-1; + ajaxObjectArray[ajaxIndex].requestFile = ajaxRequestFile + '?deleteNodeId=' + nodeId + ajaxObjectArray[ajaxIndex].onCompletion = function() { self.status = 'Node has been deleted successfully'; }; // Specify function that will be executed after file has been found + ajaxObjectArray[ajaxIndex].runAJAX(); // Execute AJAX function + */ + +} + +function initTree() +{ + for(var treeCounter=0;treeCounter 0) return this.custom(this.element.offsetHeight, 0); + else return this.custom(0, this.element.scrollHeight); + }, + + show: function(){ + return this.set(this.element.scrollHeight); + }, + + increase: function(){ + this.setStyle(this.element, 'height', this.now); + } + +}); + +Fx.Width = Class.create(); +Fx.Width.prototype = Object.extend(new Fx.Base(), { + + initialize: function(el, options){ + this.element = $(el); + this.setOptions(options); + this.element.style.overflow = 'hidden'; + this.iniWidth = this.element.offsetWidth; + }, + + toggle: function(){ + if (this.element.offsetWidth > 0) return this.custom(this.element.offsetWidth, 0); + else return this.custom(0, this.iniWidth); + }, + + show: function(){ + return this.set(this.iniWidth); + }, + + increase: function(){ + this.setStyle(this.element, 'width', this.now); + } + +}); + +Fx.Opacity = Class.create(); +Fx.Opacity.prototype = Object.extend(new Fx.Base(), { + + initialize: function(el, options){ + this.element = $(el); + this.setOptions(options); + this.now = 1; + }, + + toggle: function(){ + if (this.now > 0) return this.custom(1, 0); + else return this.custom(0, 1); + }, + + show: function(){ + return this.set(1); + }, + + increase: function(){ + this.setStyle(this.element, 'opacity', this.now); + } + +}); + +// accordion.js + +//by Valerio Proietti (http://mad4milk.net). MIT-style license. +//accordion.js - depends on prototype.js or prototype.lite.js + moo.fx.js +//version 2.0 + +Fx.Accordion = Class.create(); +Fx.Accordion.prototype = Object.extend(new Fx.Base(), { + + extendOptions: function(options){ + Object.extend(this.options, Object.extend({ + start: 'open-first', + fixedHeight: false, + fixedWidth: false, + alwaysHide: false, + wait: false, + onActive: function(){}, + onBackground: function(){}, + height: true, + opacity: true, + width: false + }, options || {})); + }, + + initialize: function(togglers, elements, options){ + this.now = {}; + this.elements = $A(elements); + this.togglers = $A(togglers); + this.setOptions(options); + this.extendOptions(options); + this.previousClick = 'nan'; + this.togglers.each(function(tog, i){ + if (tog.onclick) tog.prevClick = tog.onclick; + else tog.prevClick = function(){}; + $(tog).onclick = function(){ + tog.prevClick(); + this.showThisHideOpen(i); + }.bind(this); + }.bind(this)); + this.h = {}; this.w = {}; this.o = {}; + this.elements.each(function(el, i){ + this.now[i+1] = {}; + el.style.height = '0'; + el.style.overflow = 'hidden'; + }.bind(this)); + switch(this.options.start){ + case 'first-open': this.elements[0].style.height = this.elements[0].scrollHeight+'px'; break; + case 'open-first': this.showThisHideOpen(0); break; + } + }, + + setNow: function(){ + for (var i in this.from){ + var iFrom = this.from[i]; + var iTo = this.to[i]; + var iNow = this.now[i] = {}; + for (var p in iFrom) iNow[p] = this.compute(iFrom[p], iTo[p]); + } + }, + + custom: function(objObjs){ + if (this.timer && this.options.wait) return; + var from = {}; + var to = {}; + for (var i in objObjs){ + var iProps = objObjs[i]; + var iFrom = from[i] = {}; + var iTo = to[i] = {}; + for (var prop in iProps){ + iFrom[prop] = iProps[prop][0]; + iTo[prop] = iProps[prop][1]; + } + } + return this._start(from, to); + }, + + hideThis: function(i){ + if (this.options.height) this.h = {'height': [this.elements[i].offsetHeight, 0]}; + if (this.options.width) this.w = {'width': [this.elements[i].offsetWidth, 0]}; + if (this.options.opacity) this.o = {'opacity': [this.now[i+1]['opacity'] || 1, 0]}; + }, + + showThis: function(i){ + if (this.options.height) this.h = {'height': [this.elements[i].offsetHeight, this.options.fixedHeight || this.elements[i].scrollHeight]}; + if (this.options.width) this.w = {'width': [this.elements[i].offsetWidth, this.options.fixedWidth || this.elements[i].scrollWidth]}; + if (this.options.opacity) this.o = {'opacity': [this.now[i+1]['opacity'] || 0, 1]}; + }, + + showThisHideOpen: function(iToShow){ + if (iToShow != this.previousClick || this.options.alwaysHide){ + this.previousClick = iToShow; + var objObjs = {}; + var err = false; + var madeInactive = false; + this.elements.each(function(el, i){ + this.now[i] = this.now[i] || {}; + if (i != iToShow){ + this.hideThis(i); + } else if (this.options.alwaysHide){ + if (el.offsetHeight == el.scrollHeight){ + this.hideThis(i); + madeInactive = true; + } else if (el.offsetHeight == 0){ + this.showThis(i); + } else { + err = true; + } + } else if (this.options.wait && this.timer){ + this.previousClick = 'nan'; + err = true; + } else { + this.showThis(i); + } + objObjs[i+1] = Object.extend(this.h, Object.extend(this.o, this.w)); + }.bind(this)); + if (err) return; + if (!madeInactive) this.options.onActive.call(this, this.togglers[iToShow], iToShow); + this.togglers.each(function(tog, i){ + if (i != iToShow || madeInactive) this.options.onBackground.call(this, tog, i); + }.bind(this)); + return this.custom(objObjs); + } + }, + + increase: function(){ + for (var i in this.now){ + var iNow = this.now[i]; + for (var p in iNow) this.setStyle(this.elements[parseInt(i)-1], p, iNow[p]); + } + } + +}); + +// moo.fx.transitions.js + +//moo.fx.transitions.js - depends on prototype.js or prototype.lite.js + moo.fx.js +//Author: Robert Penner, , modified to be used with mootools. +//License: Easing Equations v1.5, (c) 2003 Robert Penner, all rights reserved. Open Source BSD License. + +Fx.Transitions = { + + linear: function(t, b, c, d){ + return c*t/d + b; + }, + + quadIn: function(t, b, c, d){ + return c*(t/=d)*t + b; + }, + + quadOut: function(t, b, c, d){ + return -c *(t/=d)*(t-2) + b; + }, + + quadInOut: function(t, b, c, d){ + if ((t/=d/2) < 1) return c/2*t*t + b; + return -c/2 * ((--t)*(t-2) - 1) + b; + }, + + cubicIn: function(t, b, c, d){ + return c*(t/=d)*t*t + b; + }, + + cubicOut: function(t, b, c, d){ + return c*((t=t/d-1)*t*t + 1) + b; + }, + + cubicInOut: function(t, b, c, d){ + if ((t/=d/2) < 1) return c/2*t*t*t + b; + return c/2*((t-=2)*t*t + 2) + b; + }, + + quartIn: function(t, b, c, d){ + return c*(t/=d)*t*t*t + b; + }, + + quartOut: function(t, b, c, d){ + return -c * ((t=t/d-1)*t*t*t - 1) + b; + }, + + quartInOut: function(t, b, c, d){ + if ((t/=d/2) < 1) return c/2*t*t*t*t + b; + return -c/2 * ((t-=2)*t*t*t - 2) + b; + }, + + quintIn: function(t, b, c, d){ + return c*(t/=d)*t*t*t*t + b; + }, + + quintOut: function(t, b, c, d){ + return c*((t=t/d-1)*t*t*t*t + 1) + b; + }, + + quintInOut: function(t, b, c, d){ + if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b; + return c/2*((t-=2)*t*t*t*t + 2) + b; + }, + + sineIn: function(t, b, c, d){ + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }, + + sineOut: function(t, b, c, d){ + return c * Math.sin(t/d * (Math.PI/2)) + b; + }, + + sineInOut: function(t, b, c, d){ + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }, + + expoIn: function(t, b, c, d){ + return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b; + }, + + expoOut: function(t, b, c, d){ + return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; + }, + + expoInOut: function(t, b, c, d){ + if (t==0) return b; + if (t==d) return b+c; + if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b; + return c/2 * (-Math.pow(2, -10 * --t) + 2) + b; + }, + + circIn: function(t, b, c, d){ + return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b; + }, + + circOut: function(t, b, c, d){ + return c * Math.sqrt(1 - (t=t/d-1)*t) + b; + }, + + circInOut: function(t, b, c, d){ + if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b; + }, + + elasticIn: function(t, b, c, d, a, p){ + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (!a) a = 1; + if (a < Math.abs(c)){ a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin(c/a); + return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + }, + + elasticOut: function(t, b, c, d, a, p){ + if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3; if (!a) a = 1; + if (a < Math.abs(c)){ a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin(c/a); + return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b; + }, + + elasticInOut: function(t, b, c, d, a, p){ + if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5); if (!a) a = 1; + if (a < Math.abs(c)){ a=c; var s=p/4; } + else var s = p/(2*Math.PI) * Math.asin(c/a); + if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b; + return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b; + }, + + backIn: function(t, b, c, d, s){ + if (!s) s = 1.70158; + return c*(t/=d)*t*((s+1)*t - s) + b; + }, + + backOut: function(t, b, c, d, s){ + if (!s) s = 1.70158; + return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; + }, + + backInOut: function(t, b, c, d, s){ + if (!s) s = 1.70158; + if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; + return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; + }, + + bounceIn: function(t, b, c, d){ + return c - Fx.Transitions.bounceOut (d-t, 0, c, d) + b; + }, + + bounceOut: function(t, b, c, d){ + if ((t/=d) < (1/2.75)){ + return c*(7.5625*t*t) + b; + } else if (t < (2/2.75)){ + return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; + } else if (t < (2.5/2.75)){ + return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; + } else { + return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; + } + }, + + bounceInOut: function(t, b, c, d){ + if (t < d/2) return Fx.Transitions.bounceIn(t*2, 0, c, d) * .5 + b; + return Fx.Transitions.bounceOut(t*2-d, 0, c, d) * .5 + c*.5 + b; + } + +}; \ No newline at end of file diff --git a/DQM/TrackerCommon/test/js_files/scriptaculous/lib/prototype.js b/DQM/TrackerCommon/test/js_files/scriptaculous/lib/prototype.js new file mode 100644 index 0000000000000..0476b8fdccc07 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/scriptaculous/lib/prototype.js @@ -0,0 +1,2515 @@ +/* Prototype JavaScript framework, version 1.5.0 + * (c) 2005-2007 Sam Stephenson + * + * Prototype is freely distributable under the terms of an MIT-style license. + * For details, see the Prototype web site: http://prototype.conio.net/ + * +/*--------------------------------------------------------------------------*/ + +var Prototype = { + Version: '1.5.0', + BrowserFeatures: { + XPath: !!document.evaluate + }, + + ScriptFragment: '(?:)((\n|\r|.)*?)(?:<\/script>)', + emptyFunction: function() {}, + K: function(x) { return x } +} + +var Class = { + create: function() { + return function() { + this.initialize.apply(this, arguments); + } + } +} + +var Abstract = new Object(); + +Object.extend = function(destination, source) { + for (var property in source) { + destination[property] = source[property]; + } + return destination; +} + +Object.extend(Object, { + inspect: function(object) { + try { + if (object === undefined) return 'undefined'; + if (object === null) return 'null'; + return object.inspect ? object.inspect() : object.toString(); + } catch (e) { + if (e instanceof RangeError) return '...'; + throw e; + } + }, + + keys: function(object) { + var keys = []; + for (var property in object) + keys.push(property); + return keys; + }, + + values: function(object) { + var values = []; + for (var property in object) + values.push(object[property]); + return values; + }, + + clone: function(object) { + return Object.extend({}, object); + } +}); + +Function.prototype.bind = function() { + var __method = this, args = $A(arguments), object = args.shift(); + return function() { + return __method.apply(object, args.concat($A(arguments))); + } +} + +Function.prototype.bindAsEventListener = function(object) { + var __method = this, args = $A(arguments), object = args.shift(); + return function(event) { + return __method.apply(object, [( event || window.event)].concat(args).concat($A(arguments))); + } +} + +Object.extend(Number.prototype, { + toColorPart: function() { + var digits = this.toString(16); + if (this < 16) return '0' + digits; + return digits; + }, + + succ: function() { + return this + 1; + }, + + times: function(iterator) { + $R(0, this, true).each(iterator); + return this; + } +}); + +var Try = { + these: function() { + var returnValue; + + for (var i = 0, length = arguments.length; i < length; i++) { + var lambda = arguments[i]; + try { + returnValue = lambda(); + break; + } catch (e) {} + } + + return returnValue; + } +} + +/*--------------------------------------------------------------------------*/ + +var PeriodicalExecuter = Class.create(); +PeriodicalExecuter.prototype = { + initialize: function(callback, frequency) { + this.callback = callback; + this.frequency = frequency; + this.currentlyExecuting = false; + + this.registerCallback(); + }, + + registerCallback: function() { + this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + stop: function() { + if (!this.timer) return; + clearInterval(this.timer); + this.timer = null; + }, + + onTimerEvent: function() { + if (!this.currentlyExecuting) { + try { + this.currentlyExecuting = true; + this.callback(this); + } finally { + this.currentlyExecuting = false; + } + } + } +} +String.interpret = function(value){ + return value == null ? '' : String(value); +} + +Object.extend(String.prototype, { + gsub: function(pattern, replacement) { + var result = '', source = this, match; + replacement = arguments.callee.prepareReplacement(replacement); + + while (source.length > 0) { + if (match = source.match(pattern)) { + result += source.slice(0, match.index); + result += String.interpret(replacement(match)); + source = source.slice(match.index + match[0].length); + } else { + result += source, source = ''; + } + } + return result; + }, + + sub: function(pattern, replacement, count) { + replacement = this.gsub.prepareReplacement(replacement); + count = count === undefined ? 1 : count; + + return this.gsub(pattern, function(match) { + if (--count < 0) return match[0]; + return replacement(match); + }); + }, + + scan: function(pattern, iterator) { + this.gsub(pattern, iterator); + return this; + }, + + truncate: function(length, truncation) { + length = length || 30; + truncation = truncation === undefined ? '...' : truncation; + return this.length > length ? + this.slice(0, length - truncation.length) + truncation : this; + }, + + strip: function() { + return this.replace(/^\s+/, '').replace(/\s+$/, ''); + }, + + stripTags: function() { + return this.replace(/<\/?[^>]+>/gi, ''); + }, + + stripScripts: function() { + return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); + }, + + extractScripts: function() { + var matchAll = new RegExp(Prototype.ScriptFragment, 'img'); + var matchOne = new RegExp(Prototype.ScriptFragment, 'im'); + return (this.match(matchAll) || []).map(function(scriptTag) { + return (scriptTag.match(matchOne) || ['', ''])[1]; + }); + }, + + evalScripts: function() { + return this.extractScripts().map(function(script) { return eval(script) }); + }, + + escapeHTML: function() { + var div = document.createElement('div'); + var text = document.createTextNode(this); + div.appendChild(text); + return div.innerHTML; + }, + + unescapeHTML: function() { + var div = document.createElement('div'); + div.innerHTML = this.stripTags(); + return div.childNodes[0] ? (div.childNodes.length > 1 ? + $A(div.childNodes).inject('',function(memo,node){ return memo+node.nodeValue }) : + div.childNodes[0].nodeValue) : ''; + }, + + toQueryParams: function(separator) { + var match = this.strip().match(/([^?#]*)(#.*)?$/); + if (!match) return {}; + + return match[1].split(separator || '&').inject({}, function(hash, pair) { + if ((pair = pair.split('='))[0]) { + var name = decodeURIComponent(pair[0]); + var value = pair[1] ? decodeURIComponent(pair[1]) : undefined; + + if (hash[name] !== undefined) { + if (hash[name].constructor != Array) + hash[name] = [hash[name]]; + if (value) hash[name].push(value); + } + else hash[name] = value; + } + return hash; + }); + }, + + toArray: function() { + return this.split(''); + }, + + succ: function() { + return this.slice(0, this.length - 1) + + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); + }, + + camelize: function() { + var parts = this.split('-'), len = parts.length; + if (len == 1) return parts[0]; + + var camelized = this.charAt(0) == '-' + ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1) + : parts[0]; + + for (var i = 1; i < len; i++) + camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1); + + return camelized; + }, + + capitalize: function(){ + return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); + }, + + underscore: function() { + return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase(); + }, + + dasherize: function() { + return this.gsub(/_/,'-'); + }, + + inspect: function(useDoubleQuotes) { + var escapedString = this.replace(/\\/g, '\\\\'); + if (useDoubleQuotes) + return '"' + escapedString.replace(/"/g, '\\"') + '"'; + else + return "'" + escapedString.replace(/'/g, '\\\'') + "'"; + } +}); + +String.prototype.gsub.prepareReplacement = function(replacement) { + if (typeof replacement == 'function') return replacement; + var template = new Template(replacement); + return function(match) { return template.evaluate(match) }; +} + +String.prototype.parseQuery = String.prototype.toQueryParams; + +var Template = Class.create(); +Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; +Template.prototype = { + initialize: function(template, pattern) { + this.template = template.toString(); + this.pattern = pattern || Template.Pattern; + }, + + evaluate: function(object) { + return this.template.gsub(this.pattern, function(match) { + var before = match[1]; + if (before == '\\') return match[2]; + return before + String.interpret(object[match[3]]); + }); + } +} + +var $break = new Object(); +var $continue = new Object(); + +var Enumerable = { + each: function(iterator) { + var index = 0; + try { + this._each(function(value) { + try { + iterator(value, index++); + } catch (e) { + if (e != $continue) throw e; + } + }); + } catch (e) { + if (e != $break) throw e; + } + return this; + }, + + eachSlice: function(number, iterator) { + var index = -number, slices = [], array = this.toArray(); + while ((index += number) < array.length) + slices.push(array.slice(index, index+number)); + return slices.map(iterator); + }, + + all: function(iterator) { + var result = true; + this.each(function(value, index) { + result = result && !!(iterator || Prototype.K)(value, index); + if (!result) throw $break; + }); + return result; + }, + + any: function(iterator) { + var result = false; + this.each(function(value, index) { + if (result = !!(iterator || Prototype.K)(value, index)) + throw $break; + }); + return result; + }, + + collect: function(iterator) { + var results = []; + this.each(function(value, index) { + results.push((iterator || Prototype.K)(value, index)); + }); + return results; + }, + + detect: function(iterator) { + var result; + this.each(function(value, index) { + if (iterator(value, index)) { + result = value; + throw $break; + } + }); + return result; + }, + + findAll: function(iterator) { + var results = []; + this.each(function(value, index) { + if (iterator(value, index)) + results.push(value); + }); + return results; + }, + + grep: function(pattern, iterator) { + var results = []; + this.each(function(value, index) { + var stringValue = value.toString(); + if (stringValue.match(pattern)) + results.push((iterator || Prototype.K)(value, index)); + }) + return results; + }, + + include: function(object) { + var found = false; + this.each(function(value) { + if (value == object) { + found = true; + throw $break; + } + }); + return found; + }, + + inGroupsOf: function(number, fillWith) { + fillWith = fillWith === undefined ? null : fillWith; + return this.eachSlice(number, function(slice) { + while(slice.length < number) slice.push(fillWith); + return slice; + }); + }, + + inject: function(memo, iterator) { + this.each(function(value, index) { + memo = iterator(memo, value, index); + }); + return memo; + }, + + invoke: function(method) { + var args = $A(arguments).slice(1); + return this.map(function(value) { + return value[method].apply(value, args); + }); + }, + + max: function(iterator) { + var result; + this.each(function(value, index) { + value = (iterator || Prototype.K)(value, index); + if (result == undefined || value >= result) + result = value; + }); + return result; + }, + + min: function(iterator) { + var result; + this.each(function(value, index) { + value = (iterator || Prototype.K)(value, index); + if (result == undefined || value < result) + result = value; + }); + return result; + }, + + partition: function(iterator) { + var trues = [], falses = []; + this.each(function(value, index) { + ((iterator || Prototype.K)(value, index) ? + trues : falses).push(value); + }); + return [trues, falses]; + }, + + pluck: function(property) { + var results = []; + this.each(function(value, index) { + results.push(value[property]); + }); + return results; + }, + + reject: function(iterator) { + var results = []; + this.each(function(value, index) { + if (!iterator(value, index)) + results.push(value); + }); + return results; + }, + + sortBy: function(iterator) { + return this.map(function(value, index) { + return {value: value, criteria: iterator(value, index)}; + }).sort(function(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }).pluck('value'); + }, + + toArray: function() { + return this.map(); + }, + + zip: function() { + var iterator = Prototype.K, args = $A(arguments); + if (typeof args.last() == 'function') + iterator = args.pop(); + + var collections = [this].concat(args).map($A); + return this.map(function(value, index) { + return iterator(collections.pluck(index)); + }); + }, + + size: function() { + return this.toArray().length; + }, + + inspect: function() { + return '#'; + } +} + +Object.extend(Enumerable, { + map: Enumerable.collect, + find: Enumerable.detect, + select: Enumerable.findAll, + member: Enumerable.include, + entries: Enumerable.toArray +}); +var $A = Array.from = function(iterable) { + if (!iterable) return []; + if (iterable.toArray) { + return iterable.toArray(); + } else { + var results = []; + for (var i = 0, length = iterable.length; i < length; i++) + results.push(iterable[i]); + return results; + } +} + +Object.extend(Array.prototype, Enumerable); + +if (!Array.prototype._reverse) + Array.prototype._reverse = Array.prototype.reverse; + +Object.extend(Array.prototype, { + _each: function(iterator) { + for (var i = 0, length = this.length; i < length; i++) + iterator(this[i]); + }, + + clear: function() { + this.length = 0; + return this; + }, + + first: function() { + return this[0]; + }, + + last: function() { + return this[this.length - 1]; + }, + + compact: function() { + return this.select(function(value) { + return value != null; + }); + }, + + flatten: function() { + return this.inject([], function(array, value) { + return array.concat(value && value.constructor == Array ? + value.flatten() : [value]); + }); + }, + + without: function() { + var values = $A(arguments); + return this.select(function(value) { + return !values.include(value); + }); + }, + + indexOf: function(object) { + for (var i = 0, length = this.length; i < length; i++) + if (this[i] == object) return i; + return -1; + }, + + reverse: function(inline) { + return (inline !== false ? this : this.toArray())._reverse(); + }, + + reduce: function() { + return this.length > 1 ? this : this[0]; + }, + + uniq: function() { + return this.inject([], function(array, value) { + return array.include(value) ? array : array.concat([value]); + }); + }, + + clone: function() { + return [].concat(this); + }, + + size: function() { + return this.length; + }, + + inspect: function() { + return '[' + this.map(Object.inspect).join(', ') + ']'; + } +}); + +Array.prototype.toArray = Array.prototype.clone; + +function $w(string){ + string = string.strip(); + return string ? string.split(/\s+/) : []; +} + +if(window.opera){ + Array.prototype.concat = function(){ + var array = []; + for(var i = 0, length = this.length; i < length; i++) array.push(this[i]); + for(var i = 0, length = arguments.length; i < length; i++) { + if(arguments[i].constructor == Array) { + for(var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++) + array.push(arguments[i][j]); + } else { + array.push(arguments[i]); + } + } + return array; + } +} +var Hash = function(obj) { + Object.extend(this, obj || {}); +}; + +Object.extend(Hash, { + toQueryString: function(obj) { + var parts = []; + + this.prototype._each.call(obj, function(pair) { + if (!pair.key) return; + + if (pair.value && pair.value.constructor == Array) { + var values = pair.value.compact(); + if (values.length < 2) pair.value = values.reduce(); + else { + key = encodeURIComponent(pair.key); + values.each(function(value) { + value = value != undefined ? encodeURIComponent(value) : ''; + parts.push(key + '=' + encodeURIComponent(value)); + }); + return; + } + } + if (pair.value == undefined) pair[1] = ''; + parts.push(pair.map(encodeURIComponent).join('=')); + }); + + return parts.join('&'); + } +}); + +Object.extend(Hash.prototype, Enumerable); +Object.extend(Hash.prototype, { + _each: function(iterator) { + for (var key in this) { + var value = this[key]; + if (value && value == Hash.prototype[key]) continue; + + var pair = [key, value]; + pair.key = key; + pair.value = value; + iterator(pair); + } + }, + + keys: function() { + return this.pluck('key'); + }, + + values: function() { + return this.pluck('value'); + }, + + merge: function(hash) { + return $H(hash).inject(this, function(mergedHash, pair) { + mergedHash[pair.key] = pair.value; + return mergedHash; + }); + }, + + remove: function() { + var result; + for(var i = 0, length = arguments.length; i < length; i++) { + var value = this[arguments[i]]; + if (value !== undefined){ + if (result === undefined) result = value; + else { + if (result.constructor != Array) result = [result]; + result.push(value) + } + } + delete this[arguments[i]]; + } + return result; + }, + + toQueryString: function() { + return Hash.toQueryString(this); + }, + + inspect: function() { + return '#'; + } +}); + +function $H(object) { + if (object && object.constructor == Hash) return object; + return new Hash(object); +}; +ObjectRange = Class.create(); +Object.extend(ObjectRange.prototype, Enumerable); +Object.extend(ObjectRange.prototype, { + initialize: function(start, end, exclusive) { + this.start = start; + this.end = end; + this.exclusive = exclusive; + }, + + _each: function(iterator) { + var value = this.start; + while (this.include(value)) { + iterator(value); + value = value.succ(); + } + }, + + include: function(value) { + if (value < this.start) + return false; + if (this.exclusive) + return value < this.end; + return value <= this.end; + } +}); + +var $R = function(start, end, exclusive) { + return new ObjectRange(start, end, exclusive); +} + +var Ajax = { + getTransport: function() { + return Try.these( + function() {return new XMLHttpRequest()}, + function() {return new ActiveXObject('Msxml2.XMLHTTP')}, + function() {return new ActiveXObject('Microsoft.XMLHTTP')} + ) || false; + }, + + activeRequestCount: 0 +} + +Ajax.Responders = { + responders: [], + + _each: function(iterator) { + this.responders._each(iterator); + }, + + register: function(responder) { + if (!this.include(responder)) + this.responders.push(responder); + }, + + unregister: function(responder) { + this.responders = this.responders.without(responder); + }, + + dispatch: function(callback, request, transport, json) { + this.each(function(responder) { + if (typeof responder[callback] == 'function') { + try { + responder[callback].apply(responder, [request, transport, json]); + } catch (e) {} + } + }); + } +}; + +Object.extend(Ajax.Responders, Enumerable); + +Ajax.Responders.register({ + onCreate: function() { + Ajax.activeRequestCount++; + }, + onComplete: function() { + Ajax.activeRequestCount--; + } +}); + +Ajax.Base = function() {}; +Ajax.Base.prototype = { + setOptions: function(options) { + this.options = { + method: 'post', + asynchronous: true, + contentType: 'application/x-www-form-urlencoded', + encoding: 'UTF-8', + parameters: '' + } + Object.extend(this.options, options || {}); + + this.options.method = this.options.method.toLowerCase(); + if (typeof this.options.parameters == 'string') + this.options.parameters = this.options.parameters.toQueryParams(); + } +} + +Ajax.Request = Class.create(); +Ajax.Request.Events = + ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; + +Ajax.Request.prototype = Object.extend(new Ajax.Base(), { + _complete: false, + + initialize: function(url, options) { + this.transport = Ajax.getTransport(); + this.setOptions(options); + this.request(url); + }, + + request: function(url) { + this.url = url; + this.method = this.options.method; + var params = this.options.parameters; + + if (!['get', 'post'].include(this.method)) { + // simulate other verbs over post + params['_method'] = this.method; + this.method = 'post'; + } + + params = Hash.toQueryString(params); + if (params && /Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_=' + + // when GET, append parameters to URL + if (this.method == 'get' && params) + this.url += (this.url.indexOf('?') > -1 ? '&' : '?') + params; + + try { + Ajax.Responders.dispatch('onCreate', this, this.transport); + + this.transport.open(this.method.toUpperCase(), this.url, + this.options.asynchronous); + + if (this.options.asynchronous) + setTimeout(function() { this.respondToReadyState(1) }.bind(this), 10); + + this.transport.onreadystatechange = this.onStateChange.bind(this); + this.setRequestHeaders(); + + var body = this.method == 'post' ? (this.options.postBody || params) : null; + + this.transport.send(body); + + /* Force Firefox to handle ready state 4 for synchronous requests */ + if (!this.options.asynchronous && this.transport.overrideMimeType) + this.onStateChange(); + + } + catch (e) { + this.dispatchException(e); + } + }, + + onStateChange: function() { + var readyState = this.transport.readyState; + if (readyState > 1 && !((readyState == 4) && this._complete)) + this.respondToReadyState(this.transport.readyState); + }, + + setRequestHeaders: function() { + var headers = { + 'X-Requested-With': 'XMLHttpRequest', + 'X-Prototype-Version': Prototype.Version, + 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' + }; + + if (this.method == 'post') { + headers['Content-type'] = this.options.contentType + + (this.options.encoding ? '; charset=' + this.options.encoding : ''); + + /* Force "Connection: close" for older Mozilla browsers to work + * around a bug where XMLHttpRequest sends an incorrect + * Content-length header. See Mozilla Bugzilla #246651. + */ + if (this.transport.overrideMimeType && + (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) + headers['Connection'] = 'close'; + } + + // user-defined headers + if (typeof this.options.requestHeaders == 'object') { + var extras = this.options.requestHeaders; + + if (typeof extras.push == 'function') + for (var i = 0, length = extras.length; i < length; i += 2) + headers[extras[i]] = extras[i+1]; + else + $H(extras).each(function(pair) { headers[pair.key] = pair.value }); + } + + for (var name in headers) + this.transport.setRequestHeader(name, headers[name]); + }, + + success: function() { + return !this.transport.status + || (this.transport.status >= 200 && this.transport.status < 300); + }, + + respondToReadyState: function(readyState) { + var state = Ajax.Request.Events[readyState]; + var transport = this.transport, json = this.evalJSON(); + + if (state == 'Complete') { + try { + this._complete = true; + (this.options['on' + this.transport.status] + || this.options['on' + (this.success() ? 'Success' : 'Failure')] + || Prototype.emptyFunction)(transport, json); + } catch (e) { + this.dispatchException(e); + } + + if ((this.getHeader('Content-type') || 'text/javascript').strip(). + match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)) + this.evalResponse(); + } + + try { + (this.options['on' + state] || Prototype.emptyFunction)(transport, json); + Ajax.Responders.dispatch('on' + state, this, transport, json); + } catch (e) { + this.dispatchException(e); + } + + if (state == 'Complete') { + // avoid memory leak in MSIE: clean up + this.transport.onreadystatechange = Prototype.emptyFunction; + } + }, + + getHeader: function(name) { + try { + return this.transport.getResponseHeader(name); + } catch (e) { return null } + }, + + evalJSON: function() { + try { + var json = this.getHeader('X-JSON'); + return json ? eval('(' + json + ')') : null; + } catch (e) { return null } + }, + + evalResponse: function() { + try { + return eval(this.transport.responseText); + } catch (e) { + this.dispatchException(e); + } + }, + + dispatchException: function(exception) { + (this.options.onException || Prototype.emptyFunction)(this, exception); + Ajax.Responders.dispatch('onException', this, exception); + } +}); + +Ajax.Updater = Class.create(); + +Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), { + initialize: function(container, url, options) { + this.container = { + success: (container.success || container), + failure: (container.failure || (container.success ? null : container)) + } + + this.transport = Ajax.getTransport(); + this.setOptions(options); + + var onComplete = this.options.onComplete || Prototype.emptyFunction; + this.options.onComplete = (function(transport, param) { + this.updateContent(); + onComplete(transport, param); + }).bind(this); + + this.request(url); + }, + + updateContent: function() { + var receiver = this.container[this.success() ? 'success' : 'failure']; + var response = this.transport.responseText; + + if (!this.options.evalScripts) response = response.stripScripts(); + + if (receiver = $(receiver)) { + if (this.options.insertion) + new this.options.insertion(receiver, response); + else + receiver.update(response); + } + + if (this.success()) { + if (this.onComplete) + setTimeout(this.onComplete.bind(this), 10); + } + } +}); + +Ajax.PeriodicalUpdater = Class.create(); +Ajax.PeriodicalUpdater.prototype = Object.extend(new Ajax.Base(), { + initialize: function(container, url, options) { + this.setOptions(options); + this.onComplete = this.options.onComplete; + + this.frequency = (this.options.frequency || 2); + this.decay = (this.options.decay || 1); + + this.updater = {}; + this.container = container; + this.url = url; + + this.start(); + }, + + start: function() { + this.options.onComplete = this.updateComplete.bind(this); + this.onTimerEvent(); + }, + + stop: function() { + this.updater.options.onComplete = undefined; + clearTimeout(this.timer); + (this.onComplete || Prototype.emptyFunction).apply(this, arguments); + }, + + updateComplete: function(request) { + if (this.options.decay) { + this.decay = (request.responseText == this.lastText ? + this.decay * this.options.decay : 1); + + this.lastText = request.responseText; + } + this.timer = setTimeout(this.onTimerEvent.bind(this), + this.decay * this.frequency * 1000); + }, + + onTimerEvent: function() { + this.updater = new Ajax.Updater(this.container, this.url, this.options); + } +}); +function $(element) { + if (arguments.length > 1) { + for (var i = 0, elements = [], length = arguments.length; i < length; i++) + elements.push($(arguments[i])); + return elements; + } + if (typeof element == 'string') + element = document.getElementById(element); + return Element.extend(element); +} + +if (Prototype.BrowserFeatures.XPath) { + document._getElementsByXPath = function(expression, parentElement) { + var results = []; + var query = document.evaluate(expression, $(parentElement) || document, + null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + for (var i = 0, length = query.snapshotLength; i < length; i++) + results.push(query.snapshotItem(i)); + return results; + }; +} + +document.getElementsByClassName = function(className, parentElement) { + if (Prototype.BrowserFeatures.XPath) { + var q = ".//*[contains(concat(' ', @class, ' '), ' " + className + " ')]"; + return document._getElementsByXPath(q, parentElement); + } else { + var children = ($(parentElement) || document.body).getElementsByTagName('*'); + var elements = [], child; + for (var i = 0, length = children.length; i < length; i++) { + child = children[i]; + if (Element.hasClassName(child, className)) + elements.push(Element.extend(child)); + } + return elements; + } +}; + +/*--------------------------------------------------------------------------*/ + +if (!window.Element) + var Element = new Object(); + +Element.extend = function(element) { + if (!element || _nativeExtensions || element.nodeType == 3) return element; + + if (!element._extended && element.tagName && element != window) { + var methods = Object.clone(Element.Methods), cache = Element.extend.cache; + + if (element.tagName == 'FORM') + Object.extend(methods, Form.Methods); + if (['INPUT', 'TEXTAREA', 'SELECT'].include(element.tagName)) + Object.extend(methods, Form.Element.Methods); + + Object.extend(methods, Element.Methods.Simulated); + + for (var property in methods) { + var value = methods[property]; + if (typeof value == 'function' && !(property in element)) + element[property] = cache.findOrStore(value); + } + } + + element._extended = true; + return element; +}; + +Element.extend.cache = { + findOrStore: function(value) { + return this[value] = this[value] || function() { + return value.apply(null, [this].concat($A(arguments))); + } + } +}; + +Element.Methods = { + visible: function(element) { + return $(element).style.display != 'none'; + }, + + toggle: function(element) { + element = $(element); + Element[Element.visible(element) ? 'hide' : 'show'](element); + return element; + }, + + hide: function(element) { + $(element).style.display = 'none'; + return element; + }, + + show: function(element) { + $(element).style.display = ''; + return element; + }, + + remove: function(element) { + element = $(element); + element.parentNode.removeChild(element); + return element; + }, + + update: function(element, html) { + html = typeof html == 'undefined' ? '' : html.toString(); + $(element).innerHTML = html.stripScripts(); + setTimeout(function() {html.evalScripts()}, 10); + return element; + }, + + replace: function(element, html) { + element = $(element); + html = typeof html == 'undefined' ? '' : html.toString(); + if (element.outerHTML) { + element.outerHTML = html.stripScripts(); + } else { + var range = element.ownerDocument.createRange(); + range.selectNodeContents(element); + element.parentNode.replaceChild( + range.createContextualFragment(html.stripScripts()), element); + } + setTimeout(function() {html.evalScripts()}, 10); + return element; + }, + + inspect: function(element) { + element = $(element); + var result = '<' + element.tagName.toLowerCase(); + $H({'id': 'id', 'className': 'class'}).each(function(pair) { + var property = pair.first(), attribute = pair.last(); + var value = (element[property] || '').toString(); + if (value) result += ' ' + attribute + '=' + value.inspect(true); + }); + return result + '>'; + }, + + recursivelyCollect: function(element, property) { + element = $(element); + var elements = []; + while (element = element[property]) + if (element.nodeType == 1) + elements.push(Element.extend(element)); + return elements; + }, + + ancestors: function(element) { + return $(element).recursivelyCollect('parentNode'); + }, + + descendants: function(element) { + return $A($(element).getElementsByTagName('*')); + }, + + immediateDescendants: function(element) { + if (!(element = $(element).firstChild)) return []; + while (element && element.nodeType != 1) element = element.nextSibling; + if (element) return [element].concat($(element).nextSiblings()); + return []; + }, + + previousSiblings: function(element) { + return $(element).recursivelyCollect('previousSibling'); + }, + + nextSiblings: function(element) { + return $(element).recursivelyCollect('nextSibling'); + }, + + siblings: function(element) { + element = $(element); + return element.previousSiblings().reverse().concat(element.nextSiblings()); + }, + + match: function(element, selector) { + if (typeof selector == 'string') + selector = new Selector(selector); + return selector.match($(element)); + }, + + up: function(element, expression, index) { + return Selector.findElement($(element).ancestors(), expression, index); + }, + + down: function(element, expression, index) { + return Selector.findElement($(element).descendants(), expression, index); + }, + + previous: function(element, expression, index) { + return Selector.findElement($(element).previousSiblings(), expression, index); + }, + + next: function(element, expression, index) { + return Selector.findElement($(element).nextSiblings(), expression, index); + }, + + getElementsBySelector: function() { + var args = $A(arguments), element = $(args.shift()); + return Selector.findChildElements(element, args); + }, + + getElementsByClassName: function(element, className) { + return document.getElementsByClassName(className, element); + }, + + readAttribute: function(element, name) { + element = $(element); + if (document.all && !window.opera) { + var t = Element._attributeTranslations; + if (t.values[name]) return t.values[name](element, name); + if (t.names[name]) name = t.names[name]; + var attribute = element.attributes[name]; + if(attribute) return attribute.nodeValue; + } + return element.getAttribute(name); + }, + + getHeight: function(element) { + return $(element).getDimensions().height; + }, + + getWidth: function(element) { + return $(element).getDimensions().width; + }, + + classNames: function(element) { + return new Element.ClassNames(element); + }, + + hasClassName: function(element, className) { + if (!(element = $(element))) return; + var elementClassName = element.className; + if (elementClassName.length == 0) return false; + if (elementClassName == className || + elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) + return true; + return false; + }, + + addClassName: function(element, className) { + if (!(element = $(element))) return; + Element.classNames(element).add(className); + return element; + }, + + removeClassName: function(element, className) { + if (!(element = $(element))) return; + Element.classNames(element).remove(className); + return element; + }, + + toggleClassName: function(element, className) { + if (!(element = $(element))) return; + Element.classNames(element)[element.hasClassName(className) ? 'remove' : 'add'](className); + return element; + }, + + observe: function() { + Event.observe.apply(Event, arguments); + return $A(arguments).first(); + }, + + stopObserving: function() { + Event.stopObserving.apply(Event, arguments); + return $A(arguments).first(); + }, + + // removes whitespace-only text node children + cleanWhitespace: function(element) { + element = $(element); + var node = element.firstChild; + while (node) { + var nextNode = node.nextSibling; + if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) + element.removeChild(node); + node = nextNode; + } + return element; + }, + + empty: function(element) { + return $(element).innerHTML.match(/^\s*$/); + }, + + descendantOf: function(element, ancestor) { + element = $(element), ancestor = $(ancestor); + while (element = element.parentNode) + if (element == ancestor) return true; + return false; + }, + + scrollTo: function(element) { + element = $(element); + var pos = Position.cumulativeOffset(element); + window.scrollTo(pos[0], pos[1]); + return element; + }, + + getStyle: function(element, style) { + element = $(element); + if (['float','cssFloat'].include(style)) + style = (typeof element.style.styleFloat != 'undefined' ? 'styleFloat' : 'cssFloat'); + style = style.camelize(); + var value = element.style[style]; + if (!value) { + if (document.defaultView && document.defaultView.getComputedStyle) { + var css = document.defaultView.getComputedStyle(element, null); + value = css ? css[style] : null; + } else if (element.currentStyle) { + value = element.currentStyle[style]; + } + } + + if((value == 'auto') && ['width','height'].include(style) && (element.getStyle('display') != 'none')) + value = element['offset'+style.capitalize()] + 'px'; + + if (window.opera && ['left', 'top', 'right', 'bottom'].include(style)) + if (Element.getStyle(element, 'position') == 'static') value = 'auto'; + if(style == 'opacity') { + if(value) return parseFloat(value); + if(value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) + if(value[1]) return parseFloat(value[1]) / 100; + return 1.0; + } + return value == 'auto' ? null : value; + }, + + setStyle: function(element, style) { + element = $(element); + for (var name in style) { + var value = style[name]; + if(name == 'opacity') { + if (value == 1) { + value = (/Gecko/.test(navigator.userAgent) && + !/Konqueror|Safari|KHTML/.test(navigator.userAgent)) ? 0.999999 : 1.0; + if(/MSIE/.test(navigator.userAgent) && !window.opera) + element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,''); + } else if(value === '') { + if(/MSIE/.test(navigator.userAgent) && !window.opera) + element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,''); + } else { + if(value < 0.00001) value = 0; + if(/MSIE/.test(navigator.userAgent) && !window.opera) + element.style.filter = element.getStyle('filter').replace(/alpha\([^\)]*\)/gi,'') + + 'alpha(opacity='+value*100+')'; + } + } else if(['float','cssFloat'].include(name)) name = (typeof element.style.styleFloat != 'undefined') ? 'styleFloat' : 'cssFloat'; + element.style[name.camelize()] = value; + } + return element; + }, + + getDimensions: function(element) { + element = $(element); + var display = $(element).getStyle('display'); + if (display != 'none' && display != null) // Safari bug + return {width: element.offsetWidth, height: element.offsetHeight}; + + // All *Width and *Height properties give 0 on elements with display none, + // so enable the element temporarily + var els = element.style; + var originalVisibility = els.visibility; + var originalPosition = els.position; + var originalDisplay = els.display; + els.visibility = 'hidden'; + els.position = 'absolute'; + els.display = 'block'; + var originalWidth = element.clientWidth; + var originalHeight = element.clientHeight; + els.display = originalDisplay; + els.position = originalPosition; + els.visibility = originalVisibility; + return {width: originalWidth, height: originalHeight}; + }, + + makePositioned: function(element) { + element = $(element); + var pos = Element.getStyle(element, 'position'); + if (pos == 'static' || !pos) { + element._madePositioned = true; + element.style.position = 'relative'; + // Opera returns the offset relative to the positioning context, when an + // element is position relative but top and left have not been defined + if (window.opera) { + element.style.top = 0; + element.style.left = 0; + } + } + return element; + }, + + undoPositioned: function(element) { + element = $(element); + if (element._madePositioned) { + element._madePositioned = undefined; + element.style.position = + element.style.top = + element.style.left = + element.style.bottom = + element.style.right = ''; + } + return element; + }, + + makeClipping: function(element) { + element = $(element); + if (element._overflow) return element; + element._overflow = element.style.overflow || 'auto'; + if ((Element.getStyle(element, 'overflow') || 'visible') != 'hidden') + element.style.overflow = 'hidden'; + return element; + }, + + undoClipping: function(element) { + element = $(element); + if (!element._overflow) return element; + element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; + element._overflow = null; + return element; + } +}; + +Object.extend(Element.Methods, {childOf: Element.Methods.descendantOf}); + +Element._attributeTranslations = {}; + +Element._attributeTranslations.names = { + colspan: "colSpan", + rowspan: "rowSpan", + valign: "vAlign", + datetime: "dateTime", + accesskey: "accessKey", + tabindex: "tabIndex", + enctype: "encType", + maxlength: "maxLength", + readonly: "readOnly", + longdesc: "longDesc" +}; + +Element._attributeTranslations.values = { + _getAttr: function(element, attribute) { + return element.getAttribute(attribute, 2); + }, + + _flag: function(element, attribute) { + return $(element).hasAttribute(attribute) ? attribute : null; + }, + + style: function(element) { + return element.style.cssText.toLowerCase(); + }, + + title: function(element) { + var node = element.getAttributeNode('title'); + return node.specified ? node.nodeValue : null; + } +}; + +Object.extend(Element._attributeTranslations.values, { + href: Element._attributeTranslations.values._getAttr, + src: Element._attributeTranslations.values._getAttr, + disabled: Element._attributeTranslations.values._flag, + checked: Element._attributeTranslations.values._flag, + readonly: Element._attributeTranslations.values._flag, + multiple: Element._attributeTranslations.values._flag +}); + +Element.Methods.Simulated = { + hasAttribute: function(element, attribute) { + var t = Element._attributeTranslations; + attribute = t.names[attribute] || attribute; + return $(element).getAttributeNode(attribute).specified; + } +}; + +// IE is missing .innerHTML support for TABLE-related elements +if (document.all && !window.opera){ + Element.Methods.update = function(element, html) { + element = $(element); + html = typeof html == 'undefined' ? '' : html.toString(); + var tagName = element.tagName.toUpperCase(); + if (['THEAD','TBODY','TR','TD'].include(tagName)) { + var div = document.createElement('div'); + switch (tagName) { + case 'THEAD': + case 'TBODY': + div.innerHTML = '' + html.stripScripts() + '
    '; + depth = 2; + break; + case 'TR': + div.innerHTML = '' + html.stripScripts() + '
    '; + depth = 3; + break; + case 'TD': + div.innerHTML = '
    ' + html.stripScripts() + '
    '; + depth = 4; + } + $A(element.childNodes).each(function(node){ + element.removeChild(node) + }); + depth.times(function(){ div = div.firstChild }); + + $A(div.childNodes).each( + function(node){ element.appendChild(node) }); + } else { + element.innerHTML = html.stripScripts(); + } + setTimeout(function() {html.evalScripts()}, 10); + return element; + } +}; + +Object.extend(Element, Element.Methods); + +var _nativeExtensions = false; + +if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)) + ['', 'Form', 'Input', 'TextArea', 'Select'].each(function(tag) { + var className = 'HTML' + tag + 'Element'; + if(window[className]) return; + var klass = window[className] = {}; + klass.prototype = document.createElement(tag ? tag.toLowerCase() : 'div').__proto__; + }); + +Element.addMethods = function(methods) { + Object.extend(Element.Methods, methods || {}); + + function copy(methods, destination, onlyIfAbsent) { + onlyIfAbsent = onlyIfAbsent || false; + var cache = Element.extend.cache; + for (var property in methods) { + var value = methods[property]; + if (!onlyIfAbsent || !(property in destination)) + destination[property] = cache.findOrStore(value); + } + } + + if (typeof HTMLElement != 'undefined') { + copy(Element.Methods, HTMLElement.prototype); + copy(Element.Methods.Simulated, HTMLElement.prototype, true); + copy(Form.Methods, HTMLFormElement.prototype); + [HTMLInputElement, HTMLTextAreaElement, HTMLSelectElement].each(function(klass) { + copy(Form.Element.Methods, klass.prototype); + }); + _nativeExtensions = true; + } +} + +var Toggle = new Object(); +Toggle.display = Element.toggle; + +/*--------------------------------------------------------------------------*/ + +Abstract.Insertion = function(adjacency) { + this.adjacency = adjacency; +} + +Abstract.Insertion.prototype = { + initialize: function(element, content) { + this.element = $(element); + this.content = content.stripScripts(); + + if (this.adjacency && this.element.insertAdjacentHTML) { + try { + this.element.insertAdjacentHTML(this.adjacency, this.content); + } catch (e) { + var tagName = this.element.tagName.toUpperCase(); + if (['TBODY', 'TR'].include(tagName)) { + this.insertContent(this.contentFromAnonymousTable()); + } else { + throw e; + } + } + } else { + this.range = this.element.ownerDocument.createRange(); + if (this.initializeRange) this.initializeRange(); + this.insertContent([this.range.createContextualFragment(this.content)]); + } + + setTimeout(function() {content.evalScripts()}, 10); + }, + + contentFromAnonymousTable: function() { + var div = document.createElement('div'); + div.innerHTML = '' + this.content + '
    '; + return $A(div.childNodes[0].childNodes[0].childNodes); + } +} + +var Insertion = new Object(); + +Insertion.Before = Class.create(); +Insertion.Before.prototype = Object.extend(new Abstract.Insertion('beforeBegin'), { + initializeRange: function() { + this.range.setStartBefore(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.parentNode.insertBefore(fragment, this.element); + }).bind(this)); + } +}); + +Insertion.Top = Class.create(); +Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), { + initializeRange: function() { + this.range.selectNodeContents(this.element); + this.range.collapse(true); + }, + + insertContent: function(fragments) { + fragments.reverse(false).each((function(fragment) { + this.element.insertBefore(fragment, this.element.firstChild); + }).bind(this)); + } +}); + +Insertion.Bottom = Class.create(); +Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion('beforeEnd'), { + initializeRange: function() { + this.range.selectNodeContents(this.element); + this.range.collapse(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.appendChild(fragment); + }).bind(this)); + } +}); + +Insertion.After = Class.create(); +Insertion.After.prototype = Object.extend(new Abstract.Insertion('afterEnd'), { + initializeRange: function() { + this.range.setStartAfter(this.element); + }, + + insertContent: function(fragments) { + fragments.each((function(fragment) { + this.element.parentNode.insertBefore(fragment, + this.element.nextSibling); + }).bind(this)); + } +}); + +/*--------------------------------------------------------------------------*/ + +Element.ClassNames = Class.create(); +Element.ClassNames.prototype = { + initialize: function(element) { + this.element = $(element); + }, + + _each: function(iterator) { + this.element.className.split(/\s+/).select(function(name) { + return name.length > 0; + })._each(iterator); + }, + + set: function(className) { + this.element.className = className; + }, + + add: function(classNameToAdd) { + if (this.include(classNameToAdd)) return; + this.set($A(this).concat(classNameToAdd).join(' ')); + }, + + remove: function(classNameToRemove) { + if (!this.include(classNameToRemove)) return; + this.set($A(this).without(classNameToRemove).join(' ')); + }, + + toString: function() { + return $A(this).join(' '); + } +}; + +Object.extend(Element.ClassNames.prototype, Enumerable); +var Selector = Class.create(); +Selector.prototype = { + initialize: function(expression) { + this.params = {classNames: []}; + this.expression = expression.toString().strip(); + this.parseExpression(); + this.compileMatcher(); + }, + + parseExpression: function() { + function abort(message) { throw 'Parse error in selector: ' + message; } + + if (this.expression == '') abort('empty expression'); + + var params = this.params, expr = this.expression, match, modifier, clause, rest; + while (match = expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)) { + params.attributes = params.attributes || []; + params.attributes.push({name: match[2], operator: match[3], value: match[4] || match[5] || ''}); + expr = match[1]; + } + + if (expr == '*') return this.params.wildcard = true; + + while (match = expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)) { + modifier = match[1], clause = match[2], rest = match[3]; + switch (modifier) { + case '#': params.id = clause; break; + case '.': params.classNames.push(clause); break; + case '': + case undefined: params.tagName = clause.toUpperCase(); break; + default: abort(expr.inspect()); + } + expr = rest; + } + + if (expr.length > 0) abort(expr.inspect()); + }, + + buildMatchExpression: function() { + var params = this.params, conditions = [], clause; + + if (params.wildcard) + conditions.push('true'); + if (clause = params.id) + conditions.push('element.readAttribute("id") == ' + clause.inspect()); + if (clause = params.tagName) + conditions.push('element.tagName.toUpperCase() == ' + clause.inspect()); + if ((clause = params.classNames).length > 0) + for (var i = 0, length = clause.length; i < length; i++) + conditions.push('element.hasClassName(' + clause[i].inspect() + ')'); + if (clause = params.attributes) { + clause.each(function(attribute) { + var value = 'element.readAttribute(' + attribute.name.inspect() + ')'; + var splitValueBy = function(delimiter) { + return value + ' && ' + value + '.split(' + delimiter.inspect() + ')'; + } + + switch (attribute.operator) { + case '=': conditions.push(value + ' == ' + attribute.value.inspect()); break; + case '~=': conditions.push(splitValueBy(' ') + '.include(' + attribute.value.inspect() + ')'); break; + case '|=': conditions.push( + splitValueBy('-') + '.first().toUpperCase() == ' + attribute.value.toUpperCase().inspect() + ); break; + case '!=': conditions.push(value + ' != ' + attribute.value.inspect()); break; + case '': + case undefined: conditions.push('element.hasAttribute(' + attribute.name.inspect() + ')'); break; + default: throw 'Unknown operator ' + attribute.operator + ' in selector'; + } + }); + } + + return conditions.join(' && '); + }, + + compileMatcher: function() { + this.match = new Function('element', 'if (!element.tagName) return false; \ + element = $(element); \ + return ' + this.buildMatchExpression()); + }, + + findElements: function(scope) { + var element; + + if (element = $(this.params.id)) + if (this.match(element)) + if (!scope || Element.childOf(element, scope)) + return [element]; + + scope = (scope || document).getElementsByTagName(this.params.tagName || '*'); + + var results = []; + for (var i = 0, length = scope.length; i < length; i++) + if (this.match(element = scope[i])) + results.push(Element.extend(element)); + + return results; + }, + + toString: function() { + return this.expression; + } +} + +Object.extend(Selector, { + matchElements: function(elements, expression) { + var selector = new Selector(expression); + return elements.select(selector.match.bind(selector)).map(Element.extend); + }, + + findElement: function(elements, expression, index) { + if (typeof expression == 'number') index = expression, expression = false; + return Selector.matchElements(elements, expression || '*')[index || 0]; + }, + + findChildElements: function(element, expressions) { + return expressions.map(function(expression) { + return expression.match(/[^\s"]+(?:"[^"]*"[^\s"]+)*/g).inject([null], function(results, expr) { + var selector = new Selector(expr); + return results.inject([], function(elements, result) { + return elements.concat(selector.findElements(result || element)); + }); + }); + }).flatten(); + } +}); + +function $$() { + return Selector.findChildElements(document, $A(arguments)); +} +var Form = { + reset: function(form) { + $(form).reset(); + return form; + }, + + serializeElements: function(elements, getHash) { + var data = elements.inject({}, function(result, element) { + if (!element.disabled && element.name) { + var key = element.name, value = $(element).getValue(); + if (value != undefined) { + if (result[key]) { + if (result[key].constructor != Array) result[key] = [result[key]]; + result[key].push(value); + } + else result[key] = value; + } + } + return result; + }); + + return getHash ? data : Hash.toQueryString(data); + } +}; + +Form.Methods = { + serialize: function(form, getHash) { + return Form.serializeElements(Form.getElements(form), getHash); + }, + + getElements: function(form) { + return $A($(form).getElementsByTagName('*')).inject([], + function(elements, child) { + if (Form.Element.Serializers[child.tagName.toLowerCase()]) + elements.push(Element.extend(child)); + return elements; + } + ); + }, + + getInputs: function(form, typeName, name) { + form = $(form); + var inputs = form.getElementsByTagName('input'); + + if (!typeName && !name) return $A(inputs).map(Element.extend); + + for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { + var input = inputs[i]; + if ((typeName && input.type != typeName) || (name && input.name != name)) + continue; + matchingInputs.push(Element.extend(input)); + } + + return matchingInputs; + }, + + disable: function(form) { + form = $(form); + form.getElements().each(function(element) { + element.blur(); + element.disabled = 'true'; + }); + return form; + }, + + enable: function(form) { + form = $(form); + form.getElements().each(function(element) { + element.disabled = ''; + }); + return form; + }, + + findFirstElement: function(form) { + return $(form).getElements().find(function(element) { + return element.type != 'hidden' && !element.disabled && + ['input', 'select', 'textarea'].include(element.tagName.toLowerCase()); + }); + }, + + focusFirstElement: function(form) { + form = $(form); + form.findFirstElement().activate(); + return form; + } +} + +Object.extend(Form, Form.Methods); + +/*--------------------------------------------------------------------------*/ + +Form.Element = { + focus: function(element) { + $(element).focus(); + return element; + }, + + select: function(element) { + $(element).select(); + return element; + } +} + +Form.Element.Methods = { + serialize: function(element) { + element = $(element); + if (!element.disabled && element.name) { + var value = element.getValue(); + if (value != undefined) { + var pair = {}; + pair[element.name] = value; + return Hash.toQueryString(pair); + } + } + return ''; + }, + + getValue: function(element) { + element = $(element); + var method = element.tagName.toLowerCase(); + return Form.Element.Serializers[method](element); + }, + + clear: function(element) { + $(element).value = ''; + return element; + }, + + present: function(element) { + return $(element).value != ''; + }, + + activate: function(element) { + element = $(element); + element.focus(); + if (element.select && ( element.tagName.toLowerCase() != 'input' || + !['button', 'reset', 'submit'].include(element.type) ) ) + element.select(); + return element; + }, + + disable: function(element) { + element = $(element); + element.disabled = true; + return element; + }, + + enable: function(element) { + element = $(element); + element.blur(); + element.disabled = false; + return element; + } +} + +Object.extend(Form.Element, Form.Element.Methods); +var Field = Form.Element; +var $F = Form.Element.getValue; + +/*--------------------------------------------------------------------------*/ + +Form.Element.Serializers = { + input: function(element) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + return Form.Element.Serializers.inputSelector(element); + default: + return Form.Element.Serializers.textarea(element); + } + }, + + inputSelector: function(element) { + return element.checked ? element.value : null; + }, + + textarea: function(element) { + return element.value; + }, + + select: function(element) { + return this[element.type == 'select-one' ? + 'selectOne' : 'selectMany'](element); + }, + + selectOne: function(element) { + var index = element.selectedIndex; + return index >= 0 ? this.optionValue(element.options[index]) : null; + }, + + selectMany: function(element) { + var values, length = element.length; + if (!length) return null; + + for (var i = 0, values = []; i < length; i++) { + var opt = element.options[i]; + if (opt.selected) values.push(this.optionValue(opt)); + } + return values; + }, + + optionValue: function(opt) { + // extend element because hasAttribute may not be native + return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; + } +} + +/*--------------------------------------------------------------------------*/ + +Abstract.TimedObserver = function() {} +Abstract.TimedObserver.prototype = { + initialize: function(element, frequency, callback) { + this.frequency = frequency; + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + this.registerCallback(); + }, + + registerCallback: function() { + setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); + }, + + onTimerEvent: function() { + var value = this.getValue(); + var changed = ('string' == typeof this.lastValue && 'string' == typeof value + ? this.lastValue != value : String(this.lastValue) != String(value)); + if (changed) { + this.callback(this.element, value); + this.lastValue = value; + } + } +} + +Form.Element.Observer = Class.create(); +Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.Observer = Class.create(); +Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), { + getValue: function() { + return Form.serialize(this.element); + } +}); + +/*--------------------------------------------------------------------------*/ + +Abstract.EventObserver = function() {} +Abstract.EventObserver.prototype = { + initialize: function(element, callback) { + this.element = $(element); + this.callback = callback; + + this.lastValue = this.getValue(); + if (this.element.tagName.toLowerCase() == 'form') + this.registerFormCallbacks(); + else + this.registerCallback(this.element); + }, + + onElementEvent: function() { + var value = this.getValue(); + if (this.lastValue != value) { + this.callback(this.element, value); + this.lastValue = value; + } + }, + + registerFormCallbacks: function() { + Form.getElements(this.element).each(this.registerCallback.bind(this)); + }, + + registerCallback: function(element) { + if (element.type) { + switch (element.type.toLowerCase()) { + case 'checkbox': + case 'radio': + Event.observe(element, 'click', this.onElementEvent.bind(this)); + break; + default: + Event.observe(element, 'change', this.onElementEvent.bind(this)); + break; + } + } + } +} + +Form.Element.EventObserver = Class.create(); +Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() { + return Form.Element.getValue(this.element); + } +}); + +Form.EventObserver = Class.create(); +Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { + getValue: function() { + return Form.serialize(this.element); + } +}); +if (!window.Event) { + var Event = new Object(); +} + +Object.extend(Event, { + KEY_BACKSPACE: 8, + KEY_TAB: 9, + KEY_RETURN: 13, + KEY_ESC: 27, + KEY_LEFT: 37, + KEY_UP: 38, + KEY_RIGHT: 39, + KEY_DOWN: 40, + KEY_DELETE: 46, + KEY_HOME: 36, + KEY_END: 35, + KEY_PAGEUP: 33, + KEY_PAGEDOWN: 34, + + element: function(event) { + return event.target || event.srcElement; + }, + + isLeftClick: function(event) { + return (((event.which) && (event.which == 1)) || + ((event.button) && (event.button == 1))); + }, + + pointerX: function(event) { + return event.pageX || (event.clientX + + (document.documentElement.scrollLeft || document.body.scrollLeft)); + }, + + pointerY: function(event) { + return event.pageY || (event.clientY + + (document.documentElement.scrollTop || document.body.scrollTop)); + }, + + stop: function(event) { + if (event.preventDefault) { + event.preventDefault(); + event.stopPropagation(); + } else { + event.returnValue = false; + event.cancelBubble = true; + } + }, + + // find the first node with the given tagName, starting from the + // node the event was triggered on; traverses the DOM upwards + findElement: function(event, tagName) { + var element = Event.element(event); + while (element.parentNode && (!element.tagName || + (element.tagName.toUpperCase() != tagName.toUpperCase()))) + element = element.parentNode; + return element; + }, + + observers: false, + + _observeAndCache: function(element, name, observer, useCapture) { + if (!this.observers) this.observers = []; + if (element.addEventListener) { + this.observers.push([element, name, observer, useCapture]); + element.addEventListener(name, observer, useCapture); + } else if (element.attachEvent) { + this.observers.push([element, name, observer, useCapture]); + element.attachEvent('on' + name, observer); + } + }, + + unloadCache: function() { + if (!Event.observers) return; + for (var i = 0, length = Event.observers.length; i < length; i++) { + Event.stopObserving.apply(this, Event.observers[i]); + Event.observers[i][0] = null; + } + Event.observers = false; + }, + + observe: function(element, name, observer, useCapture) { + element = $(element); + useCapture = useCapture || false; + + if (name == 'keypress' && + (navigator.appVersion.match(/Konqueror|Safari|KHTML/) + || element.attachEvent)) + name = 'keydown'; + + Event._observeAndCache(element, name, observer, useCapture); + }, + + stopObserving: function(element, name, observer, useCapture) { + element = $(element); + useCapture = useCapture || false; + + if (name == 'keypress' && + (navigator.appVersion.match(/Konqueror|Safari|KHTML/) + || element.detachEvent)) + name = 'keydown'; + + if (element.removeEventListener) { + element.removeEventListener(name, observer, useCapture); + } else if (element.detachEvent) { + try { + element.detachEvent('on' + name, observer); + } catch (e) {} + } + } +}); + +/* prevent memory leaks in IE */ +if (navigator.appVersion.match(/\bMSIE\b/)) + Event.observe(window, 'unload', Event.unloadCache, false); +var Position = { + // set to true if needed, warning: firefox performance problems + // NOT neeeded for page scrolling, only if draggable contained in + // scrollable elements + includeScrollOffsets: false, + + // must be called before calling withinIncludingScrolloffset, every time the + // page is scrolled + prepare: function() { + this.deltaX = window.pageXOffset + || document.documentElement.scrollLeft + || document.body.scrollLeft + || 0; + this.deltaY = window.pageYOffset + || document.documentElement.scrollTop + || document.body.scrollTop + || 0; + }, + + realOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.scrollTop || 0; + valueL += element.scrollLeft || 0; + element = element.parentNode; + } while (element); + return [valueL, valueT]; + }, + + cumulativeOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + } while (element); + return [valueL, valueT]; + }, + + positionedOffset: function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + element = element.offsetParent; + if (element) { + if(element.tagName=='BODY') break; + var p = Element.getStyle(element, 'position'); + if (p == 'relative' || p == 'absolute') break; + } + } while (element); + return [valueL, valueT]; + }, + + offsetParent: function(element) { + if (element.offsetParent) return element.offsetParent; + if (element == document.body) return element; + + while ((element = element.parentNode) && element != document.body) + if (Element.getStyle(element, 'position') != 'static') + return element; + + return document.body; + }, + + // caches x/y coordinate pair to use with overlap + within: function(element, x, y) { + if (this.includeScrollOffsets) + return this.withinIncludingScrolloffsets(element, x, y); + this.xcomp = x; + this.ycomp = y; + this.offset = this.cumulativeOffset(element); + + return (y >= this.offset[1] && + y < this.offset[1] + element.offsetHeight && + x >= this.offset[0] && + x < this.offset[0] + element.offsetWidth); + }, + + withinIncludingScrolloffsets: function(element, x, y) { + var offsetcache = this.realOffset(element); + + this.xcomp = x + offsetcache[0] - this.deltaX; + this.ycomp = y + offsetcache[1] - this.deltaY; + this.offset = this.cumulativeOffset(element); + + return (this.ycomp >= this.offset[1] && + this.ycomp < this.offset[1] + element.offsetHeight && + this.xcomp >= this.offset[0] && + this.xcomp < this.offset[0] + element.offsetWidth); + }, + + // within must be called directly before + overlap: function(mode, element) { + if (!mode) return 0; + if (mode == 'vertical') + return ((this.offset[1] + element.offsetHeight) - this.ycomp) / + element.offsetHeight; + if (mode == 'horizontal') + return ((this.offset[0] + element.offsetWidth) - this.xcomp) / + element.offsetWidth; + }, + + page: function(forElement) { + var valueT = 0, valueL = 0; + + var element = forElement; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + + // Safari fix + if (element.offsetParent==document.body) + if (Element.getStyle(element,'position')=='absolute') break; + + } while (element = element.offsetParent); + + element = forElement; + do { + if (!window.opera || element.tagName=='BODY') { + valueT -= element.scrollTop || 0; + valueL -= element.scrollLeft || 0; + } + } while (element = element.parentNode); + + return [valueL, valueT]; + }, + + clone: function(source, target) { + var options = Object.extend({ + setLeft: true, + setTop: true, + setWidth: true, + setHeight: true, + offsetTop: 0, + offsetLeft: 0 + }, arguments[2] || {}) + + // find page position of source + source = $(source); + var p = Position.page(source); + + // find coordinate system to use + target = $(target); + var delta = [0, 0]; + var parent = null; + // delta [0,0] will do fine with position: fixed elements, + // position:absolute needs offsetParent deltas + if (Element.getStyle(target,'position') == 'absolute') { + parent = Position.offsetParent(target); + delta = Position.page(parent); + } + + // correct by body offsets (fixes Safari) + if (parent == document.body) { + delta[0] -= document.body.offsetLeft; + delta[1] -= document.body.offsetTop; + } + + // set position + if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; + if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; + if(options.setWidth) target.style.width = source.offsetWidth + 'px'; + if(options.setHeight) target.style.height = source.offsetHeight + 'px'; + }, + + absolutize: function(element) { + element = $(element); + if (element.style.position == 'absolute') return; + Position.prepare(); + + var offsets = Position.positionedOffset(element); + var top = offsets[1]; + var left = offsets[0]; + var width = element.clientWidth; + var height = element.clientHeight; + + element._originalLeft = left - parseFloat(element.style.left || 0); + element._originalTop = top - parseFloat(element.style.top || 0); + element._originalWidth = element.style.width; + element._originalHeight = element.style.height; + + element.style.position = 'absolute'; + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.width = width + 'px'; + element.style.height = height + 'px'; + }, + + relativize: function(element) { + element = $(element); + if (element.style.position == 'relative') return; + Position.prepare(); + + element.style.position = 'relative'; + var top = parseFloat(element.style.top || 0) - (element._originalTop || 0); + var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); + + element.style.top = top + 'px'; + element.style.left = left + 'px'; + element.style.height = element._originalHeight; + element.style.width = element._originalWidth; + } +} + +// Safari returns margins on body which is incorrect if the child is absolutely +// positioned. For performance reasons, redefine Position.cumulativeOffset for +// KHTML/WebKit only. +if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) { + Position.cumulativeOffset = function(element) { + var valueT = 0, valueL = 0; + do { + valueT += element.offsetTop || 0; + valueL += element.offsetLeft || 0; + if (element.offsetParent == document.body) + if (Element.getStyle(element, 'position') == 'absolute') break; + + element = element.offsetParent; + } while (element); + + return [valueL, valueT]; + } +} + +Element.addMethods(); \ No newline at end of file diff --git a/DQM/TrackerCommon/test/js_files/scriptaculous/src/builder.js b/DQM/TrackerCommon/test/js_files/scriptaculous/src/builder.js new file mode 100644 index 0000000000000..199afc12f6d9c --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/scriptaculous/src/builder.js @@ -0,0 +1,131 @@ +// script.aculo.us builder.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 + +// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +var Builder = { + NODEMAP: { + AREA: 'map', + CAPTION: 'table', + COL: 'table', + COLGROUP: 'table', + LEGEND: 'fieldset', + OPTGROUP: 'select', + OPTION: 'select', + PARAM: 'object', + TBODY: 'table', + TD: 'table', + TFOOT: 'table', + TH: 'table', + THEAD: 'table', + TR: 'table' + }, + // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken, + // due to a Firefox bug + node: function(elementName) { + elementName = elementName.toUpperCase(); + + // try innerHTML approach + var parentTag = this.NODEMAP[elementName] || 'div'; + var parentElement = document.createElement(parentTag); + try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" + elementName + ">"; + } catch(e) {} + var element = parentElement.firstChild || null; + + // see if browser added wrapping tags + if(element && (element.tagName.toUpperCase() != elementName)) + element = element.getElementsByTagName(elementName)[0]; + + // fallback to createElement approach + if(!element) element = document.createElement(elementName); + + // abort if nothing could be created + if(!element) return; + + // attributes (or text) + if(arguments[1]) + if(this._isStringOrNumber(arguments[1]) || + (arguments[1] instanceof Array)) { + this._children(element, arguments[1]); + } else { + var attrs = this._attributes(arguments[1]); + if(attrs.length) { + try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707 + parentElement.innerHTML = "<" +elementName + " " + + attrs + ">"; + } catch(e) {} + element = parentElement.firstChild || null; + // workaround firefox 1.0.X bug + if(!element) { + element = document.createElement(elementName); + for(attr in arguments[1]) + element[attr == 'class' ? 'className' : attr] = arguments[1][attr]; + } + if(element.tagName.toUpperCase() != elementName) + element = parentElement.getElementsByTagName(elementName)[0]; + } + } + + // text, or array of children + if(arguments[2]) + this._children(element, arguments[2]); + + return element; + }, + _text: function(text) { + return document.createTextNode(text); + }, + + ATTR_MAP: { + 'className': 'class', + 'htmlFor': 'for' + }, + + _attributes: function(attributes) { + var attrs = []; + for(attribute in attributes) + attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) + + '="' + attributes[attribute].toString().escapeHTML() + '"'); + return attrs.join(" "); + }, + _children: function(element, children) { + if(typeof children=='object') { // array can hold nodes and text + children.flatten().each( function(e) { + if(typeof e=='object') + element.appendChild(e) + else + if(Builder._isStringOrNumber(e)) + element.appendChild(Builder._text(e)); + }); + } else + if(Builder._isStringOrNumber(children)) + element.appendChild(Builder._text(children)); + }, + _isStringOrNumber: function(param) { + return(typeof param=='string' || typeof param=='number'); + }, + build: function(html) { + var element = this.node('div'); + $(element).update(html.strip()); + return element.down(); + }, + dump: function(scope) { + if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope + + var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " + + "BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " + + "FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+ + "KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+ + "PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+ + "TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/); + + tags.each( function(tag){ + scope[tag] = function() { + return Builder.node.apply(Builder, [tag].concat($A(arguments))); + } + }); + } +} diff --git a/DQM/TrackerCommon/test/js_files/scriptaculous/src/controls.js b/DQM/TrackerCommon/test/js_files/scriptaculous/src/controls.js new file mode 100644 index 0000000000000..46f2cc18d4902 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/scriptaculous/src/controls.js @@ -0,0 +1,835 @@ +// script.aculo.us controls.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 + +// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan) +// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) +// Contributors: +// Richard Livsey +// Rahul Bhargava +// Rob Wills +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// Autocompleter.Base handles all the autocompletion functionality +// that's independent of the data source for autocompletion. This +// includes drawing the autocompletion menu, observing keyboard +// and mouse events, and similar. +// +// Specific autocompleters need to provide, at the very least, +// a getUpdatedChoices function that will be invoked every time +// the text inside the monitored textbox changes. This method +// should get the text for which to provide autocompletion by +// invoking this.getToken(), NOT by directly accessing +// this.element.value. This is to allow incremental tokenized +// autocompletion. Specific auto-completion logic (AJAX, etc) +// belongs in getUpdatedChoices. +// +// Tokenized incremental autocompletion is enabled automatically +// when an autocompleter is instantiated with the 'tokens' option +// in the options parameter, e.g.: +// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' }); +// will incrementally autocomplete with a comma as the token. +// Additionally, ',' in the above example can be replaced with +// a token array, e.g. { tokens: [',', '\n'] } which +// enables autocompletion on multiple tokens. This is most +// useful when one of the tokens is \n (a newline), as it +// allows smart autocompletion after linebreaks. + +if(typeof Effect == 'undefined') + throw("controls.js requires including script.aculo.us' effects.js library"); + +var Autocompleter = {} +Autocompleter.Base = function() {}; +Autocompleter.Base.prototype = { + baseInitialize: function(element, update, options) { + this.element = $(element); + this.update = $(update); + this.hasFocus = false; + this.changed = false; + this.active = false; + this.index = 0; + this.entryCount = 0; + + if(this.setOptions) + this.setOptions(options); + else + this.options = options || {}; + + this.options.paramName = this.options.paramName || this.element.name; + this.options.tokens = this.options.tokens || []; + this.options.frequency = this.options.frequency || 0.4; + this.options.minChars = this.options.minChars || 1; + this.options.onShow = this.options.onShow || + function(element, update){ + if(!update.style.position || update.style.position=='absolute') { + update.style.position = 'absolute'; + Position.clone(element, update, { + setHeight: false, + offsetTop: element.offsetHeight + }); + } + Effect.Appear(update,{duration:0.15}); + }; + this.options.onHide = this.options.onHide || + function(element, update){ new Effect.Fade(update,{duration:0.15}) }; + + if(typeof(this.options.tokens) == 'string') + this.options.tokens = new Array(this.options.tokens); + + this.observer = null; + + this.element.setAttribute('autocomplete','off'); + + Element.hide(this.update); + + Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this)); + Event.observe(this.element, "keypress", this.onKeyPress.bindAsEventListener(this)); + }, + + show: function() { + if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update); + if(!this.iefix && + (navigator.appVersion.indexOf('MSIE')>0) && + (navigator.userAgent.indexOf('Opera')<0) && + (Element.getStyle(this.update, 'position')=='absolute')) { + new Insertion.After(this.update, + ''); + this.iefix = $(this.update.id+'_iefix'); + } + if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); + }, + + fixIEOverlapping: function() { + Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); + this.iefix.style.zIndex = 1; + this.update.style.zIndex = 2; + Element.show(this.iefix); + }, + + hide: function() { + this.stopIndicator(); + if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); + if(this.iefix) Element.hide(this.iefix); + }, + + startIndicator: function() { + if(this.options.indicator) Element.show(this.options.indicator); + }, + + stopIndicator: function() { + if(this.options.indicator) Element.hide(this.options.indicator); + }, + + onKeyPress: function(event) { + if(this.active) + switch(event.keyCode) { + case Event.KEY_TAB: + case Event.KEY_RETURN: + this.selectEntry(); + Event.stop(event); + case Event.KEY_ESC: + this.hide(); + this.active = false; + Event.stop(event); + return; + case Event.KEY_LEFT: + case Event.KEY_RIGHT: + return; + case Event.KEY_UP: + this.markPrevious(); + this.render(); + if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event); + return; + case Event.KEY_DOWN: + this.markNext(); + this.render(); + if(navigator.appVersion.indexOf('AppleWebKit')>0) Event.stop(event); + return; + } + else + if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || + (navigator.appVersion.indexOf('AppleWebKit') > 0 && event.keyCode == 0)) return; + + this.changed = true; + this.hasFocus = true; + + if(this.observer) clearTimeout(this.observer); + this.observer = + setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); + }, + + activate: function() { + this.changed = false; + this.hasFocus = true; + this.getUpdatedChoices(); + }, + + onHover: function(event) { + var element = Event.findElement(event, 'LI'); + if(this.index != element.autocompleteIndex) + { + this.index = element.autocompleteIndex; + this.render(); + } + Event.stop(event); + }, + + onClick: function(event) { + var element = Event.findElement(event, 'LI'); + this.index = element.autocompleteIndex; + this.selectEntry(); + this.hide(); + }, + + onBlur: function(event) { + // needed to make click events working + setTimeout(this.hide.bind(this), 250); + this.hasFocus = false; + this.active = false; + }, + + render: function() { + if(this.entryCount > 0) { + for (var i = 0; i < this.entryCount; i++) + this.index==i ? + Element.addClassName(this.getEntry(i),"selected") : + Element.removeClassName(this.getEntry(i),"selected"); + + if(this.hasFocus) { + this.show(); + this.active = true; + } + } else { + this.active = false; + this.hide(); + } + }, + + markPrevious: function() { + if(this.index > 0) this.index-- + else this.index = this.entryCount-1; + this.getEntry(this.index).scrollIntoView(true); + }, + + markNext: function() { + if(this.index < this.entryCount-1) this.index++ + else this.index = 0; + this.getEntry(this.index).scrollIntoView(false); + }, + + getEntry: function(index) { + return this.update.firstChild.childNodes[index]; + }, + + getCurrentEntry: function() { + return this.getEntry(this.index); + }, + + selectEntry: function() { + this.active = false; + this.updateElement(this.getCurrentEntry()); + }, + + updateElement: function(selectedElement) { + if (this.options.updateElement) { + this.options.updateElement(selectedElement); + return; + } + var value = ''; + if (this.options.select) { + var nodes = document.getElementsByClassName(this.options.select, selectedElement) || []; + if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); + } else + value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); + + var lastTokenPos = this.findLastToken(); + if (lastTokenPos != -1) { + var newValue = this.element.value.substr(0, lastTokenPos + 1); + var whitespace = this.element.value.substr(lastTokenPos + 1).match(/^\s+/); + if (whitespace) + newValue += whitespace[0]; + this.element.value = newValue + value; + } else { + this.element.value = value; + } + this.element.focus(); + + if (this.options.afterUpdateElement) + this.options.afterUpdateElement(this.element, selectedElement); + }, + + updateChoices: function(choices) { + if(!this.changed && this.hasFocus) { + this.update.innerHTML = choices; + Element.cleanWhitespace(this.update); + Element.cleanWhitespace(this.update.down()); + + if(this.update.firstChild && this.update.down().childNodes) { + this.entryCount = + this.update.down().childNodes.length; + for (var i = 0; i < this.entryCount; i++) { + var entry = this.getEntry(i); + entry.autocompleteIndex = i; + this.addObservers(entry); + } + } else { + this.entryCount = 0; + } + + this.stopIndicator(); + this.index = 0; + + if(this.entryCount==1 && this.options.autoSelect) { + this.selectEntry(); + this.hide(); + } else { + this.render(); + } + } + }, + + addObservers: function(element) { + Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); + Event.observe(element, "click", this.onClick.bindAsEventListener(this)); + }, + + onObserverEvent: function() { + this.changed = false; + if(this.getToken().length>=this.options.minChars) { + this.startIndicator(); + this.getUpdatedChoices(); + } else { + this.active = false; + this.hide(); + } + }, + + getToken: function() { + var tokenPos = this.findLastToken(); + if (tokenPos != -1) + var ret = this.element.value.substr(tokenPos + 1).replace(/^\s+/,'').replace(/\s+$/,''); + else + var ret = this.element.value; + + return /\n/.test(ret) ? '' : ret; + }, + + findLastToken: function() { + var lastTokenPos = -1; + + for (var i=0; i lastTokenPos) + lastTokenPos = thisTokenPos; + } + return lastTokenPos; + } +} + +Ajax.Autocompleter = Class.create(); +Object.extend(Object.extend(Ajax.Autocompleter.prototype, Autocompleter.Base.prototype), { + initialize: function(element, update, url, options) { + this.baseInitialize(element, update, options); + this.options.asynchronous = true; + this.options.onComplete = this.onComplete.bind(this); + this.options.defaultParams = this.options.parameters || null; + this.url = url; + }, + + getUpdatedChoices: function() { + entry = encodeURIComponent(this.options.paramName) + '=' + + encodeURIComponent(this.getToken()); + + this.options.parameters = this.options.callback ? + this.options.callback(this.element, entry) : entry; + + if(this.options.defaultParams) + this.options.parameters += '&' + this.options.defaultParams; + + new Ajax.Request(this.url, this.options); + }, + + onComplete: function(request) { + this.updateChoices(request.responseText); + } + +}); + +// The local array autocompleter. Used when you'd prefer to +// inject an array of autocompletion options into the page, rather +// than sending out Ajax queries, which can be quite slow sometimes. +// +// The constructor takes four parameters. The first two are, as usual, +// the id of the monitored textbox, and id of the autocompletion menu. +// The third is the array you want to autocomplete from, and the fourth +// is the options block. +// +// Extra local autocompletion options: +// - choices - How many autocompletion choices to offer +// +// - partialSearch - If false, the autocompleter will match entered +// text only at the beginning of strings in the +// autocomplete array. Defaults to true, which will +// match text at the beginning of any *word* in the +// strings in the autocomplete array. If you want to +// search anywhere in the string, additionally set +// the option fullSearch to true (default: off). +// +// - fullSsearch - Search anywhere in autocomplete array strings. +// +// - partialChars - How many characters to enter before triggering +// a partial match (unlike minChars, which defines +// how many characters are required to do any match +// at all). Defaults to 2. +// +// - ignoreCase - Whether to ignore case when autocompleting. +// Defaults to true. +// +// It's possible to pass in a custom function as the 'selector' +// option, if you prefer to write your own autocompletion logic. +// In that case, the other options above will not apply unless +// you support them. + +Autocompleter.Local = Class.create(); +Autocompleter.Local.prototype = Object.extend(new Autocompleter.Base(), { + initialize: function(element, update, array, options) { + this.baseInitialize(element, update, options); + this.options.array = array; + }, + + getUpdatedChoices: function() { + this.updateChoices(this.options.selector(this)); + }, + + setOptions: function(options) { + this.options = Object.extend({ + choices: 10, + partialSearch: true, + partialChars: 2, + ignoreCase: true, + fullSearch: false, + selector: function(instance) { + var ret = []; // Beginning matches + var partial = []; // Inside matches + var entry = instance.getToken(); + var count = 0; + + for (var i = 0; i < instance.options.array.length && + ret.length < instance.options.choices ; i++) { + + var elem = instance.options.array[i]; + var foundPos = instance.options.ignoreCase ? + elem.toLowerCase().indexOf(entry.toLowerCase()) : + elem.indexOf(entry); + + while (foundPos != -1) { + if (foundPos == 0 && elem.length != entry.length) { + ret.push("
  • " + elem.substr(0, entry.length) + "" + + elem.substr(entry.length) + "
  • "); + break; + } else if (entry.length >= instance.options.partialChars && + instance.options.partialSearch && foundPos != -1) { + if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { + partial.push("
  • " + elem.substr(0, foundPos) + "" + + elem.substr(foundPos, entry.length) + "" + elem.substr( + foundPos + entry.length) + "
  • "); + break; + } + } + + foundPos = instance.options.ignoreCase ? + elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : + elem.indexOf(entry, foundPos + 1); + + } + } + if (partial.length) + ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)) + return "
      " + ret.join('') + "
    "; + } + }, options || {}); + } +}); + +// AJAX in-place editor +// +// see documentation on http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor + +// Use this if you notice weird scrolling problems on some browsers, +// the DOM might be a bit confused when this gets called so do this +// waits 1 ms (with setTimeout) until it does the activation +Field.scrollFreeActivate = function(field) { + setTimeout(function() { + Field.activate(field); + }, 1); +} + +Ajax.InPlaceEditor = Class.create(); +Ajax.InPlaceEditor.defaultHighlightColor = "#FFFF99"; +Ajax.InPlaceEditor.prototype = { + initialize: function(element, url, options) { + this.url = url; + this.element = $(element); + + this.options = Object.extend({ + paramName: "value", + okButton: true, + okText: "ok", + cancelLink: true, + cancelText: "cancel", + savingText: "Saving...", + clickToEditText: "Click to edit", + okText: "ok", + rows: 1, + onComplete: function(transport, element) { + new Effect.Highlight(element, {startcolor: this.options.highlightcolor}); + }, + onFailure: function(transport) { + alert("Error communicating with the server: " + transport.responseText.stripTags()); + }, + callback: function(form) { + return Form.serialize(form); + }, + handleLineBreaks: true, + loadingText: 'Loading...', + savingClassName: 'inplaceeditor-saving', + loadingClassName: 'inplaceeditor-loading', + formClassName: 'inplaceeditor-form', + highlightcolor: Ajax.InPlaceEditor.defaultHighlightColor, + highlightendcolor: "#FFFFFF", + externalControl: null, + submitOnBlur: false, + ajaxOptions: {}, + evalScripts: false + }, options || {}); + + if(!this.options.formId && this.element.id) { + this.options.formId = this.element.id + "-inplaceeditor"; + if ($(this.options.formId)) { + // there's already a form with that name, don't specify an id + this.options.formId = null; + } + } + + if (this.options.externalControl) { + this.options.externalControl = $(this.options.externalControl); + } + + this.originalBackground = Element.getStyle(this.element, 'background-color'); + if (!this.originalBackground) { + this.originalBackground = "transparent"; + } + + this.element.title = this.options.clickToEditText; + + this.onclickListener = this.enterEditMode.bindAsEventListener(this); + this.mouseoverListener = this.enterHover.bindAsEventListener(this); + this.mouseoutListener = this.leaveHover.bindAsEventListener(this); + Event.observe(this.element, 'click', this.onclickListener); + Event.observe(this.element, 'mouseover', this.mouseoverListener); + Event.observe(this.element, 'mouseout', this.mouseoutListener); + if (this.options.externalControl) { + Event.observe(this.options.externalControl, 'click', this.onclickListener); + Event.observe(this.options.externalControl, 'mouseover', this.mouseoverListener); + Event.observe(this.options.externalControl, 'mouseout', this.mouseoutListener); + } + }, + enterEditMode: function(evt) { + if (this.saving) return; + if (this.editing) return; + this.editing = true; + this.onEnterEditMode(); + if (this.options.externalControl) { + Element.hide(this.options.externalControl); + } + Element.hide(this.element); + this.createForm(); + this.element.parentNode.insertBefore(this.form, this.element); + if (!this.options.loadTextURL) Field.scrollFreeActivate(this.editField); + // stop the event to avoid a page refresh in Safari + if (evt) { + Event.stop(evt); + } + return false; + }, + createForm: function() { + this.form = document.createElement("form"); + this.form.id = this.options.formId; + Element.addClassName(this.form, this.options.formClassName) + this.form.onsubmit = this.onSubmit.bind(this); + + this.createEditField(); + + if (this.options.textarea) { + var br = document.createElement("br"); + this.form.appendChild(br); + } + + if (this.options.okButton) { + okButton = document.createElement("input"); + okButton.type = "submit"; + okButton.value = this.options.okText; + okButton.className = 'editor_ok_button'; + this.form.appendChild(okButton); + } + + if (this.options.cancelLink) { + cancelLink = document.createElement("a"); + cancelLink.href = "#"; + cancelLink.appendChild(document.createTextNode(this.options.cancelText)); + cancelLink.onclick = this.onclickCancel.bind(this); + cancelLink.className = 'editor_cancel'; + this.form.appendChild(cancelLink); + } + }, + hasHTMLLineBreaks: function(string) { + if (!this.options.handleLineBreaks) return false; + return string.match(/
    /i); + }, + convertHTMLLineBreaks: function(string) { + return string.replace(/
    /gi, "\n").replace(//gi, "\n").replace(/<\/p>/gi, "\n").replace(/

    /gi, ""); + }, + createEditField: function() { + var text; + if(this.options.loadTextURL) { + text = this.options.loadingText; + } else { + text = this.getText(); + } + + var obj = this; + + if (this.options.rows == 1 && !this.hasHTMLLineBreaks(text)) { + this.options.textarea = false; + var textField = document.createElement("input"); + textField.obj = this; + textField.type = "text"; + textField.name = this.options.paramName; + textField.value = text; + textField.style.backgroundColor = this.options.highlightcolor; + textField.className = 'editor_field'; + var size = this.options.size || this.options.cols || 0; + if (size != 0) textField.size = size; + if (this.options.submitOnBlur) + textField.onblur = this.onSubmit.bind(this); + this.editField = textField; + } else { + this.options.textarea = true; + var textArea = document.createElement("textarea"); + textArea.obj = this; + textArea.name = this.options.paramName; + textArea.value = this.convertHTMLLineBreaks(text); + textArea.rows = this.options.rows; + textArea.cols = this.options.cols || 40; + textArea.className = 'editor_field'; + if (this.options.submitOnBlur) + textArea.onblur = this.onSubmit.bind(this); + this.editField = textArea; + } + + if(this.options.loadTextURL) { + this.loadExternalText(); + } + this.form.appendChild(this.editField); + }, + getText: function() { + return this.element.innerHTML; + }, + loadExternalText: function() { + Element.addClassName(this.form, this.options.loadingClassName); + this.editField.disabled = true; + new Ajax.Request( + this.options.loadTextURL, + Object.extend({ + asynchronous: true, + onComplete: this.onLoadedExternalText.bind(this) + }, this.options.ajaxOptions) + ); + }, + onLoadedExternalText: function(transport) { + Element.removeClassName(this.form, this.options.loadingClassName); + this.editField.disabled = false; + this.editField.value = transport.responseText.stripTags(); + Field.scrollFreeActivate(this.editField); + }, + onclickCancel: function() { + this.onComplete(); + this.leaveEditMode(); + return false; + }, + onFailure: function(transport) { + this.options.onFailure(transport); + if (this.oldInnerHTML) { + this.element.innerHTML = this.oldInnerHTML; + this.oldInnerHTML = null; + } + return false; + }, + onSubmit: function() { + // onLoading resets these so we need to save them away for the Ajax call + var form = this.form; + var value = this.editField.value; + + // do this first, sometimes the ajax call returns before we get a chance to switch on Saving... + // which means this will actually switch on Saving... *after* we've left edit mode causing Saving... + // to be displayed indefinitely + this.onLoading(); + + if (this.options.evalScripts) { + new Ajax.Request( + this.url, Object.extend({ + parameters: this.options.callback(form, value), + onComplete: this.onComplete.bind(this), + onFailure: this.onFailure.bind(this), + asynchronous:true, + evalScripts:true + }, this.options.ajaxOptions)); + } else { + new Ajax.Updater( + { success: this.element, + // don't update on failure (this could be an option) + failure: null }, + this.url, Object.extend({ + parameters: this.options.callback(form, value), + onComplete: this.onComplete.bind(this), + onFailure: this.onFailure.bind(this) + }, this.options.ajaxOptions)); + } + // stop the event to avoid a page refresh in Safari + if (arguments.length > 1) { + Event.stop(arguments[0]); + } + return false; + }, + onLoading: function() { + this.saving = true; + this.removeForm(); + this.leaveHover(); + this.showSaving(); + }, + showSaving: function() { + this.oldInnerHTML = this.element.innerHTML; + this.element.innerHTML = this.options.savingText; + Element.addClassName(this.element, this.options.savingClassName); + this.element.style.backgroundColor = this.originalBackground; + Element.show(this.element); + }, + removeForm: function() { + if(this.form) { + if (this.form.parentNode) Element.remove(this.form); + this.form = null; + } + }, + enterHover: function() { + if (this.saving) return; + this.element.style.backgroundColor = this.options.highlightcolor; + if (this.effect) { + this.effect.cancel(); + } + Element.addClassName(this.element, this.options.hoverClassName) + }, + leaveHover: function() { + if (this.options.backgroundColor) { + this.element.style.backgroundColor = this.oldBackground; + } + Element.removeClassName(this.element, this.options.hoverClassName) + if (this.saving) return; + this.effect = new Effect.Highlight(this.element, { + startcolor: this.options.highlightcolor, + endcolor: this.options.highlightendcolor, + restorecolor: this.originalBackground + }); + }, + leaveEditMode: function() { + Element.removeClassName(this.element, this.options.savingClassName); + this.removeForm(); + this.leaveHover(); + this.element.style.backgroundColor = this.originalBackground; + Element.show(this.element); + if (this.options.externalControl) { + Element.show(this.options.externalControl); + } + this.editing = false; + this.saving = false; + this.oldInnerHTML = null; + this.onLeaveEditMode(); + }, + onComplete: function(transport) { + this.leaveEditMode(); + this.options.onComplete.bind(this)(transport, this.element); + }, + onEnterEditMode: function() {}, + onLeaveEditMode: function() {}, + dispose: function() { + if (this.oldInnerHTML) { + this.element.innerHTML = this.oldInnerHTML; + } + this.leaveEditMode(); + Event.stopObserving(this.element, 'click', this.onclickListener); + Event.stopObserving(this.element, 'mouseover', this.mouseoverListener); + Event.stopObserving(this.element, 'mouseout', this.mouseoutListener); + if (this.options.externalControl) { + Event.stopObserving(this.options.externalControl, 'click', this.onclickListener); + Event.stopObserving(this.options.externalControl, 'mouseover', this.mouseoverListener); + Event.stopObserving(this.options.externalControl, 'mouseout', this.mouseoutListener); + } + } +}; + +Ajax.InPlaceCollectionEditor = Class.create(); +Object.extend(Ajax.InPlaceCollectionEditor.prototype, Ajax.InPlaceEditor.prototype); +Object.extend(Ajax.InPlaceCollectionEditor.prototype, { + createEditField: function() { + if (!this.cached_selectTag) { + var selectTag = document.createElement("select"); + var collection = this.options.collection || []; + var optionTag; + collection.each(function(e,i) { + optionTag = document.createElement("option"); + optionTag.value = (e instanceof Array) ? e[0] : e; + if((typeof this.options.value == 'undefined') && + ((e instanceof Array) ? this.element.innerHTML == e[1] : e == optionTag.value)) optionTag.selected = true; + if(this.options.value==optionTag.value) optionTag.selected = true; + optionTag.appendChild(document.createTextNode((e instanceof Array) ? e[1] : e)); + selectTag.appendChild(optionTag); + }.bind(this)); + this.cached_selectTag = selectTag; + } + + this.editField = this.cached_selectTag; + if(this.options.loadTextURL) this.loadExternalText(); + this.form.appendChild(this.editField); + this.options.callback = function(form, value) { + return "value=" + encodeURIComponent(value); + } + } +}); + +// Delayed observer, like Form.Element.Observer, +// but waits for delay after last key input +// Ideal for live-search fields + +Form.Element.DelayedObserver = Class.create(); +Form.Element.DelayedObserver.prototype = { + initialize: function(element, delay, callback) { + this.delay = delay || 0.5; + this.element = $(element); + this.callback = callback; + this.timer = null; + this.lastValue = $F(this.element); + Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); + }, + delayedListener: function(event) { + if(this.lastValue == $F(this.element)) return; + if(this.timer) clearTimeout(this.timer); + this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); + this.lastValue = $F(this.element); + }, + onTimerEvent: function() { + this.timer = null; + this.callback(this.element, $F(this.element)); + } +}; diff --git a/DQM/TrackerCommon/test/js_files/scriptaculous/src/dragdrop.js b/DQM/TrackerCommon/test/js_files/scriptaculous/src/dragdrop.js new file mode 100644 index 0000000000000..32c91bc342b43 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/scriptaculous/src/dragdrop.js @@ -0,0 +1,944 @@ +// script.aculo.us dragdrop.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 + +// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005, 2006 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +if(typeof Effect == 'undefined') + throw("dragdrop.js requires including script.aculo.us' effects.js library"); + +var Droppables = { + drops: [], + + remove: function(element) { + this.drops = this.drops.reject(function(d) { return d.element==$(element) }); + }, + + add: function(element) { + element = $(element); + var options = Object.extend({ + greedy: true, + hoverclass: null, + tree: false + }, arguments[1] || {}); + + // cache containers + if(options.containment) { + options._containers = []; + var containment = options.containment; + if((typeof containment == 'object') && + (containment.constructor == Array)) { + containment.each( function(c) { options._containers.push($(c)) }); + } else { + options._containers.push($(containment)); + } + } + + if(options.accept) options.accept = [options.accept].flatten(); + + Element.makePositioned(element); // fix IE + options.element = element; + + this.drops.push(options); + }, + + findDeepestChild: function(drops) { + deepest = drops[0]; + + for (i = 1; i < drops.length; ++i) + if (Element.isParent(drops[i].element, deepest.element)) + deepest = drops[i]; + + return deepest; + }, + + isContained: function(element, drop) { + var containmentNode; + if(drop.tree) { + containmentNode = element.treeNode; + } else { + containmentNode = element.parentNode; + } + return drop._containers.detect(function(c) { return containmentNode == c }); + }, + + isAffected: function(point, element, drop) { + return ( + (drop.element!=element) && + ((!drop._containers) || + this.isContained(element, drop)) && + ((!drop.accept) || + (Element.classNames(element).detect( + function(v) { return drop.accept.include(v) } ) )) && + Position.within(drop.element, point[0], point[1]) ); + }, + + deactivate: function(drop) { + if(drop.hoverclass) + Element.removeClassName(drop.element, drop.hoverclass); + this.last_active = null; + }, + + activate: function(drop) { + if(drop.hoverclass) + Element.addClassName(drop.element, drop.hoverclass); + this.last_active = drop; + }, + + show: function(point, element) { + if(!this.drops.length) return; + var affected = []; + + if(this.last_active) this.deactivate(this.last_active); + this.drops.each( function(drop) { + if(Droppables.isAffected(point, element, drop)) + affected.push(drop); + }); + + if(affected.length>0) { + drop = Droppables.findDeepestChild(affected); + Position.within(drop.element, point[0], point[1]); + if(drop.onHover) + drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); + + Droppables.activate(drop); + } + }, + + fire: function(event, element) { + if(!this.last_active) return; + Position.prepare(); + + if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) + if (this.last_active.onDrop) + this.last_active.onDrop(element, this.last_active.element, event); + }, + + reset: function() { + if(this.last_active) + this.deactivate(this.last_active); + } +} + +var Draggables = { + drags: [], + observers: [], + + register: function(draggable) { + if(this.drags.length == 0) { + this.eventMouseUp = this.endDrag.bindAsEventListener(this); + this.eventMouseMove = this.updateDrag.bindAsEventListener(this); + this.eventKeypress = this.keyPress.bindAsEventListener(this); + + Event.observe(document, "mouseup", this.eventMouseUp); + Event.observe(document, "mousemove", this.eventMouseMove); + Event.observe(document, "keypress", this.eventKeypress); + } + this.drags.push(draggable); + }, + + unregister: function(draggable) { + this.drags = this.drags.reject(function(d) { return d==draggable }); + if(this.drags.length == 0) { + Event.stopObserving(document, "mouseup", this.eventMouseUp); + Event.stopObserving(document, "mousemove", this.eventMouseMove); + Event.stopObserving(document, "keypress", this.eventKeypress); + } + }, + + activate: function(draggable) { + if(draggable.options.delay) { + this._timeout = setTimeout(function() { + Draggables._timeout = null; + window.focus(); + Draggables.activeDraggable = draggable; + }.bind(this), draggable.options.delay); + } else { + window.focus(); // allows keypress events if window isn't currently focused, fails for Safari + this.activeDraggable = draggable; + } + }, + + deactivate: function() { + this.activeDraggable = null; + }, + + updateDrag: function(event) { + if(!this.activeDraggable) return; + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + // Mozilla-based browsers fire successive mousemove events with + // the same coordinates, prevent needless redrawing (moz bug?) + if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; + this._lastPointer = pointer; + + this.activeDraggable.updateDrag(event, pointer); + }, + + endDrag: function(event) { + if(this._timeout) { + clearTimeout(this._timeout); + this._timeout = null; + } + if(!this.activeDraggable) return; + this._lastPointer = null; + this.activeDraggable.endDrag(event); + this.activeDraggable = null; + }, + + keyPress: function(event) { + if(this.activeDraggable) + this.activeDraggable.keyPress(event); + }, + + addObserver: function(observer) { + this.observers.push(observer); + this._cacheObserverCallbacks(); + }, + + removeObserver: function(element) { // element instead of observer fixes mem leaks + this.observers = this.observers.reject( function(o) { return o.element==element }); + this._cacheObserverCallbacks(); + }, + + notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' + if(this[eventName+'Count'] > 0) + this.observers.each( function(o) { + if(o[eventName]) o[eventName](eventName, draggable, event); + }); + if(draggable.options[eventName]) draggable.options[eventName](draggable, event); + }, + + _cacheObserverCallbacks: function() { + ['onStart','onEnd','onDrag'].each( function(eventName) { + Draggables[eventName+'Count'] = Draggables.observers.select( + function(o) { return o[eventName]; } + ).length; + }); + } +} + +/*--------------------------------------------------------------------------*/ + +var Draggable = Class.create(); +Draggable._dragging = {}; + +Draggable.prototype = { + initialize: function(element) { + var defaults = { + handle: false, + reverteffect: function(element, top_offset, left_offset) { + var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; + new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, + queue: {scope:'_draggable', position:'end'} + }); + }, + endeffect: function(element) { + var toOpacity = typeof element._opacity == 'number' ? element._opacity : 1.0; + new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, + queue: {scope:'_draggable', position:'end'}, + afterFinish: function(){ + Draggable._dragging[element] = false + } + }); + }, + zindex: 1000, + revert: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } + delay: 0 + }; + + if(!arguments[1] || typeof arguments[1].endeffect == 'undefined') + Object.extend(defaults, { + starteffect: function(element) { + element._opacity = Element.getOpacity(element); + Draggable._dragging[element] = true; + new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); + } + }); + + var options = Object.extend(defaults, arguments[1] || {}); + + this.element = $(element); + + if(options.handle && (typeof options.handle == 'string')) + this.handle = this.element.down('.'+options.handle, 0); + + if(!this.handle) this.handle = $(options.handle); + if(!this.handle) this.handle = this.element; + + if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { + options.scroll = $(options.scroll); + this._isScrollChild = Element.childOf(this.element, options.scroll); + } + + Element.makePositioned(this.element); // fix IE + + this.delta = this.currentDelta(); + this.options = options; + this.dragging = false; + + this.eventMouseDown = this.initDrag.bindAsEventListener(this); + Event.observe(this.handle, "mousedown", this.eventMouseDown); + + Draggables.register(this); + }, + + destroy: function() { + Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); + Draggables.unregister(this); + }, + + currentDelta: function() { + return([ + parseInt(Element.getStyle(this.element,'left') || '0'), + parseInt(Element.getStyle(this.element,'top') || '0')]); + }, + + initDrag: function(event) { + if(typeof Draggable._dragging[this.element] != 'undefined' && + Draggable._dragging[this.element]) return; + if(Event.isLeftClick(event)) { + // abort on form elements, fixes a Firefox issue + var src = Event.element(event); + if((tag_name = src.tagName.toUpperCase()) && ( + tag_name=='INPUT' || + tag_name=='SELECT' || + tag_name=='OPTION' || + tag_name=='BUTTON' || + tag_name=='TEXTAREA')) return; + + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + var pos = Position.cumulativeOffset(this.element); + this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); + + Draggables.activate(this); + Event.stop(event); + } + }, + + startDrag: function(event) { + this.dragging = true; + + if(this.options.zindex) { + this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); + this.element.style.zIndex = this.options.zindex; + } + + if(this.options.ghosting) { + this._clone = this.element.cloneNode(true); + Position.absolutize(this.element); + this.element.parentNode.insertBefore(this._clone, this.element); + } + + if(this.options.scroll) { + if (this.options.scroll == window) { + var where = this._getWindowScroll(this.options.scroll); + this.originalScrollLeft = where.left; + this.originalScrollTop = where.top; + } else { + this.originalScrollLeft = this.options.scroll.scrollLeft; + this.originalScrollTop = this.options.scroll.scrollTop; + } + } + + Draggables.notify('onStart', this, event); + + if(this.options.starteffect) this.options.starteffect(this.element); + }, + + updateDrag: function(event, pointer) { + if(!this.dragging) this.startDrag(event); + Position.prepare(); + Droppables.show(pointer, this.element); + Draggables.notify('onDrag', this, event); + + this.draw(pointer); + if(this.options.change) this.options.change(this); + + if(this.options.scroll) { + this.stopScrolling(); + + var p; + if (this.options.scroll == window) { + with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } + } else { + p = Position.page(this.options.scroll); + p[0] += this.options.scroll.scrollLeft + Position.deltaX; + p[1] += this.options.scroll.scrollTop + Position.deltaY; + p.push(p[0]+this.options.scroll.offsetWidth); + p.push(p[1]+this.options.scroll.offsetHeight); + } + var speed = [0,0]; + if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); + if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); + if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); + if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); + this.startScrolling(speed); + } + + // fix AppleWebKit rendering + if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); + + Event.stop(event); + }, + + finishDrag: function(event, success) { + this.dragging = false; + + if(this.options.ghosting) { + Position.relativize(this.element); + Element.remove(this._clone); + this._clone = null; + } + + if(success) Droppables.fire(event, this.element); + Draggables.notify('onEnd', this, event); + + var revert = this.options.revert; + if(revert && typeof revert == 'function') revert = revert(this.element); + + var d = this.currentDelta(); + if(revert && this.options.reverteffect) { + this.options.reverteffect(this.element, + d[1]-this.delta[1], d[0]-this.delta[0]); + } else { + this.delta = d; + } + + if(this.options.zindex) + this.element.style.zIndex = this.originalZ; + + if(this.options.endeffect) + this.options.endeffect(this.element); + + Draggables.deactivate(this); + Droppables.reset(); + }, + + keyPress: function(event) { + if(event.keyCode!=Event.KEY_ESC) return; + this.finishDrag(event, false); + Event.stop(event); + }, + + endDrag: function(event) { + if(!this.dragging) return; + this.stopScrolling(); + this.finishDrag(event, true); + Event.stop(event); + }, + + draw: function(point) { + var pos = Position.cumulativeOffset(this.element); + if(this.options.ghosting) { + var r = Position.realOffset(this.element); + pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; + } + + var d = this.currentDelta(); + pos[0] -= d[0]; pos[1] -= d[1]; + + if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { + pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; + pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; + } + + var p = [0,1].map(function(i){ + return (point[i]-pos[i]-this.offset[i]) + }.bind(this)); + + if(this.options.snap) { + if(typeof this.options.snap == 'function') { + p = this.options.snap(p[0],p[1],this); + } else { + if(this.options.snap instanceof Array) { + p = p.map( function(v, i) { + return Math.round(v/this.options.snap[i])*this.options.snap[i] }.bind(this)) + } else { + p = p.map( function(v) { + return Math.round(v/this.options.snap)*this.options.snap }.bind(this)) + } + }} + + var style = this.element.style; + if((!this.options.constraint) || (this.options.constraint=='horizontal')) + style.left = p[0] + "px"; + if((!this.options.constraint) || (this.options.constraint=='vertical')) + style.top = p[1] + "px"; + + if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering + }, + + stopScrolling: function() { + if(this.scrollInterval) { + clearInterval(this.scrollInterval); + this.scrollInterval = null; + Draggables._lastScrollPointer = null; + } + }, + + startScrolling: function(speed) { + if(!(speed[0] || speed[1])) return; + this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; + this.lastScrolled = new Date(); + this.scrollInterval = setInterval(this.scroll.bind(this), 10); + }, + + scroll: function() { + var current = new Date(); + var delta = current - this.lastScrolled; + this.lastScrolled = current; + if(this.options.scroll == window) { + with (this._getWindowScroll(this.options.scroll)) { + if (this.scrollSpeed[0] || this.scrollSpeed[1]) { + var d = delta / 1000; + this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); + } + } + } else { + this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; + this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; + } + + Position.prepare(); + Droppables.show(Draggables._lastPointer, this.element); + Draggables.notify('onDrag', this); + if (this._isScrollChild) { + Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); + Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; + Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; + if (Draggables._lastScrollPointer[0] < 0) + Draggables._lastScrollPointer[0] = 0; + if (Draggables._lastScrollPointer[1] < 0) + Draggables._lastScrollPointer[1] = 0; + this.draw(Draggables._lastScrollPointer); + } + + if(this.options.change) this.options.change(this); + }, + + _getWindowScroll: function(w) { + var T, L, W, H; + with (w.document) { + if (w.document.documentElement && documentElement.scrollTop) { + T = documentElement.scrollTop; + L = documentElement.scrollLeft; + } else if (w.document.body) { + T = body.scrollTop; + L = body.scrollLeft; + } + if (w.innerWidth) { + W = w.innerWidth; + H = w.innerHeight; + } else if (w.document.documentElement && documentElement.clientWidth) { + W = documentElement.clientWidth; + H = documentElement.clientHeight; + } else { + W = body.offsetWidth; + H = body.offsetHeight + } + } + return { top: T, left: L, width: W, height: H }; + } +} + +/*--------------------------------------------------------------------------*/ + +var SortableObserver = Class.create(); +SortableObserver.prototype = { + initialize: function(element, observer) { + this.element = $(element); + this.observer = observer; + this.lastValue = Sortable.serialize(this.element); + }, + + onStart: function() { + this.lastValue = Sortable.serialize(this.element); + }, + + onEnd: function() { + Sortable.unmark(); + if(this.lastValue != Sortable.serialize(this.element)) + this.observer(this.element) + } +} + +var Sortable = { + SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, + + sortables: {}, + + _findRootElement: function(element) { + while (element.tagName.toUpperCase() != "BODY") { + if(element.id && Sortable.sortables[element.id]) return element; + element = element.parentNode; + } + }, + + options: function(element) { + element = Sortable._findRootElement($(element)); + if(!element) return; + return Sortable.sortables[element.id]; + }, + + destroy: function(element){ + var s = Sortable.options(element); + + if(s) { + Draggables.removeObserver(s.element); + s.droppables.each(function(d){ Droppables.remove(d) }); + s.draggables.invoke('destroy'); + + delete Sortable.sortables[s.element.id]; + } + }, + + create: function(element) { + element = $(element); + var options = Object.extend({ + element: element, + tag: 'li', // assumes li children, override with tag: 'tagname' + dropOnEmpty: false, + tree: false, + treeTag: 'ul', + overlap: 'vertical', // one of 'vertical', 'horizontal' + constraint: 'vertical', // one of 'vertical', 'horizontal', false + containment: element, // also takes array of elements (or id's); or false + handle: false, // or a CSS class + only: false, + delay: 0, + hoverclass: null, + ghosting: false, + scroll: false, + scrollSensitivity: 20, + scrollSpeed: 15, + format: this.SERIALIZE_RULE, + onChange: Prototype.emptyFunction, + onUpdate: Prototype.emptyFunction + }, arguments[1] || {}); + + // clear any old sortable with same element + this.destroy(element); + + // build options for the draggables + var options_for_draggable = { + revert: true, + scroll: options.scroll, + scrollSpeed: options.scrollSpeed, + scrollSensitivity: options.scrollSensitivity, + delay: options.delay, + ghosting: options.ghosting, + constraint: options.constraint, + handle: options.handle }; + + if(options.starteffect) + options_for_draggable.starteffect = options.starteffect; + + if(options.reverteffect) + options_for_draggable.reverteffect = options.reverteffect; + else + if(options.ghosting) options_for_draggable.reverteffect = function(element) { + element.style.top = 0; + element.style.left = 0; + }; + + if(options.endeffect) + options_for_draggable.endeffect = options.endeffect; + + if(options.zindex) + options_for_draggable.zindex = options.zindex; + + // build options for the droppables + var options_for_droppable = { + overlap: options.overlap, + containment: options.containment, + tree: options.tree, + hoverclass: options.hoverclass, + onHover: Sortable.onHover + } + + var options_for_tree = { + onHover: Sortable.onEmptyHover, + overlap: options.overlap, + containment: options.containment, + hoverclass: options.hoverclass + } + + // fix for gecko engine + Element.cleanWhitespace(element); + + options.draggables = []; + options.droppables = []; + + // drop on empty handling + if(options.dropOnEmpty || options.tree) { + Droppables.add(element, options_for_tree); + options.droppables.push(element); + } + + (this.findElements(element, options) || []).each( function(e) { + // handles are per-draggable + var handle = options.handle ? + $(e).down('.'+options.handle,0) : e; + options.draggables.push( + new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); + Droppables.add(e, options_for_droppable); + if(options.tree) e.treeNode = element; + options.droppables.push(e); + }); + + if(options.tree) { + (Sortable.findTreeElements(element, options) || []).each( function(e) { + Droppables.add(e, options_for_tree); + e.treeNode = element; + options.droppables.push(e); + }); + } + + // keep reference + this.sortables[element.id] = options; + + // for onupdate + Draggables.addObserver(new SortableObserver(element, options.onUpdate)); + + }, + + // return all suitable-for-sortable elements in a guaranteed order + findElements: function(element, options) { + return Element.findChildren( + element, options.only, options.tree ? true : false, options.tag); + }, + + findTreeElements: function(element, options) { + return Element.findChildren( + element, options.only, options.tree ? true : false, options.treeTag); + }, + + onHover: function(element, dropon, overlap) { + if(Element.isParent(dropon, element)) return; + + if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { + return; + } else if(overlap>0.5) { + Sortable.mark(dropon, 'before'); + if(dropon.previousSibling != element) { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; // fix gecko rendering + dropon.parentNode.insertBefore(element, dropon); + if(dropon.parentNode!=oldParentNode) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } else { + Sortable.mark(dropon, 'after'); + var nextElement = dropon.nextSibling || null; + if(nextElement != element) { + var oldParentNode = element.parentNode; + element.style.visibility = "hidden"; // fix gecko rendering + dropon.parentNode.insertBefore(element, nextElement); + if(dropon.parentNode!=oldParentNode) + Sortable.options(oldParentNode).onChange(element); + Sortable.options(dropon.parentNode).onChange(element); + } + } + }, + + onEmptyHover: function(element, dropon, overlap) { + var oldParentNode = element.parentNode; + var droponOptions = Sortable.options(dropon); + + if(!Element.isParent(dropon, element)) { + var index; + + var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); + var child = null; + + if(children) { + var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); + + for (index = 0; index < children.length; index += 1) { + if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { + offset -= Element.offsetSize (children[index], droponOptions.overlap); + } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { + child = index + 1 < children.length ? children[index + 1] : null; + break; + } else { + child = children[index]; + break; + } + } + } + + dropon.insertBefore(element, child); + + Sortable.options(oldParentNode).onChange(element); + droponOptions.onChange(element); + } + }, + + unmark: function() { + if(Sortable._marker) Sortable._marker.hide(); + }, + + mark: function(dropon, position) { + // mark on ghosting only + var sortable = Sortable.options(dropon.parentNode); + if(sortable && !sortable.ghosting) return; + + if(!Sortable._marker) { + Sortable._marker = + ($('dropmarker') || Element.extend(document.createElement('DIV'))). + hide().addClassName('dropmarker').setStyle({position:'absolute'}); + document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); + } + var offsets = Position.cumulativeOffset(dropon); + Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); + + if(position=='after') + if(sortable.overlap == 'horizontal') + Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); + else + Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); + + Sortable._marker.show(); + }, + + _tree: function(element, options, parent) { + var children = Sortable.findElements(element, options) || []; + + for (var i = 0; i < children.length; ++i) { + var match = children[i].id.match(options.format); + + if (!match) continue; + + var child = { + id: encodeURIComponent(match ? match[1] : null), + element: element, + parent: parent, + children: [], + position: parent.children.length, + container: $(children[i]).down(options.treeTag) + } + + /* Get the element containing the children and recurse over it */ + if (child.container) + this._tree(child.container, options, child) + + parent.children.push (child); + } + + return parent; + }, + + tree: function(element) { + element = $(element); + var sortableOptions = this.options(element); + var options = Object.extend({ + tag: sortableOptions.tag, + treeTag: sortableOptions.treeTag, + only: sortableOptions.only, + name: element.id, + format: sortableOptions.format + }, arguments[1] || {}); + + var root = { + id: null, + parent: null, + children: [], + container: element, + position: 0 + } + + return Sortable._tree(element, options, root); + }, + + /* Construct a [i] index for a particular node */ + _constructIndex: function(node) { + var index = ''; + do { + if (node.id) index = '[' + node.position + ']' + index; + } while ((node = node.parent) != null); + return index; + }, + + sequence: function(element) { + element = $(element); + var options = Object.extend(this.options(element), arguments[1] || {}); + + return $(this.findElements(element, options) || []).map( function(item) { + return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; + }); + }, + + setSequence: function(element, new_sequence) { + element = $(element); + var options = Object.extend(this.options(element), arguments[2] || {}); + + var nodeMap = {}; + this.findElements(element, options).each( function(n) { + if (n.id.match(options.format)) + nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; + n.parentNode.removeChild(n); + }); + + new_sequence.each(function(ident) { + var n = nodeMap[ident]; + if (n) { + n[1].appendChild(n[0]); + delete nodeMap[ident]; + } + }); + }, + + serialize: function(element) { + element = $(element); + var options = Object.extend(Sortable.options(element), arguments[1] || {}); + var name = encodeURIComponent( + (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); + + if (options.tree) { + return Sortable.tree(element, arguments[1]).children.map( function (item) { + return [name + Sortable._constructIndex(item) + "[id]=" + + encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); + }).flatten().join('&'); + } else { + return Sortable.sequence(element, arguments[1]).map( function(item) { + return name + "[]=" + encodeURIComponent(item); + }).join('&'); + } + } +} + +// Returns true if child is contained within element +Element.isParent = function(child, element) { + if (!child.parentNode || child == element) return false; + if (child.parentNode == element) return true; + return Element.isParent(child.parentNode, element); +} + +Element.findChildren = function(element, only, recursive, tagName) { + if(!element.hasChildNodes()) return null; + tagName = tagName.toUpperCase(); + if(only) only = [only].flatten(); + var elements = []; + $A(element.childNodes).each( function(e) { + if(e.tagName && e.tagName.toUpperCase()==tagName && + (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) + elements.push(e); + if(recursive) { + var grandchildren = Element.findChildren(e, only, recursive, tagName); + if(grandchildren) elements.push(grandchildren); + } + }); + + return (elements.length>0 ? elements.flatten() : []); +} + +Element.offsetSize = function (element, type) { + return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; +} diff --git a/DQM/TrackerCommon/test/js_files/scriptaculous/src/effects.js b/DQM/TrackerCommon/test/js_files/scriptaculous/src/effects.js new file mode 100644 index 0000000000000..06f59b47698e6 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/scriptaculous/src/effects.js @@ -0,0 +1,1090 @@ +// script.aculo.us effects.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 + +// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// Contributors: +// Justin Palmer (http://encytemedia.com/) +// Mark Pilgrim (http://diveintomark.org/) +// Martin Bialasinki +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// converts rgb() and #xxx to #xxxxxx format, +// returns self (or first argument) if not convertable +String.prototype.parseColor = function() { + var color = '#'; + if(this.slice(0,4) == 'rgb(') { + var cols = this.slice(4,this.length-1).split(','); + var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); + } else { + if(this.slice(0,1) == '#') { + if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); + if(this.length==7) color = this.toLowerCase(); + } + } + return(color.length==7 ? color : (arguments[0] || this)); +} + +/*--------------------------------------------------------------------------*/ + +Element.collectTextNodes = function(element) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); + }).flatten().join(''); +} + +Element.collectTextNodesIgnoreClass = function(element, className) { + return $A($(element).childNodes).collect( function(node) { + return (node.nodeType==3 ? node.nodeValue : + ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? + Element.collectTextNodesIgnoreClass(node, className) : '')); + }).flatten().join(''); +} + +Element.setContentZoom = function(element, percent) { + element = $(element); + element.setStyle({fontSize: (percent/100) + 'em'}); + if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); + return element; +} + +Element.getOpacity = function(element){ + return $(element).getStyle('opacity'); +} + +Element.setOpacity = function(element, value){ + return $(element).setStyle({opacity:value}); +} + +Element.getInlineOpacity = function(element){ + return $(element).style.opacity || ''; +} + +Element.forceRerendering = function(element) { + try { + element = $(element); + var n = document.createTextNode(' '); + element.appendChild(n); + element.removeChild(n); + } catch(e) { } +}; + +/*--------------------------------------------------------------------------*/ + +Array.prototype.call = function() { + var args = arguments; + this.each(function(f){ f.apply(this, args) }); +} + +/*--------------------------------------------------------------------------*/ + +var Effect = { + _elementDoesNotExistError: { + name: 'ElementDoesNotExistError', + message: 'The specified DOM element does not exist, but is required for this effect to operate' + }, + tagifyText: function(element) { + if(typeof Builder == 'undefined') + throw("Effect.tagifyText requires including script.aculo.us' builder.js library"); + + var tagifyStyle = 'position:relative'; + if(/MSIE/.test(navigator.userAgent) && !window.opera) tagifyStyle += ';zoom:1'; + + element = $(element); + $A(element.childNodes).each( function(child) { + if(child.nodeType==3) { + child.nodeValue.toArray().each( function(character) { + element.insertBefore( + Builder.node('span',{style: tagifyStyle}, + character == ' ' ? String.fromCharCode(160) : character), + child); + }); + Element.remove(child); + } + }); + }, + multiple: function(element, effect) { + var elements; + if(((typeof element == 'object') || + (typeof element == 'function')) && + (element.length)) + elements = element; + else + elements = $(element).childNodes; + + var options = Object.extend({ + speed: 0.1, + delay: 0.0 + }, arguments[2] || {}); + var masterDelay = options.delay; + + $A(elements).each( function(element, index) { + new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); + }); + }, + PAIRS: { + 'slide': ['SlideDown','SlideUp'], + 'blind': ['BlindDown','BlindUp'], + 'appear': ['Appear','Fade'] + }, + toggle: function(element, effect) { + element = $(element); + effect = (effect || 'appear').toLowerCase(); + var options = Object.extend({ + queue: { position:'end', scope:(element.id || 'global'), limit: 1 } + }, arguments[2] || {}); + Effect[element.visible() ? + Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options); + } +}; + +var Effect2 = Effect; // deprecated + +/* ------------- transitions ------------- */ + +Effect.Transitions = { + linear: Prototype.K, + sinoidal: function(pos) { + return (-Math.cos(pos*Math.PI)/2) + 0.5; + }, + reverse: function(pos) { + return 1-pos; + }, + flicker: function(pos) { + return ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4; + }, + wobble: function(pos) { + return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5; + }, + pulse: function(pos, pulses) { + pulses = pulses || 5; + return ( + Math.round((pos % (1/pulses)) * pulses) == 0 ? + ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) : + 1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) + ); + }, + none: function(pos) { + return 0; + }, + full: function(pos) { + return 1; + } +}; + +/* ------------- core effects ------------- */ + +Effect.ScopedQueue = Class.create(); +Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), { + initialize: function() { + this.effects = []; + this.interval = null; + }, + _each: function(iterator) { + this.effects._each(iterator); + }, + add: function(effect) { + var timestamp = new Date().getTime(); + + var position = (typeof effect.options.queue == 'string') ? + effect.options.queue : effect.options.queue.position; + + switch(position) { + case 'front': + // move unstarted effects after this effect + this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { + e.startOn += effect.finishOn; + e.finishOn += effect.finishOn; + }); + break; + case 'with-last': + timestamp = this.effects.pluck('startOn').max() || timestamp; + break; + case 'end': + // start effect after last queued effect has finished + timestamp = this.effects.pluck('finishOn').max() || timestamp; + break; + } + + effect.startOn += timestamp; + effect.finishOn += timestamp; + + if(!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) + this.effects.push(effect); + + if(!this.interval) + this.interval = setInterval(this.loop.bind(this), 15); + }, + remove: function(effect) { + this.effects = this.effects.reject(function(e) { return e==effect }); + if(this.effects.length == 0) { + clearInterval(this.interval); + this.interval = null; + } + }, + loop: function() { + var timePos = new Date().getTime(); + for(var i=0, len=this.effects.length;i= this.startOn) { + if(timePos >= this.finishOn) { + this.render(1.0); + this.cancel(); + this.event('beforeFinish'); + if(this.finish) this.finish(); + this.event('afterFinish'); + return; + } + var pos = (timePos - this.startOn) / (this.finishOn - this.startOn); + var frame = Math.round(pos * this.options.fps * this.options.duration); + if(frame > this.currentFrame) { + this.render(pos); + this.currentFrame = frame; + } + } + }, + render: function(pos) { + if(this.state == 'idle') { + this.state = 'running'; + this.event('beforeSetup'); + if(this.setup) this.setup(); + this.event('afterSetup'); + } + if(this.state == 'running') { + if(this.options.transition) pos = this.options.transition(pos); + pos *= (this.options.to-this.options.from); + pos += this.options.from; + this.position = pos; + this.event('beforeUpdate'); + if(this.update) this.update(pos); + this.event('afterUpdate'); + } + }, + cancel: function() { + if(!this.options.sync) + Effect.Queues.get(typeof this.options.queue == 'string' ? + 'global' : this.options.queue.scope).remove(this); + this.state = 'finished'; + }, + event: function(eventName) { + if(this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); + if(this.options[eventName]) this.options[eventName](this); + }, + inspect: function() { + var data = $H(); + for(property in this) + if(typeof this[property] != 'function') data[property] = this[property]; + return '#'; + } +} + +Effect.Parallel = Class.create(); +Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), { + initialize: function(effects) { + this.effects = effects || []; + this.start(arguments[1]); + }, + update: function(position) { + this.effects.invoke('render', position); + }, + finish: function(position) { + this.effects.each( function(effect) { + effect.render(1.0); + effect.cancel(); + effect.event('beforeFinish'); + if(effect.finish) effect.finish(position); + effect.event('afterFinish'); + }); + } +}); + +Effect.Event = Class.create(); +Object.extend(Object.extend(Effect.Event.prototype, Effect.Base.prototype), { + initialize: function() { + var options = Object.extend({ + duration: 0 + }, arguments[0] || {}); + this.start(options); + }, + update: Prototype.emptyFunction +}); + +Effect.Opacity = Class.create(); +Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), { + initialize: function(element) { + this.element = $(element); + if(!this.element) throw(Effect._elementDoesNotExistError); + // make this work on IE on elements without 'layout' + if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + var options = Object.extend({ + from: this.element.getOpacity() || 0.0, + to: 1.0 + }, arguments[1] || {}); + this.start(options); + }, + update: function(position) { + this.element.setOpacity(position); + } +}); + +Effect.Move = Class.create(); +Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), { + initialize: function(element) { + this.element = $(element); + if(!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + x: 0, + y: 0, + mode: 'relative' + }, arguments[1] || {}); + this.start(options); + }, + setup: function() { + // Bug in Opera: Opera returns the "real" position of a static element or + // relative element that does not have top/left explicitly set. + // ==> Always set top and left for position relative elements in your stylesheets + // (to 0 if you do not need them) + this.element.makePositioned(); + this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); + this.originalTop = parseFloat(this.element.getStyle('top') || '0'); + if(this.options.mode == 'absolute') { + // absolute movement, so we need to calc deltaX and deltaY + this.options.x = this.options.x - this.originalLeft; + this.options.y = this.options.y - this.originalTop; + } + }, + update: function(position) { + this.element.setStyle({ + left: Math.round(this.options.x * position + this.originalLeft) + 'px', + top: Math.round(this.options.y * position + this.originalTop) + 'px' + }); + } +}); + +// for backwards compatibility +Effect.MoveBy = function(element, toTop, toLeft) { + return new Effect.Move(element, + Object.extend({ x: toLeft, y: toTop }, arguments[3] || {})); +}; + +Effect.Scale = Class.create(); +Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), { + initialize: function(element, percent) { + this.element = $(element); + if(!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + scaleX: true, + scaleY: true, + scaleContent: true, + scaleFromCenter: false, + scaleMode: 'box', // 'box' or 'contents' or {} with provided values + scaleFrom: 100.0, + scaleTo: percent + }, arguments[2] || {}); + this.start(options); + }, + setup: function() { + this.restoreAfterFinish = this.options.restoreAfterFinish || false; + this.elementPositioning = this.element.getStyle('position'); + + this.originalStyle = {}; + ['top','left','width','height','fontSize'].each( function(k) { + this.originalStyle[k] = this.element.style[k]; + }.bind(this)); + + this.originalTop = this.element.offsetTop; + this.originalLeft = this.element.offsetLeft; + + var fontSize = this.element.getStyle('font-size') || '100%'; + ['em','px','%','pt'].each( function(fontSizeType) { + if(fontSize.indexOf(fontSizeType)>0) { + this.fontSize = parseFloat(fontSize); + this.fontSizeType = fontSizeType; + } + }.bind(this)); + + this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; + + this.dims = null; + if(this.options.scaleMode=='box') + this.dims = [this.element.offsetHeight, this.element.offsetWidth]; + if(/^content/.test(this.options.scaleMode)) + this.dims = [this.element.scrollHeight, this.element.scrollWidth]; + if(!this.dims) + this.dims = [this.options.scaleMode.originalHeight, + this.options.scaleMode.originalWidth]; + }, + update: function(position) { + var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); + if(this.options.scaleContent && this.fontSize) + this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); + this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); + }, + finish: function(position) { + if(this.restoreAfterFinish) this.element.setStyle(this.originalStyle); + }, + setDimensions: function(height, width) { + var d = {}; + if(this.options.scaleX) d.width = Math.round(width) + 'px'; + if(this.options.scaleY) d.height = Math.round(height) + 'px'; + if(this.options.scaleFromCenter) { + var topd = (height - this.dims[0])/2; + var leftd = (width - this.dims[1])/2; + if(this.elementPositioning == 'absolute') { + if(this.options.scaleY) d.top = this.originalTop-topd + 'px'; + if(this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; + } else { + if(this.options.scaleY) d.top = -topd + 'px'; + if(this.options.scaleX) d.left = -leftd + 'px'; + } + } + this.element.setStyle(d); + } +}); + +Effect.Highlight = Class.create(); +Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), { + initialize: function(element) { + this.element = $(element); + if(!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {}); + this.start(options); + }, + setup: function() { + // Prevent executing on elements not in the layout flow + if(this.element.getStyle('display')=='none') { this.cancel(); return; } + // Disable background image during the effect + this.oldStyle = {}; + if (!this.options.keepBackgroundImage) { + this.oldStyle.backgroundImage = this.element.getStyle('background-image'); + this.element.setStyle({backgroundImage: 'none'}); + } + if(!this.options.endcolor) + this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); + if(!this.options.restorecolor) + this.options.restorecolor = this.element.getStyle('background-color'); + // init color calculations + this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); + this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); + }, + update: function(position) { + this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ + return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) }); + }, + finish: function() { + this.element.setStyle(Object.extend(this.oldStyle, { + backgroundColor: this.options.restorecolor + })); + } +}); + +Effect.ScrollTo = Class.create(); +Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), { + initialize: function(element) { + this.element = $(element); + this.start(arguments[1] || {}); + }, + setup: function() { + Position.prepare(); + var offsets = Position.cumulativeOffset(this.element); + if(this.options.offset) offsets[1] += this.options.offset; + var max = window.innerHeight ? + window.height - window.innerHeight : + document.body.scrollHeight - + (document.documentElement.clientHeight ? + document.documentElement.clientHeight : document.body.clientHeight); + this.scrollStart = Position.deltaY; + this.delta = (offsets[1] > max ? max : offsets[1]) - this.scrollStart; + }, + update: function(position) { + Position.prepare(); + window.scrollTo(Position.deltaX, + this.scrollStart + (position*this.delta)); + } +}); + +/* ------------- combination effects ------------- */ + +Effect.Fade = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + var options = Object.extend({ + from: element.getOpacity() || 1.0, + to: 0.0, + afterFinishInternal: function(effect) { + if(effect.options.to!=0) return; + effect.element.hide().setStyle({opacity: oldOpacity}); + }}, arguments[1] || {}); + return new Effect.Opacity(element,options); +} + +Effect.Appear = function(element) { + element = $(element); + var options = Object.extend({ + from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), + to: 1.0, + // force Safari to render floated elements properly + afterFinishInternal: function(effect) { + effect.element.forceRerendering(); + }, + beforeSetup: function(effect) { + effect.element.setOpacity(effect.options.from).show(); + }}, arguments[1] || {}); + return new Effect.Opacity(element,options); +} + +Effect.Puff = function(element) { + element = $(element); + var oldStyle = { + opacity: element.getInlineOpacity(), + position: element.getStyle('position'), + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height + }; + return new Effect.Parallel( + [ new Effect.Scale(element, 200, + { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], + Object.extend({ duration: 1.0, + beforeSetupInternal: function(effect) { + Position.absolutize(effect.effects[0].element) + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().setStyle(oldStyle); } + }, arguments[1] || {}) + ); +} + +Effect.BlindUp = function(element) { + element = $(element); + element.makeClipping(); + return new Effect.Scale(element, 0, + Object.extend({ scaleContent: false, + scaleX: false, + restoreAfterFinish: true, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }, arguments[1] || {}) + ); +} + +Effect.BlindDown = function(element) { + element = $(element); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: 0, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping(); + } + }, arguments[1] || {})); +} + +Effect.SwitchOff = function(element) { + element = $(element); + var oldOpacity = element.getInlineOpacity(); + return new Effect.Appear(element, Object.extend({ + duration: 0.4, + from: 0, + transition: Effect.Transitions.flicker, + afterFinishInternal: function(effect) { + new Effect.Scale(effect.element, 1, { + duration: 0.3, scaleFromCenter: true, + scaleX: false, scaleContent: false, restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); + } + }) + } + }, arguments[1] || {})); +} + +Effect.DropOut = function(element) { + element = $(element); + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left'), + opacity: element.getInlineOpacity() }; + return new Effect.Parallel( + [ new Effect.Move(element, {x: 0, y: 100, sync: true }), + new Effect.Opacity(element, { sync: true, to: 0.0 }) ], + Object.extend( + { duration: 0.5, + beforeSetup: function(effect) { + effect.effects[0].element.makePositioned(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); + } + }, arguments[1] || {})); +} + +Effect.Shake = function(element) { + element = $(element); + var oldStyle = { + top: element.getStyle('top'), + left: element.getStyle('left') }; + return new Effect.Move(element, + { x: 20, y: 0, duration: 0.05, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: 40, y: 0, duration: 0.1, afterFinishInternal: function(effect) { + new Effect.Move(effect.element, + { x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) { + effect.element.undoPositioned().setStyle(oldStyle); + }}) }}) }}) }}) }}) }}); +} + +Effect.SlideDown = function(element) { + element = $(element).cleanWhitespace(); + // SlideDown need to have the content of the element wrapped in a container element with fixed height! + var oldInnerBottom = element.down().getStyle('bottom'); + var elementDimensions = element.getDimensions(); + return new Effect.Scale(element, 100, Object.extend({ + scaleContent: false, + scaleX: false, + scaleFrom: window.opera ? 0 : 1, + scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, + restoreAfterFinish: true, + afterSetup: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if(window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().setStyle({height: '0px'}).show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.undoClipping().undoPositioned(); + effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } + }, arguments[1] || {}) + ); +} + +Effect.SlideUp = function(element) { + element = $(element).cleanWhitespace(); + var oldInnerBottom = element.down().getStyle('bottom'); + return new Effect.Scale(element, window.opera ? 0 : 1, + Object.extend({ scaleContent: false, + scaleX: false, + scaleMode: 'box', + scaleFrom: 100, + restoreAfterFinish: true, + beforeStartInternal: function(effect) { + effect.element.makePositioned(); + effect.element.down().makePositioned(); + if(window.opera) effect.element.setStyle({top: ''}); + effect.element.makeClipping().show(); + }, + afterUpdateInternal: function(effect) { + effect.element.down().setStyle({bottom: + (effect.dims[0] - effect.element.clientHeight) + 'px' }); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom}); + effect.element.down().undoPositioned(); + } + }, arguments[1] || {}) + ); +} + +// Bug in opera makes the TD containing this element expand for a instance after finish +Effect.Squish = function(element) { + return new Effect.Scale(element, window.opera ? 1 : 0, { + restoreAfterFinish: true, + beforeSetup: function(effect) { + effect.element.makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping(); + } + }); +} + +Effect.Grow = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.full + }, arguments[1] || {}); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var initialMoveX, initialMoveY; + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + initialMoveX = initialMoveY = moveX = moveY = 0; + break; + case 'top-right': + initialMoveX = dims.width; + initialMoveY = moveY = 0; + moveX = -dims.width; + break; + case 'bottom-left': + initialMoveX = moveX = 0; + initialMoveY = dims.height; + moveY = -dims.height; + break; + case 'bottom-right': + initialMoveX = dims.width; + initialMoveY = dims.height; + moveX = -dims.width; + moveY = -dims.height; + break; + case 'center': + initialMoveX = dims.width / 2; + initialMoveY = dims.height / 2; + moveX = -dims.width / 2; + moveY = -dims.height / 2; + break; + } + + return new Effect.Move(element, { + x: initialMoveX, + y: initialMoveY, + duration: 0.01, + beforeSetup: function(effect) { + effect.element.hide().makeClipping().makePositioned(); + }, + afterFinishInternal: function(effect) { + new Effect.Parallel( + [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), + new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), + new Effect.Scale(effect.element, 100, { + scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, + sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) + ], Object.extend({ + beforeSetup: function(effect) { + effect.effects[0].element.setStyle({height: '0px'}).show(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); + } + }, options) + ) + } + }); +} + +Effect.Shrink = function(element) { + element = $(element); + var options = Object.extend({ + direction: 'center', + moveTransition: Effect.Transitions.sinoidal, + scaleTransition: Effect.Transitions.sinoidal, + opacityTransition: Effect.Transitions.none + }, arguments[1] || {}); + var oldStyle = { + top: element.style.top, + left: element.style.left, + height: element.style.height, + width: element.style.width, + opacity: element.getInlineOpacity() }; + + var dims = element.getDimensions(); + var moveX, moveY; + + switch (options.direction) { + case 'top-left': + moveX = moveY = 0; + break; + case 'top-right': + moveX = dims.width; + moveY = 0; + break; + case 'bottom-left': + moveX = 0; + moveY = dims.height; + break; + case 'bottom-right': + moveX = dims.width; + moveY = dims.height; + break; + case 'center': + moveX = dims.width / 2; + moveY = dims.height / 2; + break; + } + + return new Effect.Parallel( + [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), + new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), + new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) + ], Object.extend({ + beforeStartInternal: function(effect) { + effect.effects[0].element.makePositioned().makeClipping(); + }, + afterFinishInternal: function(effect) { + effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } + }, options) + ); +} + +Effect.Pulsate = function(element) { + element = $(element); + var options = arguments[1] || {}; + var oldOpacity = element.getInlineOpacity(); + var transition = options.transition || Effect.Transitions.sinoidal; + var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) }; + reverser.bind(transition); + return new Effect.Opacity(element, + Object.extend(Object.extend({ duration: 2.0, from: 0, + afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } + }, options), {transition: reverser})); +} + +Effect.Fold = function(element) { + element = $(element); + var oldStyle = { + top: element.style.top, + left: element.style.left, + width: element.style.width, + height: element.style.height }; + element.makeClipping(); + return new Effect.Scale(element, 5, Object.extend({ + scaleContent: false, + scaleX: false, + afterFinishInternal: function(effect) { + new Effect.Scale(element, 1, { + scaleContent: false, + scaleY: false, + afterFinishInternal: function(effect) { + effect.element.hide().undoClipping().setStyle(oldStyle); + } }); + }}, arguments[1] || {})); +}; + +Effect.Morph = Class.create(); +Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), { + initialize: function(element) { + this.element = $(element); + if(!this.element) throw(Effect._elementDoesNotExistError); + var options = Object.extend({ + style: {} + }, arguments[1] || {}); + if (typeof options.style == 'string') { + if(options.style.indexOf(':') == -1) { + var cssText = '', selector = '.' + options.style; + $A(document.styleSheets).reverse().each(function(styleSheet) { + if (styleSheet.cssRules) cssRules = styleSheet.cssRules; + else if (styleSheet.rules) cssRules = styleSheet.rules; + $A(cssRules).reverse().each(function(rule) { + if (selector == rule.selectorText) { + cssText = rule.style.cssText; + throw $break; + } + }); + if (cssText) throw $break; + }); + this.style = cssText.parseStyle(); + options.afterFinishInternal = function(effect){ + effect.element.addClassName(effect.options.style); + effect.transforms.each(function(transform) { + if(transform.style != 'opacity') + effect.element.style[transform.style.camelize()] = ''; + }); + } + } else this.style = options.style.parseStyle(); + } else this.style = $H(options.style) + this.start(options); + }, + setup: function(){ + function parseColor(color){ + if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; + color = color.parseColor(); + return $R(0,2).map(function(i){ + return parseInt( color.slice(i*2+1,i*2+3), 16 ) + }); + } + this.transforms = this.style.map(function(pair){ + var property = pair[0].underscore().dasherize(), value = pair[1], unit = null; + + if(value.parseColor('#zzzzzz') != '#zzzzzz') { + value = value.parseColor(); + unit = 'color'; + } else if(property == 'opacity') { + value = parseFloat(value); + if(/MSIE/.test(navigator.userAgent) && !window.opera && (!this.element.currentStyle.hasLayout)) + this.element.setStyle({zoom: 1}); + } else if(Element.CSS_LENGTH.test(value)) + var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/), + value = parseFloat(components[1]), unit = (components.length == 3) ? components[2] : null; + + var originalValue = this.element.getStyle(property); + return $H({ + style: property, + originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), + targetValue: unit=='color' ? parseColor(value) : value, + unit: unit + }); + }.bind(this)).reject(function(transform){ + return ( + (transform.originalValue == transform.targetValue) || + ( + transform.unit != 'color' && + (isNaN(transform.originalValue) || isNaN(transform.targetValue)) + ) + ) + }); + }, + update: function(position) { + var style = $H(), value = null; + this.transforms.each(function(transform){ + value = transform.unit=='color' ? + $R(0,2).inject('#',function(m,v,i){ + return m+(Math.round(transform.originalValue[i]+ + (transform.targetValue[i] - transform.originalValue[i])*position)).toColorPart() }) : + transform.originalValue + Math.round( + ((transform.targetValue - transform.originalValue) * position) * 1000)/1000 + transform.unit; + style[transform.style] = value; + }); + this.element.setStyle(style); + } +}); + +Effect.Transform = Class.create(); +Object.extend(Effect.Transform.prototype, { + initialize: function(tracks){ + this.tracks = []; + this.options = arguments[1] || {}; + this.addTracks(tracks); + }, + addTracks: function(tracks){ + tracks.each(function(track){ + var data = $H(track).values().first(); + this.tracks.push($H({ + ids: $H(track).keys().first(), + effect: Effect.Morph, + options: { style: data } + })); + }.bind(this)); + return this; + }, + play: function(){ + return new Effect.Parallel( + this.tracks.map(function(track){ + var elements = [$(track.ids) || $$(track.ids)].flatten(); + return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) }); + }).flatten(), + this.options + ); + } +}); + +Element.CSS_PROPERTIES = $w( + 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + + 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + + 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + + 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + + 'fontSize fontWeight height left letterSpacing lineHeight ' + + 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ + 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + + 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + + 'right textIndent top width wordSpacing zIndex'); + +Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; + +String.prototype.parseStyle = function(){ + var element = Element.extend(document.createElement('div')); + element.innerHTML = '

    '; + var style = element.down().style, styleRules = $H(); + + Element.CSS_PROPERTIES.each(function(property){ + if(style[property]) styleRules[property] = style[property]; + }); + if(/MSIE/.test(navigator.userAgent) && !window.opera && this.indexOf('opacity') > -1) { + styleRules.opacity = this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]; + } + return styleRules; +}; + +Element.morph = function(element, style) { + new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || {})); + return element; +}; + +['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom', + 'collectTextNodes','collectTextNodesIgnoreClass','morph'].each( + function(f) { Element.Methods[f] = Element[f]; } +); + +Element.Methods.visualEffect = function(element, effect, options) { + s = effect.gsub(/_/, '-').camelize(); + effect_class = s.charAt(0).toUpperCase() + s.substring(1); + new Effect[effect_class](element, options); + return $(element); +}; + +Element.addMethods(); \ No newline at end of file diff --git a/DQM/TrackerCommon/test/js_files/scriptaculous/src/scriptaculous.js b/DQM/TrackerCommon/test/js_files/scriptaculous/src/scriptaculous.js new file mode 100644 index 0000000000000..585313c3a87a2 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/scriptaculous/src/scriptaculous.js @@ -0,0 +1,51 @@ +// script.aculo.us scriptaculous.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 + +// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +var Scriptaculous = { + Version: '1.7.0', + require: function(libraryName) { + // inserting via DOM fails in Safari 2.0, so brute force approach + document.write(''); + }, + load: function() { + if((typeof Prototype=='undefined') || + (typeof Element == 'undefined') || + (typeof Element.Methods=='undefined') || + parseFloat(Prototype.Version.split(".")[0] + "." + + Prototype.Version.split(".")[1]) < 1.5) + throw("script.aculo.us requires the Prototype JavaScript framework >= 1.5.0"); + + $A(document.getElementsByTagName("script")).findAll( function(s) { + return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/)) + }).each( function(s) { + var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,''); + var includes = s.src.match(/\?.*load=([a-z,]*)/); + (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider').split(',').each( + function(include) { Scriptaculous.require(path+include+'.js') }); + }); + } +} + +Scriptaculous.load(); \ No newline at end of file diff --git a/DQM/TrackerCommon/test/js_files/scriptaculous/src/slider.js b/DQM/TrackerCommon/test/js_files/scriptaculous/src/slider.js new file mode 100644 index 0000000000000..f24f28233032f --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/scriptaculous/src/slider.js @@ -0,0 +1,278 @@ +// script.aculo.us slider.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 + +// Copyright (c) 2005, 2006 Marty Haught, Thomas Fuchs +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +if(!Control) var Control = {}; +Control.Slider = Class.create(); + +// options: +// axis: 'vertical', or 'horizontal' (default) +// +// callbacks: +// onChange(value) +// onSlide(value) +Control.Slider.prototype = { + initialize: function(handle, track, options) { + var slider = this; + + if(handle instanceof Array) { + this.handles = handle.collect( function(e) { return $(e) }); + } else { + this.handles = [$(handle)]; + } + + this.track = $(track); + this.options = options || {}; + + this.axis = this.options.axis || 'horizontal'; + this.increment = this.options.increment || 1; + this.step = parseInt(this.options.step || '1'); + this.range = this.options.range || $R(0,1); + + this.value = 0; // assure backwards compat + this.values = this.handles.map( function() { return 0 }); + this.spans = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false; + this.options.startSpan = $(this.options.startSpan || null); + this.options.endSpan = $(this.options.endSpan || null); + + this.restricted = this.options.restricted || false; + + this.maximum = this.options.maximum || this.range.end; + this.minimum = this.options.minimum || this.range.start; + + // Will be used to align the handle onto the track, if necessary + this.alignX = parseInt(this.options.alignX || '0'); + this.alignY = parseInt(this.options.alignY || '0'); + + this.trackLength = this.maximumOffset() - this.minimumOffset(); + + this.handleLength = this.isVertical() ? + (this.handles[0].offsetHeight != 0 ? + this.handles[0].offsetHeight : this.handles[0].style.height.replace(/px$/,"")) : + (this.handles[0].offsetWidth != 0 ? this.handles[0].offsetWidth : + this.handles[0].style.width.replace(/px$/,"")); + + this.active = false; + this.dragging = false; + this.disabled = false; + + if(this.options.disabled) this.setDisabled(); + + // Allowed values array + this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false; + if(this.allowedValues) { + this.minimum = this.allowedValues.min(); + this.maximum = this.allowedValues.max(); + } + + this.eventMouseDown = this.startDrag.bindAsEventListener(this); + this.eventMouseUp = this.endDrag.bindAsEventListener(this); + this.eventMouseMove = this.update.bindAsEventListener(this); + + // Initialize handles in reverse (make sure first handle is active) + this.handles.each( function(h,i) { + i = slider.handles.length-1-i; + slider.setValue(parseFloat( + (slider.options.sliderValue instanceof Array ? + slider.options.sliderValue[i] : slider.options.sliderValue) || + slider.range.start), i); + Element.makePositioned(h); // fix IE + Event.observe(h, "mousedown", slider.eventMouseDown); + }); + + Event.observe(this.track, "mousedown", this.eventMouseDown); + Event.observe(document, "mouseup", this.eventMouseUp); + Event.observe(document, "mousemove", this.eventMouseMove); + + this.initialized = true; + }, + dispose: function() { + var slider = this; + Event.stopObserving(this.track, "mousedown", this.eventMouseDown); + Event.stopObserving(document, "mouseup", this.eventMouseUp); + Event.stopObserving(document, "mousemove", this.eventMouseMove); + this.handles.each( function(h) { + Event.stopObserving(h, "mousedown", slider.eventMouseDown); + }); + }, + setDisabled: function(){ + this.disabled = true; + }, + setEnabled: function(){ + this.disabled = false; + }, + getNearestValue: function(value){ + if(this.allowedValues){ + if(value >= this.allowedValues.max()) return(this.allowedValues.max()); + if(value <= this.allowedValues.min()) return(this.allowedValues.min()); + + var offset = Math.abs(this.allowedValues[0] - value); + var newValue = this.allowedValues[0]; + this.allowedValues.each( function(v) { + var currentOffset = Math.abs(v - value); + if(currentOffset <= offset){ + newValue = v; + offset = currentOffset; + } + }); + return newValue; + } + if(value > this.range.end) return this.range.end; + if(value < this.range.start) return this.range.start; + return value; + }, + setValue: function(sliderValue, handleIdx){ + if(!this.active) { + this.activeHandleIdx = handleIdx || 0; + this.activeHandle = this.handles[this.activeHandleIdx]; + this.updateStyles(); + } + handleIdx = handleIdx || this.activeHandleIdx || 0; + if(this.initialized && this.restricted) { + if((handleIdx>0) && (sliderValuethis.values[handleIdx+1])) + sliderValue = this.values[handleIdx+1]; + } + sliderValue = this.getNearestValue(sliderValue); + this.values[handleIdx] = sliderValue; + this.value = this.values[0]; // assure backwards compat + + this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = + this.translateToPx(sliderValue); + + this.drawSpans(); + if(!this.dragging || !this.event) this.updateFinished(); + }, + setValueBy: function(delta, handleIdx) { + this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta, + handleIdx || this.activeHandleIdx || 0); + }, + translateToPx: function(value) { + return Math.round( + ((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) * + (value - this.range.start)) + "px"; + }, + translateToValue: function(offset) { + return ((offset/(this.trackLength-this.handleLength) * + (this.range.end-this.range.start)) + this.range.start); + }, + getRange: function(range) { + var v = this.values.sortBy(Prototype.K); + range = range || 0; + return $R(v[range],v[range+1]); + }, + minimumOffset: function(){ + return(this.isVertical() ? this.alignY : this.alignX); + }, + maximumOffset: function(){ + return(this.isVertical() ? + (this.track.offsetHeight != 0 ? this.track.offsetHeight : + this.track.style.height.replace(/px$/,"")) - this.alignY : + (this.track.offsetWidth != 0 ? this.track.offsetWidth : + this.track.style.width.replace(/px$/,"")) - this.alignY); + }, + isVertical: function(){ + return (this.axis == 'vertical'); + }, + drawSpans: function() { + var slider = this; + if(this.spans) + $R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) }); + if(this.options.startSpan) + this.setSpan(this.options.startSpan, + $R(0, this.values.length>1 ? this.getRange(0).min() : this.value )); + if(this.options.endSpan) + this.setSpan(this.options.endSpan, + $R(this.values.length>1 ? this.getRange(this.spans.length-1).max() : this.value, this.maximum)); + }, + setSpan: function(span, range) { + if(this.isVertical()) { + span.style.top = this.translateToPx(range.start); + span.style.height = this.translateToPx(range.end - range.start + this.range.start); + } else { + span.style.left = this.translateToPx(range.start); + span.style.width = this.translateToPx(range.end - range.start + this.range.start); + } + }, + updateStyles: function() { + this.handles.each( function(h){ Element.removeClassName(h, 'selected') }); + Element.addClassName(this.activeHandle, 'selected'); + }, + startDrag: function(event) { + if(Event.isLeftClick(event)) { + if(!this.disabled){ + this.active = true; + + var handle = Event.element(event); + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + var track = handle; + if(track==this.track) { + var offsets = Position.cumulativeOffset(this.track); + this.event = event; + this.setValue(this.translateToValue( + (this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2) + )); + var offsets = Position.cumulativeOffset(this.activeHandle); + this.offsetX = (pointer[0] - offsets[0]); + this.offsetY = (pointer[1] - offsets[1]); + } else { + // find the handle (prevents issues with Safari) + while((this.handles.indexOf(handle) == -1) && handle.parentNode) + handle = handle.parentNode; + + if(this.handles.indexOf(handle)!=-1) { + this.activeHandle = handle; + this.activeHandleIdx = this.handles.indexOf(this.activeHandle); + this.updateStyles(); + + var offsets = Position.cumulativeOffset(this.activeHandle); + this.offsetX = (pointer[0] - offsets[0]); + this.offsetY = (pointer[1] - offsets[1]); + } + } + } + Event.stop(event); + } + }, + update: function(event) { + if(this.active) { + if(!this.dragging) this.dragging = true; + this.draw(event); + // fix AppleWebKit rendering + if(navigator.appVersion.indexOf('AppleWebKit')>0) window.scrollBy(0,0); + Event.stop(event); + } + }, + draw: function(event) { + var pointer = [Event.pointerX(event), Event.pointerY(event)]; + var offsets = Position.cumulativeOffset(this.track); + pointer[0] -= this.offsetX + offsets[0]; + pointer[1] -= this.offsetY + offsets[1]; + this.event = event; + this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] )); + if(this.initialized && this.options.onSlide) + this.options.onSlide(this.values.length>1 ? this.values : this.value, this); + }, + endDrag: function(event) { + if(this.active && this.dragging) { + this.finishDrag(event, true); + Event.stop(event); + } + this.active = false; + this.dragging = false; + }, + finishDrag: function(event, success) { + this.active = false; + this.dragging = false; + this.updateFinished(); + }, + updateFinished: function() { + if(this.initialized && this.options.onChange) + this.options.onChange(this.values.length>1 ? this.values : this.value, this); + this.event = null; + } +} \ No newline at end of file diff --git a/DQM/TrackerCommon/test/js_files/scriptaculous/src/unittest.js b/DQM/TrackerCommon/test/js_files/scriptaculous/src/unittest.js new file mode 100644 index 0000000000000..a4478855ec204 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/scriptaculous/src/unittest.js @@ -0,0 +1,564 @@ +// script.aculo.us unittest.js v1.7.0, Fri Jan 19 19:16:36 CET 2007 + +// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) +// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com) +// (c) 2005, 2006 Michael Schuerig (http://www.schuerig.de/michael/) +// +// script.aculo.us is freely distributable under the terms of an MIT-style license. +// For details, see the script.aculo.us web site: http://script.aculo.us/ + +// experimental, Firefox-only +Event.simulateMouse = function(element, eventName) { + var options = Object.extend({ + pointerX: 0, + pointerY: 0, + buttons: 0, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false + }, arguments[2] || {}); + var oEvent = document.createEvent("MouseEvents"); + oEvent.initMouseEvent(eventName, true, true, document.defaultView, + options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY, + options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, 0, $(element)); + + if(this.mark) Element.remove(this.mark); + this.mark = document.createElement('div'); + this.mark.appendChild(document.createTextNode(" ")); + document.body.appendChild(this.mark); + this.mark.style.position = 'absolute'; + this.mark.style.top = options.pointerY + "px"; + this.mark.style.left = options.pointerX + "px"; + this.mark.style.width = "5px"; + this.mark.style.height = "5px;"; + this.mark.style.borderTop = "1px solid red;" + this.mark.style.borderLeft = "1px solid red;" + + if(this.step) + alert('['+new Date().getTime().toString()+'] '+eventName+'/'+Test.Unit.inspect(options)); + + $(element).dispatchEvent(oEvent); +}; + +// Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", this doesn't work in 1.0.6 or DP2. +// You need to downgrade to 1.0.4 for now to get this working +// See https://bugzilla.mozilla.org/show_bug.cgi?id=289940 for the fix that fixed too much +Event.simulateKey = function(element, eventName) { + var options = Object.extend({ + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + keyCode: 0, + charCode: 0 + }, arguments[2] || {}); + + var oEvent = document.createEvent("KeyEvents"); + oEvent.initKeyEvent(eventName, true, true, window, + options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, + options.keyCode, options.charCode ); + $(element).dispatchEvent(oEvent); +}; + +Event.simulateKeys = function(element, command) { + for(var i=0; i
    ' + + '' + + '' + + '' + + '
    StatusTestMessage
    '; + this.logsummary = $('logsummary') + this.loglines = $('loglines'); + }, + _toHTML: function(txt) { + return txt.escapeHTML().replace(/\n/g,"
    "); + }, + addLinksToResults: function(){ + $$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log + td.title = "Run only this test" + Event.observe(td, 'click', function(){ window.location.search = "?tests=" + td.innerHTML;}); + }); + $$("tr.passed .nameCell").each( function(td){ // todo: limit to children of this.log + td.title = "Run all tests" + Event.observe(td, 'click', function(){ window.location.search = "";}); + }); + } +} + +Test.Unit.Runner = Class.create(); +Test.Unit.Runner.prototype = { + initialize: function(testcases) { + this.options = Object.extend({ + testLog: 'testlog' + }, arguments[1] || {}); + this.options.resultsURL = this.parseResultsURLQueryParameter(); + this.options.tests = this.parseTestsQueryParameter(); + if (this.options.testLog) { + this.options.testLog = $(this.options.testLog) || null; + } + if(this.options.tests) { + this.tests = []; + for(var i = 0; i < this.options.tests.length; i++) { + if(/^test/.test(this.options.tests[i])) { + this.tests.push(new Test.Unit.Testcase(this.options.tests[i], testcases[this.options.tests[i]], testcases["setup"], testcases["teardown"])); + } + } + } else { + if (this.options.test) { + this.tests = [new Test.Unit.Testcase(this.options.test, testcases[this.options.test], testcases["setup"], testcases["teardown"])]; + } else { + this.tests = []; + for(var testcase in testcases) { + if(/^test/.test(testcase)) { + this.tests.push( + new Test.Unit.Testcase( + this.options.context ? ' -> ' + this.options.titles[testcase] : testcase, + testcases[testcase], testcases["setup"], testcases["teardown"] + )); + } + } + } + } + this.currentTest = 0; + this.logger = new Test.Unit.Logger(this.options.testLog); + setTimeout(this.runTests.bind(this), 1000); + }, + parseResultsURLQueryParameter: function() { + return window.location.search.parseQuery()["resultsURL"]; + }, + parseTestsQueryParameter: function(){ + if (window.location.search.parseQuery()["tests"]){ + return window.location.search.parseQuery()["tests"].split(','); + }; + }, + // Returns: + // "ERROR" if there was an error, + // "FAILURE" if there was a failure, or + // "SUCCESS" if there was neither + getResult: function() { + var hasFailure = false; + for(var i=0;i 0) { + return "ERROR"; + } + if (this.tests[i].failures > 0) { + hasFailure = true; + } + } + if (hasFailure) { + return "FAILURE"; + } else { + return "SUCCESS"; + } + }, + postResults: function() { + if (this.options.resultsURL) { + new Ajax.Request(this.options.resultsURL, + { method: 'get', parameters: 'result=' + this.getResult(), asynchronous: false }); + } + }, + runTests: function() { + var test = this.tests[this.currentTest]; + if (!test) { + // finished! + this.postResults(); + this.logger.summary(this.summary()); + return; + } + if(!test.isWaiting) { + this.logger.start(test.name); + } + test.run(); + if(test.isWaiting) { + this.logger.message("Waiting for " + test.timeToWait + "ms"); + setTimeout(this.runTests.bind(this), test.timeToWait || 1000); + } else { + this.logger.finish(test.status(), test.summary()); + this.currentTest++; + // tail recursive, hopefully the browser will skip the stackframe + this.runTests(); + } + }, + summary: function() { + var assertions = 0; + var failures = 0; + var errors = 0; + var messages = []; + for(var i=0;i 0) return 'failed'; + if (this.errors > 0) return 'error'; + return 'passed'; + }, + assert: function(expression) { + var message = arguments[1] || 'assert: got "' + Test.Unit.inspect(expression) + '"'; + try { expression ? this.pass() : + this.fail(message); } + catch(e) { this.error(e); } + }, + assertEqual: function(expected, actual) { + var message = arguments[2] || "assertEqual"; + try { (expected == actual) ? this.pass() : + this.fail(message + ': expected "' + Test.Unit.inspect(expected) + + '", actual "' + Test.Unit.inspect(actual) + '"'); } + catch(e) { this.error(e); } + }, + assertInspect: function(expected, actual) { + var message = arguments[2] || "assertInspect"; + try { (expected == actual.inspect()) ? this.pass() : + this.fail(message + ': expected "' + Test.Unit.inspect(expected) + + '", actual "' + Test.Unit.inspect(actual) + '"'); } + catch(e) { this.error(e); } + }, + assertEnumEqual: function(expected, actual) { + var message = arguments[2] || "assertEnumEqual"; + try { $A(expected).length == $A(actual).length && + expected.zip(actual).all(function(pair) { return pair[0] == pair[1] }) ? + this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) + + ', actual ' + Test.Unit.inspect(actual)); } + catch(e) { this.error(e); } + }, + assertNotEqual: function(expected, actual) { + var message = arguments[2] || "assertNotEqual"; + try { (expected != actual) ? this.pass() : + this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); } + catch(e) { this.error(e); } + }, + assertIdentical: function(expected, actual) { + var message = arguments[2] || "assertIdentical"; + try { (expected === actual) ? this.pass() : + this.fail(message + ': expected "' + Test.Unit.inspect(expected) + + '", actual "' + Test.Unit.inspect(actual) + '"'); } + catch(e) { this.error(e); } + }, + assertNotIdentical: function(expected, actual) { + var message = arguments[2] || "assertNotIdentical"; + try { !(expected === actual) ? this.pass() : + this.fail(message + ': expected "' + Test.Unit.inspect(expected) + + '", actual "' + Test.Unit.inspect(actual) + '"'); } + catch(e) { this.error(e); } + }, + assertNull: function(obj) { + var message = arguments[1] || 'assertNull' + try { (obj==null) ? this.pass() : + this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); } + catch(e) { this.error(e); } + }, + assertMatch: function(expected, actual) { + var message = arguments[2] || 'assertMatch'; + var regex = new RegExp(expected); + try { (regex.exec(actual)) ? this.pass() : + this.fail(message + ' : regex: "' + Test.Unit.inspect(expected) + ' did not match: ' + Test.Unit.inspect(actual) + '"'); } + catch(e) { this.error(e); } + }, + assertHidden: function(element) { + var message = arguments[1] || 'assertHidden'; + this.assertEqual("none", element.style.display, message); + }, + assertNotNull: function(object) { + var message = arguments[1] || 'assertNotNull'; + this.assert(object != null, message); + }, + assertType: function(expected, actual) { + var message = arguments[2] || 'assertType'; + try { + (actual.constructor == expected) ? this.pass() : + this.fail(message + ': expected "' + Test.Unit.inspect(expected) + + '", actual "' + (actual.constructor) + '"'); } + catch(e) { this.error(e); } + }, + assertNotOfType: function(expected, actual) { + var message = arguments[2] || 'assertNotOfType'; + try { + (actual.constructor != expected) ? this.pass() : + this.fail(message + ': expected "' + Test.Unit.inspect(expected) + + '", actual "' + (actual.constructor) + '"'); } + catch(e) { this.error(e); } + }, + assertInstanceOf: function(expected, actual) { + var message = arguments[2] || 'assertInstanceOf'; + try { + (actual instanceof expected) ? this.pass() : + this.fail(message + ": object was not an instance of the expected type"); } + catch(e) { this.error(e); } + }, + assertNotInstanceOf: function(expected, actual) { + var message = arguments[2] || 'assertNotInstanceOf'; + try { + !(actual instanceof expected) ? this.pass() : + this.fail(message + ": object was an instance of the not expected type"); } + catch(e) { this.error(e); } + }, + assertRespondsTo: function(method, obj) { + var message = arguments[2] || 'assertRespondsTo'; + try { + (obj[method] && typeof obj[method] == 'function') ? this.pass() : + this.fail(message + ": object doesn't respond to [" + method + "]"); } + catch(e) { this.error(e); } + }, + assertReturnsTrue: function(method, obj) { + var message = arguments[2] || 'assertReturnsTrue'; + try { + var m = obj[method]; + if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)]; + m() ? this.pass() : + this.fail(message + ": method returned false"); } + catch(e) { this.error(e); } + }, + assertReturnsFalse: function(method, obj) { + var message = arguments[2] || 'assertReturnsFalse'; + try { + var m = obj[method]; + if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)]; + !m() ? this.pass() : + this.fail(message + ": method returned true"); } + catch(e) { this.error(e); } + }, + assertRaise: function(exceptionName, method) { + var message = arguments[2] || 'assertRaise'; + try { + method(); + this.fail(message + ": exception expected but none was raised"); } + catch(e) { + ((exceptionName == null) || (e.name==exceptionName)) ? this.pass() : this.error(e); + } + }, + assertElementsMatch: function() { + var expressions = $A(arguments), elements = $A(expressions.shift()); + if (elements.length != expressions.length) { + this.fail('assertElementsMatch: size mismatch: ' + elements.length + ' elements, ' + expressions.length + ' expressions'); + return false; + } + elements.zip(expressions).all(function(pair, index) { + var element = $(pair.first()), expression = pair.last(); + if (element.match(expression)) return true; + this.fail('assertElementsMatch: (in index ' + index + ') expected ' + expression.inspect() + ' but got ' + element.inspect()); + }.bind(this)) && this.pass(); + }, + assertElementMatches: function(element, expression) { + this.assertElementsMatch([element], expression); + }, + benchmark: function(operation, iterations) { + var startAt = new Date(); + (iterations || 1).times(operation); + var timeTaken = ((new Date())-startAt); + this.info((arguments[2] || 'Operation') + ' finished ' + + iterations + ' iterations in ' + (timeTaken/1000)+'s' ); + return timeTaken; + }, + _isVisible: function(element) { + element = $(element); + if(!element.parentNode) return true; + this.assertNotNull(element); + if(element.style && Element.getStyle(element, 'display') == 'none') + return false; + + return this._isVisible(element.parentNode); + }, + assertNotVisible: function(element) { + this.assert(!this._isVisible(element), Test.Unit.inspect(element) + " was not hidden and didn't have a hidden parent either. " + ("" || arguments[1])); + }, + assertVisible: function(element) { + this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1])); + }, + benchmark: function(operation, iterations) { + var startAt = new Date(); + (iterations || 1).times(operation); + var timeTaken = ((new Date())-startAt); + this.info((arguments[2] || 'Operation') + ' finished ' + + iterations + ' iterations in ' + (timeTaken/1000)+'s' ); + return timeTaken; + } +} + +Test.Unit.Testcase = Class.create(); +Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), { + initialize: function(name, test, setup, teardown) { + Test.Unit.Assertions.prototype.initialize.bind(this)(); + this.name = name; + + if(typeof test == 'string') { + test = test.gsub(/(\.should[^\(]+\()/,'#{0}this,'); + test = test.gsub(/(\.should[^\(]+)\(this,\)/,'#{1}(this)'); + this.test = function() { + eval('with(this){'+test+'}'); + } + } else { + this.test = test || function() {}; + } + + this.setup = setup || function() {}; + this.teardown = teardown || function() {}; + this.isWaiting = false; + this.timeToWait = 1000; + }, + wait: function(time, nextPart) { + this.isWaiting = true; + this.test = nextPart; + this.timeToWait = time; + }, + run: function() { + try { + try { + if (!this.isWaiting) this.setup.bind(this)(); + this.isWaiting = false; + this.test.bind(this)(); + } finally { + if(!this.isWaiting) { + this.teardown.bind(this)(); + } + } + } + catch(e) { this.error(e); } + } +}); + +// *EXPERIMENTAL* BDD-style testing to please non-technical folk +// This draws many ideas from RSpec http://rspec.rubyforge.org/ + +Test.setupBDDExtensionMethods = function(){ + var METHODMAP = { + shouldEqual: 'assertEqual', + shouldNotEqual: 'assertNotEqual', + shouldEqualEnum: 'assertEnumEqual', + shouldBeA: 'assertType', + shouldNotBeA: 'assertNotOfType', + shouldBeAn: 'assertType', + shouldNotBeAn: 'assertNotOfType', + shouldBeNull: 'assertNull', + shouldNotBeNull: 'assertNotNull', + + shouldBe: 'assertReturnsTrue', + shouldNotBe: 'assertReturnsFalse', + shouldRespondTo: 'assertRespondsTo' + }; + Test.BDDMethods = {}; + for(m in METHODMAP) { + Test.BDDMethods[m] = eval( + 'function(){'+ + 'var args = $A(arguments);'+ + 'var scope = args.shift();'+ + 'scope.'+METHODMAP[m]+'.apply(scope,(args || []).concat([this])); }'); + } + [Array.prototype, String.prototype, Number.prototype].each( + function(p){ Object.extend(p, Test.BDDMethods) } + ); +} + +Test.context = function(name, spec, log){ + Test.setupBDDExtensionMethods(); + + var compiledSpec = {}; + var titles = {}; + for(specName in spec) { + switch(specName){ + case "setup": + case "teardown": + compiledSpec[specName] = spec[specName]; + break; + default: + var testName = 'test'+specName.gsub(/\s+/,'-').camelize(); + var body = spec[specName].toString().split('\n').slice(1); + if(/^\{/.test(body[0])) body = body.slice(1); + body.pop(); + body = body.map(function(statement){ + return statement.strip() + }); + compiledSpec[testName] = body.join('\n'); + titles[testName] = specName; + } + } + new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || 'testlog', context: name }); +}; \ No newline at end of file diff --git a/DQM/TrackerCommon/test/js_files/tab-view.js b/DQM/TrackerCommon/test/js_files/tab-view.js new file mode 100644 index 0000000000000..82dccb6a34893 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/tab-view.js @@ -0,0 +1,301 @@ +/************************************************************************************************************ +(C) www.dhtmlgoodies.com, October 2005 + +This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website. + +Terms of use: +You are free to use this script as long as the copyright message is kept intact. However, you may not +redistribute, sell or repost it without our permission. + +Updated: + +March, 14th, 2006 - Create new tabs dynamically +March, 15th, 2006 - Dynamically delete a tab + +Thank you! + +www.dhtmlgoodies.com +Alf Magne Kalleland + +************************************************************************************************************/ + var textPadding = 3; // Padding at the left of tab text - bigger value gives you wider tabs +var strictDocType = true; +var tabView_maxNumberOfTabs = 6;// Maximum number of tabs + +/* Don't change anything below here */ +var dhtmlgoodies_tabObj = new Array(); +var activeTabIndex = new Array(); +var MSIE = navigator.userAgent.indexOf('MSIE')>=0?true:false; +var navigatorVersion = navigator.appVersion.replace(/.*?MSIE (\d\.\d).*/g,'$1')/1; +var ajaxObjects = new Array(); +var tabView_countTabs = new Array(); +var tabViewHeight = new Array(); +var tabDivCounter = 0; + +function setPadding(obj,padding){ + var span = obj.getElementsByTagName('SPAN')[0]; + span.style.paddingLeft = padding + 'px'; + span.style.paddingRight = padding + 'px'; +} +function showTab(parentId,tabIndex) +{ + var parentId_div = parentId + "_"; + if(!document.getElementById('tabView' + parentId_div + tabIndex)){ + return; + } + if(activeTabIndex[parentId]>=0){ + if(activeTabIndex[parentId]==tabIndex){ + return; + } + + var obj = document.getElementById('tabTab'+parentId_div + activeTabIndex[parentId]); + + obj.className='tabInactive'; + var img = obj.getElementsByTagName('IMG')[0]; + img.src = '../images/tab_right_inactive.gif'; + document.getElementById('tabView' + parentId_div + activeTabIndex[parentId]).style.display='none'; + } + + var thisObj = document.getElementById('tabTab'+ parentId_div +tabIndex); + + thisObj.className='tabActive'; + var img = thisObj.getElementsByTagName('IMG')[0]; + img.src = '../images/tab_right_active.gif'; + + document.getElementById('tabView' + parentId_div + tabIndex).style.display='block'; + activeTabIndex[parentId] = tabIndex; + + + var parentObj = thisObj.parentNode; + var aTab = parentObj.getElementsByTagName('DIV')[0]; + countObjects = 0; + var startPos = 2; + var previousObjectActive = false; + while(aTab){ + if(aTab.tagName=='DIV'){ + if(previousObjectActive){ + previousObjectActive = false; + startPos-=2; + } + if(aTab==thisObj){ + startPos-=2; + previousObjectActive=true; + setPadding(aTab,textPadding+1); + }else{ + setPadding(aTab,textPadding); + } + + aTab.style.left = startPos + 'px'; + countObjects++; + startPos+=2; + } + aTab = aTab.nextSibling; + } + + return; +} + +function tabClick() +{ + var idArray = this.id.split('_'); + showTab(this.parentNode.parentNode.id,idArray[idArray.length-1].replace(/[^0-9]/gi,'')); + +} + +function rolloverTab() +{ + if(this.className.indexOf('tabInactive')>=0){ + this.className='inactiveTabOver'; + var img = this.getElementsByTagName('IMG')[0]; + img.src = '../images/tab_right_over.gif'; + } + +} +function rolloutTab() +{ + if(this.className == 'inactiveTabOver'){ + this.className='tabInactive'; + var img = this.getElementsByTagName('IMG')[0]; + img.src = '../images/tab_right_inactive.gif'; + } + +} + +function initTabs(mainContainerID,tabTitles,activeTab,width,height,additionalTab) +{ + if(!additionalTab || additionalTab=='undefined'){ + dhtmlgoodies_tabObj[mainContainerID] = document.getElementById(mainContainerID); + width = width + ''; + if(width.indexOf('%')<0)width= width + 'px'; + dhtmlgoodies_tabObj[mainContainerID].style.width = width; + + height = height + ''; + if(height.length>0){ + if(height.indexOf('%')<0)height= height + 'px'; + dhtmlgoodies_tabObj[mainContainerID].style.height = height; + } + + + tabViewHeight[mainContainerID] = height; + + var tabDiv = document.createElement('DIV'); + var firstDiv = dhtmlgoodies_tabObj[mainContainerID].getElementsByTagName('DIV')[0]; + + dhtmlgoodies_tabObj[mainContainerID].insertBefore(tabDiv,firstDiv); + tabDiv.className = 'dhtmlgoodies_tabPane'; + tabView_countTabs[mainContainerID] = 0; + + }else{ + var tabDiv = dhtmlgoodies_tabObj[mainContainerID].getElementsByTagName('DIV')[0]; + var firstDiv = dhtmlgoodies_tabObj[mainContainerID].getElementsByTagName('DIV')[1]; + height = tabViewHeight[mainContainerID]; + activeTab = tabView_countTabs[mainContainerID]; + + + } + + + + for(var no=0;no0)tabs[no].style.height = height; + tabs[no].style.display='none'; + tabs[no].id = 'tabView' + mainContainerID + "_" + divCounter; + divCounter++; + } + } + tabView_countTabs[mainContainerID] = tabView_countTabs[mainContainerID] + tabTitles.length; + showTab(mainContainerID,activeTab); + + return activeTab; +} + +function showAjaxTabContent(ajaxIndex,parentId,tabId) +{ + var obj = document.getElementById('tabView'+parentId + '_' + tabId); + obj.innerHTML = ajaxObjects[ajaxIndex].response; +} + +function resetTabIds(parentId) +{ + var tabTitleCounter = 0; + var tabContentCounter = 0; + + + var divs = dhtmlgoodies_tabObj[parentId].getElementsByTagName('DIV'); + + + for(var no=0;no=0){ + divs[no].id = 'tabTab' + parentId + '_' + tabContentCounter; + tabContentCounter++; + } + + + } + + tabView_countTabs[parentId] = tabContentCounter; +} + + +function createNewTab(parentId,tabTitle,tabContent,tabContentUrl) +{ + if(tabView_countTabs[parentId]>=tabView_maxNumberOfTabs)return;// Maximum number of tabs reached - return + var div = document.createElement('DIV'); + div.className = 'dhtmlgoodies_aTab'; + dhtmlgoodies_tabObj[parentId].appendChild(div); + var tabId = initTabs(parentId,Array(tabTitle),0,'','',true); + if(tabContent)div.innerHTML = tabContent; + if(tabContentUrl){ + var ajaxIndex = ajaxObjects.length; + ajaxObjects[ajaxIndex] = new sack(); + ajaxObjects[ajaxIndex].requestFile = tabContentUrl;// Specifying which file to get + + ajaxObjects[ajaxIndex].onCompletion = function(){ showAjaxTabContent(ajaxIndex,parentId,tabId); };// Specify function that will be executed after file has been found + ajaxObjects[ajaxIndex].runAJAX();// Execute AJAX function + + } + +} + +function getTabIndexByTitle(tabTitle) +{ + for(var prop in dhtmlgoodies_tabObj){ + var divs = dhtmlgoodies_tabObj[prop].getElementsByTagName('DIV'); + for(var no=0;no=0){ + var span = divs[no].getElementsByTagName('SPAN')[0]; + + if(span.innerHTML == tabTitle){ + var tmpId = divs[no].id.split('_'); + + return Array(prop,tmpId[tmpId.length-1].replace(/[^0-9]/g,'')/1); + } + } + } + } + + return -1; + +} + + +function deleteTab(tabLabel,tabIndex,parentId) +{ + + if(tabLabel){ + var index = getTabIndexByTitle(tabLabel); + if(index!=-1){ + deleteTab(false,index[1],index[0]); + } + + }else if(tabIndex>=0){ + if(document.getElementById('tabTab' + parentId + '_' + tabIndex)){ + var obj = document.getElementById('tabTab' + parentId + '_' + tabIndex); + var id = obj.parentNode.parentNode.id; + obj.parentNode.removeChild(obj); + var obj2 = document.getElementById('tabView' + parentId + '_' + tabIndex); + obj2.parentNode.removeChild(obj2); + resetTabIds(parentId); + activeTabIndex[parentId]=-1; + showTab(parentId,'0'); + } + } + + + + + +} diff --git a/DQM/TrackerCommon/test/js_files/tooltip.js b/DQM/TrackerCommon/test/js_files/tooltip.js new file mode 100644 index 0000000000000..47a8cc2331311 --- /dev/null +++ b/DQM/TrackerCommon/test/js_files/tooltip.js @@ -0,0 +1,86 @@ +/*********************************************** +* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com) +* This notice MUST stay intact for legal use +* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code +***********************************************/ +var offsetxpoint = -60; //Customize x offset of tooltip +var offsetypoint = 20; //Customize y offset of tooltip +var ie = document.all; +var ns6 = document.getElementById && !document.all; +var enabletip = false; +var tipobj; +if (ns6 || ie) + tipobj = document.all ? document.all["dhtmltooltip"] + : (document.getElementById ? document.getElementById("dhtmltooltip") : ""); + +function ietruebody() { + return (document.compatMode && document.compatMode!="BackCompat") + ? document.documentElement + : document.body; +} + +function ddrivetip(thetext, thecolor, thewidth) { + if (ns6 || ie) { + if (typeof thewidth != "undefined") tipobj.style.width = thewidth+"px"; + if (typeof thecolor != "undefined" && thecolor != "") + tipobj.style.backgroundColor = thecolor; + tipobj.innerHTML = thetext; + enabletip = true; + return false; + } +} + +function positiontip(e) { + if (enabletip) { + var curX = (ns6) ? e.pageX + : event.clientX+ietruebody().scrollLeft; + var curY = (ns6) ? e.pageY + : event.clientY+ietruebody().scrollTop; + // Find out how close the mouse is to the corner of the window + var rightedge = ie&&!window.opera ? ietruebody().clientWidth-event.clientX-offsetxpoint + : window.innerWidth-e.clientX-offsetxpoint-20; + var bottomedge = ie&&!window.opera ? ietruebody().clientHeight-event.clientY-offsetypoint + : window.innerHeight-e.clientY-offsetypoint-20; + var leftedge = (offsetxpoint < 0) ? offsetxpoint*(-1) : -1000; + + //if the horizontal distance isn't enough to accomodate the width of the context menu + if (rightedge < tipobj.offsetWidth) + // move the horizontal position of the menu to the left by it's width + tipobj.style.left = ie ? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" + : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"; + else if (curX < leftedge) + tipobj.style.left = "5px"; + else + // position the horizontal position of the menu where the mouse is positioned + tipobj.style.left = curX+offsetxpoint+"px"; + + // same concept with the vertical position + if (bottomedge < tipobj.offsetHeight) { + tipobj.style.top = ie ? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" + : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"; + } + else { + tipobj.style.top = curY+offsetypoint+"px"; + tipobj.style.visibility = "visible"; + } + } +} + +function hideddrivetip() { + if (ns6 || ie) { + enabletip = false; + tipobj.style.visibility = "hidden"; + tipobj.style.left = "-1000px"; + tipobj.style.backgroundColor = ''; + tipobj.style.width = ''; + } +} +function ShowSelectedItem() { + var obj = document.getElementById('tagoption'); + if (obj == null || obj.selectedIndex<0) return ''; + var value = obj.options[obj.selectedIndex].value; + ddrivetip(value,'#ffdca8', 600); + return false; +} + +document.onmousemove = positiontip;