topical media & game development
mashup-delicious-14-rally2007-rallyposter-content-overlay.js / js
var rallyposter = {
onLoad: function() {
// initialization code
this.initialized = true;
this.strings = document.getElementById("rallyposter-strings");
},
onMenuItemCommand: function(e) {
var location, title;
var savePopupURL = "http://localhost/rally2007/save_popup.php";
var browser = window.getBrowser();
var webNav = browser.webNavigation;
if(webNav.currentURI)
location = webNav.currentURI.spec;
else
location = gURLBar.value;
if(webNav.document.title)
title = webNav.document.title;
else
title = location;
this.openPopupWindow(savePopupURL+"?location="+encodeURIComponent(location)+"&title="+encodeURIComponent(title), 700, 400);
},
onToolbarButtonCommand: function(e) {
// just reuse the function above. you can change this, obviously!
rallyposter.onMenuItemCommand(e);
},
openPopupWindow : function(aPath, aWidth, aHeight){
//make it center
var width = aWidth, height = aHeight;
var left = parseInt((screen.availWidth/2) - (width/2));
var top = parseInt((screen.availHeight/2) - (height/2));
var props = "width="+width+",height="+height+",left="+left+",top="+top+",menubar=0,toolbar=0,scrollbars=1,location=0,status=1,resizable=1";
var newWindow = window.open(aPath, "", props);
newWindow.focus();
}
};
window.addEventListener("load", function(e) { rallyposter.onLoad(e); }, false);
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.