Linux-DVB-DVBT-Apps-QuartzPVR

 view release on metacpan or  search on metacpan

js/tvguide/Pages/RecList.js  view on Meta::CPAN

/*
Manages a list of TV program recording requests

*/

/*======================================================================================================*/
// Constructor
/*======================================================================================================*/

RecList.settings = {} ;

//Create the popup object we'll use
RecList.popup = new Popup();


function RecList(override)
{
	var args = {
		
		index 		: "pid" ,
		subindex 	: "progsList" ,
		sort 		: RecList.sort,
		rowClass 	: "",
		subrowClass : "lprog",
			
		popupClassName 	: "recListPop",
		recselCallback 	: RecList.setRecordings,
		priCallback 	: RecList.setRecordings
			
	} ;
	
	// override with settings - provided for derived objects
	if (override && (typeof override == "object"))
	{
		for (var setting in override)
		{
			args[setting] = override[setting] ;
		}
	}
	
	TvList.call(this, args) ;
	
	// add a ref to the global settings
	this.settings = RecList.settings ;
}


// Subclass from TvList
RecList.prototype = new TvList() ;

// Remove TvList properties from prototype
for (m in RecList.prototype)
{
	if (typeof m == 'function')
		continue ;
	
//	if (m == 'settings')
//		continue ;
	
	delete RecList.prototype[m] ;
}

// Set constructor
RecList.prototype.constructor = RecList ;


//Sort programs such that the newest active recordings appear first
RecList.sort = function(a,b) {
	
	var res = 0 ;

	/*
	low
	
		X  ( X < Y)
		
		a  (a < b)
		
		b
		
		----------------------------
		
		Y  (Y > X)
		
		m
		



( run in 0.565 second using v1.01-cache-2.11-cpan-364913b4093 )