groundworkcss-rails 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. data/lib/groundworkcss/rails/version.rb +1 -1
  2. data/lib/groundworkcss/rails/version.rb~ +1 -1
  3. data/vendor/assets/javascripts/groundworkcss/groundwork.all.js +96 -20
  4. data/vendor/assets/javascripts/groundworkcss/groundwork.js +51 -12
  5. data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.caption2.js +67 -0
  6. data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.carousel.js +265 -0
  7. data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.center.js +63 -0
  8. data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.ie-fade.js +46 -0
  9. data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.scrollVert.js +15 -0
  10. data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.shuffle.js +62 -0
  11. data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.swipe.js +70 -0
  12. data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.tile.js +131 -0
  13. data/vendor/assets/javascripts/groundworkcss/plugins/cycle/jquery.cycle2.video.js +66 -0
  14. data/vendor/assets/javascripts/groundworkcss/plugins/jquery.cycle2.js +1426 -0
  15. data/vendor/assets/stylesheets/groundworkcss-scss/_buttons.scss +4 -3
  16. data/vendor/assets/stylesheets/groundworkcss-scss/_cycle.scss +20 -0
  17. data/vendor/assets/stylesheets/groundworkcss-scss/_modals.scss +2 -1
  18. data/vendor/assets/stylesheets/groundworkcss-scss/_navigation.scss +9 -3
  19. data/vendor/assets/stylesheets/groundworkcss-scss/_tabs.scss +5 -0
  20. data/vendor/assets/stylesheets/groundworkcss-scss/groundwork.scss +2 -2
  21. metadata +25 -14
@@ -0,0 +1,63 @@
1
+ /*! center plugin for Cycle2; version: 20121121 */
2
+ (function($) {
3
+ "use strict";
4
+
5
+ $.extend($.fn.cycle.defaults, {
6
+ centerHorz: false,
7
+ centerVert: false
8
+ });
9
+
10
+ $(document).on( 'cycle-pre-initialize', function( e, opts ) {
11
+ if ( !opts.centerHorz && !opts.centerVert )
12
+ return;
13
+
14
+ // throttle resize event
15
+ var timeout, timeout2;
16
+
17
+ $(window).on( 'resize', resize );
18
+
19
+ opts.container.on( 'cycle-destroyed', destroy );
20
+
21
+ opts.container.on( 'cycle-slide-added', function( e, opts, slideOpts, slide ) {
22
+ adjustSlide.apply(slide);
23
+ });
24
+
25
+ adjustActive();
26
+
27
+ function resize() {
28
+ clearTimeout( timeout );
29
+ timeout = setTimeout( adjustActive, 50 );
30
+ }
31
+
32
+ function destroy( e, opts ) {
33
+ clearTimeout( timeout );
34
+ clearTimeout( timeout2 );
35
+ $( window ).off( 'resize', resize );
36
+ }
37
+
38
+ function adjustAll() {
39
+ opts.slides.each( adjustSlide );
40
+ }
41
+
42
+ function adjustActive() {
43
+ /*jshint validthis: true */
44
+ adjustSlide.apply( opts.container.find( opts.slideActiveClass ) );
45
+ clearTimeout( timeout2 );
46
+ timeout2 = setTimeout( adjustAll, 50 );
47
+ }
48
+
49
+ function adjustSlide() {
50
+ /*jshint validthis: true */
51
+ var slide = $(this);
52
+ var contW = opts.container.width();
53
+ var contH = opts.container.height();
54
+ var w = slide.width();
55
+ var h = slide.height();
56
+ if (opts.centerHorz && w < contW)
57
+ slide.css( 'marginLeft', (contW - w) / 2 );
58
+ if (opts.centerVert && h < contH)
59
+ slide.css( 'marginTop', (contH - h) / 2 );
60
+ }
61
+ });
62
+
63
+ })(jQuery);
@@ -0,0 +1,46 @@
1
+ /*! ie-fade transition plugin for Cycle2; version: 20121120 */
2
+ (function($) {
3
+ "use strict";
4
+
5
+ function cleartype(before, opts, el) {
6
+ if ( before && el.style.filter ) {
7
+ opts._filter = el.style.filter;
8
+ try { el.style.removeAttribute('filter'); }
9
+ catch(smother) {} // handle old opera versions
10
+ }
11
+ else if ( !before && opts._filter ) {
12
+ el.style.filter = opts._filter;
13
+ }
14
+ }
15
+
16
+ $.extend($.fn.cycle.transitions, {
17
+ fade: {
18
+ before: function( opts, curr, next, fwd ) {
19
+ var css = opts.API.getSlideOpts( opts.nextSlide ).slideCss || {};
20
+ opts.API.stackSlides( curr, next, fwd );
21
+ opts.cssBefore = $.extend(css, { opacity: 0, display: 'block' });
22
+ opts.animIn = { opacity: 1 };
23
+ opts.animOut = { opacity: 0 };
24
+ cleartype( true, opts, next );
25
+ },
26
+ after: function( opts, curr, next ) {
27
+ cleartype( false, opts, next );
28
+ }
29
+ },
30
+ fadeout: {
31
+ before: function( opts , curr, next, fwd ) {
32
+ var css = opts.API.getSlideOpts( opts.nextSlide ).slideCss || {};
33
+ opts.API.stackSlides( curr, next, fwd );
34
+ opts.cssBefore = $.extend(css, { opacity: 1, display: 'block' });
35
+ opts.animOut = { opacity: 0 };
36
+ cleartype( true, opts, next );
37
+ },
38
+ after: function( opts, curr, next ) {
39
+ cleartype( false, opts, next );
40
+ }
41
+ }
42
+ });
43
+
44
+ })(jQuery);
45
+
46
+
@@ -0,0 +1,15 @@
1
+ /*! scrollVert transition plugin for Cycle2; version: 20121120 */
2
+ (function($) {
3
+ "use strict";
4
+
5
+ $.fn.cycle.transitions.scrollVert = {
6
+ before: function( opts, curr, next, fwd ) {
7
+ opts.API.stackSlides( opts, curr, next, fwd );
8
+ var height = opts.container.css('overflow','hidden').height();
9
+ opts.cssBefore = { top: fwd ? -height : height, left: 0, opacity: 1, display: 'block' };
10
+ opts.animIn = { top: 0 };
11
+ opts.animOut = { top: fwd ? height : -height };
12
+ }
13
+ };
14
+
15
+ })(jQuery);
@@ -0,0 +1,62 @@
1
+ /*! shuffle transition plugin for Cycle2; version: 20121120 */
2
+ (function($) {
3
+ "use strict";
4
+
5
+ $.fn.cycle.transitions.shuffle = {
6
+
7
+ transition: function( opts, currEl, nextEl, fwd, callback ) {
8
+ $( nextEl ).show();
9
+ var width = opts.container.css( 'overflow', 'visible' ).width();
10
+ var speed = opts.speed / 2; // shuffle has 2 transitions
11
+ var element = fwd ? currEl : nextEl;
12
+
13
+ opts = opts.API.getSlideOpts( fwd ? opts.currSlide : opts.nextSlide );
14
+ var props1 = { left:-width, top:15 };
15
+ var props2 = opts.slideCss || { left:0, top:0 };
16
+
17
+ if ( opts.shuffleLeft !== undefined ) {
18
+ props1.left = props1.left + parseInt(opts.shuffleLeft, 10) || 0;
19
+ }
20
+ else if ( opts.shuffleRight !== undefined ) {
21
+ props1.left = width + parseInt(opts.shuffleRight, 10) || 0;
22
+ }
23
+ if ( opts.shuffleTop ) {
24
+ props1.top = opts.shuffleTop;
25
+ }
26
+
27
+ // transition slide in 3 steps: move, re-zindex, move
28
+ $( element )
29
+ .animate( props1, speed, opts.easeIn || opts.easing )
30
+ .queue( 'fx', $.proxy(reIndex, this))
31
+ .animate( props2, speed, opts.easeOut || opts.easing, callback );
32
+
33
+ function reIndex(nextFn) {
34
+ /*jshint validthis:true */
35
+ this.stack(opts, currEl, nextEl, fwd);
36
+ nextFn();
37
+ }
38
+ },
39
+
40
+ stack: function( opts, currEl, nextEl, fwd ) {
41
+ var i, z;
42
+
43
+ if (fwd) {
44
+ opts.API.stackSlides( nextEl, currEl, fwd );
45
+ // force curr slide to bottom of the stack
46
+ $(currEl).css( 'zIndex', 1 );
47
+ }
48
+ else {
49
+ z = 1;
50
+ for (i = opts.nextSlide - 1; i >= 0; i--) {
51
+ $(opts.slides[i]).css('zIndex', z++);
52
+ }
53
+ for (i = opts.slideCount - 1; i > opts.nextSlide; i--) {
54
+ $(opts.slides[i]).css('zIndex', z++);
55
+ }
56
+ $(nextEl).css( 'zIndex', opts.maxZ );
57
+ $(currEl).css( 'zIndex', opts.maxZ - 1 );
58
+ }
59
+ }
60
+ };
61
+
62
+ })(jQuery);
@@ -0,0 +1,70 @@
1
+ /*! swipe plugin for Cycle2; version: 20121120 */
2
+ (function($) {
3
+ "use strict";
4
+
5
+ // this script adds support for touch events. the logic is lifted from jQuery Mobile.
6
+ // if you have jQuery Mobile installed, you do NOT need this script
7
+
8
+ var supportTouch = 'ontouchend' in document;
9
+
10
+ $.event.special.swipe = $.event.special.swipe || {
11
+ scrollSupressionThreshold: 10, // More than this horizontal displacement, and we will suppress scrolling.
12
+ durationThreshold: 1000, // More time than this, and it isn't a swipe.
13
+ horizontalDistanceThreshold: 30, // Swipe horizontal displacement must be more than this.
14
+ verticalDistanceThreshold: 75, // Swipe vertical displacement must be less than this.
15
+
16
+ setup: function() {
17
+ var $this = $( this );
18
+
19
+ $this.bind( 'touchstart', function( event ) {
20
+ var data = event.originalEvent.touches ? event.originalEvent.touches[ 0 ] : event;
21
+ var stop, start = {
22
+ time: ( new Date() ).getTime(),
23
+ coords: [ data.pageX, data.pageY ],
24
+ origin: $( event.target )
25
+ };
26
+
27
+ function moveHandler( event ) {
28
+ if ( !start )
29
+ return;
30
+
31
+ var data = event.originalEvent.touches ? event.originalEvent.touches[ 0 ] : event;
32
+
33
+ stop = {
34
+ time: ( new Date() ).getTime(),
35
+ coords: [ data.pageX, data.pageY ]
36
+ };
37
+
38
+ // prevent scrolling
39
+ if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
40
+ event.preventDefault();
41
+ }
42
+ }
43
+
44
+ $this.bind( 'touchmove', moveHandler )
45
+ .one( 'touchend', function( event ) {
46
+ $this.unbind( 'touchmove', moveHandler );
47
+
48
+ if ( start && stop ) {
49
+ if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
50
+ Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold &&
51
+ Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) {
52
+
53
+ start.origin.trigger( "swipe" )
54
+ .trigger( start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight" );
55
+ }
56
+ }
57
+ start = stop = undefined;
58
+ });
59
+ });
60
+ }
61
+ };
62
+
63
+ $.event.special.swipeleft = $.event.special.swipeleft || {
64
+ setup: function() {
65
+ $( this ).bind( 'swipe', $.noop );
66
+ }
67
+ };
68
+ $.event.special.swiperight = $.event.special.swiperight || $.event.special.swipeleft;
69
+
70
+ })(jQuery);
@@ -0,0 +1,131 @@
1
+ /*! tile transition plugin for Cycle2; version: 20121120 */
2
+ (function ($) {
3
+ "use strict";
4
+
5
+ $.fn.cycle.transitions.tileSlide =
6
+ $.fn.cycle.transitions.tileBlind = {
7
+
8
+ before: function( opts, curr, next, fwd ) {
9
+ opts.API.stackSlides( curr, next, fwd );
10
+ $(curr).show();
11
+ opts.container.css('overflow', 'hidden');
12
+ // set defaults
13
+ opts.tileDelay = opts.tileDelay || opts.fx == 'tileSlide' ? 100 : 125;
14
+ opts.tileCount = opts.tileCount || 7;
15
+ opts.tileVertical = opts.tileVertical !== false;
16
+
17
+ if (!opts.container.data('cycleTileInitialized')) {
18
+ opts.container.on('cycle-destroyed', $.proxy(this.onDestroy, opts.API));
19
+ opts.container.data('cycleTileInitialized', true);
20
+ }
21
+ },
22
+
23
+ transition: function( opts, curr, next, fwd, callback ) {
24
+ opts.slides.not(curr).not(next).hide();
25
+
26
+ var tiles = $();
27
+ var $curr = $(curr), $next = $(next);
28
+ var tile, tileWidth, tileHeight, lastTileWidth, lastTileHeight,
29
+ num = opts.tileCount,
30
+ vert = opts.tileVertical,
31
+ height = opts.container.height(),
32
+ width = opts.container.width();
33
+
34
+ if ( vert ) {
35
+ tileWidth = Math.floor(width / num);
36
+ lastTileWidth = width - (tileWidth * (num - 1));
37
+ tileHeight = lastTileHeight = height;
38
+ }
39
+ else {
40
+ tileWidth = lastTileWidth = width;
41
+ tileHeight = Math.floor(height / num);
42
+ lastTileHeight = height - (tileHeight * (num - 1));
43
+ }
44
+
45
+ // opts.speed = opts.speed / 2;
46
+ opts.container.find('.cycle-tiles-container').remove();
47
+
48
+ var animCSS;
49
+ var tileCSS = { left: 0, top: 0, overflow: 'hidden', position: 'absolute', margin: 0, padding: 0 };
50
+ if ( vert ) {
51
+ animCSS = opts.fx == 'tileSlide' ? { top: height } : { width: 0 };
52
+ }
53
+ else {
54
+ animCSS = opts.fx == 'tileSlide' ? { left: width } : { height: 0 };
55
+ }
56
+
57
+ var tilesContainer = $('<div class="cycle-tiles-container"></div>');
58
+ tilesContainer.css({
59
+ zIndex: $curr.css('z-index'),
60
+ overflow: 'visible',
61
+ position: 'absolute',
62
+ top: 0
63
+ });
64
+ tilesContainer.insertBefore( next );
65
+
66
+ for (var i = 0; i < num; i++) {
67
+ tile = $('<div></div>')
68
+ .css( tileCSS )
69
+ .css({
70
+ width: ((num - 1 === i) ? lastTileWidth : tileWidth),
71
+ height: ((num - 1 === i) ? lastTileHeight : tileHeight),
72
+ marginLeft: vert ? ((i * tileWidth)) : 0,
73
+ marginTop: vert ? 0 : (i * tileHeight)
74
+ })
75
+ .append($curr.clone().css({
76
+ position: 'relative',
77
+ maxWidth: 'none',
78
+ width: $curr.width(),
79
+ margin: 0, padding: 0,
80
+ marginLeft: vert ? -(i * tileWidth) : 0,
81
+ marginTop: vert ? 0 : -(i * tileHeight)
82
+ }));
83
+ tiles = tiles.add(tile);
84
+ }
85
+
86
+ tilesContainer.append(tiles);
87
+ $curr.hide();
88
+ $next.show().css( 'opacity', 1 );
89
+ animateTile(fwd ? 0 : num - 1);
90
+
91
+ opts._tileAniCallback = function() {
92
+ $next.show();
93
+ $curr.hide();
94
+ tilesContainer.remove();
95
+ callback();
96
+ };
97
+
98
+ function animateTile(i) {
99
+ tiles.eq(i).animate( animCSS, {
100
+ duration: opts.speed,
101
+ easing: opts.easing,
102
+ complete: function () {
103
+ if (fwd ? (num - 1 === i) : (0 === i)) {
104
+ opts._tileAniCallback();
105
+ }
106
+ }
107
+ });
108
+
109
+ setTimeout(function () {
110
+ if (fwd ? (num - 1 !== i) : (0 !== i)) {
111
+ animateTile(fwd ? (i + 1) : (i - 1));
112
+ }
113
+ }, opts.tileDelay);
114
+ }
115
+ },
116
+
117
+ // tx API impl
118
+ stopTransition: function( opts ) {
119
+ opts.container.find('*').stop( true, true );
120
+ if (opts._tileAniCallback)
121
+ opts._tileAniCallback();
122
+ },
123
+
124
+ // core API supplement
125
+ onDestroy: function( e ) {
126
+ var opts = this.opts();
127
+ opts.container.find('.cycle-tiles-container').remove();
128
+ }
129
+ };
130
+
131
+ })(jQuery);
@@ -0,0 +1,66 @@
1
+ /*! youtube plugin for Cycle2; version: 20121120 */
2
+ (function($) {
3
+ "use strict";
4
+
5
+ var template = '<div><object width="640" height="360">' +
6
+ '<param name="movie" value="{{url}}"></param>' +
7
+ '<param name="allowFullScreen" value="{{allowFullScreen}}"></param>' +
8
+ '<param name="allowscriptaccess" value="always"></param>' +
9
+ '<embed src="{{url}}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="{{allowFullScreen}}"></embed>' +
10
+ '</object></div>';
11
+
12
+ $.extend($.fn.cycle.defaults, {
13
+ youtubeAllowFullScreen: true,
14
+ youtubeAutostart: false,
15
+ youtubeAutostop: true
16
+ });
17
+
18
+ $(document).on( 'cycle-bootstrap', function( e, opts ) {
19
+ if ( ! opts.youtube )
20
+ return;
21
+
22
+ // don't hide inactive slides; hiding video causes reload when it's shown again
23
+ opts.hideNonActive = false;
24
+
25
+ opts.container.find( opts.slides ).each(function(i) {
26
+ // convert anchors to template markup
27
+ var markup, slide = $(this), url = slide.attr( 'href' );
28
+ var fs = opts.youtubeAllowFullScreen ? 'true' : 'false';
29
+ url += ( /\?/.test( url ) ? '&' : '?') + 'enablejsapi=1';
30
+ if ( opts.youtubeAutostart && opts.startingSlide === i )
31
+ url += '&autoplay=1';
32
+ markup = opts.API.tmpl( template, { url: url, allowFullScreen: fs });
33
+ slide.replaceWith( markup );
34
+ });
35
+ opts.slides = '>div';
36
+
37
+ if ( opts.youtubeAutostart ) {
38
+ opts.container.on( 'cycle-initialized cycle-after', function( e, opts ) {
39
+ var index = e.type == 'cycle-initialized' ? opts.currSlide : opts.nextSlide;
40
+ $( opts.slides[ index ] ).find('object,embed').each( play );
41
+ });
42
+ }
43
+
44
+ if ( opts.youtubeAutostop ) {
45
+ opts.container.on( 'cycle-before', function( e, opts ) {
46
+ $( opts.slides[ opts.currSlide ] ).find('object,embed').each( pause );
47
+ });
48
+ }
49
+ });
50
+
51
+ function play() {
52
+ /*jshint validthis:true */
53
+ try {
54
+ this.playVideo();
55
+ }
56
+ catch( ignore ) {}
57
+ }
58
+ function pause() {
59
+ /*jshint validthis:true */
60
+ try {
61
+ this.pauseVideo();
62
+ }
63
+ catch( ignore ) {}
64
+ }
65
+
66
+ })(jQuery);