From f969ecf51db7088b820d747cd5b93cd226172cd5 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 22 Sep 2011 12:24:07 +0200 Subject: [PATCH] MERGE Added scrollbarwidth plugin (AIR-17) --- code/LeftAndMain.php | 1 + .../jquery-getscrollbarwidth/.piston.yml | 8 +++++ .../jquery-getscrollbarwidth/README.markdown | 10 ++++++ .../jquery-getscrollbarwidth/example.html | 24 ++++++++++++++ .../jquery.getscrollbarwidth.js | 31 +++++++++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 thirdparty/jquery-getscrollbarwidth/.piston.yml create mode 100644 thirdparty/jquery-getscrollbarwidth/README.markdown create mode 100644 thirdparty/jquery-getscrollbarwidth/example.html create mode 100644 thirdparty/jquery-getscrollbarwidth/jquery.getscrollbarwidth.js diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 3053703d..c0514e20 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -281,6 +281,7 @@ class LeftAndMain extends Controller { THIRDPARTY_DIR . '/scriptaculous/controls.js', THIRDPARTY_DIR . '/greybox/AmiJS.js', THIRDPARTY_DIR . '/greybox/greybox.js', + CMS_DIR . '/thirdparty/jquery-getscrollbarwidth/jquery.getscrollbarwidth.js', CMS_DIR . '/javascript/LeftAndMain.js', CMS_DIR . '/javascript/LeftAndMain_left.js', CMS_DIR . '/javascript/LeftAndMain_right.js', diff --git a/thirdparty/jquery-getscrollbarwidth/.piston.yml b/thirdparty/jquery-getscrollbarwidth/.piston.yml new file mode 100644 index 00000000..e740a57a --- /dev/null +++ b/thirdparty/jquery-getscrollbarwidth/.piston.yml @@ -0,0 +1,8 @@ +--- +format: 1 +handler: + commit: d04ef8794e8459cd65529efa3e623a9f3764d142 + branch: master +lock: false +repository_class: Piston::Git::Repository +repository_url: https://github.com/brandonaaron/jquery-getscrollbarwidth.git diff --git a/thirdparty/jquery-getscrollbarwidth/README.markdown b/thirdparty/jquery-getscrollbarwidth/README.markdown new file mode 100644 index 00000000..46a95702 --- /dev/null +++ b/thirdparty/jquery-getscrollbarwidth/README.markdown @@ -0,0 +1,10 @@ +# Get Scrollbar Width + +A jQuery plugin to retrieve the width of a system scrollbar. + + +## License + +The Get Scrollbar Width plugin is dual licensed *(just like jQuery)* under the [MIT](http://www.opensource.org/licenses/mit-license.php) and [GPL](http://www.opensource.org/licenses/gpl-license.php) licenses. + +Copyright (c) 2008 [Brandon Aaron](http://brandonaaron.net) \ No newline at end of file diff --git a/thirdparty/jquery-getscrollbarwidth/example.html b/thirdparty/jquery-getscrollbarwidth/example.html new file mode 100644 index 00000000..994bfceb --- /dev/null +++ b/thirdparty/jquery-getscrollbarwidth/example.html @@ -0,0 +1,24 @@ + + + + + jQuery getScrollBarWidth example + + + + + + +

jQuery getScrollbarWidth Snippet Example

+

The scrollbar width is

+
+ + \ No newline at end of file diff --git a/thirdparty/jquery-getscrollbarwidth/jquery.getscrollbarwidth.js b/thirdparty/jquery-getscrollbarwidth/jquery.getscrollbarwidth.js new file mode 100644 index 00000000..53a22b02 --- /dev/null +++ b/thirdparty/jquery-getscrollbarwidth/jquery.getscrollbarwidth.js @@ -0,0 +1,31 @@ +/*! Copyright (c) 2008 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. + */ + +/** + * Gets the width of the OS scrollbar + */ +(function($) { + var scrollbarWidth = 0; + $.getScrollbarWidth = function() { + if ( !scrollbarWidth ) { + if ( $.browser.msie ) { + var $textarea1 = $('') + .css({ position: 'absolute', top: -1000, left: -1000 }).appendTo('body'), + $textarea2 = $('') + .css({ position: 'absolute', top: -1000, left: -1000 }).appendTo('body'); + scrollbarWidth = $textarea1.width() - $textarea2.width(); + $textarea1.add($textarea2).remove(); + } else { + var $div = $('
') + .css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: -1000 }) + .prependTo('body').append('
').find('div') + .css({ width: '100%', height: 200 }); + scrollbarWidth = 100 - $div.width(); + $div.parent().remove(); + } + } + return scrollbarWidth; + }; +})(jQuery); \ No newline at end of file