diff options
| author | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-08-22 19:48:17 -0400 |
|---|---|---|
| committer | dumpfmprod <dumpfmprod@ubuntu.(none)> | 2010-08-22 19:48:17 -0400 |
| commit | 0791d4f2c2152c4e88ba6c4527fe354667cacf45 (patch) | |
| tree | f4e196dda47d087179eb79dad333842a31123292 /static/js | |
| parent | 802630b46375f391e8cbe0445d59e032ed64329c (diff) | |
sostler prod commit
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/fullscreen.js | 23 | ||||
| -rw-r--r-- | static/js/pichat.js | 2 | ||||
| -rw-r--r-- | static/js/supersized.js | 108 |
3 files changed, 131 insertions, 2 deletions
diff --git a/static/js/fullscreen.js b/static/js/fullscreen.js index 2cce5a1..cf2d997 100644 --- a/static/js/fullscreen.js +++ b/static/js/fullscreen.js @@ -3,6 +3,20 @@ function initFullscreen(){ refresh() ImageCache = [] SeenImages = {} + $('#tools-button').click(toolsToggle); +} +function toolsToggle(){ + if ($("#msgInputDiv").css("display") == "none") + toolsShow() + else + toolsHide() +} +function toolsShow(){ + $("#msgInputDiv").css("display", "block") + +} +function toolsHide(){ + $("#msgInputDiv").css("display", "none") } function scanMessagesForImages(messages){ @@ -47,4 +61,11 @@ function refresh() { success: onSuccess, error: onError }); -}
\ No newline at end of file +} + + + + + + + diff --git a/static/js/pichat.js b/static/js/pichat.js index aebe14e..4f8b47b 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -224,7 +224,7 @@ function buildMsgContent(content) { // isLoading doesn't get passed the right thing by $.map in addMessages function buildMessageDiv(msg, isLoading) { var nick = escapeHtml(msg.nick); - if (nick == 'frakbuddy' && Nick != 'frakbuddy') return; +// if (nick == 'frakbuddy' && Nick != 'frakbuddy') return; removeOldMessages() var msgId = ('msg_id' in msg) ? 'id="message-' + msg.msg_id + '"' : ''; var loadingClass = isLoading ? ' loading' : ''; diff --git a/static/js/supersized.js b/static/js/supersized.js new file mode 100644 index 0000000..7b0e44d --- /dev/null +++ b/static/js/supersized.js @@ -0,0 +1,108 @@ +/* +Supersized - Full Screen Background/Slideshow jQuery Plugin +supersized.1.0.js +February 2009 +By Sam Dunn +www.buildinternet.com / www.onemightyroar.com +*/ +(function($){ + + //Resize image on ready or resize + $.fn.supersized = function() { + + var options = $.extend($.fn.supersized.defaults, $.fn.supersized.options); + + if (options.slideshow == 1){ + setInterval("theslideshow()", options.slideinterval); + } + + $().ready(function() { + $('#supersize').resizenow(); + }); + $(window).bind("resize", function(){ + $('#supersize').resizenow(); + }); + }; + + //Adjust image size + $.fn.resizenow = function() { + + var options = $.extend($.fn.supersized.defaults, $.fn.supersized.options); + + return this.each(function() { + + //Define image ratio & minimum dimensions + var minwidth = options.minsize*(options.startwidth); + var minheight = options.minsize*(options.startheight); + var ratio = options.startheight/options.startwidth; + + //Gather browser and current image size + var imagewidth = $(this).width(); + var imageheight = $(this).height(); + var browserwidth = $(window).width(); + var browserheight = $(window).height(); + + //Check for minimum dimensions + if ((browserheight < minheight) && (browserwidth < minwidth)){ + $(this).height(minheight); + $(this).width(minwidth); + } + else{ + //When browser is taller + if (browserheight > browserwidth){ + imageheight = browserheight; + $(this).height(browserheight); + imagewidth = browserheight/ratio; + $(this).width(imagewidth); + + if (browserwidth > imagewidth){ + imagewidth = browserwidth; + $(this).width(browserwidth); + imageheight = browserwidth * ratio; + $(this).height(imageheight); + } + + } + + //When browser is wider + if (browserwidth >= browserheight){ + imagewidth = browserwidth; + $(this).width(browserwidth); + imageheight = browserwidth * ratio; + $(this).height(imageheight); + + if (browserheight > imageheight){ + imageheight = browserheight; + $(this).height(browserheight); + imagewidth = browserheight/ratio; + $(this).width(imagewidth); + } + } + } + return false; + }); + }; + + $.fn.supersized.defaults = { + startwidth: 640, + startheight: 480, + minsize: .5, + slideshow: 1, + slideinterval: 5000 + }; + +})(jQuery); + +//Slideshow Add-on +function theslideshow() { + + var currentslide = $('#supersize .activeslide'); + + if ( currentslide.length == 0 ) currentslide = $('#supersize :last'); + + var nextslide = currentslide.next().length ? currentslide.next() : $('#supersize :first'); + + nextslide.addClass('activeslide'); + currentslide.removeClass('activeslide'); + +}
\ No newline at end of file |
