summaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
authortim b <timb@camcompu.home>2010-04-03 21:11:45 -0700
committertim b <timb@camcompu.home>2010-04-03 21:11:45 -0700
commit7114b29dca66ac9032a74255fa9c7bb37e333fdc (patch)
tree60153fb300568b34f173cf3c230e197b84cd8415 /static/js
parentd32d26065494ccbd4a9ddba0789003e3daa5fa28 (diff)
parent4479097093127a20a40a9dceb604bf4290c09a2d (diff)
committing stuff so i can merge pulled repo
Diffstat (limited to 'static/js')
-rwxr-xr-xstatic/js/FancyZoom.js761
-rwxr-xr-xstatic/js/FancyZoomHTML.js0
-rwxr-xr-x[-rw-r--r--]static/js/away.js0
-rwxr-xr-xstatic/js/dumpsearch.js39
-rwxr-xr-xstatic/js/home.js28
-rw-r--r--static/js/jquery.js171
-rw-r--r--static/js/jquery.mousewheel.js85
-rw-r--r--static/js/pichat.js294
8 files changed, 1241 insertions, 137 deletions
diff --git a/static/js/FancyZoom.js b/static/js/FancyZoom.js
new file mode 100755
index 0000000..42d71ce
--- /dev/null
+++ b/static/js/FancyZoom.js
@@ -0,0 +1,761 @@
+// FancyZoom.js - v1.1 - http://www.fancyzoom.com
+//
+// Copyright (c) 2008 Cabel Sasser / Panic Inc
+// All rights reserved.
+//
+// Requires: FancyZoomHTML.js
+// Instructions: Include JS files in page, call setupZoom() in onLoad. That's it!
+// Any <a href> links to images will be updated to zoom inline.
+// Add rel="nozoom" to your <a href> to disable zooming for an image.
+//
+// Redistribution and use of this effect in source form, with or without modification,
+// are permitted provided that the following conditions are met:
+//
+// * USE OF SOURCE ON COMMERCIAL (FOR-PROFIT) WEBSITE REQUIRES ONE-TIME LICENSE FEE PER DOMAIN.
+// Reasonably priced! Visit www.fancyzoom.com for licensing instructions. Thanks!
+//
+// * Non-commercial (personal) website use is permitted without license/payment!
+//
+// * Redistribution of source code must retain the above copyright notice,
+// this list of conditions and the following disclaimer.
+//
+// * Redistribution of source code and derived works cannot be sold without specific
+// written prior permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+var includeCaption = true; // Turn on the "caption" feature, and write out the caption HTML
+var zoomTime = 5; // Milliseconds between frames of zoom animation
+var zoomSteps = 15; // Number of zoom animation frames
+var includeFade = 1; // Set to 1 to fade the image in / out as it zooms
+var minBorder = 90; // Amount of padding between large, scaled down images, and the window edges
+var shadowSettings = '0px 5px 25px rgba(0, 0, 0, '; // Blur, radius, color of shadow for compatible browsers
+
+var zoomImagesURI = '/images-global/zoom/'; // Location of the zoom and shadow images
+
+// Init. Do not add anything below this line, unless it's something awesome.
+
+var myWidth = 0, myHeight = 0, myScroll = 0; myScrollWidth = 0; myScrollHeight = 0;
+var zoomOpen = false, preloadFrame = 1, preloadActive = false, preloadTime = 0, imgPreload = new Image();
+var preloadAnimTimer = 0;
+
+var zoomActive = new Array(); var zoomTimer = new Array();
+var zoomOrigW = new Array(); var zoomOrigH = new Array();
+var zoomOrigX = new Array(); var zoomOrigY = new Array();
+
+var zoomID = "ZoomBox";
+var theID = "ZoomImage";
+var zoomCaption = "ZoomCaption";
+var zoomCaptionDiv = "ZoomCapDiv";
+
+if (navigator.userAgent.indexOf("MSIE") != -1) {
+ var browserIsIE = true;
+}
+
+// Zoom: Setup The Page! Called in your <body>'s onLoad handler.
+
+function setupZoom() {
+ prepZooms();
+ insertZoomHTML();
+ zoomdiv = document.getElementById(zoomID);
+ zoomimg = document.getElementById(theID);
+}
+
+// Zoom: Inject Javascript functions into hrefs pointing to images, one by one!
+// Skip any href that contains a rel="nozoom" tag.
+// This is done at page load time via an onLoad() handler.
+
+function prepZooms() {
+ if (! document.getElementsByTagName) {
+ return;
+ }
+ var links = document.getElementsByTagName("a");
+ for (i = 0; i < links.length; i++) {
+ if (links[i].getAttribute("href")) {
+ if (links[i].getAttribute("href").search(/(.*)\.(jpg|jpeg|gif|png|bmp|tif|tiff)/gi) != -1) {
+ if (links[i].getAttribute("rel") != "nozoom") {
+ links[i].onclick = function (event) { return zoomClick(this, event); };
+ links[i].onmouseover = function () { zoomPreload(this); };
+ }
+ }
+ }
+ }
+}
+
+// Zoom: Load an image into an image object. When done loading, function sets preloadActive to false,
+// so other bits know that they can proceed with the zoom.
+// Preloaded image is stored in imgPreload and swapped out in the zoom function.
+
+function zoomPreload(from) {
+
+ var theimage = from.getAttribute("href");
+
+ // Only preload if we have to, i.e. the image isn't this image already
+
+ if (imgPreload.src.indexOf(from.getAttribute("href").substr(from.getAttribute("href").lastIndexOf("/"))) == -1) {
+ preloadActive = true;
+ imgPreload = new Image();
+
+ // Set a function to fire when the preload is complete, setting flags along the way.
+
+ imgPreload.onload = function() {
+ preloadActive = false;
+ }
+
+ // Load it!
+ imgPreload.src = theimage;
+ }
+}
+
+// Zoom: Start the preloading animation cycle.
+
+function preloadAnimStart() {
+ preloadTime = new Date();
+ document.getElementById("ZoomSpin").style.left = (myWidth / 2) + 'px';
+ document.getElementById("ZoomSpin").style.top = ((myHeight / 2) + myScroll) + 'px';
+ document.getElementById("ZoomSpin").style.visibility = "visible";
+ preloadFrame = 1;
+ document.getElementById("SpinImage").src = zoomImagesURI+'zoom-spin-'+preloadFrame+'.png';
+ preloadAnimTimer = setInterval("preloadAnim()", 100);
+}
+
+// Zoom: Display and ANIMATE the jibber-jabber widget. Once preloadActive is false, bail and zoom it up!
+
+function preloadAnim(from) {
+ if (preloadActive != false) {
+ document.getElementById("SpinImage").src = zoomImagesURI+'zoom-spin-'+preloadFrame+'.png';
+ preloadFrame++;
+ if (preloadFrame > 12) preloadFrame = 1;
+ } else {
+ document.getElementById("ZoomSpin").style.visibility = "hidden";
+ clearInterval(preloadAnimTimer);
+ preloadAnimTimer = 0;
+ zoomIn(preloadFrom);
+ }
+}
+
+// ZOOM CLICK: We got a click! Should we do the zoom? Or wait for the preload to complete?
+// todo?: Double check that imgPreload src = clicked src
+
+function zoomClick(from, evt) {
+
+ var shift = getShift(evt);
+
+ // Check for Command / Alt key. If pressed, pass them through -- don't zoom!
+ if (! evt && window.event && (window.event.metaKey || window.event.altKey)) {
+ return true;
+ } else if (evt && (evt.metaKey|| evt.altKey)) {
+ return true;
+ }
+
+ // Get browser dimensions
+ getSize();
+
+ // If preloading still, wait, and display the spinner.
+ if (preloadActive == true) {
+ // But only display the spinner if it's not already being displayed!
+ if (preloadAnimTimer == 0) {
+ preloadFrom = from;
+ preloadAnimStart();
+ }
+ } else {
+ // Otherwise, we're loaded: do the zoom!
+ zoomIn(from, shift);
+ }
+
+ return false;
+
+}
+
+// Zoom: Move an element in to endH endW, using zoomHost as a starting point.
+// "from" is an object reference to the href that spawned the zoom.
+
+function zoomIn(from, shift) {
+
+ zoomimg.src = from.getAttribute("href");
+
+ // Determine the zoom settings from where we came from, the element in the <a>.
+ // If there's no element in the <a>, or we can't get the width, make stuff up
+
+ if (from.childNodes[0].width) {
+ startW = from.childNodes[0].width;
+ startH = from.childNodes[0].height;
+ startPos = findElementPos(from.childNodes[0]);
+ } else {
+ startW = 50;
+ startH = 12;
+ startPos = findElementPos(from);
+ }
+
+ hostX = startPos[0];
+ hostY = startPos[1];
+
+ // Make up for a scrolled containing div.
+ // TODO: This HAS to move into findElementPos.
+
+ if (document.getElementById('scroller')) {
+ hostX = hostX - document.getElementById('scroller').scrollLeft;
+ }
+
+ // Determine the target zoom settings from the preloaded image object
+
+ endW = imgPreload.width;
+ endH = imgPreload.height;
+
+ // Start! But only if we're not zooming already!
+
+ if (zoomActive[theID] != true) {
+
+ // Clear everything out just in case something is already open
+
+ if (document.getElementById("ShadowBox")) {
+ document.getElementById("ShadowBox").style.visibility = "hidden";
+ } else if (! browserIsIE) {
+
+ // Wipe timer if shadow is fading in still
+ if (fadeActive["ZoomImage"]) {
+ clearInterval(fadeTimer["ZoomImage"]);
+ fadeActive["ZoomImage"] = false;
+ fadeTimer["ZoomImage"] = false;
+ }
+
+ document.getElementById("ZoomImage").style.webkitBoxShadow = shadowSettings + '0.0)';
+ }
+
+ document.getElementById("ZoomClose").style.visibility = "hidden";
+
+ // Setup the CAPTION, if existing. Hide it first, set the text.
+
+ if (includeCaption) {
+ document.getElementById(zoomCaptionDiv).style.visibility = "hidden";
+ if (from.getAttribute('title') && includeCaption) {
+ // Yes, there's a caption, set it up
+ document.getElementById(zoomCaption).innerHTML = from.getAttribute('title');
+ } else {
+ document.getElementById(zoomCaption).innerHTML = "";
+ }
+ }
+
+ // Store original position in an array for future zoomOut.
+
+ zoomOrigW[theID] = startW;
+ zoomOrigH[theID] = startH;
+ zoomOrigX[theID] = hostX;
+ zoomOrigY[theID] = hostY;
+
+ // Now set the starting dimensions
+
+ zoomimg.style.width = startW + 'px';
+ zoomimg.style.height = startH + 'px';
+ zoomdiv.style.left = hostX + 'px';
+ zoomdiv.style.top = hostY + 'px';
+
+ // Show the zooming image container, make it invisible
+
+ if (includeFade == 1) {
+ setOpacity(0, zoomID);
+ }
+ zoomdiv.style.visibility = "visible";
+
+ // If it's too big to fit in the window, shrink the width and height to fit (with ratio).
+
+ sizeRatio = endW / endH;
+ if (endW > myWidth - minBorder) {
+ endW = myWidth - minBorder;
+ endH = endW / sizeRatio;
+ }
+ if (endH > myHeight - minBorder) {
+ endH = myHeight - minBorder;
+ endW = endH * sizeRatio;
+ }
+
+ zoomChangeX = ((myWidth / 2) - (endW / 2) - hostX);
+ zoomChangeY = (((myHeight / 2) - (endH / 2) - hostY) + myScroll);
+ zoomChangeW = (endW - startW);
+ zoomChangeH = (endH - startH);
+
+ // Shift key?
+
+ if (shift) {
+ tempSteps = zoomSteps * 7;
+ } else {
+ tempSteps = zoomSteps;
+ }
+
+ // Setup Zoom
+
+ zoomCurrent = 0;
+
+ // Setup Fade with Zoom, If Requested
+
+ if (includeFade == 1) {
+ fadeCurrent = 0;
+ fadeAmount = (0 - 100) / tempSteps;
+ } else {
+ fadeAmount = 0;
+ }
+
+ // Do It!
+
+ zoomTimer[theID] = setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+hostX+", "+zoomChangeX+", "+hostY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDoneIn(zoomID)')", zoomTime);
+ zoomActive[theID] = true;
+ }
+}
+
+// Zoom it back out.
+
+function zoomOut(from, evt) {
+
+ // Get shift key status.
+ // IE events don't seem to get passed through the function, so grab it from the window.
+
+ if (getShift(evt)) {
+ tempSteps = zoomSteps * 7;
+ } else {
+ tempSteps = zoomSteps;
+ }
+
+ // Check to see if something is happening/open
+
+ if (zoomActive[theID] != true) {
+
+ // First, get rid of the shadow if necessary.
+
+ if (document.getElementById("ShadowBox")) {
+ document.getElementById("ShadowBox").style.visibility = "hidden";
+ } else if (! browserIsIE) {
+
+ // Wipe timer if shadow is fading in still
+ if (fadeActive["ZoomImage"]) {
+ clearInterval(fadeTimer["ZoomImage"]);
+ fadeActive["ZoomImage"] = false;
+ fadeTimer["ZoomImage"] = false;
+ }
+
+ document.getElementById("ZoomImage").style.webkitBoxShadow = shadowSettings + '0.0)';
+ }
+
+ // ..and the close box...
+
+ document.getElementById("ZoomClose").style.visibility = "hidden";
+
+ // ...and the caption if necessary!
+
+ if (includeCaption && document.getElementById(zoomCaption).innerHTML != "") {
+ // fadeElementSetup(zoomCaptionDiv, 100, 0, 5, 1);
+ document.getElementById(zoomCaptionDiv).style.visibility = "hidden";
+ }
+
+ // Now, figure out where we came from, to get back there
+
+ startX = parseInt(zoomdiv.style.left);
+ startY = parseInt(zoomdiv.style.top);
+ startW = zoomimg.width;
+ startH = zoomimg.height;
+ zoomChangeX = zoomOrigX[theID] - startX;
+ zoomChangeY = zoomOrigY[theID] - startY;
+ zoomChangeW = zoomOrigW[theID] - startW;
+ zoomChangeH = zoomOrigH[theID] - startH;
+
+ // Setup Zoom
+
+ zoomCurrent = 0;
+
+ // Setup Fade with Zoom, If Requested
+
+ if (includeFade == 1) {
+ fadeCurrent = 0;
+ fadeAmount = (100 - 0) / tempSteps;
+ } else {
+ fadeAmount = 0;
+ }
+
+ // Do It!
+
+ zoomTimer[theID] = setInterval("zoomElement('"+zoomID+"', '"+theID+"', "+zoomCurrent+", "+startW+", "+zoomChangeW+", "+startH+", "+zoomChangeH+", "+startX+", "+zoomChangeX+", "+startY+", "+zoomChangeY+", "+tempSteps+", "+includeFade+", "+fadeAmount+", 'zoomDone(zoomID, theID)')", zoomTime);
+ zoomActive[theID] = true;
+ }
+}
+
+// Finished Zooming In
+
+function zoomDoneIn(zoomdiv, theID) {
+
+ // Note that it's open
+
+ zoomOpen = true;
+ zoomdiv = document.getElementById(zoomdiv);
+
+ // Position the table shadow behind the zoomed in image, and display it
+
+ if (document.getElementById("ShadowBox")) {
+
+ setOpacity(0, "ShadowBox");
+ shadowdiv = document.getElementById("ShadowBox");
+
+ shadowLeft = parseInt(zoomdiv.style.left) - 13;
+ shadowTop = parseInt(zoomdiv.style.top) - 8;
+ shadowWidth = zoomdiv.offsetWidth + 26;
+ shadowHeight = zoomdiv.offsetHeight + 26;
+
+ shadowdiv.style.width = shadowWidth + 'px';
+ shadowdiv.style.height = shadowHeight + 'px';
+ shadowdiv.style.left = shadowLeft + 'px';
+ shadowdiv.style.top = shadowTop + 'px';
+
+ document.getElementById("ShadowBox").style.visibility = "visible";
+ fadeElementSetup("ShadowBox", 0, 100, 5);
+
+ } else if (! browserIsIE) {
+ // Or, do a fade of the modern shadow
+ fadeElementSetup("ZoomImage", 0, .8, 5, 0, "shadow");
+ }
+
+ // Position and display the CAPTION, if existing
+
+ if (includeCaption && document.getElementById(zoomCaption).innerHTML != "") {
+ // setOpacity(0, zoomCaptionDiv);
+ zoomcapd = document.getElementById(zoomCaptionDiv);
+ zoomcapd.style.top = parseInt(zoomdiv.style.top) + (zoomdiv.offsetHeight + 15) + 'px';
+ zoomcapd.style.left = (myWidth / 2) - (zoomcapd.offsetWidth / 2) + 'px';
+ zoomcapd.style.visibility = "visible";
+ // fadeElementSetup(zoomCaptionDiv, 0, 100, 5);
+ }
+
+ // Display Close Box (fade it if it's not IE)
+
+ if (!browserIsIE) setOpacity(0, "ZoomClose");
+ document.getElementById("ZoomClose").style.visibility = "visible";
+ if (!browserIsIE) fadeElementSetup("ZoomClose", 0, 100, 5);
+
+ // Get keypresses
+ document.onkeypress = getKey;
+
+}
+
+// Finished Zooming Out
+
+function zoomDone(zoomdiv, theID) {
+
+ // No longer open
+
+ zoomOpen = false;
+
+ // Clear stuff out, clean up
+
+ zoomOrigH[theID] = "";
+ zoomOrigW[theID] = "";
+ document.getElementById(zoomdiv).style.visibility = "hidden";
+ zoomActive[theID] == false;
+
+ // Stop getting keypresses
+
+ document.onkeypress = null;
+
+}
+
+// Actually zoom the element
+
+function zoomElement(zoomdiv, theID, zoomCurrent, zoomStartW, zoomChangeW, zoomStartH, zoomChangeH, zoomStartX, zoomChangeX, zoomStartY, zoomChangeY, zoomSteps, includeFade, fadeAmount, execWhenDone) {
+
+ // console.log("Zooming Step #"+zoomCurrent+ " of "+zoomSteps+" (zoom " + zoomStartW + "/" + zoomChangeW + ") (zoom " + zoomStartH + "/" + zoomChangeH + ") (zoom " + zoomStartX + "/" + zoomChangeX + ") (zoom " + zoomStartY + "/" + zoomChangeY + ") Fade: "+fadeAmount);
+
+ // Test if we're done, or if we continue
+
+ if (zoomCurrent == (zoomSteps + 1)) {
+ zoomActive[theID] = false;
+ clearInterval(zoomTimer[theID]);
+
+ if (execWhenDone != "") {
+ eval(execWhenDone);
+ }
+ } else {
+
+ // Do the Fade!
+
+ if (includeFade == 1) {
+ if (fadeAmount < 0) {
+ setOpacity(Math.abs(zoomCurrent * fadeAmount), zoomdiv);
+ } else {
+ setOpacity(100 - (zoomCurrent * fadeAmount), zoomdiv);
+ }
+ }
+
+ // Calculate this step's difference, and move it!
+
+ moveW = cubicInOut(zoomCurrent, zoomStartW, zoomChangeW, zoomSteps);
+ moveH = cubicInOut(zoomCurrent, zoomStartH, zoomChangeH, zoomSteps);
+ moveX = cubicInOut(zoomCurrent, zoomStartX, zoomChangeX, zoomSteps);
+ moveY = cubicInOut(zoomCurrent, zoomStartY, zoomChangeY, zoomSteps);
+
+ document.getElementById(zoomdiv).style.left = moveX + 'px';
+ document.getElementById(zoomdiv).style.top = moveY + 'px';
+ zoomimg.style.width = moveW + 'px';
+ zoomimg.style.height = moveH + 'px';
+
+ zoomCurrent++;
+
+ clearInterval(zoomTimer[theID]);
+ zoomTimer[theID] = setInterval("zoomElement('"+zoomdiv+"', '"+theID+"', "+zoomCurrent+", "+zoomStartW+", "+zoomChangeW+", "+zoomStartH+", "+zoomChangeH+", "+zoomStartX+", "+zoomChangeX+", "+zoomStartY+", "+zoomChangeY+", "+zoomSteps+", "+includeFade+", "+fadeAmount+", '"+execWhenDone+"')", zoomTime);
+ }
+}
+
+// Zoom Utility: Get Key Press when image is open, and act accordingly
+
+function getKey(evt) {
+ if (! evt) {
+ theKey = event.keyCode;
+ } else {
+ theKey = evt.keyCode;
+ }
+
+ if (theKey == 27) { // ESC
+ zoomOut(this, evt);
+ }
+}
+
+////////////////////////////
+//
+// FADE Functions
+//
+
+function fadeOut(elem) {
+ if (elem.id) {
+ fadeElementSetup(elem.id, 100, 0, 10);
+ }
+}
+
+function fadeIn(elem) {
+ if (elem.id) {
+ fadeElementSetup(elem.id, 0, 100, 10);
+ }
+}
+
+// Fade: Initialize the fade function
+
+var fadeActive = new Array();
+var fadeQueue = new Array();
+var fadeTimer = new Array();
+var fadeClose = new Array();
+var fadeMode = new Array();
+
+function fadeElementSetup(theID, fdStart, fdEnd, fdSteps, fdClose, fdMode) {
+
+ // alert("Fading: "+theID+" Steps: "+fdSteps+" Mode: "+fdMode);
+
+ if (fadeActive[theID] == true) {
+ // Already animating, queue up this command
+ fadeQueue[theID] = new Array(theID, fdStart, fdEnd, fdSteps);
+ } else {
+ fadeSteps = fdSteps;
+ fadeCurrent = 0;
+ fadeAmount = (fdStart - fdEnd) / fadeSteps;
+ fadeTimer[theID] = setInterval("fadeElement('"+theID+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')", 15);
+ fadeActive[theID] = true;
+ fadeMode[theID] = fdMode;
+
+ if (fdClose == 1) {
+ fadeClose[theID] = true;
+ } else {
+ fadeClose[theID] = false;
+ }
+ }
+}
+
+// Fade: Do the fade. This function will call itself, modifying the parameters, so
+// many instances can run concurrently. Can fade using opacity, or fade using a box-shadow.
+
+function fadeElement(theID, fadeCurrent, fadeAmount, fadeSteps) {
+
+ if (fadeCurrent == fadeSteps) {
+
+ // We're done, so clear.
+
+ clearInterval(fadeTimer[theID]);
+ fadeActive[theID] = false;
+ fadeTimer[theID] = false;
+
+ // Should we close it once the fade is complete?
+
+ if (fadeClose[theID] == true) {
+ document.getElementById(theID).style.visibility = "hidden";
+ }
+
+ // Hang on.. did a command queue while we were working? If so, make it happen now
+
+ if (fadeQueue[theID] && fadeQueue[theID] != false) {
+ fadeElementSetup(fadeQueue[theID][0], fadeQueue[theID][1], fadeQueue[theID][2], fadeQueue[theID][3]);
+ fadeQueue[theID] = false;
+ }
+ } else {
+
+ fadeCurrent++;
+
+ // Now actually do the fade adjustment.
+
+ if (fadeMode[theID] == "shadow") {
+
+ // Do a special fade on the webkit-box-shadow of the object
+
+ if (fadeAmount < 0) {
+ document.getElementById(theID).style.webkitBoxShadow = shadowSettings + (Math.abs(fadeCurrent * fadeAmount)) + ')';
+ } else {
+ document.getElementById(theID).style.webkitBoxShadow = shadowSettings + (100 - (fadeCurrent * fadeAmount)) + ')';
+ }
+
+ } else {
+
+ // Set the opacity depending on if we're adding or subtracting (pos or neg)
+
+ if (fadeAmount < 0) {
+ setOpacity(Math.abs(fadeCurrent * fadeAmount), theID);
+ } else {
+ setOpacity(100 - (fadeCurrent * fadeAmount), theID);
+ }
+ }
+
+ // Keep going, and send myself the updated variables
+ clearInterval(fadeTimer[theID]);
+ fadeTimer[theID] = setInterval("fadeElement('"+theID+"', '"+fadeCurrent+"', '"+fadeAmount+"', '"+fadeSteps+"')", 15);
+ }
+}
+
+////////////////////////////
+//
+// UTILITY functions
+//
+
+// Utility: Set the opacity, compatible with a number of browsers. Value from 0 to 100.
+
+function setOpacity(opacity, theID) {
+
+ var object = document.getElementById(theID).style;
+
+ // If it's 100, set it to 99 for Firefox.
+
+ if (navigator.userAgent.indexOf("Firefox") != -1) {
+ if (opacity == 100) { opacity = 99.9999; } // This is majorly awkward
+ }
+
+ // Multi-browser opacity setting
+
+ object.filter = "alpha(opacity=" + opacity + ")"; // IE/Win
+ object.opacity = (opacity / 100); // Safari 1.2, Firefox+Mozilla
+
+}
+
+// Utility: Math functions for animation calucations - From http://www.robertpenner.com/easing/
+//
+// t = time, b = begin, c = change, d = duration
+// time = current frame, begin is fixed, change is basically finish - begin, duration is fixed (frames),
+
+function linear(t, b, c, d)
+{
+ return c*t/d + b;
+}
+
+function sineInOut(t, b, c, d)
+{
+ return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
+}
+
+function cubicIn(t, b, c, d) {
+ return c*(t/=d)*t*t + b;
+}
+
+function cubicOut(t, b, c, d) {
+ return c*((t=t/d-1)*t*t + 1) + b;
+}
+
+function cubicInOut(t, b, c, d)
+{
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
+ return c/2*((t-=2)*t*t + 2) + b;
+}
+
+function bounceOut(t, b, c, d)
+{
+ if ((t/=d) < (1/2.75)){
+ return c*(7.5625*t*t) + b;
+ } else if (t < (2/2.75)){
+ return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
+ } else if (t < (2.5/2.75)){
+ return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
+ } else {
+ return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
+ }
+}
+
+
+// Utility: Get the size of the window, and set myWidth and myHeight
+// Credit to quirksmode.org
+
+function getSize() {
+
+ // Window Size
+
+ if (self.innerHeight) { // Everyone but IE
+ myWidth = window.innerWidth;
+ myHeight = window.innerHeight;
+ myScroll = window.pageYOffset;
+ } else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict
+ myWidth = document.documentElement.clientWidth;
+ myHeight = document.documentElement.clientHeight;
+ myScroll = document.documentElement.scrollTop;
+ } else if (document.body) { // Other IE, such as IE7
+ myWidth = document.body.clientWidth;
+ myHeight = document.body.clientHeight;
+ myScroll = document.body.scrollTop;
+ }
+
+ // Page size w/offscreen areas
+
+ if (window.innerHeight && window.scrollMaxY) {
+ myScrollWidth = document.body.scrollWidth;
+ myScrollHeight = window.innerHeight + window.scrollMaxY;
+ } else if (document.body.scrollHeight > document.body.offsetHeight) { // All but Explorer Mac
+ myScrollWidth = document.body.scrollWidth;
+ myScrollHeight = document.body.scrollHeight;
+ } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
+ myScrollWidth = document.body.offsetWidth;
+ myScrollHeight = document.body.offsetHeight;
+ }
+}
+
+// Utility: Get Shift Key Status
+// IE events don't seem to get passed through the function, so grab it from the window.
+
+function getShift(evt) {
+ var shift = false;
+ if (! evt && window.event) {
+ shift = window.event.shiftKey;
+ } else if (evt) {
+ shift = evt.shiftKey;
+ if (shift) evt.stopPropagation(); // Prevents Firefox from doing shifty things
+ }
+ return shift;
+}
+
+// Utility: Find the Y position of an element on a page. Return Y and X as an array
+
+function findElementPos(elemFind)
+{
+ var elemX = 0;
+ var elemY = 0;
+ do {
+ elemX += elemFind.offsetLeft;
+ elemY += elemFind.offsetTop;
+ } while ( elemFind = elemFind.offsetParent )
+
+ return Array(elemX, elemY);
+} \ No newline at end of file
diff --git a/static/js/FancyZoomHTML.js b/static/js/FancyZoomHTML.js
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/static/js/FancyZoomHTML.js
diff --git a/static/js/away.js b/static/js/away.js
index cf4b19c..cf4b19c 100644..100755
--- a/static/js/away.js
+++ b/static/js/away.js
diff --git a/static/js/dumpsearch.js b/static/js/dumpsearch.js
new file mode 100755
index 0000000..bb0bcce
--- /dev/null
+++ b/static/js/dumpsearch.js
@@ -0,0 +1,39 @@
+if (!window['google']) {
+window['google'] = {};
+}
+if (!window['google']['loader']) {
+window['google']['loader'] = {};
+google.loader.ServiceBase = 'http://www.google.com/uds';
+google.loader.GoogleApisBase = 'http://ajax.googleapis.com/ajax';
+google.loader.ApiKey = 'ABQIAAAA6C4bndUCBastUbawfhKGURQviNTBAztVc6-FhSQEQv6BdFn_BBRfktMUHCKH-MICXpvRmJU3x-Ly0w';
+google.loader.KeyVerified = true;
+google.loader.LoadFailure = false;
+google.loader.Secure = false;
+google.loader.GoogleLocale = 'www.google.com';
+google.loader.ClientLocation = null;
+google.loader.AdditionalParams = '';
+(function() {var d=true,e=null,g=false,h=encodeURIComponent,j=window,k=google,m=undefined,n=document;function p(a,b){return a.load=b}var q="push",s="replace",t="charAt",u="ServiceBase",v="name",w="getTime",x="length",y="prototype",z="setTimeout",A="loader",B="substring",C="join",D="toLowerCase";function E(a){if(a in F)return F[a];return F[a]=navigator.userAgent[D]().indexOf(a)!=-1}var F={};function G(a,b){var c=function(){};c.prototype=b[y];a.S=b[y];a.prototype=new c}
+function H(a,b){var c=a.G||[];c=c.concat(Array[y].slice.call(arguments,2));if(typeof a.t!="undefined")b=a.t;if(typeof a.s!="undefined")a=a.s;var f=function(){var i=c.concat(Array[y].slice.call(arguments));return a.apply(b,i)};f.G=c;f.t=b;f.s=a;return f}function I(a){a=new Error(a);a.toString=function(){return this.message};return a}function J(a,b){a=a.split(/\./);for(var c=j,f=0;f<a[x]-1;f++){c[a[f]]||(c[a[f]]={});c=c[a[f]]}c[a[a[x]-1]]=b}function K(a,b,c){a[b]=c}if(!L)var L=J;if(!M)var M=K;k[A].u={};L("google.loader.callbacks",k[A].u);var N={},O={};k[A].eval={};L("google.loader.eval",k[A].eval);
+p(k,function(a,b,c){function f(r){var o=r.split(".");if(o[x]>2)throw I("Module: '"+r+"' not found!");else if(typeof o[1]!="undefined"){i=o[0];c.packages=c.packages||[];c.packages[q](o[1])}}var i=a;c=c||{};if(a instanceof Array||a&&typeof a=="object"&&typeof a[C]=="function"&&typeof a.reverse=="function")for(var l=0;l<a[x];l++)f(a[l]);else f(a);if(a=N[":"+i]){if(c&&!c.language&&c.locale)c.language=c.locale;if(c&&typeof c.callback=="string"){l=c.callback;if(l.match(/^[[\]A-Za-z0-9._]+$/)){l=j.eval(l);
+c.callback=l}}if((l=c&&c.callback!=e)&&!a.r(b))throw I("Module: '"+i+"' must be loaded before DOM onLoad!");else if(l)a.l(b,c)?j[z](c.callback,0):a.load(b,c);else a.l(b,c)||a.load(b,c)}else throw I("Module: '"+i+"' not found!");});L("google.load",k.load);k.R=function(a,b){b?aa(a):P(j,"load",a)};L("google.setOnLoadCallback",k.R);function P(a,b,c){if(a.addEventListener)a.addEventListener(b,c,g);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var f=a["on"+b];a["on"+b]=f!=e?ba([c,f]):c}}
+function ba(a){return function(){for(var b=0;b<a[x];b++)a[b]()}}var Q=[];function aa(a){if(Q[x]==0){P(j,"load",R);if(!E("msie")&&!(E("safari")||E("konqueror"))&&E("mozilla")||j.opera)j.addEventListener("DOMContentLoaded",R,g);else if(E("msie"))n.write("<script defer onreadystatechange='google.loader.domReady()' src=//:><\/script>");else(E("safari")||E("konqueror"))&&j[z](ca,10)}Q[q](a)}
+k[A].M=function(){var a=j.event.srcElement;if(a.readyState=="complete"){a.onreadystatechange=e;a.parentNode.removeChild(a);R()}};L("google.loader.domReady",k[A].M);var da={loaded:d,complete:d};function ca(){if(da[n.readyState])R();else Q[x]>0&&j[z](ca,10)}function R(){for(var a=0;a<Q[x];a++)Q[a]();Q.length=0}
+k[A].e=function(a,b,c){if(c){var f;if(a=="script"){f=n.createElement("script");f.type="text/javascript";f.src=b}else if(a=="css"){f=n.createElement("link");f.type="text/css";f.href=b;f.rel="stylesheet"}(a=n.getElementsByTagName("head")[0])||(a=n.body.parentNode.appendChild(n.createElement("head")));a.appendChild(f)}else if(a=="script")n.write('<script src="'+b+'" type="text/javascript"><\/script>');else a=="css"&&n.write('<link href="'+b+'" type="text/css" rel="stylesheet"></link>')};
+L("google.loader.writeLoadTag",k[A].e);k[A].O=function(a){O=a};L("google.loader.rfm",k[A].O);k[A].Q=function(a){for(var b in a)if(typeof b=="string"&&b&&b[t](0)==":"&&!N[b])N[b]=new T(b[B](1),a[b])};L("google.loader.rpl",k[A].Q);k[A].P=function(a){if((a=a.specs)&&a[x])for(var b=0;b<a[x];++b){var c=a[b];if(typeof c=="string")N[":"+c]=new U(c);else{c=new V(c[v],c.baseSpec,c.customSpecs);N[":"+c[v]]=c}}};L("google.loader.rm",k[A].P);k[A].loaded=function(a){N[":"+a.module].j(a)};
+L("google.loader.loaded",k[A].loaded);k[A].L=function(){var a=(new Date)[w](),b=Math.floor(Math.random()*1E7);return"qid="+(a.toString(16)+b.toString(16))};L("google.loader.createGuidArg_",k[A].L);J("google_exportSymbol",J);J("google_exportProperty",K);k[A].b={};L("google.loader.themes",k[A].b);k[A].b.A="http://www.google.com/cse/style/look/bubblegum.css";M(k[A].b,"BUBBLEGUM",k[A].b.A);k[A].b.C="http://www.google.com/cse/style/look/greensky.css";M(k[A].b,"GREENSKY",k[A].b.C);k[A].b.B="http://www.google.com/cse/style/look/espresso.css";
+M(k[A].b,"ESPRESSO",k[A].b.B);k[A].b.F="http://www.google.com/cse/style/look/shiny.css";M(k[A].b,"SHINY",k[A].b.F);k[A].b.D="http://www.google.com/cse/style/look/minimalist.css";M(k[A].b,"MINIMALIST",k[A].b.D);function U(a){this.a=a;this.p=[];this.o={};this.c={};this.k=d;this.d=-1}
+U[y].g=function(a,b){var c="";if(b!=m){if(b.language!=m)c+="&hl="+h(b.language);if(b.nocss!=m)c+="&output="+h("nocss="+b.nocss);if(b.nooldnames!=m)c+="&nooldnames="+h(b.nooldnames);if(b.packages!=m)c+="&packages="+h(b.packages);if(b.callback!=e)c+="&async=2";if(b.style!=m)c+="&style="+h(b.style);if(b.other_params!=m)c+="&"+b.other_params}if(!this.k){if(k[this.a]&&k[this.a].JSHash)c+="&sig="+h(k[this.a].JSHash);b=[];for(var f in this.o)f[t](0)==":"&&b[q](f[B](1));for(f in this.c)f[t](0)==":"&&b[q](f[B](1));
+c+="&have="+h(b[C](","))}return k[A][u]+"/?file="+this.a+"&v="+a+k[A].AdditionalParams+c};U[y].w=function(a){var b=e;if(a)b=a.packages;var c=e;if(b)if(typeof b=="string")c=[a.packages];else if(b[x]){c=[];for(a=0;a<b[x];a++)typeof b[a]=="string"&&c[q](b[a][s](/^\s*|\s*$/,"")[D]())}c||(c=["default"]);b=[];for(a=0;a<c[x];a++)this.o[":"+c[a]]||b[q](c[a]);return b};
+p(U[y],function(a,b){var c=this.w(b),f=b&&b.callback!=e;if(f)var i=new W(b.callback);for(var l=[],r=c[x]-1;r>=0;r--){var o=c[r];f&&i.H(o);if(this.c[":"+o]){c.splice(r,1);f&&this.c[":"+o][q](i)}else l[q](o)}if(c[x]){if(b&&b.packages)b.packages=c.sort()[C](",");if(!b&&O[":"+this.a]!=e&&O[":"+this.a].versions[":"+a]!=e&&!k[A].AdditionalParams&&this.k){a=O[":"+this.a];k[this.a]=k[this.a]||{};for(var S in a.properties)if(S&&S[t](0)==":")k[this.a][S[B](1)]=a.properties[S];k[A].e("script",k[A][u]+a.path+
+a.js,f);a.css&&k[A].e("css",k[A][u]+a.path+a.css,f)}else if(!b||!b.autoloaded)k[A].e("script",this.g(a,b),f);if(this.k){this.k=g;this.d=(new Date)[w]();if(this.d%100!=1)this.d=-1}for(r=0;r<l[x];r++){o=l[r];this.c[":"+o]=[];f&&this.c[":"+o][q](i)}}});
+U[y].j=function(a){if(this.d!=-1){X("al_"+this.a,"jl."+((new Date)[w]()-this.d),d);this.d=-1}this.p=this.p.concat(a.components);k[A][this.a]||(k[A][this.a]={});k[A][this.a].packages=this.p.slice(0);for(var b=0;b<a.components[x];b++){this.o[":"+a.components[b]]=d;var c=this.c[":"+a.components[b]];if(c){for(var f=0;f<c[x];f++)c[f].K(a.components[b]);delete this.c[":"+a.components[b]]}}X("hl",this.a)};U[y].l=function(a,b){return this.w(b)[x]==0};U[y].r=function(){return d};
+function W(a){this.J=a;this.m={};this.q=0}W[y].H=function(a){this.q++;this.m[":"+a]=d};W[y].K=function(a){if(this.m[":"+a]){this.m[":"+a]=g;this.q--;this.q==0&&j[z](this.J,0)}};function V(a,b,c){this.name=a;this.I=b;this.n=c;this.v=this.h=g;this.i=[];k[A].u[this[v]]=H(this.j,this)}G(V,U);p(V[y],function(a,b){var c=b&&b.callback!=e;if(c){this.i[q](b.callback);b.callback="google.loader.callbacks."+this[v]}else this.h=d;if(!b||!b.autoloaded)k[A].e("script",this.g(a,b),c);X("el",this[v])});V[y].l=function(a,b){return b&&b.callback!=e?this.v:this.h};V[y].j=function(){this.v=d;for(var a=0;a<this.i[x];a++)j[z](this.i[a],0);this.i=[]};
+var Y=function(a,b){return a.string?h(a.string)+"="+h(b):a.regex?b[s](/(^.*$)/,a.regex):""};V[y].g=function(a,b){return this.N(this.z(a),a,b)};
+V[y].N=function(a,b,c){var f="";if(a.key)f+="&"+Y(a.key,k[A].ApiKey);if(a.version)f+="&"+Y(a.version,b);b=k[A].Secure&&a.ssl?a.ssl:a.uri;if(c!=e)for(var i in c)if(a.params[i])f+="&"+Y(a.params[i],c[i]);else if(i=="other_params")f+="&"+c[i];else if(i=="base_domain")b="http://"+c[i]+a.uri[B](a.uri.indexOf("/",7));k[this[v]]={};if(b.indexOf("?")==-1&&f)f="?"+f[B](1);return b+f};V[y].r=function(a){return this.z(a).deferred};V[y].z=function(a){if(this.n)for(var b=0;b<this.n[x];++b){var c=this.n[b];if((new RegExp(c.pattern)).test(a))return c}return this.I};function T(a,b){this.a=a;this.f=b;this.h=g}G(T,U);p(T[y],function(a,b){this.h=d;k[A].e("script",this.g(a,b),g)});T[y].l=function(){return this.h};T[y].j=function(){};T[y].g=function(a,b){if(!this.f.versions[":"+a]){if(this.f.aliases){var c=this.f.aliases[":"+a];if(c)a=c}if(!this.f.versions[":"+a])throw I("Module: '"+this.a+"' with version '"+a+"' not found!");}a=k[A].GoogleApisBase+"/libs/"+this.a+"/"+a+"/"+this.f.versions[":"+a][b&&b.uncompressed?"uncompressed":"compressed"];X("el",this.a);return a};
+T[y].r=function(){return g};var ea=g,Z=[],fa=(new Date)[w](),X=function(a,b,c){if(!ea){P(j,"unload",ga);ea=d}if(c){if(!k[A].Secure&&(!k[A].Options||k[A].Options.csi===g)){a=a[D]()[s](/[^a-z0-9_.]+/g,"_");b=b[D]()[s](/[^a-z0-9_.]+/g,"_");j[z](H($,e,"http://csi.gstatic.com/csi?s=uds&v=2&action="+h(a)+"&it="+h(b)),1E4)}}else{Z[q]("r"+Z[x]+"="+h(a+(b?"|"+b:"")));j[z](ga,Z[x]>5?0:15E3)}},ga=function(){if(Z[x]){$(k[A][u]+"/stats?"+Z[C]("&")+"&nc="+(new Date)[w]()+"_"+((new Date)[w]()-fa));Z.length=0}},$=function(a){var b=new Image,
+c=ha++;ia[c]=b;b.onload=b.onerror=function(){delete ia[c]};b.src=a;b=e},ia={},ha=0;J("google.loader.recordStat",X);J("google.loader.createImageForLogging",$);
+
+}) ();google.loader.rm({"specs":[{"name":"books","baseSpec":{"uri":"http://books.google.com/books/api.js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"}}}},"feeds",{"name":"friendconnect","baseSpec":{"uri":"http://www.google.com/friendconnect/script/friendconnect.js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":false,"params":{}}},"spreadsheets","gdata","visualization",{"name":"sharing","baseSpec":{"uri":"http://www.google.com/s2/sharing/js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":false,"params":{"language":{"string":"hl"}}}},"search",{"name":"maps","baseSpec":{"uri":"http://maps.google.com/maps?file\u003dgoogleapi","ssl":"https://maps-api-ssl.google.com/maps?file\u003dgoogleapi","key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"regex":"callback\u003d$1\u0026async\u003d2"},"language":{"string":"hl"}}},"customSpecs":[{"uri":"http://maps.google.com/maps/api/js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"}},"pattern":"^(3|3..*)$"}]},"annotations_v2","orkut","language","earth",{"name":"annotations","baseSpec":{"uri":"http://www.google.com/reviews/scripts/annotations_bootstrap.js","ssl":null,"key":{"string":"key"},"version":{"string":"v"},"deferred":true,"params":{"callback":{"string":"callback"},"language":{"string":"hl"},"country":{"string":"gl"}}}},"ads","elements"]});
+google.loader.rfm({":feeds":{"versions":{":1":"1",":1.0":"1"},"path":"/api/feeds/1.0/e291a634414cb5ef1c9f3b5424b8ac4b/","js":"default+en.I.js","css":"default.css","properties":{":JSHash":"e291a634414cb5ef1c9f3b5424b8ac4b",":Version":"1.0"}},":search":{"versions":{":1":"1",":1.0":"1"},"path":"/api/search/1.0/d3863cc958afe4c6c797e1fc2d91793c/","js":"default+en.I.js","css":"default.css","properties":{":JSHash":"d3863cc958afe4c6c797e1fc2d91793c",":NoOldNames":false,":Version":"1.0"}},":language":{"versions":{":1":"1",":1.0":"1"},"path":"/api/language/1.0/cd6e6992328d3619ee31352c39a90b10/","js":"default+en.I.js","properties":{":JSHash":"cd6e6992328d3619ee31352c39a90b10",":Version":"1.0"}},":spreadsheets":{"versions":{":0":"1",":0.2":"1"},"path":"/api/spreadsheets/0.2/626554c678ff579189704ea83fe72774/","js":"default.I.js","properties":{":JSHash":"626554c678ff579189704ea83fe72774",":Version":"0.2"}},":earth":{"versions":{":1":"1",":1.0":"1"},"path":"/api/earth/1.0/abef9437280171d37dd6be81a58115d2/","js":"default.I.js","properties":{":JSHash":"abef9437280171d37dd6be81a58115d2",":Version":"1.0"}},":annotations":{"versions":{":1":"1",":1.0":"1"},"path":"/api/annotations/1.0/71b0b459463545c346b09f9e642464ae/","js":"default+en.I.js","properties":{":JSHash":"71b0b459463545c346b09f9e642464ae",":Version":"1.0"}}});
+google.loader.rpl({":scriptaculous":{"versions":{":1.8.3":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"},":1.8.2":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"},":1.8.1":{"uncompressed":"scriptaculous.js","compressed":"scriptaculous.js"}},"aliases":{":1.8":"1.8.3",":1":"1.8.3"}},":yui":{"versions":{":2.6.0":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.7.0":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"},":2.8.0r4":{"uncompressed":"build/yuiloader/yuiloader.js","compressed":"build/yuiloader/yuiloader-min.js"}},"aliases":{":2":"2.8.0r4",":2.7":"2.7.0",":2.6":"2.6.0",":2.8":"2.8.0r4",":2.8.0":"2.8.0r4"}},":swfobject":{"versions":{":2.1":{"uncompressed":"swfobject_src.js","compressed":"swfobject.js"},":2.2":{"uncompressed":"swfobject_src.js","compressed":"swfobject.js"}},"aliases":{":2":"2.2"}},":ext-core":{"versions":{":3.0.0":{"uncompressed":"ext-core-debug.js","compressed":"ext-core.js"}},"aliases":{":3":"3.0.0",":3.0":"3.0.0"}},":mootools":{"versions":{":1.2.3":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.1.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.4":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.1":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.2.2":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"},":1.1.2":{"uncompressed":"mootools.js","compressed":"mootools-yui-compressed.js"}},"aliases":{":1":"1.1.2",":1.11":"1.1.1",":1.2":"1.2.4",":1.1":"1.1.2"}},":jqueryui":{"versions":{":1.7.2":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.6.0":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.0":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.7.1":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.5.3":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"},":1.5.2":{"uncompressed":"jquery-ui.js","compressed":"jquery-ui.min.js"}},"aliases":{":1.7":"1.7.2",":1":"1.7.2",":1.6":"1.6.0",":1.5":"1.5.3"}},":chrome-frame":{"versions":{":1.0.2":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"},":1.0.1":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"},":1.0.0":{"uncompressed":"CFInstall.js","compressed":"CFInstall.min.js"}},"aliases":{":1":"1.0.2",":1.0":"1.0.2"}},":prototype":{"versions":{":1.6.0.2":{"uncompressed":"prototype.js","compressed":"prototype.js"},":1.6.1.0":{"uncompressed":"prototype.js","compressed":"prototype.js"},":1.6.0.3":{"uncompressed":"prototype.js","compressed":"prototype.js"}},"aliases":{":1.6.1":"1.6.1.0",":1":"1.6.1.0",":1.6":"1.6.1.0",":1.6.0":"1.6.0.3"}},":jquery":{"versions":{":1.2.3":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.1":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.0":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.3.2":{"uncompressed":"jquery.js","compressed":"jquery.min.js"},":1.2.6":{"uncompressed":"jquery.js","compressed":"jquery.min.js"}},"aliases":{":1":"1.3.2",":1.3":"1.3.2",":1.2":"1.2.6"}},":dojo":{"versions":{":1.2.3":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.1.1":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.3.2":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.2.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"},":1.4.0":{"uncompressed":"dojo/dojo.xd.js.uncompressed.js","compressed":"dojo/dojo.xd.js"}},"aliases":{":1":"1.4.0",":1.4":"1.4.0",":1.3":"1.3.2",":1.2":"1.2.3",":1.1":"1.1.1"}}});
+}
diff --git a/static/js/home.js b/static/js/home.js
index e9be833..072617a 100755
--- a/static/js/home.js
+++ b/static/js/home.js
@@ -171,3 +171,31 @@ function login() {
error: onError
});
};
+
+
+function MM_swapImgRestore() { //v3.0
+ var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
+}
+function MM_preloadImages() { //v3.0
+ var d=document; if(d.images){
+ if(!d.MM_p) d.MM_p=new Array();
+ var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
+ if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
+}
+
+function MM_findObj(n, d) { //v4.01
+ var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
+ d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
+ if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
+ for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
+ if(!x && d.getElementById) x=d.getElementById(n); return x;
+}
+
+function MM_swapImage() { //v3.0
+ var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
+ if ((x=MM_findObj(a[i]))!=null){
+ document.MM_sr[j++]=x;
+ if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
+ }
+}
+
diff --git a/static/js/jquery.js b/static/js/jquery.js
new file mode 100644
index 0000000..7361a61
--- /dev/null
+++ b/static/js/jquery.js
@@ -0,0 +1,171 @@
+/**
+ * @projectDescription Monitor Font Size Changes with jQuery
+ *
+ * @version 1.0
+ * @author Dave Cardwell
+ *
+ * jQuery-Em - $Revision: 24 $ ($Date: 2007-08-19 11:24:56 +0100 (Sun, 19 Aug 2007) $)
+ * http://davecardwell.co.uk/javascript/jquery/plugins/jquery-em/
+ *
+ * Copyright ©2007 Dave Cardwell <http://davecardwell.co.uk/>
+ *
+ * Released under the MIT licence:
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+// Upon $(document).ready()…
+jQuery(function($) {
+ // Configuration…
+ var eventName = 'emchange';
+
+
+ // Set up default options.
+ $.em = $.extend({
+ /**
+ * The jQuery-Em version string.
+ *
+ * @example $.em.version;
+ * @desc '1.0a'
+ *
+ * @property
+ * @name version
+ * @type String
+ * @cat Plugins/Em
+ */
+ version: '1.0',
+
+ /**
+ * The number of milliseconds to wait when polling for changes to the
+ * font size.
+ *
+ * @example $.em.delay = 400;
+ * @desc Defaults to 200.
+ *
+ * @property
+ * @name delay
+ * @type Number
+ * @cat Plugins/Em
+ */
+ delay: 200,
+
+ /**
+ * The element used to detect changes to the font size.
+ *
+ * @example $.em.element = $('<div />')[0];
+ * @desc Default is an empty, absolutely positioned, 100em-wide <div>.
+ *
+ * @private
+ * @property
+ * @name element
+ * @type Element
+ * @cat Plugins/Em
+ */
+ element: $('<div />').css({ left: '-100em',
+ position: 'absolute',
+ width: '100em' })
+ .prependTo('body')[0],
+
+ /**
+ * The action to perform when a change in the font size is detected.
+ *
+ * @example $.em.action = function() { ... }
+ * @desc The default action is to trigger a global “emchange” event.
+ * You probably shouldn’t change this behaviour as other plugins may
+ * rely on it, but the option is here for completion.
+ *
+ * @example $(document).bind('emchange', function(e, cur, prev) {...})
+ * @desc Any functions triggered on this event are passed the current
+ * font size, and last known font size as additional parameters.
+ *
+ * @private
+ * @property
+ * @name action
+ * @type Function
+ * @cat Plugins/Em
+ * @see current
+ * @see previous
+ */
+ action: function() {
+ var currentWidth = $.em.element.offsetWidth / 100;
+
+ // If the font size has changed since we last checked…
+ if ( currentWidth != $.em.current ) {
+ /**
+ * The previous pixel value of the user agent’s font size. See
+ * $.em.current for caveats. Will initially be undefined until
+ * the “emchange” event is triggered.
+ *
+ * @example $.em.previous;
+ * @result 16
+ *
+ * @property
+ * @name previous
+ * @type Number
+ * @cat Plugins/Em
+ * @see current
+ */
+ $.em.previous = $.em.current;
+
+ /**
+ * The current pixel value of the user agent’s font size. As
+ * with $.em.previous, this value *may* be subject to minor
+ * browser rounding errors that mean you might not want to
+ * rely upon it as an absolute value.
+ *
+ * @example $.em.current;
+ * @result 14
+ *
+ * @property
+ * @name current
+ * @type Number
+ * @cat Plugins/Em
+ * @see previous
+ */
+ $.em.current = currentWidth;
+
+ $.event.trigger(eventName, [$.em.current, $.em.previous]);
+ }
+ }
+ }, $.em );
+
+
+ /**
+ * Bind a function to the emchange event of each matched element.
+ *
+ * @example $("p").emchange( function() { alert("Hello"); } );
+ *
+ * @name emchange
+ * @type jQuery
+ * @param Function fn A function to bind to the emchange event.
+ * @cat Plugins/Em
+ */
+
+ /**
+ * Trigger the emchange event of each matched element.
+ *
+ * @example $("p").emchange()
+ *
+ * @name emchange
+ * @type jQuery
+ * @cat Plugins/Em
+ */
+ $.fn[eventName] = function(fn) { return fn ? this.bind(eventName, fn)
+ : this.trigger(eventName); };
+
+
+ // Store the initial pixel value of the user agent’s font size.
+ $.em.current = $.em.element.offsetWidth / 100;
+
+ /**
+ * While polling for font-size changes, $.em.iid stores the intervalID in
+ * case you should want to cancel with clearInterval().
+ *
+ * @example window.clearInterval( $.em.iid );
+ *
+ * @property
+ * @name iid
+ * @type Number
+ * @cat Plugins/Em
+ */
+ $.em.iid = setInterval( $.em.action, $.em.delay );
+});
diff --git a/static/js/jquery.mousewheel.js b/static/js/jquery.mousewheel.js
new file mode 100644
index 0000000..f255340
--- /dev/null
+++ b/static/js/jquery.mousewheel.js
@@ -0,0 +1,85 @@
+/* Copyright (c) 2006 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
+ *
+ * $LastChangedDate: 2007-12-20 09:02:08 -0600 (Thu, 20 Dec 2007) $
+ * $Rev: 4265 $
+ *
+ * Version: 3.0
+ *
+ * Requires: $ 1.2.2+
+ */
+
+(function($) {
+
+$.event.special.mousewheel = {
+ setup: function() {
+ var handler = $.event.special.mousewheel.handler;
+
+ // Fix pageX, pageY, clientX and clientY for mozilla
+ if ( $.browser.mozilla )
+ $(this).bind('mousemove.mousewheel', function(event) {
+ $.data(this, 'mwcursorposdata', {
+ pageX: event.pageX,
+ pageY: event.pageY,
+ clientX: event.clientX,
+ clientY: event.clientY
+ });
+ });
+
+ if ( this.addEventListener )
+ this.addEventListener( ($.browser.mozilla ? 'DOMMouseScroll' : 'mousewheel'), handler, false);
+ else
+ this.onmousewheel = handler;
+ },
+
+ teardown: function() {
+ var handler = $.event.special.mousewheel.handler;
+
+ $(this).unbind('mousemove.mousewheel');
+
+ if ( this.removeEventListener )
+ this.removeEventListener( ($.browser.mozilla ? 'DOMMouseScroll' : 'mousewheel'), handler, false);
+ else
+ this.onmousewheel = function(){};
+
+ $.removeData(this, 'mwcursorposdata');
+ },
+
+ handler: function(event) {
+ var args = Array.prototype.slice.call( arguments, 1 );
+
+ event = $.event.fix(event || window.event);
+ // Get correct pageX, pageY, clientX and clientY for mozilla
+ $.extend( event, $.data(this, 'mwcursorposdata') || {} );
+ var delta = 0, returnValue = true;
+
+ if ( event.wheelDelta ) delta = event.wheelDelta/120;
+ if ( event.detail ) delta = -event.detail/3;
+// if ( $.browser.opera ) delta = -event.wheelDelta;
+
+ event.data = event.data || {};
+ event.type = "mousewheel";
+
+ // Add delta to the front of the arguments
+ args.unshift(delta);
+ // Add event to the front of the arguments
+ args.unshift(event);
+
+ return $.event.handle.apply(this, args);
+ }
+};
+
+$.fn.extend({
+ mousewheel: function(fn) {
+ return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
+ },
+
+ unmousewheel: function(fn) {
+ return this.unbind("mousewheel", fn);
+ }
+});
+
+})(jQuery); \ No newline at end of file
diff --git a/static/js/pichat.js b/static/js/pichat.js
index ce27ebd..2cb577f 100644
--- a/static/js/pichat.js
+++ b/static/js/pichat.js
@@ -7,67 +7,67 @@ var MaxImagePosts = 40
// use e.g. "backgroundColor" not "background-color"
function isCSSPropertySupported(prop){
- return prop in document.body.style;
+ return prop in document.body.style;
}
function escapeHtml(txt) {
- if (!txt) { return ""; }
- else { return $("<span>").text(txt).html(); }
+ if (!txt) { return ""; }
+ else { return $("<span>").text(txt).html(); }
}
function linkify(text) {
- LastMsgContainsImage = false
- var URLRegex = /((\b(http\:\/\/|https\:\/\/|ftp\:\/\/)|(www\.))+(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
- return text.replace(URLRegex, linkReplace);
+ LastMsgContainsImage = false
+ var URLRegex = /((\b(http\:\/\/|https\:\/\/|ftp\:\/\/)|(www\.))+(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
+ return text.replace(URLRegex, linkReplace);
}
// durty hack to use a global to check this... but otherwise i'd have to rewrite the String.replace function? :/
var LastMsgContainsImage = false
-function linkReplace(url){
- var PicRegex = /\.(jpg|jpeg|png|gif|bmp)$/i;
- var urlWithoutParams = url.replace(/\?.*$/i, "");
-
- if (url.indexOf('http://') == 0 || url.indexOf('https://') == 0 || url.indexOf('ftp://') == 0)
- linkUrl = url;
- else
- linkUrl = 'http://' + url;
-
- if (PicRegex.test(urlWithoutParams)){
- LastMsgContainsImage = true
- return "<a target='_blank' href='" + linkUrl + "'><img src='" + linkUrl + "'></a>"
- } else {
- return "<a target='_blank' href='" + linkUrl + "'>" + url + "</a>"
- }
+function linkReplace(url) {
+ var PicRegex = /\.(jpg|jpeg|png|gif|bmp)$/i;
+ var urlWithoutParams = url.replace(/\?.*$/i, "");
+
+ if (url.indexOf('http://') == 0 || url.indexOf('https://') == 0 || url.indexOf('ftp://') == 0)
+ linkUrl = url;
+ else
+ linkUrl = 'http://' + url;
+
+ if (PicRegex.test(urlWithoutParams)){
+ LastMsgContainsImage = true
+ return "<a target='_blank' href='" + linkUrl + "'><img src='" + linkUrl + "'></a>"
+ } else {
+ return "<a target='_blank' href='" + linkUrl + "'>" + url + "</a>"
+ }
}
function linkifyWithoutImage(text) {
- LastMsgContainsImage = false
- var URLRegex = /((\b(http\:\/\/|https\:\/\/|ftp\:\/\/)|(www\.))+(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
- return text.replace(URLRegex, linkReplaceWithoutImage);
+ LastMsgContainsImage = false
+ var URLRegex = /((\b(http\:\/\/|https\:\/\/|ftp\:\/\/)|(www\.))+(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
+ return text.replace(URLRegex, linkReplaceWithoutImage);
}
function linkReplaceWithoutImage(url){
- var PicRegex = /\.(jpg|jpeg|png|gif|bmp)$/i;
- var urlWithoutParams = url.replace(/\?.*$/i, "");
- linkUrl = url.indexOf('http://') == 0 ? url : 'http://' + url;
+ var PicRegex = /\.(jpg|jpeg|png|gif|bmp)$/i;
+ var urlWithoutParams = url.replace(/\?.*$/i, "");
+ linkUrl = url.indexOf('http://') == 0 ? url : 'http://' + url;
- return "<a target='_blank' href='" + linkUrl + "'>" + url + "</a>"
+ return "<a target='_blank' href='" + linkUrl + "'>" + url + "</a>"
}
// Message Handling
var ImageMsgCount = 0
function removeOldMessages(){
- // don't count posts that are all text
- if (LastMsgContainsImage) ImageMsgCount += 1;
- while (ImageMsgCount > MaxImagePosts) {
- var imgMsg = $(".contains-image:first")
- if (imgMsg.length) {
- imgMsg.prevAll().remove() // remove all text messages before the image message
- imgMsg.remove()
- } else break;
- ImageMsgCount -= 1;
- }
+ // don't count posts that are all text
+ if (LastMsgContainsImage) ImageMsgCount += 1;
+ while (ImageMsgCount > MaxImagePosts) {
+ var imgMsg = $(".contains-image:first")
+ if (imgMsg.length) {
+ imgMsg.prevAll().remove() // remove all text messages before the image message
+ imgMsg.remove()
+ } else break;
+ ImageMsgCount -= 1;
+ }
}
function buildMsgContent(content) {
@@ -75,15 +75,15 @@ function buildMsgContent(content) {
}
function buildMessageDiv(msg, isLoading) {
- removeOldMessages()
- var nick = escapeHtml(msg.nick);
- var msgId = !isLoading ? 'id="message-' + msg.msg_id + '"' : '';
- var loadingClass = isLoading ? ' loading' : '';
- var containsImageClass = LastMsgContainsImage ? ' contains-image' : '';
- return '<div class="msgDiv ' + loadingClass + containsImageClass + '" ' + msgId + '>'
- + '<b><a href="/u/' + nick + ' ">' + nick + '</a>: </b>'
- + buildMsgContent(msg.content)
- + '</div>';
+ removeOldMessages()
+ var nick = escapeHtml(msg.nick);
+ var msgId = !isLoading ? 'id="message-' + msg.msg_id + '"' : '';
+ var loadingClass = isLoading ? ' loading' : '';
+ var containsImageClass = LastMsgContainsImage ? ' contains-image' : '';
+ return '<div class="msgDiv ' + loadingClass + containsImageClass + '" ' + msgId + '>'
+ + '<b><a href="/u/' + nick + ' ">' + nick + '</a>: </b>'
+ + buildMsgContent(msg.content)
+ + '</div>';
}
function buildUserDiv(user) {
@@ -95,6 +95,7 @@ function buildUserDiv(user) {
} else {
return '<div class="username">'
+ '<a href="/u/' + escapeHtml(user.nick) + '" target="_blank">'
+ + '<img src="/static/noinfo.png" width="50" height="50">'
+ escapeHtml(user.nick) + '</a></div>';
}
}
@@ -139,8 +140,8 @@ function submitMessage() {
var div = addNewMessage(msg, true);
var onSuccess = function(json) {
- if (typeof pageTracker !== 'undefined') {
- pageTracker._trackEvent('Message', 'Submit', typeof Room !== 'undefined' ? Room : 'UnknownRoom');
+ if (typeof pageTracker !== 'undefined') {
+ pageTracker._trackEvent('Message', 'Submit', typeof Room !== 'undefined' ? Room : 'UnknownRoom');
}
div.attr('id', 'message-' + json)
.removeClass('loading').addClass('loaded');
@@ -207,11 +208,11 @@ function updateUI(msgs, users) {
}
function sortUsersByAlpha(a, b){
- var nickA = a.nick.toLowerCase()
- var nickB = b.nick.toLowerCase()
- if (nickA > nickB) return 1
- else if (nickA < nickB) return -1
- return 0
+ var nickA = a.nick.toLowerCase()
+ var nickB = b.nick.toLowerCase()
+ if (nickA > nickB) return 1
+ else if (nickA < nickB) return -1
+ return 0
}
function isDuplicateMessage(m) {
@@ -312,7 +313,7 @@ function activateProfileEditable() {
var onSubmit = function(attr, newVal, oldVal) {
newVal = $.trim(newVal);
if (newVal == oldVal) { return oldVal };
-
+
$.ajax({
type: "POST",
timeout: 5000,
@@ -433,13 +434,29 @@ function favoriteImage() {};
function setupUpload(elementId, roomKey) {
var onSubmit = function(file, ext) {
if (!(ext && /^(jpg|png|jpeg|gif|bmp)$/i.test(ext))) {
- alert('SORRY, NOT AN IMAGE DUDE... ');
- return false;
+ alert('SORRY, NOT AN IMAGE DUDE... ');
+ return false;
}
};
var onComplete = function(file, response) {
- if (typeof pageTracker !== 'undefined') {
- pageTracker._trackEvent('Message', 'Upload', typeof Room !== 'undefined' ? Room : 'UnknownRoom');
+ if (response.match(/FILE_TOO_BIG/)) {
+ var maxSize = response.split(" ")[1] / 1024;
+ alert("Sorry. Your file is just too fucking big. "
+ + maxSize + "KB or less please.");
+ return;
+ } else if (response.match(/FILE_NOT_IMAGE/)) {
+ alert("What did you upload? Doesn't seem like an image. Sorry.");
+ return;
+ } else if (response.match(/INVALID_RESOLUTION/)) {
+ var maxWidth = response.split(" ")[1];
+ var maxHeight = response.split(" ")[2];
+ alert("Sorry, the maximum image resolution is "
+ + maxWidth + "x" + maxHeight);
+ return;
+ }
+ if (typeof pageTracker !== 'undefined') {
+ var r = typeof Room !== 'undefined' ? Room : 'UnknownRoom';
+ pageTracker._trackEvent('Message', 'Upload', r);
}
}
new AjaxUpload(elementId, {
@@ -447,7 +464,7 @@ function setupUpload(elementId, roomKey) {
autoSubmit: true,
name: 'image',
data: { room: roomKey },
- onSubmit: onSubmit,
+ onSubmit: onSubmit,
onComplete: onComplete
});
}
@@ -479,50 +496,50 @@ function setupUploadAvatar(elementId) {
onComplete: onComplete
});
}
-
+
// scrolling stuff
// this code keeps the div scrolled to the bottom, but will also let the user scroll up, without jumping down
function isScrolledToBottom(){
- var threshold = 15;
-
- var containerHeight = messageList.style.pixelHeight || messageList.offsetHeight
- var currentHeight = (messageList.scrollHeight > 0) ? messageList.scrollHeight : 0
+ var threshold = 15;
+
+ var containerHeight = messageList.style.pixelHeight || messageList.offsetHeight
+ var currentHeight = (messageList.scrollHeight > 0) ? messageList.scrollHeight : 0
- var result = (currentHeight - messageList.scrollTop - containerHeight < threshold);
+ var result = (currentHeight - messageList.scrollTop - containerHeight < threshold);
- return result;
+ return result;
}
function scrollIfPossible(){
- if (lastScriptedScrolledPosition <= messageList.scrollTop || isScrolledToBottom())
- scrollToEnd()
+ if (lastScriptedScrolledPosition <= messageList.scrollTop || isScrolledToBottom())
+ scrollToEnd()
}
var lastScriptedScrolledPosition = 0
function scrollToEnd(){
- messageList.scrollTop = messageList.scrollHeight
- lastScriptedScrolledPosition = messageList.scrollTop
+ messageList.scrollTop = messageList.scrollHeight
+ lastScriptedScrolledPosition = messageList.scrollTop
}
function scrollWatcher(){
- scrollIfPossible()
- setTimeout(scrollWatcher, 500)
+ scrollIfPossible()
+ setTimeout(scrollWatcher, 500)
}
// well fuck webkit for not supporting {text-decoration: blink}
function blinkStart(){
- blinkTimer = setInterval(function(){
- $(".blink").removeClass("blink").addClass("blink-turning-off")
- $(".blink-off").removeClass("blink-off").addClass("blink")
- $(".blink-turning-off").removeClass("blink-turning-off").addClass("blink-off")
- },500);
+ blinkTimer = setInterval(function(){
+ $(".blink").removeClass("blink").addClass("blink-turning-off")
+ $(".blink-off").removeClass("blink-off").addClass("blink")
+ $(".blink-turning-off").removeClass("blink-turning-off").addClass("blink-off")
+ },500);
}
function blinkStop(){
- clearInterval(blinkTimer);
+ clearInterval(blinkTimer);
}
function initDirectory() {
@@ -536,71 +553,72 @@ function initDirectory() {
// TODO: replace this with simple pointer-events thing.
function initBigHand(id){
- var cursorId = "#cursor-big"
- var cursor = $(cursorId)[0]
-
- // jquery's reported element sizes are not exactly the same as the browser's 'mouseover' target sizes
- // so we'll allow a few pixels extra
- var fudgeFactor = 2
+ var cursorId = "#cursor-big"
+ var cursor = $(cursorId)[0]
+
+ // jquery's reported element sizes are not exactly the same as the browser's 'mouseover' target sizes
+ // so we'll allow a few pixels extra
+ var fudgeFactor = 2
- $(id).addClass("no-cursor")
+ $(id).addClass("no-cursor")
- // i have to do this weirdly bc putting the cursor image where the mouse cursor is causes problems with mouse events:
- // * it stops mousemove events on the image below the mouse cursor
- // * it fucks up mouseover/out and even mouseenter/leave events, as well as click
-
- // so i am doing this:
- // on mousing over the image:
- // make cursor visible
- // find image co-ords
- // bind a global mousemove func
- // bind cursor click event
- // unbind mouseover
- // mousemove func:
- // move image to mouse co-ords
- // if mouse co-ords are outside the image co-ords:
- // make cursor invisible
- // unbind mousemove func
- // unbind cursor click event
+ // i have to do this weirdly bc putting the cursor image where the mouse cursor is causes problems with mouse events:
+ // * it stops mousemove events on the image below the mouse cursor
+ // * it fucks up mouseover/out and even mouseenter/leave events, as well as click
+
+ // so i am doing this:
+ // on mousing over the image:
+ // make cursor visible
+ // find image co-ords
+ // bind a global mousemove func
+ // bind cursor click event
+ // unbind mouseover
+ // mousemove func:
+ // move image to mouse co-ords
+ // if mouse co-ords are outside the image co-ords:
+ // make cursor invisible
+ // unbind mousemove func
+ // unbind cursor click event
- var mousemove = function(e){
- var y = e.pageY, x = e.pageX, coords = initBigHand.coords
+ var mousemove = function(e){
+ var y = e.pageY, x = e.pageX, coords = initBigHand.coords
+
+ cursor.style.top = y + "px"
+ cursor.style.left = x - 32 + "px" // 32: (4 pixels * 8 pixels per big pixel) to line up pointy finger with cursor
+ if (y < coords.top ||
+ y > coords.bottom ||
+ x < coords.left ||
+ x > coords.right) {
+ $(cursorId).addClass('invisible')
+ $(cursorId).css({"top": 0, "left": 0 })
+ $(cursorId).unbind('click', cursorClick)
+ $('logo7').unbind('mousemove', mousemove)
+ $(id).mouseover(imageMouseOver)
+ }
+ }
- cursor.style.top = y + "px"
- cursor.style.left = x - 32 + "px" // 32: (4 pixels * 8 pixels per big pixel) to line up pointy finger with cursor
- if (y < coords.top ||
- y > coords.bottom ||
- x < coords.left ||
- x > coords.right) {
- $(cursorId).addClass('invisible')
- $(cursorId).css({"top": 0, "left": 0 })
- $(cursorId).unbind('click', cursorClick)
- $('logo7').unbind('mousemove', mousemove)
- $(id).mouseover(imageMouseOver)
- }
- }
-
- var cursorClick = function(){ $(id).click() }
-
- var imageMouseOver = function(){
- //console.log("moused over...")
- initBigHand.coords = {
- "left": $(id).offset().left - fudgeFactor,
- "top": $(id).offset().top - fudgeFactor,
- "right": $(id).offset().left + $(id).width() + fudgeFactor,
- "bottom": $(id).offset().top + $(id).height() + fudgeFactor
+ var cursorClick = function(){ $(id).click() }
+
+ var imageMouseOver = function(){
+ //console.log("moused over...")
+ initBigHand.coords = {
+ "left": $(id).offset().left - fudgeFactor,
+ "top": $(id).offset().top - fudgeFactor,
+ "right": $(id).offset().left + $(id).width() + fudgeFactor,
+ "bottom": $(id).offset().top + $(id).height() + fudgeFactor
+ }
+ $('body').mousemove(mousemove)
+ $(cursorId).click(cursorClick)
+ $(cursorId).removeClass('invisible')
+ $(id).unbind('mouseover', imageMouseOver)
}
- $('body').mousemove(mousemove)
- $(cursorId).click(cursorClick)
- $(cursorId).removeClass('invisible')
- $(id).unbind('mouseover', imageMouseOver)
- }
-
- $(id).mouseover(imageMouseOver)
-
+
+ $(id).mouseover(imageMouseOver)
+
}
Share = {
+<<<<<<< HEAD
"getMessage": function(button){
var message = $(button).parents(".logged-dump")
var id = message.attr("id").substr(8) // cut "message-001" to "001"
@@ -650,7 +668,9 @@ Tag = {
var rawContent = content.html()
var img = content.find("img").attr("src")
var via = "via " + nick + " on dump.fm"
- return {"nick": nick, "id": id, "link": encodeURIComponent(link), "content": content, "img": encodeURIComponent(img), "via": encodeURIComponent(via)}
+ return {"nick": nick, "id": id, "link": encodeURIComponent(link),
+ "content": content, "img": encodeURIComponent(img),
+ "via": encodeURIComponent(via)}
},
"favorite": function(button){
var message = Share.getMessage(button)