Linux-DVB-DVBT-Apps-QuartzPVR

 view release on metacpan or  search on metacpan

js/tvguide/Objects/TvList.js  view on Meta::CPAN

		.addClass("lcol")
		.width(this.settings.DIR_PX)
		.appendTo($(ol))
			.append(
				$('<a>')
				.addClass('dirSel')
				.append(
					$('<img>')
					.attr({
						'src'	: Prog.ImageCache['icon_dir'].src,
						'title'	: 'Dir: ' + pathspec
					})
				)
//				.click()
			) ;
				
	// add a popup display to show program details
	this.add_dir_popup($('.dirSel', $(li)).get(0), prog) ;
	
	return li ;
}



/*------------------------------------------------------------------------------------------------------*/
//Add a text edit
TvList.prototype.display_edit = function(ol, width, text, add_editor_fn, className)
{
	var margin=10 ;
	
	// Container
	var li = this._display_li(ol, width, className) ;
	
	// Edit - slightly smaller than container
	var edit = document.createElement("input");
	edit.className = "edView" ;
	edit.style.width = (width-2*margin)+'px' ;
	edit.style.marginLeft = margin+'px' ;

	edit.setAttribute("type", 'text') ;	// NOTE: IE does NOT allow this after input is added to DOM, so postpone appendChild!
	if (text !== null) edit.setAttribute("value", text) ; 
	
	li.appendChild(edit) ;
	add_editor_fn(edit) ;

}



/*------------------------------------------------------------------------------------------------------*/
//Add a text element
TvList.prototype.display_labelled_edit = function(ol, labelWidth, label, width, text, add_editor_fn, className)
{
	// Label
	this.display_label(ol, labelWidth, label, 'edLabel') ;
//	this.display_inplace_edit(ol, width, text, add_editor_fn, className);
	this.display_edit(ol, width, text, add_editor_fn, className);
}

/*------------------------------------------------------------------------------------------------------*/
//Add a combobox element
TvList.prototype.display_selector = function(ol, width, value, valuesArray, namesArray, className, changeHandler)
{
	var margin=10 ;
	
	// Container
	var li = this._display_li(ol, width, className) ;
	
	// View - slightly smaller than container
	var view = document.createElement("li");
	view.className = "selector" ;
	var selWidth = (width-2*margin) ;
	view.style.width = selWidth+'px' ;
	view.style.marginLeft = margin+'px' ;
	
		var select = document.createElement("select");
		select.style.width = selWidth+'px' ;
		var html = "" ;
		
		value = value.toLowerCase() ;
		for (var i=0, len=valuesArray.length; i<len; i++)
		{
//			var option = document.createElement("option");
//			if (value == valuesArray[i].toLowerCase())
//				option.setAttribute('selected', 'selected') ; 
//			option.appendChild(document.createTextNode(valuesArray[i])) ;
//			select.appendChild(option) ;
			
			html += '<option ' ;
			if (value == valuesArray[i].toLowerCase())
			{
				html += 'selected="" ' ;
			}
			html += 'value="' + valuesArray[i] + '">' + namesArray[i] + '</option>' + "\n" ;
			
		}
		select.innerHTML = html ;
		
		
		if (changeHandler)
		{
log.debug("Added selector change handler for "+value);			
			select.changeHandler = changeHandler ;
			$(select).change(changeHandler) ;
		}

	view.appendChild(select) ;
	
	li.appendChild(view) ;
	
	return select ;
}



/*------------------------------------------------------------------------------------------------------*/
// Labelled selector - returns the select DOM node
TvList.prototype.display_labelled_select = function(ol, labelWidth, label, width, value, valuesArray, namesArray, className, changeHandler)
{
	// Label
	this.display_label(ol, labelWidth, label, 'edLabel') ;



( run in 0.587 second using v1.01-cache-2.11-cpan-39bf76dae61 )