Skip to content

Instantly share code, notes, and snippets.

@jakobo
Created February 17, 2011 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakobo/832172 to your computer and use it in GitHub Desktop.
Save jakobo/832172 to your computer and use it in GitHub Desktop.
IN.$extensions("HelloWorld", function HelloWorld() {
Sslac.Class("IN.Tags.HelloWorld").Extends("IN.Tags.Base")
.Constructor(function Constructor(el, attributes) {
this.Parent(el, attributes);
this.el().innerHTML = "Hello World to "+attributes.name;
var w = new IN.Objects.Window({
mode: "inline-iframe",
url: "http://www.google.com"
}).place(this.el());
});
IN.addTag("HelloWorld", IN.Tags.HelloWorld);
});
IN.$extensions("HelloWorld", function HelloWorld() {
Sslac.Class("IN.Tags.HelloWorld").Extends("IN.Tags.Base")
.Constructor(function Constructor(el, attributes) {
this.Parent(el, attributes);
this.el().innerHTML = "Hello World to "+attributes.name;
var button = new IN.Objects.Button({
title: "Click Me"
});
button.place(this.el());
IN.Event.on(button, "click", function(evt) {
evt.preventDefault();
document.body.style.color = "#f00";
}, this);
});
IN.addTag("HelloWorld", IN.Tags.HelloWorld);
});
IN.$extensions("HelloWorld", function HelloWorld() {
// Body of Extension Goes Here
console.log("HelloWorld Extension has Executed");
});
IN.$extensions("HelloWorld", function HelloWorld() {
Sslac.Class("IN.Tags.HelloWorld").Extends("IN.Tags.Base")
.Constructor(function Constructor(el, attributes) {
this.Parent(el, attributes);
var win = new IN.Objects.Window({
mode: "inline-iframe",
url: "http://jheuser-md.linkedin.biz:8081/sytycw/sample2.html"
});
win.place(this.el());
});
IN.addTag("HelloWorld", IN.Tags.HelloWorld);
});
IN.$extensions("WindowPatch", function WindowPatch() {
if (IN && IN.Objects && IN.Objects.Window) {
return;
}
function remapMode(mode) {
switch(mode) {
case "invisible-iframe":
return "invisible";
case "hover-iframe":
return "hovercard";
case "iframe":
return "modal";
case "inline-iframe":
return "embedded";
case "popup":
return "popup";
}
}
Sslac.Class("IN.Objects.Window")
.Constructor(function Constructor(config) {
config = config || {};
config = {
url: config.url || null,
mode: config.mode || null,
anchor: config.anchor || null
};
config.mode = remapMode(config.mode);
return new IN.Objects.SmartWindow(config);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment