another page). Usage as such: ^Widget(assetId, width, height, templateId); assetId is the ID of the asset to widgetize, width and height are the size of the iframe, templateId is the template ID of the template to use for the widget itself. This will pop up an icon that shows you some markup to put on another page to embed the asset in widget form. If no template given, will use the ajaxInlineView of the asset.
40 lines
1.1 KiB
JavaScript
Executable file
40 lines
1.1 KiB
JavaScript
Executable file
var WebGUI = {
|
|
|
|
widgetBox : {
|
|
|
|
parentNodeId : null,
|
|
url : null,
|
|
|
|
|
|
widget : function( url, parentId, width, height, templateId ) {
|
|
if(url == "") {
|
|
return "<iframe scrolling='no'><body>No content available from "+url+"</body></iframe>";
|
|
}
|
|
|
|
if(width == undefined) {
|
|
width = 600;
|
|
}
|
|
if(height == undefined) {
|
|
height = 400;
|
|
}
|
|
|
|
this.url = url + "?func=widgetView&templateId=" + templateId;
|
|
|
|
this.parentNodeId = parentId;
|
|
|
|
this.markup = "";
|
|
this.markup += "<iframe scrolling='no' frameborder='0' id = '";
|
|
this.markup += this.parentNodeId;
|
|
this.markup += "' src='";
|
|
this.markup += this.url;
|
|
this.markup += "' width='";
|
|
this.markup += width;
|
|
this.markup += "' height='";
|
|
this.markup += height;
|
|
this.markup += "'>";
|
|
this.markup += "</iframe>";
|
|
|
|
return this.markup;
|
|
}
|
|
}
|
|
}
|