Skip to content

Instantly share code, notes, and snippets.

@atxryan
Created June 14, 2011 21:55
Show Gist options
  • Save atxryan/1026013 to your computer and use it in GitHub Desktop.
Save atxryan/1026013 to your computer and use it in GitHub Desktop.
Box.net Maximize preview in window bookmarklet
javascript:(function(d)%20{var%20h%20=%20d.body.clientHeight;var%20w%20=%20d.body.clientWidth;var%20p%20=%20d.getElementById(%22player%22);var%20g%20=%20d.getElementById(%22gallery%22);g.style.position%20=%20%22absolute%22;g.style.width%20=%20w%20+%20%22px%22;g.style.height%20=%20h%20+%20%22px%22;p.style.width%20=%20w%20+%20%22px%22;p.style.height%20=%20h%20+%20%22px%22;p.style.position%20=%20%22relative%22;g.style.top%20=%20%220%22;g.style.left%20=%20%220%22;g.style.zIndex%20=%20%2210000%22;p.setAttribute(%22width%22,%20w);p.setAttribute(%22height%22,%20h);})(document);
(function(d) {
var h = d.body.clientHeight;
var w = d.body.clientWidth;
var p = d.getElementById("player");
var g = d.getElementById("gallery");
g.style.position = "absolute";
g.style.width = w + "px";
g.style.height = h + "px";
p.style.width = w + "px";
p.style.height = h + "px";
p.style.position = "relative";
g.style.top = "0";
g.style.left = "0";
g.style.zIndex = "10000";
p.setAttribute("width", w);
p.setAttribute("height", h);
})(document);
@atxryan
Copy link
Author

atxryan commented Jun 14, 2011

Box.net shows their document previews in an object w/ a width of 714px. It's annoying when trying to zoom into to a document, but then having to drag the doc around to get it in the view pane. Sure, there's a full screen mode, but that exits as soon as you click else where.

  • Save this bookmarklet by right-clicking this Box.net full-width preview and choosing "Save to Bookmarks" or the like.
  • Edit this bookmark and replace the URL w/ the javascript bookmarklet above.
    • Tested in Firefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment