AdPanel Behavior

Description

AdPanel is an AjaxControlToolkit based client side behavior for adding advertisenments and similar things - like partners - to the webpage automatically.

Usage

Home
Properties Base Class Properties Base Class Methods
Ads Height initialize()
Content IsPanelHeadVisible dispose()
Layer ListGroupCSS _getPanelMargin()
Position ListGroupItemCSS _getSize(data)
ListGroupItemPadding _setSize(el)
ListGroupMargin _createPanelHead(el)
PanelCSS
PanelHeadCSS
PanelHeadPadding
PanelHeadTag
PanelHeadTagCSS
PanelPadding
Title
Width

Properties


Ads
Type: Array
 

Default: [] - empty Array
 
Item collection of the contents or images. The item is a json javascript object.

Sample json object for a text content item:
   { 	
	tooltip: "Bajai cégek és vállalkozások | tlap.hu", 
	link: "http://bajaicegek.tlap.hu/",
	width: Sys.Extended.UI.AdWidth.Responsive,
	content: '<h4><span class="label label-info">bajaicegek.tlap.hu</span></h4>'
   }

Other text content item:
   { 	
	tooltip: "Dorker", 
	link: "http://www.dorker.hu/",
	width: Sys.Extended.UI.AdWidth.Responsive,
	content: 'www.dorker.hu'
   }

Image as content item with link:
   { 	
	tooltip: "AjaxControlToolkit", 
	link: "http://ajaxcontroltoolkit.codeplex.com/",
	width: Sys.Extended.UI.AdWidth.Inherit,
	image: "img/partners/ToolkitLogo.jpg"
   }

Simple text content without link:
   { 	
	content: 'simple text as list item'
   }


Content
Type: enum Sys.Extended.UI.AdPanelContent
 

Default: Sys.Extended.UI.AdPanelContent.Content
 
The AdPanelContent enumeration is used to specify how the AdPanelBehavior render the panel content.
enumerators:

Height
Type: Object
 

Default: "auto"
 
The height of the panel - any value enabled, which is a legal value of DomElement.style.height.

IsPanelHeadVisible
Type: Boolean
 

Default: true
 
If this value is true, then Bootstrap like header generated.

Layer
Type: enum Sys.Extended.UI.AdPanelLayer
 

Default: "Sys.Extended.UI.AdPanelLayer.InlineBlock"
 
The AdPanelLayer enumeration is used to specify how the AdPanelBehavior render the items in the panel content.
enumerators:

ListGroupCSS
Type: String
 

Default: "list-group"
 


ListGroupItemCSS
Type: String
 

Default: "list-group-item"
 


ListGroupItemPadding
Type: String
 

Default: "3px 10px 3px 10px"
 
If the Layer is Sys.Extended.UI.AdPanelLayer.ListGroup, then this is the padding of the actual item - any value enabled, which is a legal value of DomElement.style.padding.

ListGroupMargin
Type: String
 

Default: "4px 0px 0px 0px"
 


PanelCSS
Type: String
 

Default: "panel panel-primary"
 


PanelHeadCSS
Type: String
 

Default: "panel-heading"
 


PanelHeadPadding
Type: String
 

Default: ""
 
Any value enabled, which legal is a value of DomElement.style.padding.

PanelHeadTag
Type: String
 

Default: "h3"
 
The tagName of the head DomElement. Only enabled values: h1,h2,h3,h4,h5,h6.

PanelHeadTagCSS
Type: String
 

Default: "panel-title"
 


PanelPadding
Type: Number
 

Default: 3
 
The padding of the panel.

Position
Type: enum Sys.Extended.UI.AdPanelPosition
 

Default: Sys.Extended.UI.AdPanelPosition.Right
 
The AdPanelPosition enumeration is used to specify how the AdPanelBehavior place the panel content.
enumerators:

Title
Type: String
 

Default: ""
 
Title for the panel header.

Width
Type: Object
 

Default: 240
 
The height of the panel - any value enabled, which legal is a value of DomElement.style.width.

Methods


initialize()
Initialize the instance of the behavior and own base classes.

dispose()
Dispose the instance of the behavior.

_getPanelMargin()
<returns type="Number" integer="true" />
 
Method for calculating the margin from property PanelPadding.

_getSize(data)
<param name="data" type="Object" optional="true" mayBeNull="true">Value of size</param>
 

<returns type="String" />
 
Calculate size for the style.width and style.height attributes of a DomElement.

_setSize(el)
<param name="el" type="Sys.UI.DomElement" optional="false" mayBeNull="false">A DomElement for setting size</param>
 
Set size of the element in the parameter.

_createPanelHead(el)
<param name="el" type="Sys.UI.DomElement" optional="false" mayBeNull="false">A DomElement for panel content</param>
 

<returns type="Sys.UI.DomElement" />
 
Create a bootstrap style head

Screenshot

AdPanel_screenshot3.pngAdPanel_screenshot2.png