forked from friendica/deprecated-addons
Moved widgets and remote permissions to the deprecated addons
This commit is contained in:
parent
46ef41508e
commit
6d2a6408e8
55 changed files with 1762 additions and 0 deletions
37
widgets/widgets.js
Normal file
37
widgets/widgets.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
/**
|
||||
* @author Fabio Comuni
|
||||
*/
|
||||
var f9a_widget_$widget_id = {
|
||||
width: "$width",
|
||||
height: "$height",
|
||||
entrypoint : "$entrypoint",
|
||||
key : "$key",
|
||||
widgetid: "$widget_id",
|
||||
argstr: "$args",
|
||||
|
||||
load : function() {
|
||||
var args = new Array();
|
||||
args['k']=this.key;
|
||||
args['s']=window.location.href;
|
||||
args['a']=this.argstr;
|
||||
var urlencodedargs = new Array();
|
||||
for(k in args){
|
||||
if (typeof args[k] != 'function')
|
||||
urlencodedargs.push( encodeURIComponent(k)+"="+encodeURIComponent(args[k]) );
|
||||
}
|
||||
var url = this.entrypoint + "?"+ urlencodedargs.join("&");
|
||||
|
||||
console.log(this.widgetid);
|
||||
console.log(document.getElementById(this.widgetid));
|
||||
document.getElementById(this.widgetid).innerHTML = '<iframe style="border:0px; width: '+this.width+'; height:'+this.height+'" src="'+url+'"></iframe>';
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
document.writeln("<div id='$widget_id' class='f9k_widget $type'>");
|
||||
document.writeln("<img id='$widget_id_ld' src='$loader'>");
|
||||
document.writeln("</div>");
|
||||
(function() {
|
||||
f9a_widget_$widget_id.load();
|
||||
})();
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue