Documentation
registerConnector
usage
.kaiten("registerConnector", name, connector)
parameters
name : the name of the new connector
connector : the connector object to register
Add the connector to Kaiten's connectors collection.
If provided, the "init" function of the connector will be executed.
If provided, the "cssFile" stylesheet will be imported.
examples
$kaiten.kaiten('registerConnector', 'my.iframe', {
cssFile : 'iframe.css',
loader : function(data, $panel, $kaiten) {
if (!data.url)
{
// throwing the error will display an error panel
throw new Error('Missing URL! Cannot load content in an iframe.');
}
// set new panel title
var title = data.kTitle || data.url;
$panel.kpanel('setTitle', title);
// build the html
var html = '<div class="body" optimal-width="980px">'+
'<div class="block-iframe">'+
'<iframe src="'+data.url+'" width="100%" height="100%" class="loader" onload="$(this).removeClass(\'loader\');" />'+
'</div>'+
'</div>';
return html;
},
connectable : function(href, $link) {
// clicking on links with the "iframe-connected" class will load panels using this connector
return $link.hasClass('iframe-connected');
},
getData : function(href, $link) {
// the url contained in the href attribute of the link will be passed to loader()
return { url : href };
}
});
See also :
getConnector
Retrieve a connector object from Kaiten's collection.
unRegisterConnector
Unregister a connector.