Class ViewManager : onGetHTMLForProgrammeListDescription Event


String onGetHTMLForProgrammeListDescription( Programme prog )

Summary

Called to obtain the HTML text that will be used when "Include Descriptions" is enabled on list views.


Remarks

This callback does not populate the descriptions for Find or Show Me windows.


Parameters

ParameterDescription
Programme prog The programme object for the current programme.


Returns


Return the string, with HTML formatting that you wish to appear under programme lines on list views.


Examples

////////////////////////////////////////////////////////////////////////////
// This script shows how to override the descriptions for the list views with the
// ViewManager.onGetHTMLForProgrammeListDescription event

var vm = app.getViewManager();


vm.onGetHTMLForProgrammeListDescription = function( programme )
{
var bCapDescriptions = app.getSetting( knListViewCapDescriptions );

// Build up our description from the different elements
var strInfo = programme.description;
if( programme.episodeDetails.length )
{
strInfo = "<b>" + programme.episodeDetails + "</b> " + strInfo;
}

// Fix up the description
strInfo = strInfo.replace( /\r/g, " " );
strInfo = strInfo.replace( / /g, " " );

// Cap our description if set
var uCapLength = app.getSetting( knListViewShortDescriptionCapAmount );
if( bCapDescriptions && strInfo.length > uCapLength )
{
strInfo = strInfo.substr( 0, uCapLength ) + "...";
}

// Only mark up if advanced setting says so
if( app.getSetting( knHighlightWordsInMarkedDescriptions ) )
{
strInfo = programme.getMarkedUpText( strInfo );
}

return strInfo;
};


See Also

  • Programme


    Requirements

    Build 1069