From 7aea9fc04bd42e2ac02a1925d3a02a76d391c3e7 Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Sun, 10 Mar 2013 12:10:26 +0100 Subject: update plugins --- plugins/jetpack/_inc/gallery-settings.js | 19 + .../jetpack/_inc/images/module-icons-sprite-2x.png | Bin 37559 -> 72735 bytes .../jetpack/_inc/images/module-icons-sprite.png | Bin 11465 -> 31542 bytes plugins/jetpack/_inc/images/publicize.png | Bin 0 -> 113219 bytes .../jetpack/_inc/images/screenshots/carousel.png | Bin 0 -> 361672 bytes .../jetpack/_inc/images/screenshots/custom-css.png | Bin 0 -> 43048 bytes plugins/jetpack/_inc/images/screenshots/likes.png | Bin 0 -> 48953 bytes .../screenshots/mobile-push-notifications.jpg | Bin 0 -> 29830 bytes .../_inc/images/screenshots/mobile-theme.png | Bin 0 -> 37559 bytes plugins/jetpack/_inc/images/screenshots/notes.png | Bin 0 -> 27450 bytes .../_inc/images/screenshots/post-by-email.png | Bin 0 -> 28349 bytes .../jetpack/_inc/images/screenshots/publicize.png | Bin 0 -> 113219 bytes .../_inc/images/screenshots/tiled-gallery.png | Bin 0 -> 192182 bytes plugins/jetpack/_inc/jetpack.css | 247 ++++++------ plugins/jetpack/_inc/jetpack.js | 58 ++- plugins/jetpack/_inc/jquery.inview.js | 143 +++++++ plugins/jetpack/_inc/jquery.jetpack-resize.js | 275 +++++++++++++ plugins/jetpack/_inc/jquery.spin.js | 86 ++++ plugins/jetpack/_inc/postmessage.js | 438 +++++++++++++++++++++ plugins/jetpack/_inc/spin.js | 301 ++++++++++++++ 20 files changed, 1397 insertions(+), 170 deletions(-) create mode 100644 plugins/jetpack/_inc/gallery-settings.js create mode 100644 plugins/jetpack/_inc/images/publicize.png create mode 100644 plugins/jetpack/_inc/images/screenshots/carousel.png create mode 100644 plugins/jetpack/_inc/images/screenshots/custom-css.png create mode 100644 plugins/jetpack/_inc/images/screenshots/likes.png create mode 100644 plugins/jetpack/_inc/images/screenshots/mobile-push-notifications.jpg create mode 100644 plugins/jetpack/_inc/images/screenshots/mobile-theme.png create mode 100644 plugins/jetpack/_inc/images/screenshots/notes.png create mode 100644 plugins/jetpack/_inc/images/screenshots/post-by-email.png create mode 100644 plugins/jetpack/_inc/images/screenshots/publicize.png create mode 100644 plugins/jetpack/_inc/images/screenshots/tiled-gallery.png create mode 100644 plugins/jetpack/_inc/jquery.inview.js create mode 100644 plugins/jetpack/_inc/jquery.jetpack-resize.js create mode 100644 plugins/jetpack/_inc/jquery.spin.js create mode 100644 plugins/jetpack/_inc/postmessage.js create mode 100644 plugins/jetpack/_inc/spin.js (limited to 'plugins/jetpack/_inc') diff --git a/plugins/jetpack/_inc/gallery-settings.js b/plugins/jetpack/_inc/gallery-settings.js new file mode 100644 index 00000000..0ce38f0b --- /dev/null +++ b/plugins/jetpack/_inc/gallery-settings.js @@ -0,0 +1,19 @@ +/** + * Jetpack Gallery Settings + */ +(function($) { + var media = wp.media; + + // Wrap the render() function to append controls. + media.view.Settings.Gallery = media.view.Settings.Gallery.extend({ + render: function() { + media.view.Settings.prototype.render.apply( this, arguments ); + + // Append the type template and update the settings. + this.$el.append( media.template( 'jetpack-gallery-settings' ) ); + media.gallery.defaults.type = 'default'; // lil hack that lets media know there's a type attribute. + this.update.apply( this, ['type'] ); + return this; + } + }); +})(jQuery); \ No newline at end of file diff --git a/plugins/jetpack/_inc/images/module-icons-sprite-2x.png b/plugins/jetpack/_inc/images/module-icons-sprite-2x.png index db87b2d5..11f42042 100644 Binary files a/plugins/jetpack/_inc/images/module-icons-sprite-2x.png and b/plugins/jetpack/_inc/images/module-icons-sprite-2x.png differ diff --git a/plugins/jetpack/_inc/images/module-icons-sprite.png b/plugins/jetpack/_inc/images/module-icons-sprite.png index 44de3b9e..c6979f67 100644 Binary files a/plugins/jetpack/_inc/images/module-icons-sprite.png and b/plugins/jetpack/_inc/images/module-icons-sprite.png differ diff --git a/plugins/jetpack/_inc/images/publicize.png b/plugins/jetpack/_inc/images/publicize.png new file mode 100644 index 00000000..428b886c Binary files /dev/null and b/plugins/jetpack/_inc/images/publicize.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/carousel.png b/plugins/jetpack/_inc/images/screenshots/carousel.png new file mode 100644 index 00000000..5bcc94cd Binary files /dev/null and b/plugins/jetpack/_inc/images/screenshots/carousel.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/custom-css.png b/plugins/jetpack/_inc/images/screenshots/custom-css.png new file mode 100644 index 00000000..4be5cb22 Binary files /dev/null and b/plugins/jetpack/_inc/images/screenshots/custom-css.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/likes.png b/plugins/jetpack/_inc/images/screenshots/likes.png new file mode 100644 index 00000000..1c7670a3 Binary files /dev/null and b/plugins/jetpack/_inc/images/screenshots/likes.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/mobile-push-notifications.jpg b/plugins/jetpack/_inc/images/screenshots/mobile-push-notifications.jpg new file mode 100644 index 00000000..94ca6dd6 Binary files /dev/null and b/plugins/jetpack/_inc/images/screenshots/mobile-push-notifications.jpg differ diff --git a/plugins/jetpack/_inc/images/screenshots/mobile-theme.png b/plugins/jetpack/_inc/images/screenshots/mobile-theme.png new file mode 100644 index 00000000..88bad2d6 Binary files /dev/null and b/plugins/jetpack/_inc/images/screenshots/mobile-theme.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/notes.png b/plugins/jetpack/_inc/images/screenshots/notes.png new file mode 100644 index 00000000..4506db17 Binary files /dev/null and b/plugins/jetpack/_inc/images/screenshots/notes.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/post-by-email.png b/plugins/jetpack/_inc/images/screenshots/post-by-email.png new file mode 100644 index 00000000..b114088c Binary files /dev/null and b/plugins/jetpack/_inc/images/screenshots/post-by-email.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/publicize.png b/plugins/jetpack/_inc/images/screenshots/publicize.png new file mode 100644 index 00000000..428b886c Binary files /dev/null and b/plugins/jetpack/_inc/images/screenshots/publicize.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/tiled-gallery.png b/plugins/jetpack/_inc/images/screenshots/tiled-gallery.png new file mode 100644 index 00000000..8168590d Binary files /dev/null and b/plugins/jetpack/_inc/images/screenshots/tiled-gallery.png differ diff --git a/plugins/jetpack/_inc/jetpack.css b/plugins/jetpack/_inc/jetpack.css index 0b6c340e..b684f7c7 100644 --- a/plugins/jetpack/_inc/jetpack.css +++ b/plugins/jetpack/_inc/jetpack.css @@ -21,20 +21,27 @@ height: 70px; } - #jp-header #jp-clouds #jp-disconnect { + + #jp-header #jp-clouds #jp-disconnectors { font-size: 12px; color: #fff; float: right; - margin: -35px 25px 0 0; - text-align: right; + margin-top: -35px; + text-align: left; + position: relative; + left: -45px; } - #jp-header #jp-clouds #jp-disconnect a { + #jp-header #jp-clouds .jp-disconnect a { background: #8caa46 url( images/status-light.png ) 3px 85% no-repeat; display: inline-block; - padding: 4px 10px 3px 30px; + position: relative; + width: 100%; + height: 1.7em; + overflow: hidden; + padding: 4px 0 3px 30px; + margin: 0 -20px 3px 0; color: #fff; - text-align: center; text-decoration: none; border: 1px solid #7a943d; -moz-border-radius: 5px; @@ -45,14 +52,23 @@ box-shadow: inset 0 0 2px rgba( 255, 255, 255, 0.4 ); text-shadow: 0px -1px 0px rgba( 0,0,0,0.3 ); } - #jp-header #jp-clouds #jp-disconnect a:hover { - background: #8caa46 url( images/status-light.png ) 3px 5% no-repeat; + #jp-header #jp-clouds .jp-disconnect a:hover { + background: #8caa46 url( images/status-light.png ) 3px -2% no-repeat; background-color: #839f40; border-color: #6a8037; } - #jp-header #jp-clouds #jp-disconnect span { display: none; } - + #jp-header #jp-clouds .jp-disconnect div { + position: relative; + line-height: 1.7em; + height: 1.7em; + } + + #jp-header #jp-clouds .jp-disconnect a:hover div, + #jp-header #jp-clouds .jp-disconnect a.clicked div { + top: -1.7em; + } + /* Retina Header Clouds & Status Light */ @media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { #jp-header #jp-clouds { @@ -63,18 +79,18 @@ background: transparent url( images/header-clouds-small-2x.png ) -120px 100% repeat-x; background-size:980px 140px; } - - #jp-header #jp-clouds #jp-disconnect a { + + #jp-header #jp-clouds .jp-disconnect a { background: #8caa46 url( images/status-light-2x.png ) 3px 85% no-repeat; background-size:25px 57px; } - #jp-header #jp-clouds #jp-disconnect a:hover { - background: #8caa46 url( images/status-light-2x.png ) 3px 5% no-repeat; + #jp-header #jp-clouds .jp-disconnect a:hover { + background: #8caa46 url( images/status-light-2x.png ) 3px -2% no-repeat; background-size:25px 57px; } } - - + + #jp-header h3 { position: relative; background: transparent url( images/logo.png ) top left no-repeat; @@ -93,7 +109,7 @@ height: 120px; top: -35px; } - + /* Retina Logo */ @media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { #jp-header h3 { @@ -105,9 +121,9 @@ background-size:150px 120px; } } - - - + + + #jp-header p { position: absolute; left: 390px; @@ -237,11 +253,11 @@ color: #fff; text-decoration: underline; } - + .jetpack-message .squeezer a:hover { color: #f0a000; } - + .jetpack-message code, .jetpack-err p { background: rgba( 0,0,0,0.2 ); font-size: 14px; @@ -309,7 +325,7 @@ -moz-box-shadow: inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 ); box-shadow: inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 ); } - + /* Retina moreinfo bg clouds */ @media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { .more-info { @@ -317,8 +333,8 @@ background-size:980px 140px; } } - - + + .more-info h4 { padding: 0; background: none; @@ -340,7 +356,7 @@ left: 0; background: url( images/arrow.png ) top left no-repeat; } - + /* Retina module more info arrow */ @media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { .more-info .arrow { @@ -534,13 +550,13 @@ p.jp-help { border-bottom-left-radius: 3px; background-repeat: no-repeat; background-image: url( images/module-icons-sprite.png ); + background-size: 2555px 50px; /* remember to update this every time a new module is added! */ } @media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { .jetpack-module div.module-image { background-image: url( images/module-icons-sprite-2x.png ); - background-size: 1450px 50px; } } @@ -586,6 +602,40 @@ p.jp-help { #carousel.jetpack-module div.module-image { background-position: -1325px 5px; } + #custom-css.jetpack-module div.module-image { + background-position: -1459px 5px; + } + #minileven.jetpack-module div.module-image { + background-position: -1570px 5px; + } + #notes.jetpack-module div.module-image { + background-position: -1806px 5px; + } + #json-api.jetpack-module div.module-image { + background-position: -1689px 5px; + } + #mobile-push.jetpack-module div.module-image { + background-position: -1925px 5px; + } + #publicize.jetpack-module div.module-image { + background-position: -2136px 5px; + } + #post-by-email.jetpack-module div.module-image { + background-position: -2025px 5px; + } + #infinite-scroll.jetpack-module div.module-image { + background-position: -2230px 5px; + } + #photon.jetpack-module div.module-image { + background-position: -2320px 5px; + } + #tiled-gallery.jetpack-module div.module-image { + background-position: -2400px 5px; + } + + #likes.jetpack-module div.module-image { + background-position: -2471px 5px; + } .jetpack-module div.module-image p { background-color: #b4d278; @@ -725,7 +775,7 @@ p.jp-help { margin-right: 15px; box-shadow: none; } - + @media only screen and (-moz-min-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 3/2), only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) { .placeholder h3 { background: transparent url(images/icon-comingsoon-2x.png) top center no-repeat; @@ -822,34 +872,10 @@ p#news-sub { margin-top: 15px; } -#jetpack-settings .button, #jetpack-settings .button-primary { - -moz-border-radius: 5px !important; - -webkit-border-radius: 5px !important; - border-radius: 5px !important; - padding: 5px 10px !important; - -moz-box-shadow: inset 0 0 2px #fff, 0 0 3px rgba(0,0,0,0.1); - -webkit-box-shadow: inset 0 0 2px #fff, 0 0 3px rgba(0,0,0,0.1); - box-shadow: inset 0 0 2px #fff, 0 0 3px rgba(0,0,0,0.1); -} - #jetpack-settings .button-primary { - color: #bceaff !important; -} - -#jetpack-settings .button-primary:hover { color: #fff !important; } -#jetpack-settings .button:hover { - color: #298cba !important; - border-color: #69acce !important; - -moz-box-shadow: 0 0 2px rgba(105,172,206,1); - -webkit-box-shadow: 0 0 2px rgba(105,172,206,1); - box-shadow: 0 0 2px rgba(105,172,206,1); - -webkit-transition-duration: .3s; - -moz-transition-duration: .3s; -} - .jp-survey { position: relative; z-index: 100; @@ -889,91 +915,6 @@ p#news-sub { display: block; } -.jp-survey a { - color: #000; - text-decoration: underline; - -webkit-transition-duration: .3s; - -moz-transition-duration: .3s; - -o-transition-duration: .3s; - -ms-transition-duration: .3s; - transition-duration: .3s; -} - -.jp-survey a:hover { - color: #555; - text-decoration: none; -} - -#jetpack-settings .jp-survey p a.button-primary { - font-size: 16px !important; - display: inline-block; - padding: 8px 15px; - color: #fff!important; - text-align: center; - font-size: 20px; - text-decoration: none; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - border: 1px solid #2A8CBA; - background: #6AAFCF; - -moz-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); - -webkit-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); - box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); - text-shadow: 0px -1px 0px rgba( 0,0,0,0.3); - -webkit-transition-duration: .3s; - -moz-transition-duration: .3s; - -o-transition-duration: .3s; - -ms-transition-duration: .3s; - transition-duration: .3s; - cursor: pointer; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; -} - -#jetpack-settings .jp-survey p a.button-primary:hover, #jetpack-settings .jp-survey p a.button-primary:active { - background-color: #f0a000; - border-color: #c87800; - -webkit-transition-duration: .3s; - outline: none; -} - -.jp-survey p a.button-secondary { - font-size: 16px !important; - display: inline-block; - padding: 8px 15px; - color: #fff; - text-align: center; - font-size: 20px; - text-decoration: none; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - border: 1px solid #8caa46; - background: #b4d278; - -moz-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); - -webkit-box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); - box-shadow: inset 0 0 2px rgba( 255,255,255,1), 0 1px 1px rgba( 0,0,0,0.1 ); - text-shadow: 0px -1px 0px rgba( 0,0,0,0.3); - -webkit-transition-duration: .3s; - -moz-transition-duration: .3s; - -o-transition-duration: .3s; - -ms-transition-duration: .3s; - transition-duration: .3s; - cursor: pointer; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; -} - -.jp-survey p a.button-secondary:hover, .jp-survey p a.button-secondary:active { - background-color: #f0a000; - border-color: #c87800; - -webkit-transition-duration: .3s; - -moz-transition-duration: .3s; - -o-transition-duration: .3s; - -ms-transition-duration: .3s; - transition-duration: .3s; - outline: none; -} - .jp-survey-container { overflow: hidden; padding: 0 20px 8px 0; @@ -1095,3 +1036,35 @@ p#news-sub { box-shadow: inset 0 0 2px #fff, 0 1px 7spx rgba(240,160,0,0.5); } +.jetpack-inline-error, .jetpack-inline-message { + padding: .5em 1em .5em 1em; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + border-width: 1px; + border-style: solid; + color: #333; +} + +.jetpack-inline-error { + background-color: #ffebe8; + border-color: #c00; +} + +.jetpack-inline-message { + background-color: #ffffe0; + border-color: #e6db55; +} + +.jetpack-targetable { + border-top: 28px solid transparent; + margin-top: -28px; +} + +.jetpack-targetable:target { + background-color: #ffffe0; + background-clip: padding-box; + padding: 0 10px; + margin-left: -10px; + margin-right: -10px; +} diff --git a/plugins/jetpack/_inc/jetpack.js b/plugins/jetpack/_inc/jetpack.js index 69a86c13..6ef9de8d 100644 --- a/plugins/jetpack/_inc/jetpack.js +++ b/plugins/jetpack/_inc/jetpack.js @@ -57,36 +57,23 @@ jetpack = { }); var widerWidth = 0; - jQuery( '#jp-disconnect' ).hover( function() { - var t = jQuery( this ), - a = t.find( 'a' ), - width = t.width(), - changeWidth = widerWidth == 0; - - if ( changeWidth && widerWidth < width ) { - widerWidth = width; - } - jetpack.statusText = a.html(); - a.html( jQuery( '#jp-disconnect span' ).html() ); - width = t.width(); - if ( changeWidth && widerWidth < width ) { - widerWidth = width + 15; - } - if ( changeWidth ) { - t.width( widerWidth ); - } - a.hide().fadeIn(100); - }, function() { - var a = jQuery( 'a', this ); - a.html( jetpack.statusText ); - a.hide().fadeIn(100); - jetpack.statusText = null; - } ).find( 'a' ).click( function() { + jQuery( '#jp-disconnect a' ).click( function() { if ( confirm( jetpackL10n.ays_disconnect ) ) { - jQuery( '#jp-disconnect' ).unbind( 'mouseenter mouseleave' ); + jQuery( this ).addClass( 'clicked' ).css( { + "background-image": 'url( ' + userSettings.url + 'wp-admin/images/wpspin_light.gif )', + "background-position": '9px 5px', + "background-size": '16px 16px' + } ).unbind( 'click' ).click( function() { return false; } ); + } else { + return false; + } + } ); + jQuery( '#jp-unlink a' ).click( function() { + if ( confirm( jetpackL10n.ays_unlink ) ) { jQuery( this ).css( { - "background-image": 'url( ' + userSettings.url + 'wp-admin/images/wpspin_dark.gif )', + "background-image": 'url( ' + userSettings.url + 'wp-admin/images/wpspin_light.gif )', "background-position": '9px 5px', + "background-size": '16px 16px' } ).unbind( 'click' ).click( function() { return false; } ); } else { return false; @@ -108,7 +95,7 @@ jetpack = { jQuery( 'div.placeholder' ).show(); var containerWidth = jetpack.container.width(), - needed = 4 * parseInt( containerWidth / 242, 10 ) - jetpack.numModules + needed = 5 * parseInt( containerWidth / 242, 10 ) - jetpack.numModules if ( jetpack.numModules * 242 > containerWidth ) jQuery( 'div.placeholder' ).slice( needed ).hide(); @@ -155,12 +142,15 @@ jetpack = { jQuery( window ).scrollTo( ( jQuery( 'div.more-info' ).prev().offset().top ) - 70, 600, function() { if ( typeof callback == 'function' ) callback.call( this ); } ); } else { jQuery( 'div.more-info div.jp-content' ).hide(); - jQuery( 'div.more-info' ).slideUp( 200, function() { - jQuery(this).detach().insertAfter( el ); + jQuery( 'div.more-info' ).css( { height: '230px', minHeight: 0 } ).slideUp( 200, function() { + var $this = jQuery(this); + $this.detach().insertAfter( el ); jQuery( 'div.more-info div.jp-content' ).hide(); jetpack.learn_more_content( jQuery(card).attr( 'id' ) ); - jQuery( 'div.more-info' ).slideDown( 300 ); - jQuery( window ).scrollTo( ( jQuery( 'div.more-info' ).prev().offset().top ) - 70, 600, function() { if ( typeof callback == 'function' ) callback.call( this ); } ); + $this.css( { height: '230px', minHeight: 0 } ).slideDown( 300, function() { + $this.css( { height: 'auto', minHeight: '230px' } ); + } ); + jQuery( window ).scrollTo( ( $this.prev().offset().top ) - 70, 600, function() { if ( typeof callback == 'function' ) callback.call( this ); } ); } ); } @@ -170,7 +160,9 @@ jetpack = { jQuery( el ).after( '
' ); // Show the box + jQuery( 'div.more-info' ).css( { height: '230px', minHeight: 0 } ); jQuery( 'div.more-info', 'div.module-container' ).hide().slideDown( 400, function() { + jQuery( 'div.more-info' ).css( { height: 'auto', minHeight: '230px' } ); // Load the content and scroll to it jetpack.learn_more_content( jQuery(card).attr( 'id' ) ); jQuery( window ).scrollTo( ( jQuery( 'div.more-info' ).prev().offset().top ) - 70, 600 ); @@ -226,7 +218,7 @@ jetpack = { close_learn_more: function( callback ) { jQuery( 'div.more-info div.jp-content' ).hide(); - jQuery( 'div.more-info' ).slideUp( 200, function() { + jQuery( 'div.more-info' ).css( { height: '230px', minHeight: 0 } ).slideUp( 200, function() { jQuery( this ).remove(); jQuery( 'a.jetpack-deactivate-button' ).hide(); jetpack.linkClicked.parents( 'div.jetpack-module' ).children( '.jetpack-module-actions' ).children( 'a.jetpack-configure-button' ).show(); diff --git a/plugins/jetpack/_inc/jquery.inview.js b/plugins/jetpack/_inc/jquery.inview.js new file mode 100644 index 00000000..45f71c4c --- /dev/null +++ b/plugins/jetpack/_inc/jquery.inview.js @@ -0,0 +1,143 @@ +/** + * author Christopher Blum + * - based on the idea of Remy Sharp, http://remysharp.com/2009/01/26/element-in-view-event-plugin/ + * - forked from http://github.com/zuk/jquery.inview/ + */ +(function ($) { + var inviewObjects = {}, viewportSize, viewportOffset, + d = document, w = window, documentElement = d.documentElement, expando = $.expando; + + $.event.special.inview = { + add: function(data) { + inviewObjects[data.guid + "-" + this[expando]] = { data: data, $element: $(this) }; + }, + + remove: function(data) { + try { delete inviewObjects[data.guid + "-" + this[expando]]; } catch(e) {} + } + }; + + function getViewportSize() { + var mode, domObject, size = { height: w.innerHeight, width: w.innerWidth }; + + // if this is correct then return it. iPad has compat Mode, so will + // go into check clientHeight/clientWidth (which has the wrong value). + if (!size.height) { + mode = d.compatMode; + if (mode || !$.support.boxModel) { // IE, Gecko + domObject = mode === 'CSS1Compat' ? + documentElement : // Standards + d.body; // Quirks + size = { + height: domObject.clientHeight, + width: domObject.clientWidth + }; + } + } + + return size; + } + + function getViewportOffset() { + return { + top: w.pageYOffset || documentElement.scrollTop || d.body.scrollTop, + left: w.pageXOffset || documentElement.scrollLeft || d.body.scrollLeft + }; + } + + function checkInView() { + var $elements = $(), elementsLength, i = 0; + + $.each(inviewObjects, function(i, inviewObject) { + var selector = inviewObject.data.selector, + $element = inviewObject.$element; + $elements = $elements.add(selector ? $element.find(selector) : $element); + }); + + elementsLength = $elements.length; + if (elementsLength) { + viewportSize = viewportSize || getViewportSize(); + viewportOffset = viewportOffset || getViewportOffset(); + + for (; i= 0 && element.offsetHeight >= 0 && element.style.display != "none" && + elementOffset.top + elementSize.height > viewportOffset.top && + elementOffset.top < viewportOffset.top + viewportSize.height && + elementOffset.left + elementSize.width > viewportOffset.left && + elementOffset.left < viewportOffset.left + viewportSize.width) { + visiblePartX = (viewportOffset.left > elementOffset.left ? + 'right' : (viewportOffset.left + viewportSize.width) < (elementOffset.left + elementSize.width) ? + 'left' : 'both'); + visiblePartY = (viewportOffset.top > elementOffset.top ? + 'bottom' : (viewportOffset.top + viewportSize.height) < (elementOffset.top + elementSize.height) ? + 'top' : 'both'); + visiblePartsMerged = visiblePartX + "-" + visiblePartY; + if (!inView || inView !== visiblePartsMerged) { + $element.data('inview', visiblePartsMerged).trigger('inview', [true, visiblePartX, visiblePartY]); + } + } else if (inView) { + $element.data('inview', false).trigger('inview', [false]); + } + } + } + } + + $(w).bind("scroll resize", function() { + viewportSize = viewportOffset = null; + }); + + // IE < 9 scrolls to focused elements without firing the "scroll" event + if (!documentElement.addEventListener && documentElement.attachEvent) { + documentElement.attachEvent("onfocusin", function() { + viewportOffset = null; + }); + } + + // Use setInterval in order to also make sure this captures elements within + // "overflow:scroll" elements or elements that appeared in the dom tree due to + // dom manipulation and reflow + // old: $(window).scroll(checkInView); + // + // By the way, iOS (iPad, iPhone, ...) seems to not execute, or at least delays + // intervals while the user scrolls. Therefore the inview event might fire a bit late there + setInterval(checkInView, 250); +})(jQuery); \ No newline at end of file diff --git a/plugins/jetpack/_inc/jquery.jetpack-resize.js b/plugins/jetpack/_inc/jquery.jetpack-resize.js new file mode 100644 index 00000000..e1adb22d --- /dev/null +++ b/plugins/jetpack/_inc/jquery.jetpack-resize.js @@ -0,0 +1,275 @@ +/** + * Resizeable Iframes. + * + * Start listening to resize postMessage events for selected iframes: + * $( selector ).Jetpack( 'resizeable' ); + * - OR - + * Jetpack.resizeable( 'on', context ); + * + * Resize selected iframes: + * $( selector ).Jetpack( 'resizeable', 'resize', { width: 100, height: 200 } ); + * - OR - + * Jetpack.resizeable( 'resize', { width: 100, height: 200 }, context ); + * + * Stop listening to resize postMessage events for selected iframes: + * $( selector ).Jetpack( 'resizeable', 'off' ); + * - OR - + * Jetpack.resizeable( 'off', context ); + * + * Stop listening to all resize postMessage events: + * Jetpack.resizeable( 'off' ); + */ +(function($) { + var listening = false, // Are we listening for resize postMessage events + sourceOrigins = [], // What origins are allowed to send resize postMessage events + $sources = false, // What iframe elements are we tracking resize postMessage events from + + URLtoOrigin, // Utility to convert URLs into origins + setupListener, // Binds global resize postMessage event handler + destroyListener, // Unbinds global resize postMessage event handler + + methods; // Jetpack.resizeable methods + + // Setup the Jetpack global + if ( 'undefined' === typeof window.Jetpack ) { + window.Jetpack = { + /** + * Handles the two different calling methods: + * $( selector ).Jetpack( 'namespace', 'method', context ) // here, context is optional and is used to filter the collection + * - vs. - + * Jetpack.namespace( 'method', context ) // here context defines the collection + * + * @internal + * + * Call as: Jetpack.getTarget.call( this, context ) + * + * @param string context: jQuery selector + * @return jQuery|undefined object on which to perform operations or undefined when context cannot be determined + */ + getTarget: function( context ) { + if ( this instanceof jQuery ) { + return context ? this.filter( context ) : this; + } + + return context ? $( context ) : context; + } + }; + } + + // Setup the Jetpack jQuery method + if ( 'undefined' === typeof $.fn.Jetpack ) { + /** + * Dispatches calls to the correct namespace + * + * @param string namespace + * @param ... + * @return mixed|jQuery (chainable) + */ + $.fn.Jetpack = function( namespace ) { + if ( 'function' === typeof Jetpack[namespace] ) { + // Send the call to the correct Jetpack.namespace + return Jetpack[namespace].apply( this, Array.prototype.slice.call( arguments, 1 ) ); + } else { + $.error( 'Namespace "' + namespace + '" does not exist on jQuery.Jetpack' ); + } + }; + } + + // Define Jetpack.resizeable() namespace to just always bail if no postMessage + if ( 'function' !== typeof window.postMessage ) { + $.extend( window.Jetpack, { + /** + * Defines the Jetpack.resizeable() namespace. + * See below for non-trivial definition for browsers with postMessage. + */ + resizeable: function() { + $.error( 'Browser does not support window.postMessage' ); + } + } ); + + return; + } + + /** + * Utility to convert URLs into origins + * + * http://example.com:port/path?query#fragment -> http://example.com:port + * + * @param string URL + * @return string origin + */ + URLtoOrigin = function( URL ) { + if ( ! URL.match( /^https?:\/\// ) ) { + URL = document.location.href; + } + return URL.split( '/' ).slice( 0, 3 ).join( '/' ); + }; + + /** + * Binds global resize postMessage event handler + */ + setupListener = function() { + listening = true; + + $( window ).on( 'message.JetpackResizeableIframe', function( e ) { + var event = e.originalEvent, + data; + + // Ensure origin is allowed + if ( -1 === $.inArray( event.origin, sourceOrigins ) ) { + return; + } + + // Some browsers send structured data, some send JSON strings + if ( 'object' === typeof event.data ) { + data = event.data; + } else { + try { + data = JSON.parse( event.data ); + } catch ( err ) { + data = false; + } + } + + if ( !data ) { + return; + } + + // Is it a resize event? + if ( 'undefined' === typeof data.action || 'resize' !== data.action ) { + return; + } + + // Find the correct iframe and resize it + $sources.filter( function() { + if ( 'undefined' !== typeof data.name ) + return this.name === data.name; + else + return event.source === this.contentWindow; + } ).first().Jetpack( 'resizeable', 'resize', data ); + } ); + }; + + /** + * Unbinds global resize postMessage event handler + */ + destroyListener = function() { + listening = false; + $( window ).off( 'message.JetpackResizeableIframe' ); + + sourceOrigins = []; + $( '.jetpack-resizeable' ).removeClass( 'jetpack-resizeable' ); + $sources = false; + }; + + // Methods for Jetpack.resizeable() namespace + methods = { + /** + * Start listening for resize postMessage events on the given iframes + * + * Call statically as: Jetpack.resizeable( 'on', context ) + * Call as: $( selector ).Jetpack( 'resizeable', 'on', context ) // context optional: used to filter the collectino + * + * @param string context jQuery selector. + * @return jQuery (chainable) + */ + on: function( context ) { + var target = Jetpack.getTarget.call( this, context ); + + if ( ! listening ) { + setupListener(); + } + + target.each( function() { + sourceOrigins.push( URLtoOrigin( $( this ).attr( 'src' ) ) ); + } ).addClass( 'jetpack-resizeable' ); + + $sources = $( '.jetpack-resizeable' ); + + return target; + }, + + /** + * Stop listening for resize postMessage events on the given iframes + * + * Call statically as: Jetpack.resizeable( 'off', context ) + * Call as: $( selector ).Jetpack( 'resizeable', 'off', context ) // context optional: used to filter the collectino + * + * @param string context jQuery selector + * @return jQuery (chainable) + */ + off: function( context ) { + var target = Jetpack.getTarget.call( this, context ); + + if ( 'undefined' === typeof target ) { + destroyListener(); + + return target; + } + + target.each( function() { + var origin = URLtoOrigin( $( this ).attr( 'src' ) ), + pos = $.inArray( origin, sourceOrigins ); + + if ( -1 !== pos ) { + sourceOrigins.splice( pos, 1 ); + } + } ).removeClass( 'jetpack-resizeable' ); + + $sources = $( '.jetpack-resizeable' ); + + return target; + }, + + /** + * Resize the given iframes + * + * Call statically as: Jetpack.resizeable( 'resize', dimensions, context ) + * Call as: $( selector ).Jetpack( 'resizeable', 'resize', dimensions, context ) // context optional: used to filter the collectino + * + * @param object dimensions in pixels: { width: (int), height: (int) } + * @param string context jQuery selector + * @return jQuery (chainable) + */ + resize: function( dimensions, context ) { + var target = Jetpack.getTarget.call( this, context ); + + $.each( [ 'width', 'height' ], function( i, variable ) { + var value = 0; + if ( 'undefined' !== typeof dimensions[variable] ) { + value = parseInt( dimensions[variable], 10 ); + } + + if ( 0 !== value ) { + target[variable]( value ); + } + } ); + + return target; + } + }; + + // Define Jetpack.resizeable() namespace + $.extend( window.Jetpack, { + /** + * Defines the Jetpack.resizeable() namespace. + * See above for trivial definition for browsers with no postMessage. + * + * @param string method + * @param ... + * @return mixed|jQuery (chainable) + */ + resizeable: function( method ) { + if ( methods[method] ) { + // Send the call to the correct Jetpack.resizeable() method + return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ) ); + } else if ( ! method ) { + // By default, send to Jetpack.resizeable( 'on' ), which isn't useful in that form but is when called as + // jQuery( selector ).Jetpack( 'resizeable' ) + return methods.on.apply( this ); + } else { + $.error( 'Method ' + method + ' does not exist on Jetpack.resizeable' ); + } + } + } ); +})(jQuery); diff --git a/plugins/jetpack/_inc/jquery.spin.js b/plugins/jetpack/_inc/jquery.spin.js new file mode 100644 index 00000000..4642af13 --- /dev/null +++ b/plugins/jetpack/_inc/jquery.spin.js @@ -0,0 +1,86 @@ +/* + * Matt Husby https://github.com/matthusby/spin.js + * Based on the jquery plugin by Bradley Smith + * https://gist.github.com/1290439 + */ + +/* +Add spin to the jQuery object +If color is not passed the spinner will be black +You can now create a spinner using any of the variants below: +$("#el").spin(); // Produces default Spinner +$("#el").spin("small"); // Produces a 'small' Spinner +$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color). +$("#el").spin({ ... }); // Produces a Spinner using your custom settings. +$("#el").spin("small-right"); // Pin the small spinner to the right edge +$("#el").spin("{small, medium, large}-{left, right, top, bottom}"); // All options for where to pin +$("#el").spin(false); // Kills the spinner. +*/ + +( function( $ ) { + $.fn.spin = function( opts, color ) { + var presets = { + "small": { lines: 8, length: 2, width: 2, radius: 3, trail: 60, speed: 1.3 }, + "medium": { lines: 8, length: 4, width: 3, radius: 5, trail: 60, speed: 1.3 }, + "large": { lines: 10, length: 6, width: 4, radius: 7, trail: 60, speed: 1.3 } + }; + if ( Spinner ) { + return this.each( function() { + var $this = $( this ), + data = $this.data(); + + if ( data.spinner ) { + data.spinner.stop(); + delete data.spinner; + } + if ( opts !== false ) { + var spinner_options; + if ( typeof opts === "string" ) { + var spinner_base = opts.indexOf( '-' ); + if( spinner_base == -1 ) { + spinner_base = opts; + } else { + spinner_base = opts.substring( 0, spinner_base ); + } + if ( spinner_base in presets ) { + spinner_options = presets[spinner_base]; + } else { + spinner_options = {}; + } + var padding; + if ( opts.indexOf( "-right" ) != -1 ) { + padding = jQuery( this ).css( 'padding-left' ); + if( typeof padding === "undefined" ) { + padding = 0; + } else { + padding = padding.replace( 'px', '' ); + } + spinner_options.left = jQuery( this ).outerWidth() - ( 2 * ( spinner_options.length + spinner_options.width + spinner_options.radius ) ) - padding - 5; + } + if ( opts.indexOf( '-left' ) != -1 ) { + spinner_options.left = 5; + } + if ( opts.indexOf( '-top' ) != -1 ) { + spinner_options.top = 5; + } + if ( opts.indexOf( '-bottom' ) != -1 ) { + padding = jQuery( this ).css( 'padding-top' ); + if( typeof padding === "undefined" ) { + padding = 0; + } else { + padding = padding.replace( 'px', '' ); + } + spinner_options.top = jQuery( this ).outerHeight() - ( 2 * ( spinner_options.length + spinner_options.width + spinner_options.radius ) ) - padding - 5; + } + } + if( color ){ + spinner_options.color = color; + } + data.spinner = new Spinner( spinner_options ).spin( this ); + } + }); + } else { + throw "Spinner class not available."; + } + }; +})( jQuery ); \ No newline at end of file diff --git a/plugins/jetpack/_inc/postmessage.js b/plugins/jetpack/_inc/postmessage.js new file mode 100644 index 00000000..e8933bca --- /dev/null +++ b/plugins/jetpack/_inc/postmessage.js @@ -0,0 +1,438 @@ +/** + The MIT License + + Copyright (c) 2010 Daniel Park (http://metaweb.com, http://postmessage.freebaseapps.com) + + 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. + **/ +var NO_JQUERY = {}; +(function(window, $, undefined) { + + if (!("console" in window)) { + var c = window.console = {}; + c.log = c.warn = c.error = c.debug = function(){}; + } + + if ($ === NO_JQUERY) { + // jQuery is optional + $ = { + fn: {}, + extend: function() { + var a = arguments[0]; + for (var i=1,len=arguments.length; i> 1) : o.left+mid) + 'px', + top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : o.top+mid) + 'px' + }); + } + + el.setAttribute('aria-role', 'progressbar'); + self.lines(el, self.opts); + + if (!useCssAnimations) { + // No CSS animation support, use setTimeout() instead + var i = 0; + var fps = o.fps; + var f = fps/o.speed; + var ostep = (1-o.opacity)/(f*o.trail / 100); + var astep = f/o.lines; + + !function anim() { + i++; + for (var s=o.lines; s; s--) { + var alpha = Math.max(1-(i+s*astep)%f * ostep, o.opacity); + self.opacity(el, o.lines-s, alpha, o); + } + self.timeout = self.el && setTimeout(anim, ~~(1000/fps)); + }(); + } + return self; + }, + stop: function() { + var el = this.el; + if (el) { + clearTimeout(this.timeout); + if (el.parentNode) el.parentNode.removeChild(el); + this.el = undefined; + } + return this; + }, + lines: function(el, o) { + var i = 0; + var seg; + + function fill(color, shadow) { + return css(createEl(), { + position: 'absolute', + width: (o.length+o.width) + 'px', + height: o.width + 'px', + background: color, + boxShadow: shadow, + transformOrigin: 'left', + transform: 'rotate(' + ~~(360/o.lines*i) + 'deg) translate(' + o.radius+'px' +',0)', + borderRadius: (o.width>>1) + 'px' + }); + } + for (; i < o.lines; i++) { + seg = css(createEl(), { + position: 'absolute', + top: 1+~(o.width/2) + 'px', + transform: o.hwaccel ? 'translate3d(0,0,0)' : '', + opacity: o.opacity, + animation: useCssAnimations && addAnimation(o.opacity, o.trail, i, o.lines) + ' ' + 1/o.speed + 's linear infinite' + }); + if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'})); + ins(el, ins(seg, fill(o.color, '0 0 1px rgba(0,0,0,.1)'))); + } + return el; + }, + opacity: function(el, i, val) { + if (i < el.childNodes.length) el.childNodes[i].style.opacity = val; + } + }; + + ///////////////////////////////////////////////////////////////////////// + // VML rendering for IE + ///////////////////////////////////////////////////////////////////////// + + /** + * Check and init VML support + */ + !function() { + var s = css(createEl('group'), {behavior: 'url(#default#VML)'}); + var i; + + if (!vendor(s, 'transform') && s.adj) { + + // VML support detected. Insert CSS rules ... + for (i=4; i--;) sheet.addRule(['group', 'roundrect', 'fill', 'stroke'][i], 'behavior:url(#default#VML)'); + + Spinner.prototype.lines = function(el, o) { + var r = o.length+o.width; + var s = 2*r; + + function grp() { + return css(createEl('group', {coordsize: s +' '+s, coordorigin: -r +' '+-r}), {width: s, height: s}); + } + + var margin = -(o.width+o.length)*2+'px'; + var g = css(grp(), {position: 'absolute', top: margin, left: margin}); + + var i; + + function seg(i, dx, filter) { + ins(g, + ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}), + ins(css(createEl('roundrect', {arcsize: 1}), { + width: r, + height: o.width, + left: o.radius, + top: -o.width>>1, + filter: filter + }), + createEl('fill', {color: o.color, opacity: o.opacity}), + createEl('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change + ) + ) + ); + } + + if (o.shadow) { + for (i = 1; i <= o.lines; i++) { + seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)'); + } + } + for (i = 1; i <= o.lines; i++) seg(i); + return ins(el, g); + }; + Spinner.prototype.opacity = function(el, i, val, o) { + var c = el.firstChild; + o = o.shadow && o.lines || 0; + if (c && i+o < c.childNodes.length) { + c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild; + if (c) c.opacity = val; + } + }; + } + else { + useCssAnimations = vendor(s, 'animation'); + } + }(); + + window.Spinner = Spinner; + +})(window, document); \ No newline at end of file -- cgit v1.2.3-65-gdbad