[llvm-commits] [LNT] r161424 - in /lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed: ./ README.md jquery-scrolltofixed-min.js jquery-scrolltofixed.js license.txt

Michael Gottesman mgottesman at apple.com
Tue Aug 7 09:37:33 PDT 2012


Author: mgottesman
Date: Tue Aug  7 11:37:33 2012
New Revision: 161424

URL: http://llvm.org/viewvc/llvm-project?rev=161424&view=rev
Log:
[LNT] Added jquery plugin jquery.scrolltofixed to ui/static/jquery/jquery.scrolltofixed/*
for use with new compiler status overview page.

*NOTE* Code is licensed under the MIT License.

Added:
    lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/
    lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/README.md   (with props)
    lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed-min.js   (with props)
    lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed.js   (with props)
    lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/license.txt   (with props)

Added: lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/README.md
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/README.md?rev=161424&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/README.md (added)
+++ lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/README.md Tue Aug  7 11:37:33 2012
@@ -0,0 +1,127 @@
+ScrollToFixed
+==========================
+
+This plugin is used to fix elements on the page (top, bottom, anywhere); however, it still allows the element to continue to move left or right with the horizontal scroll.
+
+Given an option marginTop, the element will stop moving vertically upward once the vertical scroll has reached the target position; but, the element will still move horizontally as the page is scrolled left or right. Once the page has been scrolled back down past the target position, the element will be restored to its original position on the page.
+
+This plugin has been tested in Firefox 3+, Google Chrome 10+ Safari 5+, Internet Explorer 8/9, and Opera 11.60+.
+
+**IMPORTANT**: The latest version of this plugin reverts the offset adustment code that added the difference between the left offset and position to the left offset.  For anyone that needed it, that code is now turned on by using the **offsets: true** option.
+## Usage ##
+
+Default options:
+
+```javascript
+$(document).ready(function() {
+  $('#mydiv').scrollToFixed();
+});
+```
+
+Margin and Limit options:
+
+```javascript
+$(document).ready(function() {
+  $('#cart').scrollToFixed({ marginTop: 10, limit: $($('h2')[5]).offset().top });
+});
+```
+
+Fixed Header and Fixed Footer with a Limit
+
+```javascript
+// The fixed footer will go unfixed to reveal whatever is below it when scrolled
+// past the limit.
+$(document).ready(function() {
+  $('.header').scrollToFixed();
+  $('.footer').scrollToFixed( { bottom: 0, limit: $('.footer').offset().top } );
+});
+```
+
+Very Full Example
+
+```javascript
+$(document).ready(function() {
+    $('.header').scrollToFixed({
+        preFixed: function() { $(this).find('h1').css('color', 'blue'); },
+        postFixed: function() { $(this).find('h1').css('color', ''); }
+    });
+
+    $('.footer').scrollToFixed( {
+        bottom: 0,
+        limit: $('.footer').offset().top,
+        preFixed: function() { $(this).find('h1').css('color', 'blue'); },
+        postFixed: function() { $(this).find('h1').css('color', ''); }
+    });
+
+    // Order matters because our summary limit is based on the position
+    // of the footer.  On window refresh, the summary needs to recalculate
+    // after the footer.
+    $('#summary').scrollToFixed({
+        marginTop: $('.header').outerHeight() + 10,
+        limit: function() {
+            var limit = $('.footer').offset().top - $('#summary').outerHeight(true) - 10;
+            return limit;
+        },
+        zIndex: 999,
+        preFixed: function() { $(this).find('.title').css('color', 'blue'); },
+        preAbsolute: function() { $(this).find('.title').css('color', 'red'); },
+        postFixed: function() { $(this).find('.title').css('color', ''); },
+        postAbsolute: function() { $(this).find('.title').css('color', ''); }
+    });
+});
+```
+
+```javascript
+// returns whether or not the ScrollToFixed plugin has been applied to the element.
+var b = $.isScrollToFixed('.header');
+```
+
+## Triggers ##
+
+```javascript
+  $('.header').trigger('remove'); // Removes scrollToFixed from the element.
+
+  $('.header').trigger('resize'); // Resizes the spacer in case the fixed element height changes.
+                                  // Good for size changes to the fixed element.
+  
+  $(window).scroll(); // Causes the plugin to recalculate the window scoll.
+                      // Good for layout changes that could change the fixed element's response to
+                      // the scroll.  Example: the fixed element height expands which should cause
+                      // it to invoke its limit.
+
+  $(window).resize(); // Causes the plugin to recalculate the element offsets, then the window scroll.
+                      // Good for layout changes that could cause the fixed element to move.
+                      // Example: the header height increases which should cause the fixed 
+                      // element to fix at a greater vertical scroll position.  
+```
+
+## Options ##
+
+* __marginTop__ - the number of pixels between the top of the window and the fixed element.
+* __limit__ (value|function) - the vertical scroll position at which the element will begin to scroll up the page (absolutely).
+* __bottom__ - (fix to bottom) the number of pixels between the bottom of the window and the bottom of the fixed element.
+* __zIndex__ - the z-index of the fixed element.
+* __spacerClass__ - the class to add to the spacer for styling purposes.
+* __preFixed__ - the function handler triggered just before the element goes fixed.
+* __fixed__ - the function handler triggered just after the element goes fixed.
+* __postFixed__ - the function handler triggered just after the element leaves fixed.
+* __preUnfixed__ - the function handler triggered just before the element goes unfixed.
+* __unfixed__ - the function handler triggered just after the element goes unfixed.
+* __postUnfixed__ - the function handler triggered just after the element leaves unfixed.
+* __preAbsolute__ - the function handler triggered just before the element goes absolute.
+* __postAbsolute__ - the function handler triggered just after the element leaves absolute.
+* __offsets__ - (true|false|not present) some websites have needed an adjustment to the left position of the element due to something in their layout.  This option turns this adjustment on.
+
+## Demos ##
+
+* http://jsfiddle.net/y3qV5/434/ - floating cart summary with a limit.
+* http://jsfiddle.net/k2R3G/81/  - fixed header; allows content to flow under it.
+* http://jsfiddle.net/ZczEt/167/ - very full example: fixed header, footer and floating summary, with events.
+* http://jsfiddle.net/y3qV5/435/ - 2 cart summaries that scroll up and stop at different intervals.
+* http://jsfiddle.net/y3qV5/769/ - Another multi-cart example using floats, with section stops.
+
+## Contributors ##
+
+* [bigspotteddog](https://github.com/bigspotteddog)
+* [megamattron](https://github.com/megamattron)
+* [techpeace](https://github.com/techpeace)
\ No newline at end of file

Propchange: lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/README.md
------------------------------------------------------------------------------
    svn:executable = *

Added: lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed-min.js
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed-min.js?rev=161424&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed-min.js (added)
+++ lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed-min.js Tue Aug  7 11:37:33 2012
@@ -0,0 +1 @@
+(function(a){a.isScrollToFixed=function(b){return a(b).data("ScrollToFixed")!==undefined};a.ScrollToFixed=function(d,g){var j=this;j.$el=a(d);j.el=d;j.$el.data("ScrollToFixed",j);var c=false;var z=j.$el;var A;var x=0;var n=0;var h=-1;var e=-1;var p=null;var u;function q(){i();e=-1;x=z.offset().top;n=z.offset().left;if(j.options.offsets){n+=(z.offset().left-z.position().left)}if(h==-1){h=n}A=z.css("position");c=true;if(j.options.bottom!=-1){z.trigger("preFixed");s();z.trigger("fixed")}}function k(){var B=j.options.limit;if(!B){return 0}if(typeof(B)==="function"){return B()}return B}function m(){return A==="fixed"}function t(){return A==="absolute"}function f(){return !(m()||t())}function s(){if(!m()){p.css({display:z.css("display"),width:z.outerWidth(true),height:z.outerHeight(true),"float":z.css("float")});z.css({width:z.width(),position:"fixed",top:j.options.bottom==-1?o():"",bottom:j.options.bottom==-1?"":j.options.bottom});A="fixed"}}function b(){z.css({width:z.width(),po
 sition:"absolute",top:k(),left:n});A="absolute"}function i(){if(!f()){e=-1;p.css("display","none");z.css({width:"",position:"",left:"",top:""});A=null}}function r(B){if(B!=e){z.css("left",n-B);e=B}}function o(){return j.options.marginTop}function v(){var D=c;if(!c){q()}var B=a(window).scrollLeft();var E=a(window).scrollTop();var C=k();if(j.options.minWidth&&a(window).width()<j.options.minWidth){if(!f()||!D){l();z.trigger("preUnfixed");i();z.trigger("unfixed")}}else{if(j.options.bottom==-1){if(C>0&&E>=C-o()){if(!t()||!D){l();z.trigger("preAbsolute");b();z.trigger("unfixed")}}else{if(E>=x-o()){if(!m()||!D){l();z.trigger("preFixed");s();e=-1;z.trigger("fixed")}r(B)}else{if(!f()||!D){l();z.trigger("preUnfixed");i();z.trigger("unfixed")}}}}else{if(C>0){if(E+a(window).height()-z.outerHeight(true)>=C-o()){if(m()){l();z.trigger("preUnfixed");i();z.trigger("unfixed")}}else{if(!m()){l();z.trigger("preFixed");s()}r(B);z.trigger("fixed")}}else{r(B)}}}}function l(){var B=z.css("position"
 );if(B=="absolute"){z.trigger("postAbsolute")}else{if(B=="fixed"){z.trigger("postFixed")}else{z.trigger("postUnfixed")}}}var w=function(B){c=false;v()};var y=function(B){v()};j.init=function(){j.options=a.extend({},a.ScrollToFixed.defaultOptions,g);if(navigator.platform==="iPad"||navigator.platform==="iPhone"||navigator.platform==="iPod"){if(!navigator.userAgent.match(/OS 5_.*\ like Mac OS X/i)){return}}j.$el.css("z-index",j.options.zIndex);p=a("<div />");A=z.css("position");if(f()){j.$el.after(p)}a(window).bind("resize.ScrollToFixed",w);a(window).bind("scroll.ScrollToFixed",y);if(j.options.preFixed){z.bind("preFixed.ScrollToFixed",j.options.preFixed)}if(j.options.postFixed){z.bind("postFixed.ScrollToFixed",j.options.postFixed)}if(j.options.preUnfixed){z.bind("preUnfixed.ScrollToFixed",j.options.preUnfixed)}if(j.options.postUnfixed){z.bind("postUnfixed.ScrollToFixed",j.options.postUnfixed)}if(j.options.preAbsolute){z.bind("preAbsolute.ScrollToFixed",j.options.preAbsolute)}if
 (j.options.postAbsolute){z.bind("postAbsolute.ScrollToFixed",j.options.postAbsolute)}if(j.options.fixed){z.bind("fixed.ScrollToFixed",j.options.fixed)}if(j.options.unfixed){z.bind("unfixed.ScrollToFixed",j.options.unfixed)}if(j.options.spacerClass){p.addClass(j.options.spacerClass)}z.bind("resize",function(){p.height(z.height())});z.bind("scroll.ScrollToFixed",function(){i();v()});z.bind("remove.ScrollToFixed",function(){z.trigger("preUnfixed");i();z.trigger("unfixed");a(window).unbind("resize",w);a(window).unbind("scroll",y);z.unbind(".ScrollToFixed");j.$el.removeData("ScrollToFixed")});w()};j.init()};a.ScrollToFixed.defaultOptions={marginTop:0,limit:0,bottom:-1,zIndex:1000};a.fn.scrollToFixed=function(b){return this.each(function(){(new a.ScrollToFixed(this,b))})}})(jQuery);
\ No newline at end of file

Propchange: lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed-min.js
------------------------------------------------------------------------------
    svn:executable = *

Added: lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed.js
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed.js?rev=161424&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed.js (added)
+++ lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed.js Tue Aug  7 11:37:33 2012
@@ -0,0 +1,418 @@
+(function($) {
+    $.isScrollToFixed = function(el) {
+        return $(el).data('ScrollToFixed') !== undefined;
+    };
+
+    $.ScrollToFixed = function(el, options) {
+        // To avoid scope issues, use 'base' instead of 'this' to reference this
+        // class from internal events and functions.
+        var base = this;
+
+        // Access to jQuery and DOM versions of element.
+        base.$el = $(el);
+        base.el = el;
+
+        // Add a reverse reference to the DOM object.
+        base.$el.data("ScrollToFixed", base);
+
+        // A flag so we know if the scroll has been reset.
+        var isReset = false;
+
+        // The element that was given to us to fix if scrolled above the top of
+        // the page.
+        var target = base.$el;
+
+        var position;
+
+        // The offset top of the element when resetScroll was called. This is
+        // used to determine if we have scrolled past the top of the element.
+        var offsetTop = 0;
+
+        // The offset left of the element when resetScroll was called. This is
+        // used to move the element left or right relative to the horizontal
+        // scroll.
+        var offsetLeft = 0;
+        var originalOffsetLeft = -1;
+
+        // This last offset used to move the element horizontally. This is used
+        // to determine if we need to move the element because we would not want
+        // to do that for no reason.
+        var lastOffsetLeft = -1;
+
+        // This is the element used to fill the void left by the target element
+        // when it goes fixed; otherwise, everything below it moves up the page.
+        var spacer = null;
+
+        var spacerClass;
+
+        // Capture the original offsets for the target element. This needs to be
+        // called whenever the page size changes or when the page is first
+        // scrolled. For some reason, calling this before the page is first
+        // scrolled causes the element to become fixed too late.
+        function resetScroll() {
+            // Set the element to it original positioning.
+            setUnfixed();
+
+            // Reset the last offset used to determine if the page has moved
+            // horizontally.
+            lastOffsetLeft = -1;
+
+            // Capture the offset top of the target element.
+            offsetTop = target.offset().top;
+
+            // Capture the offset left of the target element.
+            offsetLeft = target.offset().left;
+            
+            // If the offsets option is on, alter the left offset.
+            if (base.options.offsets) {
+                offsetLeft += (target.offset().left - target.position().left);
+            }
+            
+            if (originalOffsetLeft == -1) {
+                originalOffsetLeft = offsetLeft;
+            }
+
+            position = target.css('position');
+
+            // Set that this has been called at least once.
+            isReset = true;
+            
+            if (base.options.bottom != -1) {
+                target.trigger('preFixed');
+                setFixed();
+                target.trigger('fixed');
+            }
+        }
+
+        function getLimit() {
+            var limit = base.options.limit;
+            if (!limit) return 0;
+
+            if (typeof(limit) === 'function') {
+                return limit();
+            }
+            return limit;
+        }
+
+        // Returns whether the target element is fixed or not.
+        function isFixed() {
+            return position === 'fixed';
+        }
+
+        // Returns whether the target element is absolute or not.
+        function isAbsolute() {
+            return position === 'absolute';
+        }
+
+        function isUnfixed() {
+            return !(isFixed() || isAbsolute());
+        }
+
+        // Sets the target element to fixed. Also, sets the spacer to fill the
+        // void left by the target element.
+        function setFixed() {
+            // Only fix the target element and the spacer if we need to.
+            if (!isFixed()) {
+                // Set the spacer to fill the height and width of the target
+                // element, then display it.
+                spacer.css({
+                    'display' : target.css('display'),
+                    'width' : target.outerWidth(true),
+                    'height' : target.outerHeight(true),
+                    'float' : target.css('float')
+                });
+
+                // Set the target element to fixed and set its width so it does
+                // not fill the rest of the page horizontally. Also, set its top
+                // to the margin top specified in the options.
+                target.css({
+                    'width' : target.width(),
+                    'position' : 'fixed',
+                    'top' : base.options.bottom == -1?getMarginTop():'',
+                    'bottom' : base.options.bottom == -1?'':base.options.bottom
+                });
+
+                position = 'fixed';
+            }
+        }
+
+        function setAbsolute() {
+            target.css({
+                'width' : target.width(),
+                'position' : 'absolute',
+                'top' : getLimit(),
+                'left' : offsetLeft
+            });
+
+            position = 'absolute';
+        }
+
+        // Sets the target element back to unfixed. Also, hides the spacer.
+        function setUnfixed() {
+            // Only unfix the target element and the spacer if we need to.
+            if (!isUnfixed()) {
+                lastOffsetLeft = -1;
+
+                // Hide the spacer now that the target element will fill the
+                // space.
+                spacer.css('display', 'none');
+
+                // Remove the style attributes that were added to the target.
+                // This will reverse the target back to the its original style.
+                target.css({
+                    'width' : '',
+                    'position' : '',
+                    'left' : '',
+                    'top' : ''
+                });
+
+                position = null;
+            }
+        }
+
+        // Moves the target element left or right relative to the horizontal
+        // scroll position.
+        function setLeft(x) {
+            // Only if the scroll is not what it was last time we did this.
+            if (x != lastOffsetLeft) {
+                // Move the target element horizontally relative to its original
+                // horizontal position.
+                target.css('left', offsetLeft - x);
+
+                // Hold the last horizontal position set.
+                lastOffsetLeft = x;
+            }
+        }
+
+        function getMarginTop() {
+            return base.options.marginTop;
+        }
+
+        // Checks to see if we need to do something based on new scroll position
+        // of the page.
+        function checkScroll() {
+            var wasReset = isReset;
+
+            // If resetScroll has not yet been called, call it. This only
+            // happens once.
+            if (!isReset) {
+                resetScroll();
+            }
+
+            // Grab the current horizontal scroll position.
+            var x = $(window).scrollLeft();
+
+            // Grab the current vertical scroll position.
+            var y = $(window).scrollTop();
+
+            // Get the limit, if there is one.
+            var limit = getLimit();
+
+            // If the vertical scroll position, plus the optional margin, would
+            // put the target element at the specified limit, set the target
+            // element to absolute.
+            if (base.options.minWidth && $(window).width() < base.options.minWidth) {
+                if (!isUnfixed() || !wasReset) {
+                    postPosition();
+                    target.trigger('preUnfixed');
+                    setUnfixed();
+                    target.trigger("unfixed");
+                }
+            } else if (base.options.bottom == -1) {
+                // If the vertical scroll position, plus the optional margin, would
+                // put the target element at the specified limit, set the target
+                // element to absolute.
+                if (limit > 0 && y >= limit - getMarginTop()) {
+                    if (!isAbsolute() || !wasReset) {
+                        postPosition();
+                        target.trigger('preAbsolute');
+                        setAbsolute();
+                        target.trigger('unfixed');
+                    }
+                // If the vertical scroll position, plus the optional margin, would
+                // put the target element above the top of the page, set the target
+                // element to fixed.
+                } else if (y >= offsetTop - getMarginTop()) {
+                    if (!isFixed() || !wasReset) {
+                        postPosition();
+                        target.trigger('preFixed');
+
+                        // Set the target element to fixed.
+                        setFixed();
+
+                        // Reset the last offset left because we just went fixed.
+                        lastOffsetLeft = -1;
+
+                        target.trigger('fixed');
+                    }
+                    // If the page has been scrolled horizontally as well, move the
+                    // target element accordingly.
+                    setLeft(x);
+                } else {
+                    // Set the target element to unfixed, placing it where it was
+                    // before.
+                    if (!isUnfixed() || !wasReset) {
+                        postPosition();
+                        target.trigger('preUnfixed');
+                        setUnfixed();
+                        target.trigger("unfixed");
+                    }
+                }
+            } else {
+                if (limit > 0) {
+                    if (y + $(window).height() - target.outerHeight(true) >= limit - getMarginTop()) {
+                        if (isFixed()) {
+                            postPosition();
+                            target.trigger('preUnfixed');
+                            setUnfixed();
+                            target.trigger("unfixed");
+                        }
+                    } else {
+                        if (!isFixed()) {
+                            postPosition();
+                            target.trigger('preFixed');
+                            setFixed();
+                        }
+                        setLeft(x);
+                        target.trigger("fixed");
+                    }
+                } else {
+                    setLeft(x);
+                }
+            }
+        }
+
+        function postPosition() {
+            var position = target.css('position');
+            
+            if (position == 'absolute') {
+                target.trigger('postAbsolute');
+            } else if (position == 'fixed') {
+                target.trigger('postFixed');
+            } else {
+                target.trigger('postUnfixed');
+            }
+        }
+
+        var windowResize = function(event) {
+            isReset = false;
+            checkScroll();
+        }
+
+        var windowScroll = function(event) {
+            checkScroll();
+        }
+
+        // Initializes this plugin. Captures the options passed in, turns this
+        // off for iOS, adds the spacer, and binds to the window scroll and
+        // resize events.
+        base.init = function() {
+            // Capture the options for this plugin.
+            base.options = $
+                    .extend({}, $.ScrollToFixed.defaultOptions, options);
+
+            // Turn off this functionality for iOS devices until we figure out
+            // what to do with them, or until iOS5 comes out which is supposed
+            // to support position:fixed.
+            if (navigator.platform === 'iPad' || navigator.platform === 'iPhone' || navigator.platform === "iPod") {
+                if (!navigator.userAgent.match(/OS 5_.*\ like Mac OS X/i)) {
+                    return;
+                }
+            }
+
+            // Put the target element on top of everything that could be below
+            // it. This reduces flicker when the target element is transitioning
+            // to fixed.
+            base.$el.css('z-index', base.options.zIndex);
+
+            // Create a spacer element to fill the void left by the target
+            // element when it goes fixed.
+            spacer = $('<div />');
+
+            position = target.css('position');
+
+            // Place the spacer right after the target element.
+            if (isUnfixed()) base.$el.after(spacer);
+
+            // Reset the target element offsets when the window is resized, then
+            // check to see if we need to fix or unfix the target element.
+            $(window).bind('resize.ScrollToFixed', windowResize);
+
+            // When the window scrolls, check to see if we need to fix or unfix
+            // the target element.
+            $(window).bind('scroll.ScrollToFixed', windowScroll);
+            
+            if (base.options.preFixed) {
+                target.bind('preFixed.ScrollToFixed', base.options.preFixed);
+            }
+            if (base.options.postFixed) {
+                target.bind('postFixed.ScrollToFixed', base.options.postFixed);
+            }
+            if (base.options.preUnfixed) {
+                target.bind('preUnfixed.ScrollToFixed', base.options.preUnfixed);
+            }
+            if (base.options.postUnfixed) {
+                target.bind('postUnfixed.ScrollToFixed', base.options.postUnfixed);
+            }
+            if (base.options.preAbsolute) {
+                target.bind('preAbsolute.ScrollToFixed', base.options.preAbsolute);
+            }
+            if (base.options.postAbsolute) {
+                target.bind('postAbsolute.ScrollToFixed', base.options.postAbsolute);
+            }
+            if (base.options.fixed) {
+                target.bind('fixed.ScrollToFixed', base.options.fixed);
+            }
+            if (base.options.unfixed) {
+                target.bind('unfixed.ScrollToFixed', base.options.unfixed);
+            }
+
+            if (base.options.spacerClass) {
+                spacer.addClass(base.options.spacerClass);
+            }
+
+            target.bind('resize', function() {
+                spacer.height(target.height());
+            });
+
+            target.bind('scroll.ScrollToFixed', function() {
+                setUnfixed();
+                checkScroll();
+            });
+
+            target.bind('remove.ScrollToFixed', function() {
+                target.trigger('preUnfixed');
+                setUnfixed();
+                target.trigger("unfixed");
+
+                $(window).unbind('resize', windowResize);
+                $(window).unbind('scroll', windowScroll);
+
+                target.unbind('.ScrollToFixed');
+                base.$el.removeData("ScrollToFixed");
+            });
+            
+            // Reset everything.
+            windowResize();
+        };
+
+        // Initialize the plugin.
+        base.init();
+    };
+
+    // Sets the option defaults.
+    $.ScrollToFixed.defaultOptions = {
+        marginTop : 0,
+        limit : 0,
+        bottom : -1,
+        zIndex : 1000
+    };
+
+    // Returns enhanced elements that will fix to the top of the page when the
+    // page is scrolled.
+    $.fn.scrollToFixed = function(options) {
+        return this.each(function() {
+            (new $.ScrollToFixed(this, options));
+        });
+    };
+})(jQuery);
\ No newline at end of file

Propchange: lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/jquery-scrolltofixed.js
------------------------------------------------------------------------------
    svn:executable = *

Added: lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/license.txt
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/license.txt?rev=161424&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/license.txt (added)
+++ lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/license.txt Tue Aug  7 11:37:33 2012
@@ -0,0 +1,18 @@
+Copyright (c) 2011 Joseph Cava-Lynch
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file

Propchange: lnt/trunk/lnt/server/ui/static/jquery/jquery.scrolltofixed/license.txt
------------------------------------------------------------------------------
    svn:executable = *





More information about the llvm-commits mailing list