From c65f25a29edb6d47fa7d99a69c274f906b61adea Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Thu, 1 Aug 2013 08:53:46 +0200 Subject: Update jetpack, akismet and wordpress-importer --- plugins/jetpack/_inc/gallery-settings.js | 15 +- plugins/jetpack/_inc/images/a8c.png | Bin 2058 -> 845 bytes .../jetpack/_inc/images/alertbox-closeicon-2x.png | Bin 515 -> 245 bytes plugins/jetpack/_inc/images/alertbox-closeicon.png | Bin 437 -> 240 bytes plugins/jetpack/_inc/images/alertbox-clouds-2x.png | Bin 2247 -> 1308 bytes plugins/jetpack/_inc/images/alertbox-clouds.png | Bin 1088 -> 640 bytes plugins/jetpack/_inc/images/arrow-2x.png | Bin 460 -> 267 bytes .../jetpack/_inc/images/arrow-pointer-blue-2x.png | Bin 3022 -> 2052 bytes plugins/jetpack/_inc/images/arrow.png | Bin 296 -> 173 bytes plugins/jetpack/_inc/images/arrows-2x.png | Bin 1371 -> 978 bytes plugins/jetpack/_inc/images/arrows-dark-2x.png | Bin 1416 -> 958 bytes plugins/jetpack/_inc/images/arrows-dark-vs-2x.png | Bin 1287 -> 1093 bytes plugins/jetpack/_inc/images/arrows-vs-2x.png | Bin 1213 -> 1079 bytes plugins/jetpack/_inc/images/atdbuttontr-2x.png | Bin 1840 -> 1598 bytes plugins/jetpack/_inc/images/automattic-2x.png | Bin 5902 -> 3851 bytes plugins/jetpack/_inc/images/automattic.png | Bin 3056 -> 1904 bytes plugins/jetpack/_inc/images/bubble_bg-2x.png | Bin 570 -> 532 bytes .../jetpack/_inc/images/comment-grey-bubble-2x.png | Bin 256 -> 175 bytes plugins/jetpack/_inc/images/delete-2x.png | Bin 4009 -> 3687 bytes plugins/jetpack/_inc/images/footer-clouds-2x.png | Bin 63998 -> 57101 bytes plugins/jetpack/_inc/images/footer-clouds.png | Bin 23583 -> 20077 bytes plugins/jetpack/_inc/images/generic-2x.png | Bin 2166 -> 1826 bytes plugins/jetpack/_inc/images/header-clouds-2x.png | Bin 78134 -> 50373 bytes .../jetpack/_inc/images/header-clouds-small-2x.png | Bin 29032 -> 18157 bytes .../jetpack/_inc/images/header-clouds-small.png | Bin 12781 -> 7969 bytes plugins/jetpack/_inc/images/header-clouds.png | Bin 30454 -> 18565 bytes plugins/jetpack/_inc/images/icon-comingsoon-2x.png | Bin 3096 -> 1960 bytes plugins/jetpack/_inc/images/icon-comingsoon.png | Bin 1482 -> 896 bytes .../jetpack/_inc/images/icon-pointer-flag-2x.png | Bin 2427 -> 1747 bytes plugins/jetpack/_inc/images/image-2x.png | Bin 5414 -> 2671 bytes plugins/jetpack/_inc/images/imgedit-icons-2x.png | Bin 17070 -> 15590 bytes .../jetpack/_inc/images/jetpack-closebox-icon.png | Bin 388 -> 189 bytes plugins/jetpack/_inc/images/list-2x.png | Bin 2052 -> 2000 bytes plugins/jetpack/_inc/images/logo-2x.png | Bin 52802 -> 50369 bytes plugins/jetpack/_inc/images/logo-small-2x.png | Bin 28124 -> 27389 bytes plugins/jetpack/_inc/images/logo-small.png | Bin 11205 -> 10611 bytes plugins/jetpack/_inc/images/logo.png | Bin 22543 -> 21731 bytes plugins/jetpack/_inc/images/media-button-2x.png | Bin 1206 -> 875 bytes plugins/jetpack/_inc/images/menuicon-sprite-2x.png | Bin 4456 -> 3688 bytes plugins/jetpack/_inc/images/menuicon-sprite.png | Bin 1652 -> 1351 bytes plugins/jetpack/_inc/images/module-clouds-2x.png | Bin 5942 -> 5375 bytes plugins/jetpack/_inc/images/module-clouds.png | Bin 2646 -> 2378 bytes .../jetpack/_inc/images/module-icons-sprite-2x.png | Bin 72735 -> 59781 bytes .../jetpack/_inc/images/module-icons-sprite.png | Bin 31542 -> 28049 bytes plugins/jetpack/_inc/images/press-this-2x.png | Bin 887 -> 821 bytes plugins/jetpack/_inc/images/publicize.png | Bin 113219 -> 81768 bytes plugins/jetpack/_inc/images/rss/blue-large.png | Bin 1797 -> 1776 bytes plugins/jetpack/_inc/images/rss/blue-medium.png | Bin 1213 -> 1195 bytes plugins/jetpack/_inc/images/rss/blue-small.png | Bin 618 -> 597 bytes plugins/jetpack/_inc/images/rss/green-large.png | Bin 1665 -> 1644 bytes plugins/jetpack/_inc/images/rss/green-medium.png | Bin 1057 -> 1036 bytes plugins/jetpack/_inc/images/rss/green-small.png | Bin 549 -> 528 bytes plugins/jetpack/_inc/images/rss/orange-large.png | Bin 2570 -> 2545 bytes plugins/jetpack/_inc/images/rss/orange-medium.png | Bin 1718 -> 1697 bytes plugins/jetpack/_inc/images/rss/orange-small.png | Bin 712 -> 672 bytes plugins/jetpack/_inc/images/rss/pink-large.png | Bin 3639 -> 3617 bytes plugins/jetpack/_inc/images/rss/pink-medium.png | Bin 1574 -> 1553 bytes plugins/jetpack/_inc/images/rss/purple-large.png | Bin 3778 -> 3755 bytes plugins/jetpack/_inc/images/rss/purple-medium.png | Bin 1723 -> 1702 bytes plugins/jetpack/_inc/images/rss/purple-small.png | Bin 707 -> 651 bytes plugins/jetpack/_inc/images/rss/red-large.png | Bin 3618 -> 3595 bytes plugins/jetpack/_inc/images/rss/red-medium.png | Bin 1579 -> 1558 bytes plugins/jetpack/_inc/images/rss/red-small.png | Bin 675 -> 609 bytes plugins/jetpack/_inc/images/rss/silver-large.png | Bin 2141 -> 2120 bytes plugins/jetpack/_inc/images/rss/silver-medium.png | Bin 874 -> 853 bytes plugins/jetpack/_inc/images/rss/silver-small.png | Bin 355 -> 336 bytes .../_inc/images/screenshots/beautifulmath.png | Bin 45978 -> 41588 bytes .../jetpack/_inc/images/screenshots/carousel.png | Bin 361672 -> 345257 bytes .../jetpack/_inc/images/screenshots/comments.png | Bin 36696 -> 31650 bytes .../_inc/images/screenshots/contactform.png | Bin 40668 -> 33236 bytes .../jetpack/_inc/images/screenshots/custom-css.png | Bin 43048 -> 25789 bytes .../jetpack/_inc/images/screenshots/hovercards.png | Bin 105102 -> 103110 bytes plugins/jetpack/_inc/images/screenshots/likes.png | Bin 48953 -> 45802 bytes .../screenshots/mobile-push-notifications.jpg | Bin 29830 -> 29242 bytes plugins/jetpack/_inc/images/screenshots/notes.png | Bin 27450 -> 24032 bytes .../_inc/images/screenshots/post-by-email.png | Bin 28349 -> 25973 bytes .../jetpack/_inc/images/screenshots/publicize.png | Bin 113219 -> 81768 bytes .../jetpack/_inc/images/screenshots/sharing.png | Bin 36342 -> 35544 bytes .../jetpack/_inc/images/screenshots/shortcodes.png | Bin 46029 -> 35980 bytes .../jetpack/_inc/images/screenshots/shortlinks.png | Bin 54587 -> 52873 bytes .../jetpack/_inc/images/screenshots/spelling.png | Bin 59981 -> 56568 bytes plugins/jetpack/_inc/images/screenshots/stats.png | Bin 80732 -> 74882 bytes .../_inc/images/screenshots/subscriptions.png | Bin 52112 -> 43275 bytes .../_inc/images/screenshots/tiled-gallery.png | Bin 192182 -> 186121 bytes .../jetpack/_inc/images/screenshots/vaultpress.png | Bin 45517 -> 39774 bytes .../jetpack/_inc/images/screenshots/widgets.png | Bin 107072 -> 106129 bytes plugins/jetpack/_inc/images/stars-2x.png | Bin 1388 -> 1022 bytes plugins/jetpack/_inc/images/status-light-2x.png | Bin 2309 -> 1771 bytes plugins/jetpack/_inc/images/status-light.png | Bin 1006 -> 703 bytes plugins/jetpack/_inc/images/tb-close-2x.png | Bin 337 -> 197 bytes plugins/jetpack/_inc/jetpack-retina.css | 191 +- plugins/jetpack/_inc/jetpack-rtl.css | 238 +- plugins/jetpack/_inc/jetpack.css | 1728 +++-- plugins/jetpack/_inc/jetpack.js | 1 + plugins/jetpack/_inc/jquery.inview.js | 8 +- plugins/jetpack/_inc/jquery.jetpack-resize.js | 17 +- plugins/jetpack/_inc/jquery.spin.js | 180 +- plugins/jetpack/_inc/postmessage.js | 6 +- plugins/jetpack/_inc/spin.js | 642 +- plugins/jetpack/class.jetpack-ixr-client.php | 2 +- plugins/jetpack/class.jetpack-post-images.php | 32 +- plugins/jetpack/class.jetpack-signature.php | 4 +- plugins/jetpack/class.jetpack-user-agent.php | 158 +- plugins/jetpack/class.jetpack-xmlrpc-server.php | 6 +- plugins/jetpack/class.json-api-endpoints.php | 466 +- plugins/jetpack/class.json-api.php | 81 +- plugins/jetpack/class.photon.php | 6 +- plugins/jetpack/functions.gallery.php | 9 +- plugins/jetpack/functions.opengraph.php | 24 +- plugins/jetpack/functions.photon.php | 4 +- plugins/jetpack/jetpack.php | 4488 +---------- plugins/jetpack/languages/jetpack-ar.mo | Bin 14004 -> 132582 bytes plugins/jetpack/languages/jetpack-az.mo | Bin 2886 -> 3077 bytes plugins/jetpack/languages/jetpack-bs_BA.mo | Bin 76528 -> 76232 bytes plugins/jetpack/languages/jetpack-ca.mo | Bin 76602 -> 79877 bytes plugins/jetpack/languages/jetpack-cs_CZ.mo | Bin 8242 -> 8967 bytes plugins/jetpack/languages/jetpack-da_DK.mo | Bin 44830 -> 44531 bytes plugins/jetpack/languages/jetpack-de_DE.mo | Bin 117625 -> 123046 bytes plugins/jetpack/languages/jetpack-el.mo | Bin 8337 -> 12312 bytes plugins/jetpack/languages/jetpack-es_ES.mo | Bin 49121 -> 73672 bytes plugins/jetpack/languages/jetpack-fa_IR.mo | Bin 47862 -> 58196 bytes plugins/jetpack/languages/jetpack-fi.mo | Bin 27526 -> 28822 bytes plugins/jetpack/languages/jetpack-fr_FR.mo | Bin 113684 -> 127742 bytes plugins/jetpack/languages/jetpack-gl_ES.mo | Bin 33955 -> 34697 bytes plugins/jetpack/languages/jetpack-he_IL.mo | Bin 75590 -> 75006 bytes plugins/jetpack/languages/jetpack-hr.mo | Bin 35895 -> 36776 bytes plugins/jetpack/languages/jetpack-hu_HU.mo | Bin 77710 -> 99073 bytes plugins/jetpack/languages/jetpack-id_ID.mo | Bin 52347 -> 51973 bytes plugins/jetpack/languages/jetpack-it_IT.mo | Bin 50000 -> 62055 bytes plugins/jetpack/languages/jetpack-ja.mo | Bin 116549 -> 131786 bytes plugins/jetpack/languages/jetpack-ko_KR.mo | Bin 110462 -> 121971 bytes plugins/jetpack/languages/jetpack-lt_LT.mo | Bin 12440 -> 14165 bytes plugins/jetpack/languages/jetpack-mk_MK.mo | Bin 23594 -> 24002 bytes plugins/jetpack/languages/jetpack-my_MM.mo | Bin 11071 -> 12429 bytes plugins/jetpack/languages/jetpack-nb_NO.mo | Bin 88203 -> 96717 bytes plugins/jetpack/languages/jetpack-nl_NL.mo | Bin 38043 -> 38431 bytes plugins/jetpack/languages/jetpack-nn_NO.mo | Bin 14701 -> 16249 bytes plugins/jetpack/languages/jetpack-pl_PL.mo | Bin 11997 -> 19309 bytes plugins/jetpack/languages/jetpack-pt_BR.mo | Bin 107473 -> 110039 bytes plugins/jetpack/languages/jetpack-pt_PT.mo | Bin 46165 -> 46473 bytes plugins/jetpack/languages/jetpack-ro_RO.mo | Bin 10652 -> 11212 bytes plugins/jetpack/languages/jetpack-ru_RU.mo | Bin 49300 -> 49671 bytes plugins/jetpack/languages/jetpack-sa_IN.mo | Bin 1006 -> 1006 bytes plugins/jetpack/languages/jetpack-sk_SK.mo | Bin 10517 -> 11359 bytes plugins/jetpack/languages/jetpack-sq.mo | Bin 112583 -> 111067 bytes plugins/jetpack/languages/jetpack-sr_RS.mo | Bin 44079 -> 54018 bytes plugins/jetpack/languages/jetpack-sv_SE.mo | Bin 24534 -> 33308 bytes plugins/jetpack/languages/jetpack-th.mo | Bin 18421 -> 20113 bytes plugins/jetpack/languages/jetpack-tr_TR.mo | Bin 35311 -> 36876 bytes plugins/jetpack/languages/jetpack-zh_CN.mo | Bin 7637 -> 8477 bytes plugins/jetpack/languages/jetpack-zh_TW.mo | Bin 93742 -> 91924 bytes plugins/jetpack/locales.php | 10 +- plugins/jetpack/modules/after-the-deadline.php | 35 +- .../after-the-deadline/atd-autoproofread.js | 6 +- .../after-the-deadline/atd-nonvis-editor-plugin.js | 20 +- .../jetpack/modules/after-the-deadline/atd.core.js | 58 +- plugins/jetpack/modules/after-the-deadline/atd.css | 32 +- .../modules/after-the-deadline/config-options.php | 26 +- .../modules/after-the-deadline/config-unignore.php | 10 +- .../modules/after-the-deadline/install_atd_l10n.js | 4 +- .../modules/after-the-deadline/jquery.atd.js | 44 +- .../jetpack/modules/after-the-deadline/proxy.php | 8 +- .../after-the-deadline/tinymce/editor_plugin.js | 126 +- plugins/jetpack/modules/carousel.php | 1 + .../jetpack/modules/carousel/jetpack-carousel.css | 34 +- .../jetpack/modules/carousel/jetpack-carousel.js | 209 +- .../jetpack/modules/carousel/jetpack-carousel.php | 69 +- .../modules/carousel/rtl/jetpack-carousel-rtl.css | 36 +- plugins/jetpack/modules/comments.php | 1 + plugins/jetpack/modules/comments/admin.php | 2 +- plugins/jetpack/modules/comments/base.php | 14 +- plugins/jetpack/modules/comments/comments.php | 19 +- plugins/jetpack/modules/contact-form.php | 3 +- plugins/jetpack/modules/contact-form/admin.php | 47 +- .../jetpack/modules/contact-form/css/grunion.css | 4 +- .../modules/contact-form/grunion-contact-form.php | 414 +- .../modules/contact-form/grunion-form-view.php | 22 +- plugins/jetpack/modules/contact-form/js/grunion.js | 34 +- plugins/jetpack/modules/custom-css.php | 1 + .../modules/custom-css/csstidy/class.csstidy.php | 7 +- .../custom-css/csstidy/class.csstidy_optimise.php | 9 +- .../custom-css/csstidy/class.csstidy_print.php | 4 +- .../modules/custom-css/csstidy/data-wp.inc.php | 8 + .../modules/custom-css/csstidy/data.inc.php | 4 +- .../modules/custom-css/csstidy/lang.inc.php | 8 +- plugins/jetpack/modules/custom-css/custom-css.php | 425 +- .../modules/custom-css/custom-css/js/ace/ace.js | 1 - .../custom-css/custom-css/js/ace/worker-css.js | 7887 +++++++++++++++++++- .../custom-css/custom-css/js/safecss-ace.js | 53 +- .../custom-css/custom-css/preprocessors.php | 2 +- plugins/jetpack/modules/enhanced-distribution.php | 1 + .../modules/featured-content/featured-content.php | 6 +- plugins/jetpack/modules/gravatar-hovercards.php | 11 +- plugins/jetpack/modules/holiday-snow.php | 1 + plugins/jetpack/modules/infinite-scroll.php | 1 + .../jetpack/modules/infinite-scroll/infinity.css | 5 +- .../jetpack/modules/infinite-scroll/infinity.js | 9 +- .../jetpack/modules/infinite-scroll/infinity.php | 134 +- plugins/jetpack/modules/json-api.php | 1 + plugins/jetpack/modules/latex.php | 1 + plugins/jetpack/modules/likes.php | 214 +- plugins/jetpack/modules/likes/style.css | 19 +- plugins/jetpack/modules/minileven.php | 1 + plugins/jetpack/modules/minileven/minileven.php | 17 + .../theme/pub/minileven/content-gallery.php | 4 +- .../minileven/theme/pub/minileven/content.php | 13 +- .../minileven/theme/pub/minileven/footer.php | 2 - .../minileven/theme/pub/minileven/functions.php | 56 +- .../minileven/theme/pub/minileven/header.php | 20 +- .../minileven/theme/pub/minileven/image.php | 2 +- .../theme/pub/minileven/inc/custom-header.php | 36 +- .../theme/pub/minileven/inc/template-tags.php | 5 +- .../minileven/theme/pub/minileven/inc/tweaks.php | 22 +- .../minileven/theme/pub/minileven/index.php | 2 + .../minileven/theme/pub/minileven/js/small-menu.js | 64 +- .../minileven/theme/pub/minileven/style.css | 624 +- plugins/jetpack/modules/mobile-push.php | 3 +- plugins/jetpack/modules/module-extras.php | 2 + plugins/jetpack/modules/module-info.php | 48 +- plugins/jetpack/modules/notes.php | 82 +- plugins/jetpack/modules/photon.php | 1 + plugins/jetpack/modules/post-by-email.php | 5 +- .../jetpack/modules/post-by-email/post-by-email.js | 2 +- plugins/jetpack/modules/publicize.php | 1 + .../jetpack/modules/publicize/assets/publicize.css | 5 +- .../jetpack/modules/publicize/assets/publicize.js | 2 +- .../modules/publicize/assets/rtl/publicize-rtl.css | 7 +- .../modules/publicize/publicize-jetpack.php | 93 +- plugins/jetpack/modules/publicize/publicize.php | 45 +- plugins/jetpack/modules/publicize/ui.php | 39 +- plugins/jetpack/modules/sharedaddy.php | 3 +- .../jetpack/modules/sharedaddy/admin-sharing.css | 46 +- .../jetpack/modules/sharedaddy/admin-sharing.js | 108 +- .../jetpack/modules/sharedaddy/images/facebook.png | Bin 838 -> 568 bytes .../modules/sharedaddy/images/facebook@2x.png | Bin 1533 -> 1036 bytes .../modules/sharedaddy/images/googleplus1.png | Bin 574 -> 722 bytes .../modules/sharedaddy/images/googleplus1@2x.png | Bin 1815 -> 1333 bytes .../modules/sharedaddy/images/icon-facebook-2x.png | Bin 671 -> 1036 bytes .../modules/sharedaddy/images/icon-facebook.png | Bin 887 -> 568 bytes .../jetpack/modules/sharedaddy/recaptchalib.php | 14 +- plugins/jetpack/modules/sharedaddy/sharedaddy.php | 6 +- .../jetpack/modules/sharedaddy/sharing-service.php | 42 +- .../jetpack/modules/sharedaddy/sharing-sources.php | 91 +- plugins/jetpack/modules/sharedaddy/sharing.css | 71 +- plugins/jetpack/modules/sharedaddy/sharing.js | 11 +- plugins/jetpack/modules/sharedaddy/sharing.php | 1 - plugins/jetpack/modules/shortcodes.php | 35 +- plugins/jetpack/modules/shortcodes/archives.php | 2 +- plugins/jetpack/modules/shortcodes/audio.php | 31 +- plugins/jetpack/modules/shortcodes/blip.php | 6 +- .../shortcodes/css/rtl/slideshow-shortcode-rtl.css | 4 +- .../modules/shortcodes/css/slideshow-shortcode.css | 2 + plugins/jetpack/modules/shortcodes/dailymotion.php | 32 +- plugins/jetpack/modules/shortcodes/diggthis.php | 14 +- plugins/jetpack/modules/shortcodes/flickr.php | 10 +- plugins/jetpack/modules/shortcodes/googlemaps.php | 4 + plugins/jetpack/modules/shortcodes/googlevideo.php | 4 +- .../modules/shortcodes/js/audio-shortcode.js | 12 +- .../jetpack/modules/shortcodes/js/jquery.cycle.js | 40 +- plugins/jetpack/modules/shortcodes/polldaddy.php | 168 +- plugins/jetpack/modules/shortcodes/slideshare.php | 4 +- plugins/jetpack/modules/shortcodes/slideshow.php | 2 +- plugins/jetpack/modules/shortcodes/ted.php | 4 + plugins/jetpack/modules/shortcodes/videopress.php | 18 +- plugins/jetpack/modules/shortcodes/vimeo.php | 27 +- plugins/jetpack/modules/shortcodes/youtube.php | 43 +- plugins/jetpack/modules/shortlinks.php | 1 + plugins/jetpack/modules/stats.php | 73 +- plugins/jetpack/modules/subscriptions.php | 53 +- plugins/jetpack/modules/tiled-gallery.php | 1 + .../math/class-constrained-array-rounding.php | 6 +- .../modules/tiled-gallery/tiled-gallery.php | 34 +- .../tiled-gallery/rtl/tiled-gallery-rtl.css | 15 +- .../tiled-gallery/tiled-gallery/tiled-gallery.css | 12 +- .../tiled-gallery/tiled-gallery/tiled-gallery.js | 15 +- plugins/jetpack/modules/vaultpress.php | 5 +- plugins/jetpack/modules/widgets.php | 11 +- .../jetpack/modules/widgets/facebook-likebox.php | 78 +- .../jetpack/modules/widgets/gravatar-profile.css | 2 +- plugins/jetpack/modules/widgets/readmill.php | 2 +- .../jetpack/modules/widgets/rsslinks-widget.php | 2 +- plugins/jetpack/modules/widgets/top-posts.php | 16 +- plugins/jetpack/readme.txt | 210 +- 283 files changed, 13280 insertions(+), 7720 deletions(-) (limited to 'plugins/jetpack') diff --git a/plugins/jetpack/_inc/gallery-settings.js b/plugins/jetpack/_inc/gallery-settings.js index 0ce38f0b..4b5316b8 100644 --- a/plugins/jetpack/_inc/gallery-settings.js +++ b/plugins/jetpack/_inc/gallery-settings.js @@ -7,12 +7,25 @@ // Wrap the render() function to append controls. media.view.Settings.Gallery = media.view.Settings.Gallery.extend({ render: function() { + var $el = this.$el; + media.view.Settings.prototype.render.apply( this, arguments ); // Append the type template and update the settings. - this.$el.append( media.template( 'jetpack-gallery-settings' ) ); + $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'] ); + + // Hide the Columns setting for all types except Default + $el.find( 'select[name=type]' ).on( 'change', function () { + var columnSetting = $el.find( 'select[name=columns]' ).closest( 'label.setting' ); + + if ( 'default' == $( this ).val() ) + columnSetting.show(); + else + columnSetting.hide(); + } ).change(); + return this; } }); diff --git a/plugins/jetpack/_inc/images/a8c.png b/plugins/jetpack/_inc/images/a8c.png index b6c84df9..d31d6e3b 100644 Binary files a/plugins/jetpack/_inc/images/a8c.png and b/plugins/jetpack/_inc/images/a8c.png differ diff --git a/plugins/jetpack/_inc/images/alertbox-closeicon-2x.png b/plugins/jetpack/_inc/images/alertbox-closeicon-2x.png index 5c64a0e1..e78f4482 100644 Binary files a/plugins/jetpack/_inc/images/alertbox-closeicon-2x.png and b/plugins/jetpack/_inc/images/alertbox-closeicon-2x.png differ diff --git a/plugins/jetpack/_inc/images/alertbox-closeicon.png b/plugins/jetpack/_inc/images/alertbox-closeicon.png index c293dafa..ad3a3264 100644 Binary files a/plugins/jetpack/_inc/images/alertbox-closeicon.png and b/plugins/jetpack/_inc/images/alertbox-closeicon.png differ diff --git a/plugins/jetpack/_inc/images/alertbox-clouds-2x.png b/plugins/jetpack/_inc/images/alertbox-clouds-2x.png index 770390f6..bfa71b2a 100644 Binary files a/plugins/jetpack/_inc/images/alertbox-clouds-2x.png and b/plugins/jetpack/_inc/images/alertbox-clouds-2x.png differ diff --git a/plugins/jetpack/_inc/images/alertbox-clouds.png b/plugins/jetpack/_inc/images/alertbox-clouds.png index 207dd2a3..4a40a7e1 100644 Binary files a/plugins/jetpack/_inc/images/alertbox-clouds.png and b/plugins/jetpack/_inc/images/alertbox-clouds.png differ diff --git a/plugins/jetpack/_inc/images/arrow-2x.png b/plugins/jetpack/_inc/images/arrow-2x.png index 668bd220..6b83e7cd 100644 Binary files a/plugins/jetpack/_inc/images/arrow-2x.png and b/plugins/jetpack/_inc/images/arrow-2x.png differ diff --git a/plugins/jetpack/_inc/images/arrow-pointer-blue-2x.png b/plugins/jetpack/_inc/images/arrow-pointer-blue-2x.png index 5c567fad..29c7dcf8 100644 Binary files a/plugins/jetpack/_inc/images/arrow-pointer-blue-2x.png and b/plugins/jetpack/_inc/images/arrow-pointer-blue-2x.png differ diff --git a/plugins/jetpack/_inc/images/arrow.png b/plugins/jetpack/_inc/images/arrow.png index 995148cb..25d2f027 100644 Binary files a/plugins/jetpack/_inc/images/arrow.png and b/plugins/jetpack/_inc/images/arrow.png differ diff --git a/plugins/jetpack/_inc/images/arrows-2x.png b/plugins/jetpack/_inc/images/arrows-2x.png index 752f3e2a..5004253b 100644 Binary files a/plugins/jetpack/_inc/images/arrows-2x.png and b/plugins/jetpack/_inc/images/arrows-2x.png differ diff --git a/plugins/jetpack/_inc/images/arrows-dark-2x.png b/plugins/jetpack/_inc/images/arrows-dark-2x.png index cc665817..9e1b44f2 100644 Binary files a/plugins/jetpack/_inc/images/arrows-dark-2x.png and b/plugins/jetpack/_inc/images/arrows-dark-2x.png differ diff --git a/plugins/jetpack/_inc/images/arrows-dark-vs-2x.png b/plugins/jetpack/_inc/images/arrows-dark-vs-2x.png index 908daa6b..4b667c4a 100644 Binary files a/plugins/jetpack/_inc/images/arrows-dark-vs-2x.png and b/plugins/jetpack/_inc/images/arrows-dark-vs-2x.png differ diff --git a/plugins/jetpack/_inc/images/arrows-vs-2x.png b/plugins/jetpack/_inc/images/arrows-vs-2x.png index 50af7389..1ecd8291 100644 Binary files a/plugins/jetpack/_inc/images/arrows-vs-2x.png and b/plugins/jetpack/_inc/images/arrows-vs-2x.png differ diff --git a/plugins/jetpack/_inc/images/atdbuttontr-2x.png b/plugins/jetpack/_inc/images/atdbuttontr-2x.png index 8d3617e5..5086e088 100644 Binary files a/plugins/jetpack/_inc/images/atdbuttontr-2x.png and b/plugins/jetpack/_inc/images/atdbuttontr-2x.png differ diff --git a/plugins/jetpack/_inc/images/automattic-2x.png b/plugins/jetpack/_inc/images/automattic-2x.png index 412bee1a..661556a1 100644 Binary files a/plugins/jetpack/_inc/images/automattic-2x.png and b/plugins/jetpack/_inc/images/automattic-2x.png differ diff --git a/plugins/jetpack/_inc/images/automattic.png b/plugins/jetpack/_inc/images/automattic.png index dc1c3a7e..9c0c3886 100644 Binary files a/plugins/jetpack/_inc/images/automattic.png and b/plugins/jetpack/_inc/images/automattic.png differ diff --git a/plugins/jetpack/_inc/images/bubble_bg-2x.png b/plugins/jetpack/_inc/images/bubble_bg-2x.png index f5353136..8757def4 100644 Binary files a/plugins/jetpack/_inc/images/bubble_bg-2x.png and b/plugins/jetpack/_inc/images/bubble_bg-2x.png differ diff --git a/plugins/jetpack/_inc/images/comment-grey-bubble-2x.png b/plugins/jetpack/_inc/images/comment-grey-bubble-2x.png index 72e02404..57fbeacf 100644 Binary files a/plugins/jetpack/_inc/images/comment-grey-bubble-2x.png and b/plugins/jetpack/_inc/images/comment-grey-bubble-2x.png differ diff --git a/plugins/jetpack/_inc/images/delete-2x.png b/plugins/jetpack/_inc/images/delete-2x.png index 5c869b17..9436624a 100644 Binary files a/plugins/jetpack/_inc/images/delete-2x.png and b/plugins/jetpack/_inc/images/delete-2x.png differ diff --git a/plugins/jetpack/_inc/images/footer-clouds-2x.png b/plugins/jetpack/_inc/images/footer-clouds-2x.png index f6b7454e..4616c0af 100644 Binary files a/plugins/jetpack/_inc/images/footer-clouds-2x.png and b/plugins/jetpack/_inc/images/footer-clouds-2x.png differ diff --git a/plugins/jetpack/_inc/images/footer-clouds.png b/plugins/jetpack/_inc/images/footer-clouds.png index e7c8d057..d8dc03a7 100644 Binary files a/plugins/jetpack/_inc/images/footer-clouds.png and b/plugins/jetpack/_inc/images/footer-clouds.png differ diff --git a/plugins/jetpack/_inc/images/generic-2x.png b/plugins/jetpack/_inc/images/generic-2x.png index 85c6f85b..0f7b28f6 100644 Binary files a/plugins/jetpack/_inc/images/generic-2x.png and b/plugins/jetpack/_inc/images/generic-2x.png differ diff --git a/plugins/jetpack/_inc/images/header-clouds-2x.png b/plugins/jetpack/_inc/images/header-clouds-2x.png index 0762edfe..2fdf221f 100644 Binary files a/plugins/jetpack/_inc/images/header-clouds-2x.png and b/plugins/jetpack/_inc/images/header-clouds-2x.png differ diff --git a/plugins/jetpack/_inc/images/header-clouds-small-2x.png b/plugins/jetpack/_inc/images/header-clouds-small-2x.png index a5ab65c1..04387676 100644 Binary files a/plugins/jetpack/_inc/images/header-clouds-small-2x.png and b/plugins/jetpack/_inc/images/header-clouds-small-2x.png differ diff --git a/plugins/jetpack/_inc/images/header-clouds-small.png b/plugins/jetpack/_inc/images/header-clouds-small.png index c1a6b273..00bbf16f 100644 Binary files a/plugins/jetpack/_inc/images/header-clouds-small.png and b/plugins/jetpack/_inc/images/header-clouds-small.png differ diff --git a/plugins/jetpack/_inc/images/header-clouds.png b/plugins/jetpack/_inc/images/header-clouds.png index a766222e..ce8fea9f 100644 Binary files a/plugins/jetpack/_inc/images/header-clouds.png and b/plugins/jetpack/_inc/images/header-clouds.png differ diff --git a/plugins/jetpack/_inc/images/icon-comingsoon-2x.png b/plugins/jetpack/_inc/images/icon-comingsoon-2x.png index baede10f..ea426d49 100644 Binary files a/plugins/jetpack/_inc/images/icon-comingsoon-2x.png and b/plugins/jetpack/_inc/images/icon-comingsoon-2x.png differ diff --git a/plugins/jetpack/_inc/images/icon-comingsoon.png b/plugins/jetpack/_inc/images/icon-comingsoon.png index 3814c86e..ecfce9ba 100644 Binary files a/plugins/jetpack/_inc/images/icon-comingsoon.png and b/plugins/jetpack/_inc/images/icon-comingsoon.png differ diff --git a/plugins/jetpack/_inc/images/icon-pointer-flag-2x.png b/plugins/jetpack/_inc/images/icon-pointer-flag-2x.png index 057545a5..b130901b 100644 Binary files a/plugins/jetpack/_inc/images/icon-pointer-flag-2x.png and b/plugins/jetpack/_inc/images/icon-pointer-flag-2x.png differ diff --git a/plugins/jetpack/_inc/images/image-2x.png b/plugins/jetpack/_inc/images/image-2x.png index a47dd71c..8a5e57a8 100644 Binary files a/plugins/jetpack/_inc/images/image-2x.png and b/plugins/jetpack/_inc/images/image-2x.png differ diff --git a/plugins/jetpack/_inc/images/imgedit-icons-2x.png b/plugins/jetpack/_inc/images/imgedit-icons-2x.png index 155f5411..c9a0f02d 100644 Binary files a/plugins/jetpack/_inc/images/imgedit-icons-2x.png and b/plugins/jetpack/_inc/images/imgedit-icons-2x.png differ diff --git a/plugins/jetpack/_inc/images/jetpack-closebox-icon.png b/plugins/jetpack/_inc/images/jetpack-closebox-icon.png index 1c014d9c..5f48b493 100644 Binary files a/plugins/jetpack/_inc/images/jetpack-closebox-icon.png and b/plugins/jetpack/_inc/images/jetpack-closebox-icon.png differ diff --git a/plugins/jetpack/_inc/images/list-2x.png b/plugins/jetpack/_inc/images/list-2x.png index 27a67b86..043b8695 100644 Binary files a/plugins/jetpack/_inc/images/list-2x.png and b/plugins/jetpack/_inc/images/list-2x.png differ diff --git a/plugins/jetpack/_inc/images/logo-2x.png b/plugins/jetpack/_inc/images/logo-2x.png index 9f7f693d..80d789ee 100644 Binary files a/plugins/jetpack/_inc/images/logo-2x.png and b/plugins/jetpack/_inc/images/logo-2x.png differ diff --git a/plugins/jetpack/_inc/images/logo-small-2x.png b/plugins/jetpack/_inc/images/logo-small-2x.png index c39fbf9a..2126ab77 100644 Binary files a/plugins/jetpack/_inc/images/logo-small-2x.png and b/plugins/jetpack/_inc/images/logo-small-2x.png differ diff --git a/plugins/jetpack/_inc/images/logo-small.png b/plugins/jetpack/_inc/images/logo-small.png index 997dbb13..634b5a99 100644 Binary files a/plugins/jetpack/_inc/images/logo-small.png and b/plugins/jetpack/_inc/images/logo-small.png differ diff --git a/plugins/jetpack/_inc/images/logo.png b/plugins/jetpack/_inc/images/logo.png index 2d49b671..9882b7ad 100644 Binary files a/plugins/jetpack/_inc/images/logo.png and b/plugins/jetpack/_inc/images/logo.png differ diff --git a/plugins/jetpack/_inc/images/media-button-2x.png b/plugins/jetpack/_inc/images/media-button-2x.png index 8ad6eb4e..1c6b785c 100644 Binary files a/plugins/jetpack/_inc/images/media-button-2x.png and b/plugins/jetpack/_inc/images/media-button-2x.png differ diff --git a/plugins/jetpack/_inc/images/menuicon-sprite-2x.png b/plugins/jetpack/_inc/images/menuicon-sprite-2x.png index aa9a3680..302b3369 100644 Binary files a/plugins/jetpack/_inc/images/menuicon-sprite-2x.png and b/plugins/jetpack/_inc/images/menuicon-sprite-2x.png differ diff --git a/plugins/jetpack/_inc/images/menuicon-sprite.png b/plugins/jetpack/_inc/images/menuicon-sprite.png index 3bebcf1e..15a3351a 100644 Binary files a/plugins/jetpack/_inc/images/menuicon-sprite.png and b/plugins/jetpack/_inc/images/menuicon-sprite.png differ diff --git a/plugins/jetpack/_inc/images/module-clouds-2x.png b/plugins/jetpack/_inc/images/module-clouds-2x.png index 1bab9fb1..905a4307 100644 Binary files a/plugins/jetpack/_inc/images/module-clouds-2x.png and b/plugins/jetpack/_inc/images/module-clouds-2x.png differ diff --git a/plugins/jetpack/_inc/images/module-clouds.png b/plugins/jetpack/_inc/images/module-clouds.png index 2414fef9..1e0f72d4 100644 Binary files a/plugins/jetpack/_inc/images/module-clouds.png and b/plugins/jetpack/_inc/images/module-clouds.png differ diff --git a/plugins/jetpack/_inc/images/module-icons-sprite-2x.png b/plugins/jetpack/_inc/images/module-icons-sprite-2x.png index 11f42042..f73023fe 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 c6979f67..90a42f83 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/press-this-2x.png b/plugins/jetpack/_inc/images/press-this-2x.png index a335aecb..be6ee74e 100644 Binary files a/plugins/jetpack/_inc/images/press-this-2x.png and b/plugins/jetpack/_inc/images/press-this-2x.png differ diff --git a/plugins/jetpack/_inc/images/publicize.png b/plugins/jetpack/_inc/images/publicize.png index 428b886c..8cf9ede5 100644 Binary files a/plugins/jetpack/_inc/images/publicize.png and b/plugins/jetpack/_inc/images/publicize.png differ diff --git a/plugins/jetpack/_inc/images/rss/blue-large.png b/plugins/jetpack/_inc/images/rss/blue-large.png index b4a6c52f..fd623278 100644 Binary files a/plugins/jetpack/_inc/images/rss/blue-large.png and b/plugins/jetpack/_inc/images/rss/blue-large.png differ diff --git a/plugins/jetpack/_inc/images/rss/blue-medium.png b/plugins/jetpack/_inc/images/rss/blue-medium.png index f64e3541..94110185 100644 Binary files a/plugins/jetpack/_inc/images/rss/blue-medium.png and b/plugins/jetpack/_inc/images/rss/blue-medium.png differ diff --git a/plugins/jetpack/_inc/images/rss/blue-small.png b/plugins/jetpack/_inc/images/rss/blue-small.png index c281155e..8e4b053b 100644 Binary files a/plugins/jetpack/_inc/images/rss/blue-small.png and b/plugins/jetpack/_inc/images/rss/blue-small.png differ diff --git a/plugins/jetpack/_inc/images/rss/green-large.png b/plugins/jetpack/_inc/images/rss/green-large.png index 4bf86435..a9c2c83c 100644 Binary files a/plugins/jetpack/_inc/images/rss/green-large.png and b/plugins/jetpack/_inc/images/rss/green-large.png differ diff --git a/plugins/jetpack/_inc/images/rss/green-medium.png b/plugins/jetpack/_inc/images/rss/green-medium.png index 13304ce2..f8e8fbc0 100644 Binary files a/plugins/jetpack/_inc/images/rss/green-medium.png and b/plugins/jetpack/_inc/images/rss/green-medium.png differ diff --git a/plugins/jetpack/_inc/images/rss/green-small.png b/plugins/jetpack/_inc/images/rss/green-small.png index 8833c9e6..299905b8 100644 Binary files a/plugins/jetpack/_inc/images/rss/green-small.png and b/plugins/jetpack/_inc/images/rss/green-small.png differ diff --git a/plugins/jetpack/_inc/images/rss/orange-large.png b/plugins/jetpack/_inc/images/rss/orange-large.png index 966b1c1a..12503492 100644 Binary files a/plugins/jetpack/_inc/images/rss/orange-large.png and b/plugins/jetpack/_inc/images/rss/orange-large.png differ diff --git a/plugins/jetpack/_inc/images/rss/orange-medium.png b/plugins/jetpack/_inc/images/rss/orange-medium.png index 8f5aaa24..7c47f764 100644 Binary files a/plugins/jetpack/_inc/images/rss/orange-medium.png and b/plugins/jetpack/_inc/images/rss/orange-medium.png differ diff --git a/plugins/jetpack/_inc/images/rss/orange-small.png b/plugins/jetpack/_inc/images/rss/orange-small.png index 9e0bf22e..4f326d56 100644 Binary files a/plugins/jetpack/_inc/images/rss/orange-small.png and b/plugins/jetpack/_inc/images/rss/orange-small.png differ diff --git a/plugins/jetpack/_inc/images/rss/pink-large.png b/plugins/jetpack/_inc/images/rss/pink-large.png index 49b94c77..1273b773 100644 Binary files a/plugins/jetpack/_inc/images/rss/pink-large.png and b/plugins/jetpack/_inc/images/rss/pink-large.png differ diff --git a/plugins/jetpack/_inc/images/rss/pink-medium.png b/plugins/jetpack/_inc/images/rss/pink-medium.png index cd8e957b..feb154c7 100644 Binary files a/plugins/jetpack/_inc/images/rss/pink-medium.png and b/plugins/jetpack/_inc/images/rss/pink-medium.png differ diff --git a/plugins/jetpack/_inc/images/rss/purple-large.png b/plugins/jetpack/_inc/images/rss/purple-large.png index 1ddb70f0..704765ee 100644 Binary files a/plugins/jetpack/_inc/images/rss/purple-large.png and b/plugins/jetpack/_inc/images/rss/purple-large.png differ diff --git a/plugins/jetpack/_inc/images/rss/purple-medium.png b/plugins/jetpack/_inc/images/rss/purple-medium.png index 8d375a5f..f785cbb2 100644 Binary files a/plugins/jetpack/_inc/images/rss/purple-medium.png and b/plugins/jetpack/_inc/images/rss/purple-medium.png differ diff --git a/plugins/jetpack/_inc/images/rss/purple-small.png b/plugins/jetpack/_inc/images/rss/purple-small.png index 75f3c607..d21d59be 100644 Binary files a/plugins/jetpack/_inc/images/rss/purple-small.png and b/plugins/jetpack/_inc/images/rss/purple-small.png differ diff --git a/plugins/jetpack/_inc/images/rss/red-large.png b/plugins/jetpack/_inc/images/rss/red-large.png index 88d9bf8d..5e03f141 100644 Binary files a/plugins/jetpack/_inc/images/rss/red-large.png and b/plugins/jetpack/_inc/images/rss/red-large.png differ diff --git a/plugins/jetpack/_inc/images/rss/red-medium.png b/plugins/jetpack/_inc/images/rss/red-medium.png index 838db55b..d01e0d8d 100644 Binary files a/plugins/jetpack/_inc/images/rss/red-medium.png and b/plugins/jetpack/_inc/images/rss/red-medium.png differ diff --git a/plugins/jetpack/_inc/images/rss/red-small.png b/plugins/jetpack/_inc/images/rss/red-small.png index 85fd61c6..d42b135d 100644 Binary files a/plugins/jetpack/_inc/images/rss/red-small.png and b/plugins/jetpack/_inc/images/rss/red-small.png differ diff --git a/plugins/jetpack/_inc/images/rss/silver-large.png b/plugins/jetpack/_inc/images/rss/silver-large.png index af67da9d..d10b8849 100644 Binary files a/plugins/jetpack/_inc/images/rss/silver-large.png and b/plugins/jetpack/_inc/images/rss/silver-large.png differ diff --git a/plugins/jetpack/_inc/images/rss/silver-medium.png b/plugins/jetpack/_inc/images/rss/silver-medium.png index 5559c8c2..34552319 100644 Binary files a/plugins/jetpack/_inc/images/rss/silver-medium.png and b/plugins/jetpack/_inc/images/rss/silver-medium.png differ diff --git a/plugins/jetpack/_inc/images/rss/silver-small.png b/plugins/jetpack/_inc/images/rss/silver-small.png index 4a41080d..ef8be0eb 100644 Binary files a/plugins/jetpack/_inc/images/rss/silver-small.png and b/plugins/jetpack/_inc/images/rss/silver-small.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/beautifulmath.png b/plugins/jetpack/_inc/images/screenshots/beautifulmath.png index eaf8d1d4..3599a425 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/beautifulmath.png and b/plugins/jetpack/_inc/images/screenshots/beautifulmath.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/carousel.png b/plugins/jetpack/_inc/images/screenshots/carousel.png index 5bcc94cd..bc56e4da 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/carousel.png and b/plugins/jetpack/_inc/images/screenshots/carousel.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/comments.png b/plugins/jetpack/_inc/images/screenshots/comments.png index 86f6530c..04f37ba9 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/comments.png and b/plugins/jetpack/_inc/images/screenshots/comments.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/contactform.png b/plugins/jetpack/_inc/images/screenshots/contactform.png index b41760b4..02934a50 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/contactform.png and b/plugins/jetpack/_inc/images/screenshots/contactform.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/custom-css.png b/plugins/jetpack/_inc/images/screenshots/custom-css.png index 4be5cb22..1e35ad48 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/custom-css.png and b/plugins/jetpack/_inc/images/screenshots/custom-css.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/hovercards.png b/plugins/jetpack/_inc/images/screenshots/hovercards.png index 63977a5b..12205492 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/hovercards.png and b/plugins/jetpack/_inc/images/screenshots/hovercards.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/likes.png b/plugins/jetpack/_inc/images/screenshots/likes.png index 1c7670a3..9f5404ac 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/likes.png 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 index 94ca6dd6..d09d3915 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/mobile-push-notifications.jpg and b/plugins/jetpack/_inc/images/screenshots/mobile-push-notifications.jpg differ diff --git a/plugins/jetpack/_inc/images/screenshots/notes.png b/plugins/jetpack/_inc/images/screenshots/notes.png index 4506db17..bf3a6b99 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/notes.png 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 index b114088c..e63e9a7b 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/post-by-email.png 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 index 428b886c..8cf9ede5 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/publicize.png and b/plugins/jetpack/_inc/images/screenshots/publicize.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/sharing.png b/plugins/jetpack/_inc/images/screenshots/sharing.png index 9c36d17b..0949b5e4 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/sharing.png and b/plugins/jetpack/_inc/images/screenshots/sharing.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/shortcodes.png b/plugins/jetpack/_inc/images/screenshots/shortcodes.png index 8bff1d6d..5434e120 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/shortcodes.png and b/plugins/jetpack/_inc/images/screenshots/shortcodes.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/shortlinks.png b/plugins/jetpack/_inc/images/screenshots/shortlinks.png index 2de84771..bfc99cfa 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/shortlinks.png and b/plugins/jetpack/_inc/images/screenshots/shortlinks.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/spelling.png b/plugins/jetpack/_inc/images/screenshots/spelling.png index a6986d4f..b28142e5 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/spelling.png and b/plugins/jetpack/_inc/images/screenshots/spelling.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/stats.png b/plugins/jetpack/_inc/images/screenshots/stats.png index 836c1392..ceb3fbed 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/stats.png and b/plugins/jetpack/_inc/images/screenshots/stats.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/subscriptions.png b/plugins/jetpack/_inc/images/screenshots/subscriptions.png index a1c55630..113800b2 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/subscriptions.png and b/plugins/jetpack/_inc/images/screenshots/subscriptions.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/tiled-gallery.png b/plugins/jetpack/_inc/images/screenshots/tiled-gallery.png index 8168590d..0da99eee 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/tiled-gallery.png and b/plugins/jetpack/_inc/images/screenshots/tiled-gallery.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/vaultpress.png b/plugins/jetpack/_inc/images/screenshots/vaultpress.png index f1f80c70..64645bc8 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/vaultpress.png and b/plugins/jetpack/_inc/images/screenshots/vaultpress.png differ diff --git a/plugins/jetpack/_inc/images/screenshots/widgets.png b/plugins/jetpack/_inc/images/screenshots/widgets.png index e0749c62..ad609ae9 100644 Binary files a/plugins/jetpack/_inc/images/screenshots/widgets.png and b/plugins/jetpack/_inc/images/screenshots/widgets.png differ diff --git a/plugins/jetpack/_inc/images/stars-2x.png b/plugins/jetpack/_inc/images/stars-2x.png index a370aaf6..503c83a0 100644 Binary files a/plugins/jetpack/_inc/images/stars-2x.png and b/plugins/jetpack/_inc/images/stars-2x.png differ diff --git a/plugins/jetpack/_inc/images/status-light-2x.png b/plugins/jetpack/_inc/images/status-light-2x.png index adff4979..461d9874 100644 Binary files a/plugins/jetpack/_inc/images/status-light-2x.png and b/plugins/jetpack/_inc/images/status-light-2x.png differ diff --git a/plugins/jetpack/_inc/images/status-light.png b/plugins/jetpack/_inc/images/status-light.png index 9a6665c5..c9ffb7bb 100644 Binary files a/plugins/jetpack/_inc/images/status-light.png and b/plugins/jetpack/_inc/images/status-light.png differ diff --git a/plugins/jetpack/_inc/images/tb-close-2x.png b/plugins/jetpack/_inc/images/tb-close-2x.png index 9f5f6b63..9530278d 100644 Binary files a/plugins/jetpack/_inc/images/tb-close-2x.png and b/plugins/jetpack/_inc/images/tb-close-2x.png differ diff --git a/plugins/jetpack/_inc/jetpack-retina.css b/plugins/jetpack/_inc/jetpack-retina.css index c5c69ff8..295f6caa 100644 --- a/plugins/jetpack/_inc/jetpack-retina.css +++ b/plugins/jetpack/_inc/jetpack-retina.css @@ -1,5 +1,9 @@ /* Retina core icons */ -@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) { +@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) { + /* TinyMCE buttons */ .wp_themeSkin .mceToolbar span.mce_undo, .wp_themeSkin .mceToolbar span.mce_redo, @@ -36,7 +40,7 @@ .wp_themeSkin .mceToolbar .mceSplitButton .mce_forecolor span.mce_forecolor, .wp_themeSkin .mceToolbar .mceSplitButton span.mce_numlist, .wp_themeSkin .mceToolbar .mceSplitButton span.mce_bullist { - background-image: url('images/wpicons-2x.png'); + background-image: url(images/wpicons-2x.png); background-size: 560px 40px; } @@ -44,7 +48,7 @@ .view-switch .current #view-switch-list, .view-switch #view-switch-excerpt, .view-switch .current #view-switch-excerpt { - background-image: url('images/list-2x.png'); + background-image: url(images/list-2x.png); background-size: 80px 20px; } @@ -55,74 +59,76 @@ .imgedit-fliph, .imgedit-undo, .imgedit-redo { - background-image: url('images/imgedit-icons-2x.png'); + background-image: url(images/imgedit-icons-2x.png); background-size: 260px 64px; } /* Welcome screen close button */ .welcome-panel .welcome-panel-close:before { - background-image: url('images/xit-2x.gif'); + background-image: url(images/xit-2x.gif); background-size: 20px 10px; } /* Dismiss tag buttons */ - .tagchecklist span a, #bulk-titles div a { - background-image: url('images/xit-2x.gif') !important; + .tagchecklist span a, + #bulk-titles div a { + background-image: url(images/xit-2x.gif) !important; background-size: 20px 10px !important; } - .tagchecklist span a:hover, #bulk-titles div a:hover { - background-image: url('images/xit-2x.gif') !important; + .tagchecklist span a:hover, + #bulk-titles div a:hover { + background-image: url(images/xit-2x.gif) !important; background-size: 20px 10px !important; } /* Pointer dismiss button */ .wp-pointer-buttons a.close::before { - background-image: url('images/xit-2x.gif'); - background-size: 20px 10px; + background-image: url(images/xit-2x.gif); + background-size: 20px 10px; } /* Pointer icon */ .wp-pointer-content h3::before { - background-image: url('images/icon-pointer-flag-2x.png'); + background-image: url(images/icon-pointer-flag-2x.png); background-size: 36px 37px; } /* Pointer arrow */ .wp-pointer-arrow { - background-image: url('images/arrow-pointer-blue-2x.png') !important; + background-image: url(images/arrow-pointer-blue-2x.png) !important; background-size: 30px 60px !important; } /* Screen options links */ #screen-meta-links a.show-settings { - background-image: url('images/arrows-2x.png') !important; + background-image: url(images/arrows-2x.png) !important; background-size: 15px 123px !important; } body.admin-color-classic #screen-meta-links a.show-settings { - background-image: url('images/arrows-vs-2x.png') !important; + background-image: url(images/arrows-vs-2x.png) !important; } - + /* Collapse button divs */ #collapse-button div { - background-image: url('images/arrows-2x.png') !important; + background-image: url(images/arrows-2x.png) !important; background-size: 15px 123px !important; } body.admin-color-classic #collapse-button div { - background-image: url('images/arrows-vs-2x.png') !important; + background-image: url(images/arrows-vs-2x.png) !important; } /* Metabox handle arrows */ .meta-box-sortables .postbox:hover .handlediv { - background-image: url('images/arrows-2x.png') !important; + background-image: url(images/arrows-2x.png) !important; background-size: 15px 123px !important; } body.admin-color-classic .meta-box-sortables .postbox:hover .handlediv { - background-image: url('images/arrows-vs-2x.png') !important; + background-image: url(images/arrows-vs-2x.png) !important; } /* Date button */ .curtime #timestamp { - background-image: url('images/date-button-2x.gif') !important; + background-image: url(images/date-button-2x.gif) !important; background-size: 16px 16px; display: inline-block; height: 16px; @@ -133,77 +139,88 @@ padding-top: 12px; height: 0; width: 12px; - background: transparent url('images/comment-grey-bubble-2x.png') no-repeat center center; + background: transparent url(images/comment-grey-bubble-2x.png) no-repeat center center; background-size: 12px 12px; } .post-com-count { - background-image: url('images/bubble_bg-2x.png') !important; + background-image: url(images/bubble_bg-2x.png) !important; background-size: 18px 100px; } /* Post sorting indicator */ .sorting-indicator { - background-image: url('images/sort-2x.gif'); + background-image: url(images/sort-2x.gif); background-size: 14px 4px; } /* Widget arrows */ .sidebar-name-arrow { - background-image: url('images/arrows-2x.png') !important; + background-image: url(images/arrows-2x.png) !important; background-size: 15px 123px !important; } + body.admin-color-classic .sidebar-name-arrow { - background-image: url('images/arrows-vs-2x.png') !important; + background-image: url(images/arrows-vs-2x.png) !important; } + .sidebar-name:hover .sidebar-name-arrow { - background-image: url('images/arrows-dark-2x.png') !important; + background-image: url(images/arrows-dark-2x.png) !important; } + body.admin-color-classic .sidebar-name:hover .sidebar-name-arrow { - background-image: url('images/arrows-dark-vs-2x.png') !important; + background-image: url(images/arrows-dark-vs-2x.png) !important; } + .widget-top a.widget-action { - background-image: url('images/arrows-2x.png') !important; + background-image: url(images/arrows-2x.png) !important; background-size: 15px 123px !important; } + body.admin-color-classic .widget-top a.widget-action { - background-image: url('images/arrows-vs-2x.png') !important; + background-image: url(images/arrows-vs-2x.png) !important; } + .widget-top a.widget-action:hover { - background-image: url('images/arrows-dark-2x.png') !important; + background-image: url(images/arrows-dark-2x.png) !important; } + body.admin-color-classic .widget-top a.widget-action:hover { - background-image: url('images/arrows-dark-vs-2x.png') !important; + background-image: url(images/arrows-dark-vs-2x.png) !important; } /* Menu editor item arrows */ .item-edit { - background-image: url('images/arrows-2x.png') !important; + background-image: url(images/arrows-2x.png) !important; background-size: 15px 123px !important; } + body.admin-color-classic .item-edit { - background-image: url('images/arrows-vs-2x.png') !important; + background-image: url(images/arrows-vs-2x.png) !important; } + .item-edit:hover { - background-image: url('images/arrows-dark-2x.png') !important; + background-image: url(images/arrows-dark-2x.png) !important; background-size: 15px 123px !important; } + body.admin-color-classic .item-edit:hover { - background-image: url('images/arrows-dark-vs-2x.png') !important; + background-image: url(images/arrows-dark-vs-2x.png) !important; } /* Plugin install star ratings */ div.star-holder { - background-image: url('images/stars-2x.png'); + background-image: url(images/stars-2x.png); background-size: 21px 37px; } + div.star-holder .star-rating { - background-image: url('images/stars-2x.png'); + background-image: url(images/stars-2x.png); background-size: 21px 37px; } /* Press This bookmarklet icon */ .pressthis a span { - background-image: url('images/press-this-2x.png'); + background-image: url(images/press-this-2x.png); background-size: 24px 20px; } @@ -212,7 +229,7 @@ padding-top: 15px; width: 15px; height: 0; - background: url('images/media-button-2x.png') no-repeat center center; + background: url(images/media-button-2x.png) no-repeat center center; background-size: 15px 15px; } @@ -221,28 +238,28 @@ padding-top: 20px; width: 20px; height: 0; - background: url('images/atdbuttontr-2x.png') no-repeat center center; + background: url(images/atdbuttontr-2x.png) no-repeat center center; background-size: 20px 20px; } /* Resize editor */ #post-body .wp_themeSkin .mceStatusbar a.mceResize { - background-image: url('images/resize-2x.gif') !important; + background-image: url(images/resize-2x.gif) !important; background-size: 11px 11px !important; } /* MCE dropdowns */ .wp_themeSkin .mceListBox .mceOpen span, .wp_themeSkin .mceSplitButton a.mceOpen { - background-image: url("images/down_arrow-2x.gif") !important; + background-image: url(images/down_arrow-2x.gif) !important; background-size: 10px 20px; } - + /* Img overlay buttons */ #wp_editimgbtn, #wp_delimgbtn, #wp_editgallery, #wp_delgallery { padding-top: 24px !important; height: 0; width: 24px; - background: url("images/delete-2x.png") no-repeat center center !important; + background: url(images/delete-2x.png) no-repeat center center !important; background-size: 24px 24px; } @@ -254,40 +271,40 @@ } #wp_editimgbtn, #wp_editgallery { - background: #eee url("images/image-2x.png") no-repeat center center !important; + background: #eee url(images/image-2x.png) no-repeat center center !important; } #wp_delimgbtn, #wp_delgallery { - background: #eee url("images/delete-2x.png") no-repeat center center !important; + background: #eee url(images/delete-2x.png) no-repeat center center !important; } - + /* AJAX loading spinners */ img.ajax-loading, img.ajax-feedback { width: 16px; height: 0; padding-top: 19px !important; - background: url("images/wpspin_light-2x.gif") no-repeat center center !important; + background: url(images/wpspin_light-2x.gif) no-repeat center center !important; background-size: 16px 16px; } /* Align buttons (in image properties in the media library) */ .image-align-none-label { - background: url('images/align-none-2x.png') no-repeat center left; + background: url(images/align-none-2x.png) no-repeat center left; background-size: 21px 15px; } .image-align-left-label { - background: url('images/align-left-2x.png') no-repeat center left; + background: url(images/align-left-2x.png) no-repeat center left; background-size: 22px 15px; } .image-align-center-label { - background: url('images/align-center-2x.png') no-repeat center left; + background: url(images/align-center-2x.png) no-repeat center left; background-size: 21px 15px; } .image-align-right-label { - background: url('images/align-right-2x.png') no-repeat center left; + background: url(images/align-right-2x.png) no-repeat center left; background-size: 22px 15px; } @@ -345,88 +362,88 @@ /* Uploader close button */ #TB_closeWindowButton img { - background: url('images/tb-close-2x.png') no-repeat center center; + background: url(images/tb-close-2x.png) no-repeat center center; padding-top: 15px; width: 15px; height: 0; background-size: 15px 15px; } - td.media-icon img[src$='wp-includes/images/crystal/archive.png'], - td.A1B1 img[src$='wp-includes/images/crystal/archive.png'] { - background: url('images/archive-2x.png') no-repeat center center; + td.media-icon img[src$="wp-includes/images/crystal/archive.png"], + td.A1B1 img[src$="wp-includes/images/crystal/archive.png"] { + background: url(images/archive-2x.png) no-repeat center center; padding-top: 60px; width: 46px; height: 0; background-size: 46px 60px; } - td.media-icon img[src$='wp-includes/images/crystal/audio.png'], - td.A1B1 img[src$='wp-includes/images/crystal/audio.png'] { - background: url('images/audio-2x.png') no-repeat center center; + td.media-icon img[src$="wp-includes/images/crystal/audio.png"], + td.A1B1 img[src$="wp-includes/images/crystal/audio.png"] { + background: url(images/audio-2x.png) no-repeat center center; padding-top: 60px; width: 46px; height: 0; background-size: 46px 60px; } - td.media-icon img[src$='wp-includes/images/crystal/code.png'], - td.A1B1 img[src$='wp-includes/images/crystal/code.png'] { - background: url('images/code-2x.png') no-repeat center center; + td.media-icon img[src$="wp-includes/images/crystal/code.png"], + td.A1B1 img[src$="wp-includes/images/crystal/code.png"] { + background: url(images/code-2x.png) no-repeat center center; padding-top: 60px; width: 46px; height: 0; background-size: 46px 60px; } - td.media-icon img[src$='wp-includes/images/crystal/default.png'], - td.A1B1 img[src$='wp-includes/images/crystal/default.png'] { - background: url('images/default-2x.png') no-repeat center center; + td.media-icon img[src$="wp-includes/images/crystal/default.png"], + td.A1B1 img[src$="wp-includes/images/crystal/default.png"] { + background: url(images/default-2x.png) no-repeat center center; padding-top: 60px; width: 46px; height: 0; background-size: 46px 60px; } - td.media-icon img[src$='wp-includes/images/crystal/document.png'], - td.A1B1 img[src$='wp-includes/images/crystal/document.png'] { - background: url('images/document-2x.png') no-repeat center center; + td.media-icon img[src$="wp-includes/images/crystal/document.png"], + td.A1B1 img[src$="wp-includes/images/crystal/document.png"] { + background: url(images/document-2x.png) no-repeat center center; padding-top: 60px; width: 46px; height: 0; background-size: 46px 60px; } - td.media-icon img[src$='wp-includes/images/crystal/interactive.png'], - td.A1B1 img[src$='wp-includes/images/crystal/interactive.png'] { - background: url('images/interactive-2x.png') no-repeat center center; + td.media-icon img[src$="wp-includes/images/crystal/interactive.png"], + td.A1B1 img[src$="wp-includes/images/crystal/interactive.png"] { + background: url(images/interactive-2x.png) no-repeat center center; padding-top: 60px; width: 46px; height: 0; background-size: 46px 60px; } - td.media-icon img[src$='wp-includes/images/crystal/spreadsheet.png'], - td.A1B1 img[src$='wp-includes/images/crystal/spreadsheet.png'] { - background: url('images/spreadsheet-2x.png') no-repeat center center; + td.media-icon img[src$="wp-includes/images/crystal/spreadsheet.png"], + td.A1B1 img[src$="wp-includes/images/crystal/spreadsheet.png"] { + background: url(images/spreadsheet-2x.png) no-repeat center center; padding-top: 60px; width: 46px; height: 0; background-size: 46px 60px; } - td.media-icon img[src$='wp-includes/images/crystal/text.png'], - td.A1B1 img[src$='wp-includes/images/crystal/text.png'] { - background: url('images/text-2x.png') no-repeat center center; + td.media-icon img[src$="wp-includes/images/crystal/text.png"], + td.A1B1 img[src$="wp-includes/images/crystal/text.png"] { + background: url(images/text-2x.png) no-repeat center center; padding-top: 60px; width: 46px; height: 0; background-size: 46px 60px; } - td.media-icon img[src$='wp-includes/images/crystal/video.png'], - td.A1B1 img[src$='wp-includes/images/crystal/video.png'] { - background: url('images/video-2x.png') no-repeat center center; + td.media-icon img[src$="wp-includes/images/crystal/video.png"], + td.A1B1 img[src$="wp-includes/images/crystal/video.png"] { + background: url(images/video-2x.png) no-repeat center center; padding-top: 60px; width: 46px; height: 0; @@ -434,23 +451,23 @@ } .farbtastic .marker { - background-image: url('images/marker-2x.png'); + background-image: url(images/marker-2x.png); background-size: 17px 17px; } .farbtastic .wheel { - background-image: url('images/wheel-2x.png'); + background-image: url(images/wheel-2x.png); background-size: 195px 195px; } .farbtastic .overlay { - background-image: url('images/mask-2x.png'); + background-image: url(images/mask-2x.png); background-size: 101px 101px; } /* Generic admin menu icon */ - #adminmenu img[src$='wp-admin/images/generic.png'] { - background: url('images/generic-2x.png') no-repeat center center; + #adminmenu img[src$="wp-admin/images/generic.png"] { + background: url(images/generic-2x.png) no-repeat center center; padding-top: 25px; width: 16px; height: 0; @@ -463,7 +480,7 @@ .clearlooks2 .mceMed, .clearlooks2 .mceMax, .wp-dialog .ui-dialog-titlebar-close { - background-image: url('images/buttons-2x.gif') !important; + background-image: url(images/buttons-2x.gif) !important; background-size: 116px 48px !important; } } diff --git a/plugins/jetpack/_inc/jetpack-rtl.css b/plugins/jetpack/_inc/jetpack-rtl.css index 45c676b4..f1fad500 100644 --- a/plugins/jetpack/_inc/jetpack-rtl.css +++ b/plugins/jetpack/_inc/jetpack-rtl.css @@ -1,128 +1,120 @@ - #jp-header #jp-clouds { - background-position: -632px 100%; - } - #jp-header.small #jp-clouds { - background-position: -425px 100%; - } - - #jp-header #jp-clouds #jp-disconnect { - float: left; - margin: -35px 0 0 25px; - text-align: left; - } - - #jp-header #jp-clouds #jp-disconnect a { - background-position: 100% 90%; - padding: 4px 30px 3px 10px; - } - #jp-header #jp-clouds #jp-disconnect a:hover { - background-position: 100% 3%; - } - - #jp-header h3 { - background-position: top right; - right: 25px; - left: auto; - } - - #jp-header p { - right: 390px; - left: auto; - text-align: right; - } - - #jp-info { - margin: 0 28px 0 12px; - } - - #jp-info p { - float:right; - } - - #jp-info a.jp-button { - float: left; - margin: 8px 20px 0 0; - } - - .jp-connect { padding: 10px 0 5px !important; } - - #jetpack-settings > .jetpack-message { margin: 10px 15px 10px 13px } - - .jetpack-message .squeezer { - text-align: right; - } - .jetpack-message h4 { - margin: 0 0 10px 10px; - } - - .more-info { - margin: 0 15px 5px 12px; - background: transparent url( images/header-clouds-sm.png ) bottom right repeat-x; - } - .more-info .jp-close { - left: 0; - right: auto; - padding: 0 6px 0 4px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - -moz-border-radius-topright: 0; - -moz-border-radius-bottomright: 0; - -webkit-border-top-left-radius: 0; - -webkit-border-bottom-left-radius: 0; - border-top-left-radius: 0; - border-bottom-left-radius: 0; - } - - .more-info div.jp-info-img { - float: left; - margin: 0 20px 0 30px; - } - +#jp-header #jp-clouds { + background-position: -632px 100%; +} + +#jp-header.small #jp-clouds { + background-position: -425px 100%; +} + +#jp-header #jp-clouds #jp-disconnect { + float: left; + margin: -35px 0 0 25px; + text-align: left; +} + +#jp-header #jp-clouds #jp-disconnect a { + background-position: 100% 90%; + padding: 4px 30px 3px 10px; +} + +#jp-header #jp-clouds #jp-disconnect a:hover { + background-position: 100% 3%; +} + +#jp-header h3 { + background-position: top right; + right: 25px; + left: auto; +} + +#jp-header p { + right: 390px; + left: auto; + text-align: right; +} + +#jp-info { + margin: 0 28px 0 12px; +} + +#jp-info p { + float:right; +} + +#jp-info a.jp-button { + float: left; + margin: 8px 20px 0 0; +} + +.jp-connect { + padding: 10px 0 5px !important; +} + +#jetpack-settings > .jetpack-message { + margin: 10px 15px 10px 13px; +} + +.jetpack-message .squeezer { + text-align: right; +} + +.jetpack-message h4 { + margin: 0 0 10px 10px; +} + +.more-info { + margin: 0 15px 5px 12px; + background: transparent url(images/header-clouds-sm.png) bottom right repeat-x; +} + +.more-info .jp-close { + left: 0; + right: auto; + padding: 0 6px 0 4px; + border-radius: 3px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.more-info div.jp-info-img { + float: left; + margin: 0 20px 0 30px; +} + .jetpack-module { float: right; margin: 0 15px 15px 0; padding: 15px 15px 35px 0; } - .jetpack-module div.module-image { - float: left; - margin: 0 10px 5px 0; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; - -webkit-border-top-right-radius: 5px; - -moz-border-radius-topleft: 5px; - border-top-right-radius: 5px; - -webkit-border-bottom-right-radius: 5px; - -moz-border-radius-bottomleft: 5px; - border-bottom-right-radius: 5px; - } - - .jetpack-module div.module-image p { - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; - -webkit-border-bottom-right-radius: 5px; - -moz-border-radius-bottomleft: 5px; - border-bottom-right-radius: 5px; - } - - - .jetpack-module .jetpack-module-actions { - right: 15px; - left: auto; - } - - .placeholder h3 { - margin-left: 15px; - margin-right: auto; - } - - #jp-footer .automattic { - padding-right: 3px; - padding-left: 0; - } - - #jp-footer .automattic span { - margin: 0 1px 0 5px; - } + +.jetpack-module div.module-image { + float: left; + margin: 0 10px 5px 0; + border-radius: 0; + border-top-right-radius: 5px; + border-bottom-right-radius: 5px; +} + +.jetpack-module div.module-image p { + border-radius: 0; + border-bottom-right-radius: 5px; +} + +.jetpack-module .jetpack-module-actions { + right: 15px; + left: auto; +} + +.placeholder h3 { + margin-left: 15px; + margin-right: auto; +} + +#jp-footer .automattic { + padding-right: 3px; + padding-left: 0; +} + +#jp-footer .automattic span { + margin: 0 1px 0 5px; +} diff --git a/plugins/jetpack/_inc/jetpack.css b/plugins/jetpack/_inc/jetpack.css index b684f7c7..9c2c977d 100644 --- a/plugins/jetpack/_inc/jetpack.css +++ b/plugins/jetpack/_inc/jetpack.css @@ -1,439 +1,566 @@ +/* + * Consolidate the font-family declarations: + */ + +#jp-header p, +#jp-info a.jp-button, +.jetpack-message h4, +.jetpack-message h5, +.jetpack-message p a.button-primary, +.jetpack-activated h3, +.jetpack-activated p, +.jetpack-module div.module-image p, +.jetpack-module h3, +.jetpack-module .jetpack-module-actions a, +#jp-settings-screen h3, +.jp-survey h4, +.jetpack-install-container p a.button-connector { + font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", Verdana, "Bitstream Vera Sans", sans-serif; +} + +#jp-info p, +.more-info p, +.more-info ul, +.jetpack-module-description p { + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; +} + +/* + * Jetpack: + */ + +/* Force the menu not to be sticky, so we can color the arrow. */ +.toplevel_page_jetpack.admin-color-mp6.sticky-menu #adminmenuwrap, +body[class*=" jetpack_page_jetpack_"].admin-color-mp6.sticky-menu #adminmenuwrap { + position: relative; + z-index: auto; + top: 0; +} + +.toplevel_page_jetpack.admin-color-mp6 ul#adminmenu a.wp-has-current-submenu:after, +.toplevel_page_jetpack.admin-color-mp6 ul#adminmenu > li.current > a.current:after, +body[class*=" jetpack_page_jetpack_"].admin-color-mp6 ul#adminmenu a.wp-has-current-submenu:after, +body[class*=" jetpack_page_jetpack_"].admin-color-mp6 ul#adminmenu > li.current > a.current:after { + border-right-color:#8fad4b; +} + +.toplevel_page_jetpack.jetpack-disconnected #wpwrap, +body[class*=" jetpack_page_jetpack_"].jetpack-disconnected #wpwrap { + background: url(images/header-clouds.png) -150px -60px repeat-x; +} + +.toplevel_page_jetpack.jetpack-disconnected.admin-color-mp6 #wpwrap, +body[class*=" jetpack_page_jetpack_"].jetpack-disconnected.admin-color-mp6 #wpwrap { + background-position: -143px -60px; +} + +.toplevel_page_jetpack.jetpack-disconnected.folded #wpwrap, +body[class*=" jetpack_page_jetpack_"].jetpack-disconnected.folded #wpwrap { + background-position: -263px -60px; +} + +.toplevel_page_jetpack.jetpack-disconnected.admin-color-mp6.folded #wpwrap, +body[class*=" jetpack_page_jetpack_"].jetpack-disconnected.admin-color-mp6.folded #wpwrap { + background-position: -257px -60px; +} + +.toplevel_page_jetpack.jetpack-connected #wpwrap, +body[class*=" jetpack_page_jetpack_"].jetpack-connected #wpwrap { + background: url(images/header-clouds-small.png) 45px 0 repeat-x; +} + +.toplevel_page_jetpack.jetpack-connected.admin-color-mp6 #wpwrap, +body[class*=" jetpack_page_jetpack_"].jetpack-connected.admin-color-mp6 #wpwrap { + background-position: 52px 0; +} + +.toplevel_page_jetpack.jetpack-connected.folded #wpwrap, +body[class*=" jetpack_page_jetpack_"].jetpack-connected.folded #wpwrap { + background-position: -68px 0; +} + +.toplevel_page_jetpack.jetpack-connected.admin-color-mp6.folded #wpwrap, +body[class*=" jetpack_page_jetpack_"].jetpack-connected.admin-color-mp6.folded #wpwrap { + background-position: -62px 0; +} + +@media only screen and (max-width: 900px) { + + .toplevel_page_jetpack.jetpack-disconnected.auto-fold #wpwrap, + body[class*=" jetpack_page_jetpack_"].jetpack-disconnected.auto-fold #wpwrap { + background-position: -263px -60px; + } + + .toplevel_page_jetpack.jetpack-disconnected.admin-color-mp6.auto-fold #wpwrap, + body[class*=" jetpack_page_jetpack_"].jetpack-disconnected.admin-color-mp6.auto-fold #wpwrap { + background-position: -257px -60px; + } + + .toplevel_page_jetpack.jetpack-connected.auto-fold #wpwrap, + body[class*=" jetpack_page_jetpack_"].jetpack-connected.auto-fold #wpwrap { + background-position: -68px 0; + } + + .toplevel_page_jetpack.jetpack-connected.admin-color-mp6.auto-fold #wpwrap, + body[class*=" jetpack_page_jetpack_"].jetpack-connected.admin-color-mp6.auto-fold #wpwrap { + background-position: -62px 0; + } + +} + +.toplevel_page_jetpack.screen-meta-wrap { + position: absolute; + top: 0; + width: 100%; + z-index: 2; +} + #jp-header { min-width: 741px; z-index: 0; margin: 30px 0 -30px 0; } - #jp-header.small { - margin-bottom: 50px; + +#jp-header.small { + margin: 20px 0 50px; +} + +#jp-header #jp-clouds { + position: relative; + padding-top: 110px; +} + +#jp-header.small #jp-clouds { + padding: 50px 0 0 0; + height: 70px; +} + +#jp-header #jp-clouds #jp-disconnectors { + font-size: 12px; + color: #fff; + float: right; + margin-top: -35px; + text-align: left; + position: relative; + left: -45px; +} + +#jp-header #jp-clouds .jp-disconnect a { + background: #8caa46 url(images/status-light.png) 3px 85% no-repeat; + display: inline-block; + position: relative; + width: 100%; + height: 1.7em; + overflow: hidden; + padding: 4px 0 3px 30px; + margin: 0 -20px 3px 0; + color: #fff; + text-decoration: none; + border: 1px solid #7a943d; + border-radius: 5px; + box-shadow: inset 0 0 2px rgba(255, 255, 255, 0.4); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3); +} + +#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 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) { + + .toplevel_page_jetpack.jetpack-disconnected #wpwrap, + body[class*=" jetpack_page_jetpack_"].jetpack-disconnected #wpwrap { + background-image: url(images/header-clouds-2x.png); + background-size: 1600px 400px; } - #jp-header #jp-clouds { - position: relative; - background: transparent url( images/header-clouds.png ) -315px 100% repeat-x; - padding-top: 110px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; + .toplevel_page_jetpack.jetpack-connected #wpwrap, + body[class*=" jetpack_page_jetpack_"].jetpack-connected #wpwrap { + background-image: url(images/header-clouds-small-2x.png); + background-size: 980px 140px; } - #jp-header.small #jp-clouds { - background: transparent url( images/header-clouds-small.png ) -120px 100% repeat-x; - padding: 50px 0 0 0; - height: 70px; - } - - - #jp-header #jp-clouds #jp-disconnectors { - font-size: 12px; - color: #fff; - float: right; - margin-top: -35px; - text-align: left; - position: relative; - left: -45px; - } - - #jp-header #jp-clouds .jp-disconnect a { - background: #8caa46 url( images/status-light.png ) 3px 85% no-repeat; - display: inline-block; - position: relative; - width: 100%; - height: 1.7em; - overflow: hidden; - padding: 4px 0 3px 30px; - margin: 0 -20px 3px 0; - color: #fff; - text-decoration: none; - border: 1px solid #7a943d; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - -moz-box-shadow: inset 0 0 2px rgba( 255, 255, 255, 0.4 ); - -webkit-box-shadow: inset 0 0 2px rgba( 255, 255, 255, 0.4 ); - 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 -2% no-repeat; - background-color: #839f40; - border-color: #6a8037; - } - - #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 { - background: transparent url( images/header-clouds-2x.png ) -315px 100% repeat-x; - background-size:1600px 400px; - } - #jp-header.small #jp-clouds { - background: transparent url( images/header-clouds-small-2x.png ) -120px 100% repeat-x; - background-size:980px 140px; - } - - #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 -2% no-repeat; - background-size:25px 57px; - } + + #jp-header #jp-clouds .jp-disconnect a { + background-image: url(images/status-light-2x.png); + background-size: 25px 57px; + } + + #jp-header #jp-clouds .jp-disconnect a:hover { + background-image: url(images/status-light-2x.png); + background-size: 25px 57px; } +} + +#jp-header h3 { + position: relative; + background: transparent url(images/logo.png) top left no-repeat; + width: 252px; + height: 200px; + overflow: hidden; + text-indent: -999em; + top: -95px; + left: 25px; + margin: 0; + padding: 0; +} + +#jp-header.small h3 { + background: transparent url(images/logo-small.png) top left no-repeat; + width: 149px; + 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 { - position: relative; - background: transparent url( images/logo.png ) top left no-repeat; - width: 252px; - height: 200px; - overflow: hidden; - text-indent: -999em; - top: -95px; - left: 25px; - margin: 0; - padding: 0; + background-image: url(images/logo-2x.png); + background-size: 250px 200px; } - #jp-header.small h3 { - background: transparent url( images/logo-small.png ) top left no-repeat; - width: 149px; - 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 { - background: transparent url( images/logo-2x.png ) top left no-repeat; - background-size:250px 200px; - } - #jp-header.small h3 { - background: transparent url( images/logo-small-2x.png ) top left no-repeat; - background-size:150px 120px; - } + + #jp-header.small h3 { + background-image: url(images/logo-small-2x.png); + background-size: 150px 120px; } +} +#jp-header p { + position: absolute; + left: 390px; + text-align: left; + top: 30px; + width: 48%; + color: #fff; + font-size: 25px; + line-height: 130%; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); + -webkit-font-smoothing: antialiased; +} - #jp-header p { - position: absolute; - left: 390px; - text-align: left; - top: 30px; - width: 48%; - color: #fff; - font-size: 25px; - line-height: 130%; - text-shadow: 0px 1px 1px rgba(0,0,0,0.5); - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - -webkit-font-smoothing: antialiased; - } +#jp-info { + position: relative; + overflow: visible; + z-index: 50; + margin: 0 12px 0 28px; + min-width: 780px; +} - #jp-info { - position: relative; - overflow: visible; - z-index: 50; - margin: 0 12px 0 28px; - min-width: 780px; - } +#jp-info p { + font-size: 17px; + line-height: 150%; + text-shadow: 0 1px 0 #fff; + color: #666; + margin: 0 0 40px; + float: left; + width: 58%; +} - #jp-info p { - font-size: 17px; - line-height: 150%; - text-shadow: 0px 1px 0px #fff; - font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; - color: #666; - margin: 0 0 40px; - float:left; - width: 58%; - } - #jp-info p.small { - font-size: 14px; - } - - #jp-info a.jp-button { - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - float: right; - margin: 8px 0 0 20px; - display: inline-block; - background: #69acce; - -moz-box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3); - -webkit-box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3); - box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3); - padding: 12px 20px; - border: 1px solid #2a8cba; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - line-height: 100%; - color: #fff; - text-align: center; - font-size: 20px; - font-weight: bold; - text-decoration: none; - text-shadow: 0px 1px 2px rgba( 0,0,0,0.5); - -webkit-transition-duration: .3s; - -moz-transition-duration: .3s; - cursor: pointer; - } - #jp-info a.jp-button:hover, #jp-info a.jp-button:active { - background-color: #f0a000; - border-color: #c87800; - -webkit-transition-duration: .3s; - outline: none; - -moz-box-shadow: inset 0 0 2px #fff, 0 1px 7px rgba(240,160,0,0.5); - -webkit-box-shadow: inset 0 0 2px #fff, 0 1px 7px rgba(240,160,0,0.5); - box-shadow: inset 0 0 2px #fff, 0 1px 7spx rgba(240,160,0,0.5); - } +#jp-info p.small { + font-size: 14px; +} + +#jp-info a.jp-button { + float: right; + margin: 8px 0 0 20px; + display: inline-block; + background: #69acce; + box-shadow: inset 0 0 2px #fff, + 0 1px 5px rgba(0, 0, 0, 0.3); + padding: 12px 20px; + border: 1px solid #2a8cba; + border-radius: 5px; + line-height: 100%; + color: #fff; + text-align: center; + font-size: 20px; + font-weight: bold; + text-decoration: none; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s; + cursor: pointer; +} + +#jp-info a.jp-button:hover, +#jp-info a.jp-button:active { + background-color: #f0a000; + border-color: #c87800; + outline: none; + box-shadow: inset 0 0 2px #fff, + 0 1px 7px rgba(240, 160, 0, 0.5); +} .jetpack-message { position: relative; z-index: 100; border: 1px solid #2a8cba !important; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; border-radius: 3px; - background: url( images/alertbox-clouds.png ) 100% 100% no-repeat; + background: url(images/alertbox-clouds.png) 100% 100% no-repeat; background-color: #6aafcf !important; - -webkit-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); - -moz-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); - box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); + box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.04); padding: 18px 90px 8px 15px !important; overflow: hidden; line-height: 180%; } /* Retina alertbox 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) { - .jetpack-message { - background: url( images/alertbox-clouds-2x.png ) 100% 100% no-repeat; - background-size:95px 55px; - } +@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-message { + background-image: url(images/alertbox-clouds-2x.png); + background-size: 95px 55px; + } + } - .jp-connect { padding: 10px 0 5px !important; } +.jp-connect { + padding: 10px 0 5px !important; +} - #jetpack-settings > .jetpack-message { margin: 10px 13px 10px 15px } +#jetpack-settings > .jetpack-message { + margin: 10px 13px 10px 15px; +} - .jetpack-message .squeezer { - max-width: 940px; - margin: 0 0 2px; - padding: 0 10px; - text-align: left; - overflow: hidden; - } - .jetpack-message h4 { - margin: 0 10px 10px 0; - font-size: 18px; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - font-weight: normal; - color: #fff; - text-shadow: 0px 1px 1px rgba(0,0,0,0.4); - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - display: inline-block; - } +.jetpack-message .squeezer { + max-width: 940px; + margin: 0 0 2px; + padding: 0 10px; + text-align: left; + overflow: hidden; +} - .jetpack-message h5 { - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - margin: 0; - } +.jetpack-message h4 { + margin: 0 10px 10px 0; + font-size: 18px; + font-weight: normal; + color: #fff; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); + border-radius: 5px; + display: inline-block; +} - .jetpack-message .squeezer a, .jetpack-message .squeezer a:visited { - color: #fff; - text-decoration: underline; - } +.jetpack-message h5 { + margin: 0; +} - .jetpack-message .squeezer a:hover { - color: #f0a000; - } +.jetpack-message .squeezer a, +.jetpack-message .squeezer a:visited { + color: #fff; + text-decoration: underline; +} - .jetpack-message code, .jetpack-err p { - background: rgba( 0,0,0,0.2 ); - font-size: 14px; - padding: 3px 5px !important; - text-shadow: 0px 1px 1px rgba(0,0,0,0.4); - color: #fff; - } +.jetpack-message .squeezer a:hover { + color: #f0a000; +} - .jetpack-message p { - margin: -1px 0 0 0 !important; - padding: 0; - display: inline-block; - } - .jetpack-err p { - overflow: hidden; - margin-bottom: 10px !important; - } - - .jetpack-message p a.button-primary { - 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; - cursor: pointer; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - } - .jetpack-message p a.button-primary:hover, .jetpack-message p a.button-primary:active { - background-color: #f0a000; - border-color: #c87800; - -webkit-transition-duration: .3s; - outline: none; - } - - .inline-message p strong { display: block; } +.jetpack-message code, .jetpack-err p { + background: rgba(0, 0, 0, 0.2); + font-size: 14px; + padding: 3px 5px !important; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4); + color: #fff; +} + +.jetpack-message p { + margin: -1px 0 0 0 !important; + padding: 0; + display: inline-block; +} + +.jetpack-err p { + overflow: hidden; + margin-bottom: 10px !important; +} + +.jetpack-message p a.button-primary { + font-size: 16px !important; + display: inline-block; + padding: 8px 15px; + color: #fff; + text-align: center; + font-size: 20px; + text-decoration: none; + border-radius: 5px; + border: 1px solid #8caa46; + background: #b4d278; + box-shadow: inset 0 0 2px #fff, + 0 1px 1px rgba(0, 0, 0, 0.1); + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3); + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s; + cursor: pointer; +} + +.jetpack-message p a.button-primary:hover, +.jetpack-message p a.button-primary:active { + background-color: #f0a000; + border-color: #c87800; + outline: none; +} + +.inline-message p strong { + display: block; +} + +.more-info { + position: relative; + top: -5px; + margin: 0 15px 5px 15px; + height: 230px; /* Have to set height otherwise slideDown() doesn't work. */ + padding-right: 15px !important; + padding-bottom: 15px; + clear: both; + overflow: visible !important; + color: #666 !important; + background: transparent url(images/module-clouds.png) bottom left repeat-x; + background-color: #f0f0f0 !important; + border-color: #dcdcdc !important; + text-shadow: 0 1px 0 #fff; + 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 { - position: relative; - top: -5px; - margin: 0 15px 5px 15px; - height: 230px; /* Have to set height otherwise slideDown() doesn't work. */ - padding-right: 15px !important; - padding-bottom: 15px; - clear: both; - overflow: visible !important; - color: #666 !important; - background: transparent url( images/module-clouds.png ) bottom left repeat-x; - background-color: #f0f0f0 !important; - border-color: #dcdcdc !important; - text-shadow: 0px 1px 0px #fff; - -webkit-box-shadow: inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 ); - -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 ); + background-image: url(images/module-clouds-2x.png); + background-size: 980px 140px; } - /* 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 { - background: transparent url( images/module-clouds-2x.png ) bottom left repeat-x; - background-size:980px 140px; - } +} + +.more-info h4 { + padding: 0; + background: none; + font-weight: normal; + color: #000; + font-size: 19px; + text-shadow: 0 1px 0 #fff; +} + +.more-info h5 { + margin-left: 0; + font-size: 12px !important; +} + +.more-info .arrow { + position: absolute; + width: 29px; + height: 18px; + top: -16px; + left: 0; + background: url(images/arrow.png) top left no-repeat; +} + +.more-info .arrow:after { + display: none; +} + +/* 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 { + background-image: url(images/arrow-2x.png); + background-size: 29px 16px; } +} + +.more-info p { + margin: 0 0 10px 0 !important; + font-size: 14px; + line-height: 150%; + display: block; +} + +.more-info ul { + font-size: 14px; + line-height: 150%; +} + +.more-info li { + list-style-type: disc; + list-style-position: inside; +} + +.more-info code { + background: rgba(0, 0, 0, 0.05); + font-size: 12px; + padding: 1px; + text-shadow: none; + color: #555; +} + +.more-info .jp-close { + position: absolute; + top: 18px; + right: 0; + background: #888; + background: rgba(0, 0, 0, 0.4); + color: #fff; + font-size: 14px !important; + height: 22px; + line-height: 20px; + padding: 0 6px 0 6px; + font-weight: bold !important; + border-radius: 3px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + cursor: pointer; + text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2); +} + +.more-info .jp-close:hover { + background: #69acce; +} + +.more-info div.jp-info-img { + float: right; + width: 320px; + margin: 0 30px 0 20px; +} - .more-info h4 { - padding: 0; - background: none; - font-weight: normal; - color: #000; - font-size: 19px; - text-shadow: 0px 1px 0px #fff; - } - - .more-info h5 { - margin-left: 0; - font-size: 12px !important; - } - .more-info .arrow { - position: absolute; - width: 29px; - height: 18px; - top: -16px; - 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 { - background: url( images/arrow-2x.png ) top left no-repeat; - background-size:29px 16px; - } - } - - .more-info p { - margin: 0 0 10px 0 !important; - font-size: 14px; - font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; - line-height: 150%; - display: block; - } - - .more-info ul { - font-size: 14px; - font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; - line-height: 150%; - } - - .more-info li { - list-style-type: disc; - list-style-position: inside; - } - - .more-info code { - background: rgba( 0,0,0,0.05 ); - font-size: 12px; - padding: 1px; - text-shadow: none; - color: #555; - } - - .more-info .jp-close { - position: absolute; - top: 18px; - right: 0; - background: #888; - background: rgba(0,0,0,0.4); - color: #fff; - font-size: 14px !important; - height: 22px; - line-height: 20px; - padding: 0 6px 0 6px; - font-weight: bold !important; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - -moz-border-radius-topright: 0; - -moz-border-radius-bottomright: 0; - -webkit-border-top-right-radius: 0; - -webkit-border-bottom-right-radius: 0; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - cursor: pointer; - text-shadow: 0 1px 0 rgba(0,0,0,0.2); - } - .more-info .jp-close:hover { - background: #69acce; - } - - .more-info div.jp-info-img { - float: right; - width: 320px; - margin: 0 30px 0 20px; - } - - .more-info img.jp-info-img { - padding: 3px; - background: rgba( 255, 255, 255, 0.65 ); - border: 5px solid #ddd; - } +.more-info img.jp-info-img { + padding: 3px; + background: rgba(255, 255, 255, 0.65); + border: 5px solid #ddd; +} .jetpack-activated { - background: #fffff5 url( images/jp-enabled-bg.jpg ) top left repeat-x !important; + background: #fffff5 url(images/jp-enabled-bg.jpg) top left repeat-x !important; height: 154px; padding: 60px 0 0 200px !important; position: relative; @@ -442,59 +569,55 @@ z-index: 5; position: relative; } - .jetpack-activated h3 { - position: relative; - z-index: 5; - color: #444; - font-size: 42px; - font-weight: bold; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - margin: 0; - padding: 0; - background: none; - display: block; - text-transform: uppercase; - } - .jetpack-activated p { - position: relative; - z-index: 3; - top: 3px; - left: 10px; - font-size: 16px; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - font-weight: normal; - color: #666; - background: rgba( 255, 255, 255, 0.75 ); - padding: 7px 10px 6px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - display: inline-block; - } - .jetpack-activated .jetpack { - position: absolute; - top: 0; - left: 0; - width: 238px; - height: 214px; - background: url( images/jp-enabled-jetpack.jpg ) top left no-repeat; - z-index: 2; - } - .jetpack-activated .clouds { - position: absolute; - right: 0; - bottom: 0; - width: 566px; - height: 214px; - background: url( images/jp-enabled-clouds.png ) bottom left no-repeat; - z-index: 0; - -webkit-border-bottom-right-radius: 5px; - -moz-border-radius-bottomright: 5px; - border-bottom-right-radius: 5px; - -webkit-box-shadow: inset -7px -7px 10px rgba( 0,0,0,0.05 ); - -moz-box-shadow: inset -7px -7px 10px rgba( 0,0,0,0.05 ); - box-shadow: inset -7px -7px 10px rgba( 0,0,0,0.05 ); - } + +.jetpack-activated h3 { + position: relative; + z-index: 5; + color: #444; + font-size: 42px; + font-weight: bold; + margin: 0; + padding: 0; + background: none; + display: block; + text-transform: uppercase; +} + +.jetpack-activated p { + position: relative; + z-index: 3; + top: 3px; + left: 10px; + font-size: 16px; + font-weight: normal; + color: #666; + background: rgba(255, 255, 255, 0.75); + padding: 7px 10px 6px; + border-radius: 5px; + display: inline-block; +} + +.jetpack-activated .jetpack { + position: absolute; + top: 0; + left: 0; + width: 238px; + height: 214px; + background: url(images/jp-enabled-jetpack.jpg) top left no-repeat; + z-index: 2; +} + +.jetpack-activated .clouds { + position: absolute; + right: 0; + bottom: 0; + width: 566px; + height: 214px; + background: url(images/jp-enabled-clouds.png) bottom left no-repeat; + z-index: 0; + border-bottom-right-radius: 5px; + box-shadow: inset -7px -7px 10px rgba(0, 0, 0, 0.05); +} p.jp-help { padding: 10px 0 15px; @@ -515,346 +638,397 @@ p.jp-help { max-height: 220px; margin: 0 0 15px 15px; border: 1px solid #dedede; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; border-radius: 3px; background: #fff; padding: 15px 0 35px 15px; - -webkit-box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 ); - -moz-box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 ); - box-shadow: inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 ); - -webkit-transition-duration: .4s; - -moz-transition-duration: .4s + box-shadow: inset 0 1px 0 #fff, + inset 0 0 20px rgba(0, 0, 0, 0.05), + 0 1px 2px rgba(0, 0, 0, 0.1); + -webkit-transition-duration: 0.4s; + transition-duration: 0.4s; } + /* - .jetpack-module:hover { - border-color: #bbb; - -webkit-box-shadow: 0 1px 2px rgba( 0,0,0,0.2 ); - -moz-box-shadow: 0 1px 2px rgba( 0,0,0,0.2 ); - box-shadow: 0 1px 2px rgba( 0,0,0,0.2 ); - -webkit-transition-duration: .4s; - -moz-transition-duration: .4s - } +.jetpack-module:hover { + border-color: #bbb; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); + -webkit-transition-duration: 0.4s; + transition-duration: 0.4s; +} */ + +.jetpack-module div.module-image { + float: right; + margin: 0 0 5px 10px; + padding: 60px 0 0; + background: #cbe0a1; + width: 80px; + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + background-repeat: no-repeat; + background-image: url(images/module-icons-sprite.png); + background-size: 2705px 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 { - float: right; - margin: 0 0 5px 10px; - padding: 60px 0 0; - background: #cbe0a1; - width: 80px; - -webkit-border-top-left-radius: 3px; - -moz-border-radius-topleft: 3px; - border-top-left-radius: 3px; - -webkit-border-bottom-left-radius: 3px; - -moz-border-radius-bottomleft: 3px; - 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! */ + background-image: url(images/module-icons-sprite-2x.png); } +} - @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 ); - } - } +#stats.jetpack-module div.module-image { + background-position: -510px 5px; +} - #stats.jetpack-module div.module-image { - background-position: -510px 5px; - } - #comments.jetpack-module div.module-image { - background-position: -1210px 5px; - } - #subscriptions.jetpack-module div.module-image { - background-position: -1009px 5px; - } - #sharedaddy.jetpack-module div.module-image { - background-position: -710px 5px; - } - #after-the-deadline.jetpack-module div.module-image { - background-position: -308px 5px; - } - #vaultpress.jetpack-module div.module-image { - background-position: -910px 5px; - } - #gravatar-hovercards.jetpack-module div.module-image { - background-position: -410px 5px; - } - #contact-form.jetpack-module div.module-image { - background-position: -1107px 5px; - } - #shortlinks.jetpack-module div.module-image { - background-position: -108px 5px; - } - #shortcodes.jetpack-module div.module-image { - background-position: -608px 5px; - } - #latex.jetpack-module div.module-image { - background-position: -208px 5px; - } - #widgets.jetpack-module div.module-image { - background-position: -5px 5px; - } - #enhanced-distribution.jetpack-module div.module-image { - background-position: -808px 5px; - } - #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; - color: #fff; - text-shadow: 1px 1px 0px rgba(0,0,0,0.2); - text-align: center; - margin: 0; - padding: 0; - clear: both; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - font-weight: bold; - -webkit-font-smoothing: antialiased; - -webkit-border-bottom-left-radius: 2px; - -moz-border-radius-bottomleft: 2px; - border-bottom-left-radius: 2px; - } - - .jetpack-new-module div.module-image p { - background-color: #f5bd4d; - } - - .jetpack-updated-module div.module-image p { - background-color: #6aafcf; - } - - .jetpack-new-module:hover div.module-image p { - background-color: #b4d278; - } - - .jetpack-updated-module:hover div.module-image p { - background-color: #b4d278; - } - - .jetpack-new-module:hover div.module-image span.module-image-free, - .jetpack-updated-module:hover div.module-image span.module-image-free { - display: inline !important; - } - - .jetpack-new-module:hover div.module-image span.module-image-badge, - .jetpack-updated-module:hover div.module-image span.module-image-badge { - display: none; - } - - .jetpack-toggle { - float: right; - padding: 2px 4px 4px; - } - .jetpack-toggle a { - text-decoration: none; - font-weight: bold; - font-size: 180%; - color: #bbb; - } - - .jetpack-active .jetpack-toggle-button:hover { color: #b90000; } - - .jetpack-module h3 { - line-height: 1.1; - margin: 0; - padding: 0; - font-size: 17px; - font-weight: normal; - font-style: normal; - color: #000; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - } +#comments.jetpack-module div.module-image { + background-position: -1210px 5px; +} - .jetpack-module-description p { - line-height: 150%; - font-size: 12px; - font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; - margin-bottom: 20px; - color: #666; - } +#subscriptions.jetpack-module div.module-image { + background-position: -1009px 5px; +} - .jetpack-module .jetpack-module-actions { - position: absolute; - bottom: 20px; - left: 15px; - background: #fff; - display: block; - } +#sharedaddy.jetpack-module div.module-image { + background-position: -710px 5px; +} - .jetpack-module .jetpack-module-actions a { - position: relative; - font-weight: bold; - color: #888; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - } +#after-the-deadline.jetpack-module div.module-image { + background-position: -308px 5px; +} - .jetpack-inactive { - border-color: #eee; - cursor: pointer; - } - .jetpack-inactive *, jetpack-inactive:hover * { -webkit-transition-duration: .4s; -moz-transition-duration: .4s } +#vaultpress.jetpack-module div.module-image { + background-position: -910px 5px; +} + +#gravatar-hovercards.jetpack-module div.module-image { + background-position: -410px 5px; +} + +#contact-form.jetpack-module div.module-image { + background-position: -1107px 5px; +} + +#shortlinks.jetpack-module div.module-image { + background-position: -108px 5px; +} + +#shortcodes.jetpack-module div.module-image { + background-position: -608px 5px; +} + +#latex.jetpack-module div.module-image { + background-position: -208px 5px; +} + +#widgets.jetpack-module div.module-image { + background-position: -5px 5px; +} + +#enhanced-distribution.jetpack-module div.module-image { + background-position: -808px 5px; +} + +#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; +} + +#debug.jetpack-module div.module-image { + background-position: -2550px 5px; +} + +#omnisearch.jetpack-module div.module-image { + background-position: -2625px 5px; +} + +.jetpack-module div.module-image p { + background-color: #b4d278; + color: #fff; + text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2); + text-align: center; + margin: 0; + padding: 0; + clear: both; + font-weight: bold; + -webkit-font-smoothing: antialiased; + border-bottom-left-radius: 2px; +} - .jetpack-inactive h3, .jetpack-inactive p, .jetpack-inactive span { - color: #ccc; - } +.jetpack-new-module div.module-image p { + background-color: #f5bd4d; +} - .jetpack-inactive .jetpack-configure-button { display: none; } - .jetpack-inactive div.module-image { - opacity: 0.6; - } +.jetpack-updated-module div.module-image p { + background-color: #6aafcf; +} - .jetpack-inactive .jetpack-module-description p a { - color: #92b8d0; - } - .jetpack-inactive:hover .jetpack-module-description p a { - color: #5590b7; - } +.jetpack-new-module:hover div.module-image p { + background-color: #b4d278; +} +.jetpack-updated-module:hover div.module-image p { + background-color: #b4d278; +} - .jetpack-inactive:hover { - border-color: #ddd; - } +.jetpack-new-module:hover div.module-image span.module-image-free, +.jetpack-updated-module:hover div.module-image span.module-image-free { + display: inline !important; +} - .jetpack-inactive:hover h3, .jetpack-inactive:hover p, .jetpack-inactive:hover span { - color: #aaa; - } +.jetpack-new-module:hover div.module-image span.module-image-badge, +.jetpack-updated-module:hover div.module-image span.module-image-badge { + display: none; +} - .jetpack-inactive:hover div.module-image { - opacity: 0.75; - } +.jetpack-toggle { + float: right; + padding: 2px 4px 4px; +} - .placeholder { - border-color: #eee !important; - cursor: default !important; +.jetpack-toggle a { + text-decoration: none; + font-weight: bold; + font-size: 180%; + color: #bbb; +} + +.jetpack-active .jetpack-toggle-button:hover { + color: #b90000; +} + +.jetpack-module h3 { + line-height: 1.1; + margin: 0; + padding: 0; + font-size: 17px; + font-weight: normal; + font-style: normal; + color: #000; +} + +.jetpack-module-description p { + line-height: 150%; + font-size: 12px; + margin-bottom: 20px; + color: #666; +} + +.jetpack-module .jetpack-module-actions { + position: absolute; + bottom: 20px; + left: 15px; + background: #fff; + display: block; +} + +.jetpack-module .jetpack-module-actions a { + position: relative; + font-weight: bold; + color: #888; +} + +.jetpack-inactive { + border-color: #eee; + cursor: pointer; +} + +.jetpack-inactive *, +jetpack-inactive:hover * { + -webkit-transition-duration: 0.4s; + transition-duration: 0.4s; +} + +.jetpack-inactive h3, .jetpack-inactive p, .jetpack-inactive span { + color: #ccc; +} + +.jetpack-inactive .jetpack-configure-button { + display: none; +} + +.jetpack-inactive div.module-image { + opacity: 0.6; +} + +.jetpack-inactive .jetpack-module-description p a { + color: #92b8d0; +} + +.jetpack-inactive:hover .jetpack-module-description p a { + color: #5590b7; +} + +.jetpack-inactive:hover { + border-color: #ddd; +} + +.jetpack-inactive:hover h3, +.jetpack-inactive:hover p, +.jetpack-inactive:hover span { + color: #aaa; +} + +.jetpack-inactive:hover div.module-image { + opacity: 0.75; +} + +.placeholder { + border-color: #eee !important; + cursor: default !important; +} + +.placeholder h3 { + color: #dadada; + margin-top: 55px; + text-align: center; + background: transparent url(images/icon-comingsoon.png) top center no-repeat; + padding: 40px 0 0 0; + 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-image: url(images/icon-comingsoon-2x.png); + background-size: 32px 32px; } - .placeholder h3 { - color: #dadada; - margin-top: 55px; - text-align: center; - background: transparent url(images/icon-comingsoon.png) top center no-repeat; - padding: 40px 0 0 0; - 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; - background-size:32px 32px; - } - } +} #jp-settings-screen { margin: 0 25px; } - #jp-settings-screen h3 { - font-size: 18px; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; - color: #555; - padding-bottom: 20px; - border-bottom: 1px solid #eee; - } + +#jp-settings-screen h3 { + font-size: 18px; + color: #555; + padding-bottom: 20px; + border-bottom: 1px solid #eee; +} p#news-sub { text-align: center; } #jp-footer { - background: url( images/footer-clouds.png ) top center no-repeat; + background: url(images/footer-clouds.png) top center no-repeat; margin: 30px 0; padding-top: 60px; text-align: center; } -@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-footer { - background: url( images/footer-clouds-2x.png ) top center no-repeat; - background-size:700px 150px; - } +@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-footer { + background-image: url(images/footer-clouds-2x.png); + background-size: 700px 150px; + } + } +#jp-footer .automattic { + color: #999; + font-size: 10px; + line-height: 15px; + text-transform: uppercase; + letter-spacing: 3px; + padding-left: 3px; +} - #jp-footer .automattic { - color: #999; - font-size: 10px; - line-height: 15px; - text-transform: uppercase; - letter-spacing: 3px; - padding-left: 3px; - } +#jp-footer .automattic span { + text-indent: -999em; + overflow: hidden; + background: url(images/automattic.png) center top no-repeat; + display: inline-block; + width: 165px; + vertical-align: top; + margin: 0 5px 0 1px; + line-height: 14px; + height: 14px; + filter: alpha(opacity=40); + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; + opacity: 0.5; +} - #jp-footer .automattic span { - text-indent: -999em; - overflow: hidden; - background: url( images/automattic.png ) center top no-repeat; - display: inline-block; - width: 165px; - vertical-align: top; - margin: 0 5px 0 1px; - line-height: 14px; - height: 14px; - filter: alpha(opacity=40); - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - opacity: 0.5; - } - @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-footer .automattic span { - background: url( images/automattic-2x.png ) center top no-repeat; - background-size:165px 14px; - } - } - - #jp-footer p.small { - font-size: 11px; - color: #ccc; +@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-footer .automattic span { + background-image: url(images/automattic-2x.png); + background-size: 165px 14px; } - #jp-footer .small a { - text-decoration: none; - } +} - #jp-footer .small a:hover { - text-decoration: underline; - } +#jp-footer p.small { + font-size: 11px; + color: #ccc; +} + +#jp-footer .small a { + text-decoration: none; +} + +#jp-footer .small a:hover { + text-decoration: underline; +} #jetpack-configuration code { font-size: 14px; @@ -864,7 +1038,11 @@ p#news-sub { clear: both; } -.error, .updated { position: relative; z-index: 100; } +.error, +.updated { + position: relative; + z-index: 100; +} .toplevel_page_jetpack .wrap { max-width: 983px; @@ -880,29 +1058,24 @@ p#news-sub { position: relative; z-index: 100; border: 1px solid #ccc !important; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; border-radius: 3px; background-color: #efefef !important; - -webkit-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); - -moz-box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); - box-shadow: inset 0 0 15px rgba( 0,0,0,0.04 ); + box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.04); padding: 18px 90px 8px 15px !important; overflow: hidden; line-height: 180%; } -#jetpack-settings > .jp-survey { margin: 10px 13px 40px 15px } +#jetpack-settings > .jp-survey { + margin: 10px 13px 40px 15px; +} .jp-survey h4 { margin: 0; font-size: 18px; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; font-weight: normal; color: #333; text-shadow: 0 1px 0 #fff; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; border-radius: 5px; display: block; float: left; @@ -942,50 +1115,40 @@ p#news-sub { width: 16px; height: 16px; text-indent: -9999px; - background: transparent url( images/alertbox-closeicon.png ) no-repeat center center; + background: transparent url(images/alertbox-closeicon.png) center center no-repeat; border: 0 none; - -moz-border-radius: 0 0 0 5px; - -webkit-border-radius: 0 0 0 5px; - -o-border-radius: 0 0 0 5px; - -ms-border-radius: 0 0 0 5px; border-radius: 0 0 0 5px; - -moz-box-shadow: none; - -webkit-box-shadow: none; box-shadow: none; - -webkit-transition-duration: .3s; - -moz-transition-duration: .3s; - -o-transition-duration: .3s; - -ms-transition-duration: .3s; - transition-duration: .3s; + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s; cursor: pointer; } -@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-close-button { - background: transparent url( images/alertbox-closeicon-2x.png ) no-repeat center center; - background-size:16px 16px; - } +@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-close-button { + background-image: url(images/alertbox-closeicon-2x.png); + background-size: 16px 16px; + } + } .jetpack-close-button:hover { background-color: #fff; border: 0 none; outline: none; - -webkit-transition-duration: .3s; - -moz-transition-duration: .3s; - -o-transition-duration: .3s; - -ms-transition-duration: .3s; - transition-duration: .3s; + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s; } .jetpack-close-button:active { background-color: #efefef; border: 0 none; - -webkit-transition-duration: .3s; - -moz-transition-duration: .3s; - -o-transition-duration: .3s; - -ms-transition-duration: .3s; - transition-duration: .3s; + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s; } .jetpack-wrap-container { @@ -1002,17 +1165,13 @@ p#news-sub { position: absolute; bottom: 5px; right: 15px; - font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",Verdana,"Bitstream Vera Sans",sans-serif; float: right; display: inline-block; background: #b4d278; - -moz-box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3); - -webkit-box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3); - box-shadow: inset 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.3); + box-shadow: inset 0 0 2px #fff, + 0 1px 5px rgba(0, 0, 0, 0.3); padding: 8px 15px; border: 1px solid #2a8cba; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; border-radius: 5px; line-height: 1.3; color: #fff; @@ -1020,26 +1179,23 @@ p#news-sub { font-size: 16px; font-weight: bold; text-decoration: none; - text-shadow: 0px 1px 2px rgba( 0,0,0,0.5); - -webkit-transition-duration: .3s; - -moz-transition-duration: .3s; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); + -webkit-transition-duration: 0.3s; + transition-duration: 0.3s; cursor: pointer; } -.jetpack-install-container p a.button-connector:hover, .jetpack-install-container p a.button-connector:active { +.jetpack-install-container p a.button-connector:hover, +.jetpack-install-container p a.button-connector:active { background-color: #f0a000; border-color: #c87800; - -webkit-transition-duration: .3s; outline: none; - -moz-box-shadow: inset 0 0 2px #fff, 0 1px 7px rgba(240,160,0,0.5); - -webkit-box-shadow: inset 0 0 2px #fff, 0 1px 7px rgba(240,160,0,0.5); - box-shadow: inset 0 0 2px #fff, 0 1px 7spx rgba(240,160,0,0.5); + box-shadow: inset 0 0 2px #fff, + 0 1px 7px 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; + padding: 0.5em 1em 0.5em 1em; border-radius: 3px; border-width: 1px; border-style: solid; diff --git a/plugins/jetpack/_inc/jetpack.js b/plugins/jetpack/_inc/jetpack.js index 6ef9de8d..4d70053d 100644 --- a/plugins/jetpack/_inc/jetpack.js +++ b/plugins/jetpack/_inc/jetpack.js @@ -80,6 +80,7 @@ jetpack = { } } ); + jQuery( '#screen-meta, #screen-meta-links' ).wrapAll( '
' ); }, level_modules: function() { diff --git a/plugins/jetpack/_inc/jquery.inview.js b/plugins/jetpack/_inc/jquery.inview.js index 45f71c4c..b581903a 100644 --- a/plugins/jetpack/_inc/jquery.inview.js +++ b/plugins/jetpack/_inc/jquery.inview.js @@ -73,14 +73,14 @@ visiblePartX, visiblePartY, visiblePartsMerged; - + // for the case where 'display:none' is used in place of 'visibility:hidden' // count and sum the above items to get and move closer to the correct values // IMPORTANT :: insert element into container empty if($element.css('display') == 'none') { var parentElement = $element.parent(); - + elementOffset.top = parentElement.offset().top; elementOffset.left = parentElement.offset().left; elementSize.height = parentElement.height(); @@ -98,7 +98,7 @@ if (!viewportOffset || !viewportSize) { return; } - + if (element.offsetWidth >= 0 && element.offsetHeight >= 0 && element.style.display != "none" && elementOffset.top + elementSize.height > viewportOffset.top && elementOffset.top < viewportOffset.top + viewportSize.height && @@ -124,7 +124,7 @@ $(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() { diff --git a/plugins/jetpack/_inc/jquery.jetpack-resize.js b/plugins/jetpack/_inc/jquery.jetpack-resize.js index e1adb22d..1c3cc87c 100644 --- a/plugins/jetpack/_inc/jquery.jetpack-resize.js +++ b/plugins/jetpack/_inc/jquery.jetpack-resize.js @@ -60,7 +60,7 @@ if ( 'undefined' === typeof $.fn.Jetpack ) { /** * Dispatches calls to the correct namespace - * + * * @param string namespace * @param ... * @return mixed|jQuery (chainable) @@ -81,7 +81,7 @@ /** * Defines the Jetpack.resizeable() namespace. * See below for non-trivial definition for browsers with postMessage. - */ + */ resizeable: function() { $.error( 'Browser does not support window.postMessage' ); } @@ -122,7 +122,7 @@ // Some browsers send structured data, some send JSON strings if ( 'object' === typeof event.data ) { - data = event.data; + data = event.data.data; } else { try { data = JSON.parse( event.data ); @@ -131,10 +131,13 @@ } } - if ( !data ) { + if ( !data.data ) { return; } + // Un-nest + data = data.data; + // Is it a resize event? if ( 'undefined' === typeof data.action || 'resize' !== data.action ) { return; @@ -242,6 +245,10 @@ if ( 0 !== value ) { target[variable]( value ); + var container = target.parent(); + if ( container.hasClass( 'slim-likes-widget' ) ) { + container[variable]( value ); + } } } ); @@ -269,7 +276,7 @@ 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 index 4642af13..1e901ca6 100644 --- a/plugins/jetpack/_inc/jquery.spin.js +++ b/plugins/jetpack/_inc/jquery.spin.js @@ -1,86 +1,104 @@ -/* - * Matt Husby https://github.com/matthusby/spin.js - * Based on the jquery plugin by Bradley Smith - * https://gist.github.com/1290439 +/** + * Copyright (c) 2011-2013 Felix Gnass + * Licensed under the MIT license */ /* -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. + +Basic Usage: +============ + +$('#el').spin(); // Creates a default Spinner using the text color of #el. +$('#el').spin({ ... }); // Creates a Spinner using the provided options. + +$('#el').spin(false); // Stops and removes the spinner. + +Using Presets: +============== + +$('#el').spin('small'); // Creates a 'small' Spinner using the text color of #el. +$('#el').spin('large', '#fff'); // Creates a 'large' white Spinner. + +Adding a custom preset: +======================= + +$.fn.spin.presets.flower = { + lines: 9 + length: 10 + width: 20 + radius: 0 +} + +$('#el').spin('flower', 'red'); + */ -( 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 +(function(factory) { + + if (typeof exports == 'object') { + // CommonJS + factory(require('jquery'), require('spin')) + } + else if (typeof define == 'function' && define.amd) { + // AMD, register as anonymous module + define(['jquery', 'spin'], factory) + } + else { + // Browser globals + if (!window.Spinner) throw new Error('Spin.js not present') + factory(window.jQuery, window.Spinner) + } + +}(function($, Spinner) { + + $.fn.spin = function(opts, color) { + + return this.each(function() { + var $this = $(this), + data = $this.data(); + + if (data.spinner) { + data.spinner.stop(); + delete data.spinner; + } + if (opts !== false) { + opts = $.extend( + { color: color || $this.css('color') }, + $.fn.spin.presets[opts] || opts + ) + // Begin WordPress Additions + // To use opts.right, you need to have specified a length, width, and radius. + if ( typeof opts.right !== 'undefined' && typeof opts.length !== 'undefined' + && typeof opts.width !== 'undefined' && typeof opts.radius !== 'undefined' ) { + var pad = $this.css( 'padding-left' ); + pad = ( typeof pad === 'undefined' ) ? 0 : parseInt( pad, 10 ); + opts.left = $this.outerWidth() - ( 2 * ( opts.length + opts.width + opts.radius ) ) - pad - opts.right; + delete opts.right; + } + // End WordPress Additions + data.spinner = new Spinner(opts).spin(this) + } + }) + } + + $.fn.spin.presets = { + tiny: { lines: 8, length: 2, width: 2, radius: 3 }, + small: { lines: 8, length: 4, width: 3, radius: 5 }, + large: { lines: 10, length: 8, width: 4, radius: 8 } + } + +})); + +// Jetpack Presets Overrides: +(function($){ + $.fn.spin.presets.wp = { trail: 60, speed: 1.3 }; + $.fn.spin.presets.small = $.extend( { lines: 8, length: 2, width: 2, radius: 3 }, $.fn.spin.presets.wp ); + $.fn.spin.presets.medium = $.extend( { lines: 8, length: 4, width: 3, radius: 5 }, $.fn.spin.presets.wp ); + $.fn.spin.presets.large = $.extend( { lines: 10, length: 6, width: 4, radius: 7 }, $.fn.spin.presets.wp ); + $.fn.spin.presets['small-left'] = $.extend( { left: 5 }, $.fn.spin.presets.small ); + $.fn.spin.presets['small-right'] = $.extend( { right: 5 }, $.fn.spin.presets.small ); + $.fn.spin.presets['medium-left'] = $.extend( { left: 5 }, $.fn.spin.presets.medium ); + $.fn.spin.presets['medium-right'] = $.extend( { right: 5 }, $.fn.spin.presets.medium ); + $.fn.spin.presets['large-left'] = $.extend( { left: 5 }, $.fn.spin.presets.large ); + $.fn.spin.presets['large-right'] = $.extend( { right: 5 }, $.fn.spin.presets.large ); +})(jQuery); diff --git a/plugins/jetpack/_inc/postmessage.js b/plugins/jetpack/_inc/postmessage.js index e8933bca..51f8567b 100644 --- a/plugins/jetpack/_inc/postmessage.js +++ b/plugins/jetpack/_inc/postmessage.js @@ -105,7 +105,7 @@ var NO_JQUERY = {}; bind: function(type, fn, origin, hash, async_reply) { pm._replyBind ( type, fn, origin, hash, async_reply ); }, - + _replyBind: function(type, fn, origin, hash, isCallback) { if (("postMessage" in window) && !hash) { pm._bind(); @@ -243,7 +243,7 @@ var NO_JQUERY = {}; pm.send({target:e.source, data:data, type:msg.callback}); } } - + try { if ( o.callback ) { o.fn(msg.data, sendReply, e); @@ -390,7 +390,7 @@ var NO_JQUERY = {}; pm.send({target:source_window, data:data, type:msg.callback, hash:true, url:hash.source.url}); } } - + try { if ( o.callback ) { o.fn(msg.data, sendReply); diff --git a/plugins/jetpack/_inc/spin.js b/plugins/jetpack/_inc/spin.js index f506cd2b..c66c607a 100644 --- a/plugins/jetpack/_inc/spin.js +++ b/plugins/jetpack/_inc/spin.js @@ -1,301 +1,349 @@ -//fgnass.github.com/spin.js#v1.2.4 -(function(window, document, undefined) { +//fgnass.github.com/spin.js#v1.3 /** - * Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de] + * Copyright (c) 2011-2013 Felix Gnass * Licensed under the MIT license */ - - var prefixes = ['webkit', 'Moz', 'ms', 'O']; /* Vendor prefixes */ - var animations = {}; /* Animation rules keyed by their name */ - var useCssAnimations; - - /** - * Utility function to create elements. If no tag name is given, - * a DIV is created. Optionally properties can be passed. - */ - function createEl(tag, prop) { - var el = document.createElement(tag || 'div'); - var n; - - for(n in prop) { - el[n] = prop[n]; - } - return el; - } - - /** - * Appends children and returns the parent. - */ - function ins(parent /* child1, child2, ...*/) { - for (var i=1, n=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 +(function(root, factory) { + + /* CommonJS */ + if (typeof exports == 'object') module.exports = factory() + + /* AMD module */ + else if (typeof define == 'function' && define.amd) define(factory) + + /* Browser global */ + else root.Spinner = factory() +} +(this, function() { + "use strict"; + + var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */ + , animations = {} /* Animation rules keyed by their name */ + , useCssAnimations /* Whether to use CSS animations or setTimeout */ + + /** + * Utility function to create elements. If no tag name is given, + * a DIV is created. Optionally properties can be passed. + */ + function createEl(tag, prop) { + var el = document.createElement(tag || 'div') + , n + + for(n in prop) el[n] = prop[n] + return el + } + + /** + * Appends children and returns the parent. + */ + function ins(parent /* child1, child2, ...*/) { + for (var i=1, n=arguments.length; i> 1) : parseInt(o.left, 10) + mid) + 'px', + top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : parseInt(o.top, 10) + mid) + 'px' + }) + } + + el.setAttribute('role', 'progressbar') + self.lines(el, self.opts) + + if (!useCssAnimations) { + // No CSS animation support, use setTimeout() instead + var i = 0 + , start = (o.lines - 1) * (1 - o.direction) / 2 + , alpha + , fps = o.fps + , f = fps/o.speed + , ostep = (1-o.opacity) / (f*o.trail / 100) + , astep = f/o.lines + + ;(function anim() { + i++; + for (var j = 0; j < o.lines; j++) { + alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity) + + self.opacity(el, j * o.direction + start, alpha, o) + } + self.timeout = self.el && setTimeout(anim, ~~(1000/fps)) + })() + } + return self + }, + + /** + * Stops and removes the Spinner. + */ + stop: function() { + var el = this.el + if (el) { + clearTimeout(this.timeout) + if (el.parentNode) el.parentNode.removeChild(el) + this.el = undefined + } + return this + }, + + /** + * Internal method that draws the individual lines. Will be overwritten + * in VML fallback mode below. + */ + lines: function(el, o) { + var i = 0 + , start = (o.lines - 1) * (1 - o.direction) / 2 + , 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+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)', + borderRadius: (o.corners * 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, start + i * o.direction, 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 + }, + + /** + * Internal method that adjusts the opacity of a single line. + * Will be overwritten in VML fallback mode below. + */ + opacity: function(el, i, val) { + if (i < el.childNodes.length) el.childNodes[i].style.opacity = val + } + + }) + + + function initVML() { + + /* Utility function to create a VML tag */ + function vml(tag, attr) { + return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr) + } + + // No CSS transforms but VML support, add a CSS rule for VML elements: + sheet.addRule('.spin-vml', 'behavior:url(#default#VML)') + + Spinner.prototype.lines = function(el, o) { + var r = o.length+o.width + , s = 2*r + + function grp() { + return css( + vml('group', { + coordsize: s + ' ' + s, + coordorigin: -r + ' ' + -r + }), + { width: s, height: s } + ) + } + + var margin = -(o.width+o.length)*2 + 'px' + , g = css(grp(), {position: 'absolute', top: margin, left: margin}) + , i + + function seg(i, dx, filter) { + ins(g, + ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}), + ins(css(vml('roundrect', {arcsize: o.corners}), { + width: r, + height: o.width, + left: o.radius, + top: -o.width>>1, + filter: filter + }), + vml('fill', {color: o.color, opacity: o.opacity}), + vml('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 + } + } + } + + var probe = css(createEl('group'), {behavior: 'url(#default#VML)'}) + + if (!vendor(probe, 'transform') && probe.adj) initVML() + else useCssAnimations = vendor(probe, 'animation') + + return Spinner + +})); diff --git a/plugins/jetpack/class.jetpack-ixr-client.php b/plugins/jetpack/class.jetpack-ixr-client.php index 8d6e52fe..7eefee5f 100644 --- a/plugins/jetpack/class.jetpack-ixr-client.php +++ b/plugins/jetpack/class.jetpack-ixr-client.php @@ -49,7 +49,7 @@ class Jetpack_IXR_Client extends IXR_Client { $this->error = new IXR_Error( -32300, 'transport error - HTTP status code was not 200' ); return false; } - + $content = wp_remote_retrieve_body( $response ); // Now parse what we've got back diff --git a/plugins/jetpack/class.jetpack-post-images.php b/plugins/jetpack/class.jetpack-post-images.php index afdcacfa..5829fcc6 100644 --- a/plugins/jetpack/class.jetpack-post-images.php +++ b/plugins/jetpack/class.jetpack-post-images.php @@ -15,15 +15,17 @@ class Jetpack_PostImages { * If a slideshow is embedded within a post, then parse out the images involved and return them */ static function from_slideshow( $post_id, $width = 200, $height = 200 ) { + $images = array(); + $post = get_post( $post_id ); + if ( !empty( $post->post_password ) ) + return $images; if ( false === strpos( $post->post_content, '[slideshow' ) ) return false; // no slideshow - bail $permalink = get_permalink( $post->ID ); - $images = array(); - // Mechanic: Somebody set us up the bomb $old_post = $GLOBALS['post']; $GLOBALS['post'] = $post; @@ -79,15 +81,17 @@ class Jetpack_PostImages { * If a gallery is detected, then get all the images from it. */ static function from_gallery( $post_id ) { + $images = array(); + $post = get_post( $post_id ); + if ( !empty( $post->post_password ) ) + return $images; if ( false === strpos( $post->post_content, '[gallery' ) ) return false; // no gallery - bail $permalink = get_permalink( $post->ID ); - $images = array(); - // CATS: All your base are belong to us $old_post = $GLOBALS['post']; $GLOBALS['post'] = $post; @@ -145,6 +149,11 @@ class Jetpack_PostImages { * their dimensions are at or above a required minimum. */ static function from_attachment( $post_id, $width = 200, $height = 200 ) { + $images = array(); + + $post = get_post( $post_id ); + if ( !empty( $post->post_password ) ) + return $images; $post_images = get_posts( array( 'post_parent' => $post_id, // Must be children of post @@ -158,8 +167,6 @@ class Jetpack_PostImages { $permalink = get_permalink( $post_id ); - $images = array(); - foreach ( $post_images as $post_image ) { $meta = wp_get_attachment_metadata( $post_image->ID ); // Must be larger than 200x200 @@ -210,9 +217,12 @@ class Jetpack_PostImages { static function from_thumbnail( $post_id, $width = 200, $height = 200 ) { $images = array(); - if ( !function_exists( 'get_post_thumbnail_id' ) ) { + $post = get_post( $post_id ); + if ( !empty( $post->post_password ) ) + return $images; + + if ( !function_exists( 'get_post_thumbnail_id' ) ) return $images; - } $thumb = get_post_thumbnail_id( $post_id ); @@ -251,10 +261,12 @@ class Jetpack_PostImages { if ( is_numeric( $html_or_id ) ) { $post = get_post( $html_or_id ); - - if ( !$post ) + if ( empty( $post ) || !empty( $post->post_password ) ) return $images; + $html = $post->post_content; // DO NOT apply the_content filters here, it will cause loops + } else { + $html = $html_or_id; } if ( !$html ) diff --git a/plugins/jetpack/class.jetpack-signature.php b/plugins/jetpack/class.jetpack-signature.php index 975375ab..3f6c16fb 100644 --- a/plugins/jetpack/class.jetpack-signature.php +++ b/plugins/jetpack/class.jetpack-signature.php @@ -56,7 +56,7 @@ class Jetpack_Signature { } } - $method = isset( $override['method'] ) ? $override['method'] : $_SERVER['REQUEST_METHOD']; + $method = isset( $override['method'] ) ? $override['method'] : $_SERVER['REQUEST_METHOD']; return $this->sign_request( $a['token'], $a['timestamp'], $a['nonce'], $a['body-hash'], $method, $url, $body, true ); } @@ -99,7 +99,7 @@ class Jetpack_Signature { return new Jetpack_Error( 'invalid_body_hash', 'The body hash does not match.' ); } } else { - if ( $verify_body_hash && jetpack_sha1_base64( $body ) != $body_hash ) { + if ( $verify_body_hash && jetpack_sha1_base64( $body ) !== $body_hash ) { return new Jetpack_Error( 'invalid_body_hash', 'The body hash does not match.' ); } } diff --git a/plugins/jetpack/class.jetpack-user-agent.php b/plugins/jetpack/class.jetpack-user-agent.php index 3ae1bb85..4c63a65a 100644 --- a/plugins/jetpack/class.jetpack-user-agent.php +++ b/plugins/jetpack/class.jetpack-user-agent.php @@ -78,6 +78,7 @@ class Jetpack_User_Agent_Info { const PLATFORM_J2ME_MIDP = 'j2me_midp'; const PLATFORM_ANDROID = 'android'; const PLATFORM_ANDROID_TABLET = 'android_tablet'; + const PLATFORM_FIREFOX_OS = 'firefoxOS'; var $dumb_agents = array( 'nokia', 'blackberry', 'philips', 'samsung', 'sanyo', 'sony', 'panasonic', 'webos', @@ -139,6 +140,8 @@ class Jetpack_User_Agent_Info { return 'webos'; elseif ( $this->is_S60_OSSBrowser() ) return 'series60'; + elseif ( $this->is_firefox_os() ) + return 'firefoxOS'; elseif ( $this->is_firefox_mobile() ) return 'firefox_mobile'; elseif ( $this->is_MaemoTablet() ) @@ -228,6 +231,9 @@ class Jetpack_User_Agent_Info { elseif ( $this->is_J2ME_platform() ) { $this->_platform = self::PLATFORM_J2ME_MIDP; } + elseif ( $this->is_firefox_os() ) { + $this->_platform = self::PLATFORM_FIREFOX_OS; + } else $this->_platform = false; @@ -297,6 +303,12 @@ class Jetpack_User_Agent_Info { $this->isTierRichCss = false; $this->isTierGenericMobile = false; } + elseif ( $this->is_firefox_os() ) { + $this->matched_agent = 'firefoxOS'; + $this->isTierIphone = true; + $this->isTierRichCss = false; + $this->isTierGenericMobile = false; + } elseif ( $this->is_firefox_mobile() ) { $this->matched_agent = 'fennec'; $this->isTierIphone = true; @@ -377,7 +389,7 @@ class Jetpack_User_Agent_Info { // Detects if the user is using a tablet. // props Corey Gilmore, BGR.com - function is_tablet() { + static function is_tablet() { return ( 0 // never true, but makes it easier to manage our list of tablet conditions || self::is_ipad() || self::is_android_tablet() @@ -387,14 +399,14 @@ class Jetpack_User_Agent_Info { || self::is_TouchPad() ); } - + /* * Detects if the current UA is the default iPhone or iPod Touch Browser. * * DEPRECATED: use is_iphone_or_ipod * */ - function is_iphoneOrIpod(){ + static function is_iphoneOrIpod(){ if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -421,7 +433,7 @@ class Jetpack_User_Agent_Info { * Otherwise those browsers will be 'catched' by the iphone string. * */ - function is_iphone_or_ipod( $type = 'iphone-any' ) { + static function is_iphone_or_ipod( $type = 'iphone-any' ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -438,61 +450,61 @@ class Jetpack_User_Agent_Info { return $is_iphone; } - + /* * Detects if the current UA is Chrome for iOS * * The User-Agent string in Chrome for iOS is the same as the Mobile Safari User-Agent, with CriOS/ instead of Version/. * - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3 */ - function is_chrome_for_iOS( ) { + static function is_chrome_for_iOS( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; - + if ( self::is_iphone_or_ipod( 'iphone-safari' ) === false ) return false; - + $ua = strtolower( $_SERVER['HTTP_USER_AGENT'] ); - + if ( strpos( $ua, 'crios/' ) !== false ) return true; else return false; } - - + + /* * Detects if the current UA is Twitter for iPhone - * + * * Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; nb-no) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPhone * Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone - * + * */ - function is_twitter_for_iphone( ) { + static function is_twitter_for_iphone( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; - + $ua = strtolower( $_SERVER['HTTP_USER_AGENT'] ); if ( strpos( $ua, 'ipad' ) !== false ) return false; - + if ( strpos( $ua, 'twitter for iphone' ) !== false ) return true; else return false; } - + /* * Detects if the current UA is Twitter for iPad - * + * * Old version 4.X - Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1 Twitter for iPad * Ver 5.0 or Higher - Mozilla/5.0 (iPad; CPU OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 Twitter for iPhone - * + * */ - function is_twitter_for_ipad( ) { + static function is_twitter_for_ipad( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; - + $ua = strtolower( $_SERVER['HTTP_USER_AGENT'] ); if ( strpos( $ua, 'twitter for ipad' ) !== false ) @@ -502,7 +514,7 @@ class Jetpack_User_Agent_Info { else return false; } - + /* * Detects if the current UA is Facebook for iPhone @@ -510,7 +522,7 @@ class Jetpack_User_Agent_Info { * - Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.0;FBSS/2; FBCR/O2;FBID/phone;FBLC/en_US;FBSF/2.0] * - Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B206 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPhone3,1;FBMD/iPhone;FBSN/iPhone OS;FBSV/5.1.1;FBSS/2; FBCR/3ITA;FBID/phone;FBLC/en_US] */ - function is_facebook_for_iphone( ) { + static function is_facebook_for_iphone( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -535,7 +547,7 @@ class Jetpack_User_Agent_Info { * - Mozilla/5.0 (iPad; U; CPU iPhone OS 5_0 like Mac OS X; en_US) AppleWebKit (KHTML, like Gecko) Mobile [FBAN/FBForIPhone;FBAV/4.0.2;FBBV/4020.0;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/5.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US;FBSF/1.0] * - Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403 [FBAN/FBIOS;FBAV/5.0;FBBV/47423;FBDV/iPad2,1;FBMD/iPad;FBSN/iPhone OS;FBSV/6.0;FBSS/1; FBCR/;FBID/tablet;FBLC/en_US] */ - function is_facebook_for_ipad( ) { + static function is_facebook_for_ipad( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -553,7 +565,7 @@ class Jetpack_User_Agent_Info { /* * Detects if the current UA is WordPress for iOS */ - function is_wordpress_for_ios( ) { + static function is_wordpress_for_ios( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -573,7 +585,7 @@ class Jetpack_User_Agent_Info { * Otherwise those browsers will be 'catched' by the ipad string. * */ - function is_ipad( $type = 'ipad-any' ) { + static function is_ipad( $type = 'ipad-any' ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -598,7 +610,7 @@ class Jetpack_User_Agent_Info { * Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.1.1) Gecko/20110415 Firefox/4.0.2pre Fennec/4.0.1 * Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2pre) Gecko/20081015 Fennec/1.0a1 */ - function is_firefox_mobile( ) { + static function is_firefox_mobile( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -612,6 +624,26 @@ class Jetpack_User_Agent_Info { } + /* + * Detects if the current browser is FirefoxOS Native browser + * + * Mozilla/5.0 (Mobile; rv:14.0) Gecko/14.0 Firefox/14.0 + * + */ + static function is_firefox_os( ) { + + if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) + return false; + + $ua = strtolower( $_SERVER['HTTP_USER_AGENT'] ); + + if ( strpos( $ua, 'mozilla' ) !== false && strpos( $ua, 'mobile' ) !== false && strpos( $ua, 'gecko' ) !== false && strpos( $ua, 'firefox' ) !== false) + return true; + else + return false; + } + + /* * Detects if the current browser is Opera Mobile * @@ -623,7 +655,7 @@ class Jetpack_User_Agent_Info { * * Opera/9.80 (Windows NT 6.1; Opera Mobi/14316; U; en) Presto/2.7.81 Version/11.00" */ - function is_opera_mobile( ) { + static function is_opera_mobile( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -649,7 +681,7 @@ class Jetpack_User_Agent_Info { * Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54 * */ - function is_opera_mini( ) { + static function is_opera_mini( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -666,7 +698,7 @@ class Jetpack_User_Agent_Info { * Detects if the current browser is Opera Mini, but not on a smart device OS(Android, iOS, etc) * Used to send users on dumb devices to m.wor */ - function is_opera_mini_dumb( ) { + static function is_opera_mini_dumb( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -690,7 +722,7 @@ class Jetpack_User_Agent_Info { * Opera Mini 5 Beta: Opera/9.80 (J2ME/MIDP; Opera Mini/5.0.15650/756; U; en) Presto/2.2.0 * Opera Mini 8: Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr) */ - function is_OperaMobile() { + static function is_OperaMobile() { _deprecated_function( __FUNCTION__, 'always', 'is_opera_mini() or is_opera_mobile()' ); if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) @@ -712,7 +744,7 @@ class Jetpack_User_Agent_Info { * Detects if the current browser is a Windows Phone 7 device. * ex: Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; LG; GW910) */ - function is_WindowsPhone7() { + static function is_WindowsPhone7() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -732,10 +764,10 @@ class Jetpack_User_Agent_Info { * Detects if the current browser is a Windows Phone 8 device. * ex: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; ARM; Touch; IEMobile/10.0; ; [;]) */ - function is_windows_phone_8() { + static function is_windows_phone_8() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; - + $ua = strtolower( $_SERVER['HTTP_USER_AGENT'] ); if ( strpos( $ua, 'windows phone 8' ) === false ) { return false; @@ -743,8 +775,8 @@ class Jetpack_User_Agent_Info { return true; } } - - + + /* * Detects if the current browser is on a Palm device running the new WebOS. This EXCLUDES TouchPad. * @@ -752,7 +784,7 @@ class Jetpack_User_Agent_Info { * ex2: Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pixi/1.1 * */ - function is_PalmWebOS() { + static function is_PalmWebOS() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -775,7 +807,7 @@ class Jetpack_User_Agent_Info { * TouchPad: Mozilla/5.0 (hp-tablet; Linux; hpwOS/3.0.0; U; en-US) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/233.70 Safari/534.6 TouchPad/1.0 * */ - function is_TouchPad() { + static function is_TouchPad() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -801,7 +833,7 @@ class Jetpack_User_Agent_Info { * Browser 7.1 (Nokia N97 (v12.0.024)) : Mozilla/5.0 (SymbianOS/9.4; Series60/5.0 NokiaN97-1/12.0.024; Profile/MIDP-2.1 Configuration/CLDC-1.1; en-us) AppleWebKit/525 (KHTML, like Gecko) BrowserNG/7.1.12344 * */ - function is_S60_OSSBrowser() { + static function is_S60_OSSBrowser() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -831,7 +863,7 @@ class Jetpack_User_Agent_Info { * Detects if the device platform is the Symbian Series 60. * */ - function is_symbian_platform() { + static function is_symbian_platform() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -864,7 +896,7 @@ class Jetpack_User_Agent_Info { * This browser will report 'NokiaBrowser' in the header, however some older version will also report 'OviBrowser'. * */ - function is_symbian_s40_platform() { + static function is_symbian_s40_platform() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -879,7 +911,7 @@ class Jetpack_User_Agent_Info { return false; } - function is_J2ME_platform() { + static function is_J2ME_platform() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -899,7 +931,7 @@ class Jetpack_User_Agent_Info { /* * Detects if the current UA is on one of the Maemo-based Nokia Internet Tablets. */ - function is_MaemoTablet() { + static function is_MaemoTablet() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -922,7 +954,7 @@ class Jetpack_User_Agent_Info { /* * Detects if the current UA is a MeeGo device (Nokia Smartphone). */ - function is_MeeGo() { + static function is_MeeGo() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -943,7 +975,7 @@ class Jetpack_User_Agent_Info { /* is_webkit() can be used to check the User Agent for an webkit generic browser */ - function is_webkit() { + static function is_webkit() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -962,7 +994,7 @@ class Jetpack_User_Agent_Info { * Detects if the current browser is the Native Android browser. * @return boolean true if the browser is Android otherwise false */ - function is_android() { + static function is_android() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -985,7 +1017,7 @@ class Jetpack_User_Agent_Info { * * @return boolean true if the browser is Android and not 'mobile' otherwise false */ - function is_android_tablet( ) { + static function is_android_tablet( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -1012,7 +1044,7 @@ class Jetpack_User_Agent_Info { * * @return boolean true if the browser is Kindle Fire Native browser otherwise false */ - function is_kindle_fire( ) { + static function is_kindle_fire( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -1033,7 +1065,7 @@ class Jetpack_User_Agent_Info { * * @return boolean true if the browser is Kindle monochrome Native browser otherwise false */ - function is_kindle_touch( ) { + static function is_kindle_touch( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); @@ -1046,7 +1078,7 @@ class Jetpack_User_Agent_Info { // Detect if user agent is the WordPress.com Windows 8 app (used ONLY on the custom oauth stylesheet) - function is_windows8_auth( ) { + static function is_windows8_auth( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -1059,10 +1091,10 @@ class Jetpack_User_Agent_Info { } // Detect if user agent is the WordPress.com Windows 8 app. - function is_wordpress_for_win8( ) { + static function is_wordpress_for_win8( ) { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; - + $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); $pos = strpos( $agent, 'wp-windows8' ); if ( $pos !== false ) @@ -1070,15 +1102,15 @@ class Jetpack_User_Agent_Info { else return false; } - - + + /* * is_blackberry_tablet() can be used to check the User Agent for a RIM blackberry tablet * The user agent of the BlackBerry® Tablet OS follows a format similar to the following: * Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.8+ (KHTML, like Gecko) Version/0.0.1 Safari/534.8+ * */ - function is_blackberry_tablet() { + static function is_blackberry_tablet() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -1099,13 +1131,13 @@ class Jetpack_User_Agent_Info { is_blackbeberry() can be used to check the User Agent for a blackberry device Note that opera mini on BB matches this rule. */ - function is_blackbeberry() { + static function is_blackbeberry() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); - + $pos_blackberry = strpos( $agent, 'blackberry' ); if ( $pos_blackberry !== false ) { if ( self::is_opera_mini() || self::is_opera_mobile() || self::is_firefox_mobile() ) @@ -1120,7 +1152,7 @@ class Jetpack_User_Agent_Info { /* is_blackberry_10() can be used to check the User Agent for a BlackBerry 10 device. */ - function is_blackberry_10() { + static function is_blackberry_10() { $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); return ( strpos( $agent, 'bb10' ) !== false ) && ( strpos( $agent, 'mobile' ) !== false ); } @@ -1141,14 +1173,14 @@ class Jetpack_User_Agent_Info { * @return string Version of the BB OS. * If version is not found, get_blackbeberry_OS_version will return boolean false. */ - function get_blackbeberry_OS_version() { + static function get_blackbeberry_OS_version() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; if ( self::is_blackberry_10() ) return 'blackberry-10'; - + $agent = strtolower( $_SERVER['HTTP_USER_AGENT'] ); $pos_blackberry = stripos( $agent, 'blackberry' ); @@ -1223,7 +1255,7 @@ class Jetpack_User_Agent_Info { * @return string Type of the BB browser. * If browser's version is not found, detect_blackbeberry_browser_version will return boolean false. */ - function detect_blackberry_browser_version() { + static function detect_blackberry_browser_version() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; @@ -1232,7 +1264,7 @@ class Jetpack_User_Agent_Info { if ( self::is_blackberry_10() ) return 'blackberry-10'; - + $pos_blackberry = strpos( $agent, 'blackberry' ); if ( $pos_blackberry === false ) { //not a blackberry device @@ -1270,7 +1302,7 @@ class Jetpack_User_Agent_Info { } //Checks if a visitor is coming from one of the WordPress mobile apps - function is_mobile_app() { + static function is_mobile_app() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) return false; diff --git a/plugins/jetpack/class.jetpack-xmlrpc-server.php b/plugins/jetpack/class.jetpack-xmlrpc-server.php index 3aa5adb1..fd1b8939 100644 --- a/plugins/jetpack/class.jetpack-xmlrpc-server.php +++ b/plugins/jetpack/class.jetpack-xmlrpc-server.php @@ -30,7 +30,7 @@ class Jetpack_XMLRPC_Server { 'jetpack.featuresEnabled' => array( $this, 'features_enabled' ), 'jetpack.getPost' => array( $this, 'get_post' ), 'jetpack.getPosts' => array( $this, 'get_posts' ), - 'jetpack.getComment' => array( $this, 'get_comment' ), + 'jetpack.getComment' => array( $this, 'get_comment' ), 'jetpack.getComments' => array( $this, 'get_comments' ), ) ); @@ -158,7 +158,7 @@ class Jetpack_XMLRPC_Server { function test_connection() { return JETPACK__VERSION; } - + function test_api_user_code( $args ) { $client_id = (int) $args[0]; $user_id = (int) $args[1]; @@ -279,7 +279,7 @@ class Jetpack_XMLRPC_Server { return $sync_data; } - + function update_attachment_parent( $args ) { $attachment_id = (int) $args[0]; $parent_id = (int) $args[1]; diff --git a/plugins/jetpack/class.json-api-endpoints.php b/plugins/jetpack/class.json-api-endpoints.php index 6189d404..91c14808 100644 --- a/plugins/jetpack/class.json-api-endpoints.php +++ b/plugins/jetpack/class.json-api-endpoints.php @@ -55,7 +55,7 @@ abstract class WPCOM_JSON_API_Endpoint { // Is this endpoint still in testing phase? If so, not available to the public. var $in_testing = false; - + /** * @var string Version of the API */ @@ -161,15 +161,16 @@ abstract class WPCOM_JSON_API_Endpoint { // Get POST body data function input( $return_default_values = true, $cast_and_filter = true ) { $input = trim( $this->api->post_body ); - switch ( $this->api->content_type ) { + case 'application/json; charset=utf-8' : case 'application/json' : case 'application/x-javascript' : case 'text/javascript' : case 'text/x-javascript' : case 'text/x-json' : case 'text/json' : - $return = json_decode( $input ); + $return = json_decode( $input, true ); + if ( function_exists( 'json_last_error' ) ) { if ( JSON_ERROR_NONE !== json_last_error() ) { return null; @@ -180,9 +181,6 @@ abstract class WPCOM_JSON_API_Endpoint { } } - if ( is_object( $return ) ) { - $return = (array) $return; - } break; case 'multipart/form-data' : $return = array_merge( stripslashes_deep( $_POST ), $_FILES ); @@ -202,6 +200,7 @@ abstract class WPCOM_JSON_API_Endpoint { function cast_and_filter( $data, $documentation, $return_default_values = false, $for_output = false ) { $return_as_object = false; if ( is_object( $data ) ) { + // @todo this should probably be a deep copy if $data can ever have nested objects $data = (array) $data; $return_as_object = true; } elseif ( !is_array( $data ) ) { @@ -446,6 +445,16 @@ abstract class WPCOM_JSON_API_Endpoint { ); $return[$key] = (object) $this->cast_and_filter( $value, apply_filters( 'wpcom_json_api_attachment_cast_and_filter', $docs ), false, $for_output ); break; + case 'metadata' : + $docs = array( + 'id' => '(int)', + 'key' => '(string)', + 'value' => '(string|false|float|int|array|object)', + 'previous_value' => '(string)', + 'operation' => '(string)', + ); + $return[$key] = (object) $this->cast_and_filter( $value, apply_filters( 'wpcom_json_api_attachment_cast_and_filter', $docs ), false, $for_output ); + break; default : trigger_error( "Unknown API casting type {$type['type']}", E_USER_WARNING ); } @@ -517,7 +526,7 @@ abstract class WPCOM_JSON_API_Endpoint { 'body' => 'Request Parameters', 'response' => 'Response Parameters', ) as $doc_section_key => $label ) : - $doc_section = 'response' == $doc_section_key ? $doc['response']['body'] : $doc['request'][$doc_section_key]; + $doc_section = 'response' === $doc_section_key ? $doc['response']['body'] : $doc['request'][$doc_section_key]; if ( !$doc_section ) { continue; } @@ -560,29 +569,26 @@ abstract class WPCOM_JSON_API_Endpoint { example_response ) ) { + if ( empty( $this->example_response ) ) { // Examples for endpoint documentation response $response_key = 'dev_response_' . $this->version . '_' . $this->method . '_' . sanitize_title( $this->path ); - $response = get_option( $response_key ); + $response = wp_cache_get( $response_key ); // Response doesn't exist, so run the request - if ( empty( $response ) ) { + if ( false === $response ) { // Only trust GET request - if ( 'GET' == $this->method ) { - $response = wp_remote_get( $this->example_request ); - } - - // Set as false if it's an error - if ( is_wp_error( $response ) ) { - $response = false; - } + if ( 'GET' === $this->method ) { + $response = wp_remote_get( $this->example_request ); + $response_body = wp_remote_retrieve_body( $response ); - // Only update the option if there's a result - if ( !empty( $response ) ) { - $response = $response['body']; - update_option( $response_key, $response ); + // Only cache if there's a result + if ( strlen( $response_body ) ) { + wp_cache_set( $response_key, $response ); + } else { + wp_cache_delete( $response_key ); + } } } @@ -771,7 +777,7 @@ EOPHP; $type = '(string)'; } - if ( 'response_format' != $_property ) { + if ( 'response_format' !== $_property ) { // hack - don't show "(default)" in response format reset( $description ); $description_key = key( $description ); @@ -802,7 +808,7 @@ EOPHP; $item = compact( 'type', 'description' ); - if ( 'response_format' == $_property ) { + if ( 'response_format' === $_property ) { $doc['response'][$doc_item][$key] = $item; } else { $doc['request'][$doc_item][$key] = $item; @@ -819,7 +825,7 @@ EOPHP; return false; } - if ( 'inherit' == $post->post_status ) { + if ( 'inherit' === $post->post_status ) { $parent_post = get_post( $post->post_parent ); $post_status_obj = get_post_status_object( $parent_post->post_status ); } else { @@ -849,11 +855,11 @@ EOPHP; } if ( -1 == get_option( 'blog_public' ) && !current_user_can( 'read_post', $post->ID ) ) { - return new WP_Error( 'unauthorized', 'User cannot view post', 403 ); + return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) ); } if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) { - return new WP_Error( 'unauthorized', 'User cannot view password protected post', 403 ); + return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) ); } return true; @@ -876,6 +882,9 @@ EOPHP; $profile_URL = 'http://en.gravatar.com/' . md5( strtolower( trim( $email ) ) ); } else { if ( isset( $author->post_author ) ) { + if ( 0 == $author->post_author ) + return null; + $author = $author->post_author; } elseif ( isset( $author->user_id ) && $author->user_id ) { $author = $author->user_id; @@ -944,7 +953,7 @@ EOPHP; $response['description'] = (string) $taxonomy->description; $response['post_count'] = (int) $taxonomy->count; - if ( 'category' == $taxonomy_type ) + if ( 'category' === $taxonomy_type ) $response['parent'] = (int) $taxonomy->parent; $response['meta'] = (object) array( @@ -1009,11 +1018,11 @@ EOPHP; $gmt_offset = get_option( 'gmt_offset' ); $local_time = $time + $gmt_offset * 3600; - + $date = getdate( ( int ) $local_time ); $datetime->setDate( $date['year'], $date['mon'], $date['mday'] ); $datetime->setTime( $date['hours'], $date['minutes'], $date['seconds'] ); - + $local = $datetime->format( 'Y-m-d H:i:s' ); return array( (string) $local, (string) $gmt ); } @@ -1038,7 +1047,7 @@ EOPHP; } function get_taxonomy_link( $blog_id, $taxonomy_id, $taxonomy_type, $path = '' ) { - if ( 'category' == $taxonomy_type ) + if ( 'category' === $taxonomy_type ) return $this->get_link( '/sites/%d/categories/slug:%s', $blog_id, $taxonomy_id, $path ); else return $this->get_link( '/sites/%d/tags/slug:%s', $blog_id, $taxonomy_id, $path ); @@ -1091,14 +1100,14 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { ), 'password' => '(string) The plaintext password protecting the post, or, more likely, the empty string if the post is not password protected.', 'parent' => "(object>post_reference|false) A reference to the post's parent, if it has one.", - 'type' => array( - 'post' => 'A blog post.', - 'page' => 'A page.', - ), + 'type' => "(string) The post's post_type. Post types besides post and page need to be whitelisted using the rest_api_allowed_post_types filter.", 'comments_open' => '(bool) Is the post open for comments?', 'pings_open' => '(bool) Is the post open for pingbacks, trackbacks?', 'comment_count' => '(int) The number of comments for this post.', 'like_count' => '(int) The number of likes for this post.', + 'i_like' => '(bool) Does the current user like this post?', + 'is_reblogged' => '(bool) Did the current user reblog this post?', + 'is_following' => '(bool) Is the current user following this blog?', 'featured_image' => '(URL) The URL to the featured image for this post if it has one.', 'format' => array(), // see constructor 'geo' => '(object>geo|false)', @@ -1106,7 +1115,8 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { 'tags' => '(object:tag) Hash of tags (keyed by tag name) applied to the post.', 'categories' => '(object:category) Hash of categories (keyed by category name) applied to the post.', 'attachments' => '(object:attachment) Hash of post attachments (keyed by attachment ID).', - 'meta' => '(object) Meta data', + 'metadata' => '(array) Array of post metadata keys and values. All unprotected meta keys are available by default for read requests. Both unprotected and protected meta keys are avaiable for authenticated requests with access. Protected meta keys can be made available with the rest_api_allowed_public_metadata filter.', + 'meta' => '(object) API result meta data', ); // var $response_format =& $this->post_object_format; @@ -1121,6 +1131,30 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { parent::__construct( $args ); } + function is_post_type_allowed( $post_type ) { + + // if the post type is empty, that's fine, WordPress will default to post + if ( empty( $post_type ) ) + return true; + + // whitelist of post types that can be accessed + if ( in_array( $post_type, apply_filters( 'rest_api_allowed_post_types', array( 'post', 'page', 'any' ) ) ) ) + return true; + + return false; + } + + function is_metadata_public( $key ) { + if ( empty( $key ) ) + return false; + + // whitelist of metadata that can be accessed + if ( in_array( $key, apply_filters( 'rest_api_allowed_public_metadata', array() ) ) ) + return true; + + return false; + } + function the_password_form() { return __( 'This post is password protected.', 'jetpack' ); } @@ -1134,7 +1168,7 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { $geo = false; } - if ( 'display' == $context ) { + if ( 'display' === $context ) { $args = $this->query_args(); if ( isset( $args['content_width'] ) && $args['content_width'] ) { $GLOBALS['content_width'] = (int) $args['content_width']; @@ -1173,8 +1207,7 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { return new WP_Error( 'unknown_post', 'Unknown post', 404 ); } - $types = array( 'post', 'page' ); - if ( !in_array( $post->post_type, $types ) ) { + if ( ! $this->is_post_type_allowed( $post->post_type ) ) { return new WP_Error( 'unknown_post', 'Unknown post', 404 ); } @@ -1200,7 +1233,7 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { $post = get_post( $post->ID, OBJECT, $context ); $GLOBALS['post'] = $post; - if ( 'display' == $context ) { + if ( 'display' === $context ) { setup_postdata( $post ); } @@ -1221,7 +1254,7 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { $response[$key] = (string) $this->format_date( $post->post_modified_gmt, $post->post_modified ); break; case 'title' : - if ( 'display' == $context ) { + if ( 'display' === $context ) { $response[$key] = (string) get_the_title( $post->ID ); } else { $response[$key] = (string) $post->post_title; @@ -1234,7 +1267,7 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { $response[$key] = (string) esc_url_raw( wp_get_shortlink( $post->ID ) ); break; case 'content' : - if ( 'display' == $context ) { + if ( 'display' === $context ) { add_filter( 'the_password_form', array( $this, 'the_password_form' ) ); $response[$key] = (string) $this->get_the_post_content_for_display(); remove_filter( 'the_password_form', array( $this, 'the_password_form' ) ); @@ -1243,7 +1276,7 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { } break; case 'excerpt' : - if ( 'display' == $context ) { + if ( 'display' === $context ) { add_filter( 'the_password_form', array( $this, 'the_password_form' ) ); ob_start(); the_excerpt(); @@ -1289,6 +1322,15 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { case 'like_count' : $response[$key] = (int) $this->api->post_like_count( $blog_id, $post->ID ); break; + case 'i_like' : + $response[$key] = (int) $this->api->is_liked( $blog_id, $post->ID ); + break; + case 'is_reblogged': + $response[$key] = (int) $this->api->is_reblogged( $blog_id, $post->ID ); + break; + case 'is_following': + $response[$key] = (int) $this->api->is_following( $blog_id ); + break; case 'featured_image' : $image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); if ( is_array( $image_attributes ) && isset( $image_attributes[0] ) ) @@ -1379,6 +1421,32 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { } $response[$key] = (object) $response[$key]; break; + case 'metadata' : // (array|false) + $metadata = array(); + foreach ( (array) has_meta( $post_id ) as $meta ) { + // Don't expose protected fields. + $show = false; + if ( $this->is_metadata_public( $meta['meta_key'] ) ) + $show = true; + if ( current_user_can( 'edit_post_meta', $post_id , $meta['meta_key'] ) ) + $show = true; + + if ( !$show ) + continue; + + $metadata[] = array( + 'id' => $meta['meta_id'], + 'key' => $meta['meta_key'], + 'value' => maybe_unserialize( $meta['meta_value'] ), + ); + } + + if ( ! empty( $metadata ) ) { + $response[$key] = $metadata; + } else { + $response[$key] = false; + } + break; case 'meta' : $response[$key] = (object) array( 'links' => (object) array( @@ -1462,7 +1530,7 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { $size = 'win8app-column'; $id = intval( $id ); - if ( 'RAND' == $order ) + if ( 'RAND' === $order ) $orderby = 'none'; if ( !empty( $include ) ) { @@ -1481,7 +1549,7 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { if ( ! empty( $attachments ) ) { foreach ( $attachments as $id => $attachment ) { - $link = isset( $attr['link'] ) && 'file' == $attr['link'] ? wp_get_attachment_link( $id, $size, false, false ) : wp_get_attachment_link( $id, $size, true, false ); + $link = isset( $attr['link'] ) && 'file' === $attr['link'] ? wp_get_attachment_link( $id, $size, false, false ) : wp_get_attachment_link( $id, $size, true, false ); if ( $captiontag && trim($attachment->post_excerpt) ) { $output .= "
$link @@ -1509,8 +1577,8 @@ abstract class WPCOM_JSON_API_Post_Endpoint extends WPCOM_JSON_API_Endpoint { 'URL' => (string) wp_get_attachment_url( $attachment->ID ), 'guid' => (string) $attachment->guid, 'mime_type' => (string) $attachment->post_mime_type, - 'width' => (int) $metadata['width'], - 'height' => (int) $metadata['height'], + 'width' => (int) isset( $metadata['width'] ) ? $metadata['width'] : 0, + 'height' => (int) isset( $metadata['height'] ) ? $metadata['height'] : 0, ); if ( isset( $metadata['duration'] ) ) { @@ -1573,16 +1641,37 @@ class WPCOM_JSON_API_List_Posts_Endpoint extends WPCOM_JSON_API_Post_Endpoint { return new WP_Error( 'invalid_number', 'The NUMBER parameter must be less than or equal to 100.', 400 ); } + if ( ! $this->is_post_type_allowed( $args['type'] ) ) { + return new WP_Error( 'unknown_post_type', 'Unknown post type', 404 ); + } + $query = array( 'posts_per_page' => $args['number'], 'order' => $args['order'], 'orderby' => $args['order_by'], - 'post_type' => $args['type'], + 'post_type' => ( 'any' == $args['type'] ) ? array( 'post', 'page' ) : $args['type'], 'post_status' => $args['status'], 'author' => isset( $args['author'] ) && 0 < $args['author'] ? $args['author'] : null, 's' => isset( $args['search'] ) ? $args['search'] : null, ); + if ( isset( $args['meta_key'] ) ) { + $show = false; + if ( $this->is_metadata_public( $args['meta_key'] ) ) + $show = true; + if ( current_user_can( 'edit_post_meta', $query['post_type'], $args['meta_key'] ) ) + $show = true; + + if ( is_protected_meta( $args['meta_key'], 'post' ) && ! $show ) + return new WP_Error( 'invalid_meta_key', 'Invalid meta key', 404 ); + + $meta = array( 'key' => $args['meta_key'] ); + if ( isset( $args['meta_value'] ) ) + $meta['value'] = $args['meta_value']; + + $query['meta_query'] = array( $meta ); + } + if ( isset( $args['sticky'] ) && @@ -1735,8 +1824,16 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { return new WP_Error( 'invalid_input', 'Invalid request input', 400 ); } + // default to post + if ( empty( $input['type'] ) ) + $input['type'] = 'post'; + $post_type = get_post_type_object( $input['type'] ); + if ( ! $this->is_post_type_allowed( $input['type'] ) ) { + return new WP_Error( 'unknown_post_type', 'Unknown post type', 404 ); + } + if ( 'publish' === $input['status'] ) { if ( !current_user_can( $post_type->cap->publish_posts ) ) { if ( current_user_can( $post_type->cap->edit_posts ) ) { @@ -1782,12 +1879,21 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { if ( !empty( $input['categories'] )) { if ( is_array( $input['categories'] ) ) { - $categories = $input['categories']; + $_categories = $input['categories']; } else { foreach ( explode( ',', $input['categories'] ) as $category ) { - $categories[] = $category; + $_categories[] = $category; } } + foreach ( $_categories as $category ) { + if ( !$category_info = term_exists( $category, 'category' ) ) { + if ( is_int( $category ) ) + continue; + $category_info = wp_insert_term( $category, 'category' ); + } + if ( !is_wp_error( $category_info ) ) + $categories[] = (int) $category_info['term_id']; + } } if ( !empty( $input['tags'] ) ) { @@ -1802,9 +1908,9 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { } unset( $input['tags'], $input['categories'] ); - + $insert = array(); - + if ( !empty( $input['slug'] ) ) { $insert['post_name'] = $input['slug']; unset( $input['slug'] ); @@ -1814,22 +1920,30 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { $insert['comment_status'] = 'open'; else if ( false === $input['comments_open'] ) $insert['comment_status'] = 'closed'; - + if ( true === $input['pings_open'] ) $insert['ping_status'] = 'open'; else if ( false === $input['pings_open'] ) $insert['ping_status'] = 'closed'; - + unset( $input['comments_open'], $input['pings_open'] ); - + $publicize = $input['publicize']; $publicize_custom_message = $input['publicize_message']; unset( $input['publicize'], $input['publicize_message'] ); - + + $metadata = $input['metadata']; + unset( $input['metadata'] ); + foreach ( $input as $key => $value ) { $insert["post_$key"] = $value; } - + + if ( !empty( $tags ) ) + $insert["tax_input"]["post_tag"] = $tags; + if ( !empty( $categories ) ) + $insert["tax_input"]["category"] = $categories; + $has_media = isset( $input['media'] ) && $input['media'] ? count( $input['media'] ) : false; if ( $new ) { @@ -1868,9 +1982,9 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { } if ( !$post_id || is_wp_error( $post_id ) ) { - return null; + return $post_id; } - + if ( $publicize === false ) { foreach ( $GLOBALS['publicize_ui']->publicize->get_services( 'all' ) as $name => $service ) { update_post_meta( $post_id, $GLOBALS['publicize_ui']->publicize->POST_SKIP . $name, 1 ); @@ -1882,17 +1996,80 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { } } } - + if ( !empty( $publicize_custom_message ) ) - update_post_meta( $post_id, $GLOBALS['publicize_ui']->publicize->POST_MESS, trim( $publicize_custom_message ) ); - - if ( is_array( $categories ) ) - wp_set_object_terms( $post_id, $categories, 'category' ); - if ( is_array( $tags ) ) - wp_set_object_terms( $post_id, $tags, 'post_tag' ); + update_post_meta( $post_id, $GLOBALS['publicize_ui']->publicize->POST_MESS, trim( $publicize_custom_message ) ); set_post_format( $post_id, $insert['post_format'] ); + if ( ! empty( $metadata ) ) { + foreach ( (array) $metadata as $meta ) { + + $meta = (object) $meta; + + $existing_meta_item = new stdClass; + + if ( empty( $meta->operation ) ) + $meta->operation = 'update'; + + if ( ! empty( $meta->value ) ) { + if ( 'true' == $meta->value ) + $meta->value = true; + if ( 'false' == $meta->value ) + $meta->value = false; + } + + if ( ! empty( $meta->id ) ) { + $meta->id = absint( $meta->id ); + $existing_meta_item = get_metadata_by_mid( 'post', $meta->id ); + } + + $unslashed_meta_key = wp_unslash( $meta->key ); // should match what the final key will be + $meta->key = wp_slash( $meta->key ); + $unslashed_existing_meta_key = wp_unslash( $existing_meta_item->meta_key ); + $existing_meta_item->meta_key = wp_slash( $existing_meta_item->meta_key ); + + switch ( $meta->operation ) { + case 'delete': + + if ( ! empty( $meta->id ) && ! empty( $existing_meta_item->meta_key ) && current_user_can( 'delete_post_meta', $post_id, $unslashed_existing_meta_key ) ) { + delete_metadata_by_mid( 'post', $meta->id ); + } elseif ( ! empty( $meta->key ) && ! empty( $meta->previous_value ) && current_user_can( 'delete_post_meta', $post_id, $unslashed_meta_key ) ) { + delete_post_meta( $post_id, $meta->key, $meta->previous_value ); + } elseif ( ! empty( $meta->key ) && current_user_can( 'delete_post_meta', $post_id, $unslashed_meta_key ) ) { + delete_post_meta( $post_id, $meta->key ); + } + + break; + case 'add': + + if ( ! empty( $meta->id ) || ! empty( $meta->previous_value ) ) { + continue; + } elseif ( ! empty( $meta->key ) && ! empty( $meta->value ) && current_user_can( 'add_post_meta', $post_id, $unslashed_meta_key ) ) { + add_post_meta( $post_id, $meta->key, $meta->value ); + } + + break; + case 'update': + + if ( empty( $meta->value ) ) { + continue; + } elseif ( ! empty( $meta->id ) && ! empty( $existing_meta_item->meta_key ) && current_user_can( 'edit_post_meta', $post_id, $unslashed_existing_meta_key ) ) { + update_metadata_by_mid( 'post', $meta->id, $meta->value ); + } elseif ( ! empty( $meta->key ) && ! empty( $meta->previous_value ) && current_user_can( 'edit_post_meta', $post_id, $unslashed_meta_key ) ) { + update_post_meta( $post_id, $meta->key,$meta->value, $meta->previous_value ); + } elseif ( ! empty( $meta->key ) && current_user_can( 'edit_post_meta', $post_id, $unslashed_meta_key ) ) { + update_post_meta( $post_id, $meta->key, $meta->value ); + } + + break; + } + + } + } + + do_action( 'rest_api_inserted_post', $post_id, $insert, $new ); + $return = $this->get_post_by( 'ID', $post_id, $args['context'] ); if ( !$return || is_wp_error( $return ) ) { return $return; @@ -1910,6 +2087,10 @@ class WPCOM_JSON_API_Update_Post_Endpoint extends WPCOM_JSON_API_Post_Endpoint { return new WP_Error( 'unknown_post', 'Unknown post', 404 ); } + if ( ! $this->is_post_type_allowed( $post->post_type ) ) { + return new WP_Error( 'unknown_post_type', 'Unknown post type', 404 ); + } + if ( !current_user_can( 'delete_post', $post->ID ) ) { return new WP_Error( 'unauthorized', 'User cannot delete posts', 403 ); } @@ -2039,7 +2220,7 @@ class WPCOM_JSON_API_Update_Taxonomy_Endpoint extends WPCOM_JSON_API_Taxonomy_En return new WP_Error( 'unknown_taxonomy', 'A taxonomy with that name already exists', 404 ); } - if ( 'category' != $taxonomy_type ) + if ( 'category' !== $taxonomy_type ) $input['parent'] = 0; $data = wp_insert_term( addslashes( $input['name'] ), $taxonomy_type, @@ -2048,8 +2229,12 @@ class WPCOM_JSON_API_Update_Taxonomy_Endpoint extends WPCOM_JSON_API_Taxonomy_En 'parent' => $input['parent'] ) ); - + + if ( is_wp_error( $data ) ) + return $data; + $taxonomy = get_term_by( 'id', $data['term_id'], $taxonomy_type ); + $return = $this->get_taxonomy( $taxonomy->slug, $taxonomy_type, $args['context'] ); if ( !$return || is_wp_error( $return ) ) { return $return; @@ -2081,7 +2266,7 @@ class WPCOM_JSON_API_Update_Taxonomy_Endpoint extends WPCOM_JSON_API_Taxonomy_En } $update = array(); - if ( 'category' == $taxonomy_type && !empty( $input['parent'] ) ) + if ( 'category' === $taxonomy_type && !empty( $input['parent'] ) ) $update['parent'] = $input['parent']; if ( !empty( $input['description'] ) ) @@ -2093,7 +2278,7 @@ class WPCOM_JSON_API_Update_Taxonomy_Endpoint extends WPCOM_JSON_API_Taxonomy_En $data = wp_update_term( $taxonomy->term_id, $taxonomy_type, $update ); $taxonomy = get_term_by( 'id', $data['term_id'], $taxonomy_type ); - + $return = $this->get_taxonomy( $taxonomy->slug, $taxonomy_type, $args['context'] ); if ( !$return || is_wp_error( $return ) ) { return $return; @@ -2266,7 +2451,7 @@ abstract class WPCOM_JSON_API_Comment_Endpoint extends WPCOM_JSON_API_Endpoint { $response[$key] = (string) esc_url_raw( wp_get_shortlink( $post->ID ) . "%23comment-{$comment->comment_ID}" ); break; case 'content' : - if ( 'display' == $context ) { + if ( 'display' === $context ) { ob_start(); comment_text(); $response[$key] = (string) ob_get_clean(); @@ -2694,17 +2879,28 @@ class WPCOM_JSON_API_Update_Comment_Endpoint extends WPCOM_JSON_API_Comment_Endp } if ( isset( $update['comment_status'] ) ) { + if ( count( $update ) === 1 ) { + // We are only here to update the comment status so let's respond ASAP + add_action( 'wp_set_comment_status', array( $this, 'output_comment' ), 0, 1 ); + } switch ( $update['comment_status'] ) { + case 'approved' : + if ( 'approve' !== $comment_status ) { + wp_set_comment_status( $comment->comment_ID, 'approve' ); + } + break; case 'unapproved' : - $update['comment_approved'] = 0; + if ( 'hold' !== $comment_status ) { + wp_set_comment_status( $comment->comment_ID, 'hold' ); + } break; case 'spam' : - if ( 'spam' != $comment_status ) { + if ( 'spam' !== $comment_status ) { wp_spam_comment( $comment->comment_ID ); } break; case 'unspam' : - if ( 'spam' == $comment_status ) { + if ( 'spam' === $comment_status ) { wp_unspam_comment( $comment->comment_ID ); } break; @@ -2713,12 +2909,12 @@ class WPCOM_JSON_API_Update_Comment_Endpoint extends WPCOM_JSON_API_Comment_Endp return new WP_Error( 'trash_disabled', 'Cannot trash comment', 403 ); } - if ( 'trash' != $comment_status ) { + if ( 'trash' !== $comment_status ) { wp_trash_comment( $comment_id ); } break; case 'untrash' : - if ( 'trash' == $comment_status ) { + if ( 'trash' === $comment_status ) { wp_untrash_comment( $comment->comment_ID ); } break; @@ -2729,9 +2925,10 @@ class WPCOM_JSON_API_Update_Comment_Endpoint extends WPCOM_JSON_API_Comment_Endp unset( $update['comment_status'] ); } - $update['comment_ID'] = $comment->comment_ID; - - wp_update_comment( add_magic_quotes( $update ) ); + if ( ! empty( $update ) ) { + $update['comment_ID'] = $comment->comment_ID; + wp_update_comment( add_magic_quotes( $update ) ); + } $return = $this->get_comment( $comment->comment_ID, $args['context'] ); if ( !$return || is_wp_error( $return ) ) { @@ -2770,6 +2967,12 @@ class WPCOM_JSON_API_Update_Comment_Endpoint extends WPCOM_JSON_API_Comment_Endp return $this->get_comment( $comment->comment_ID, $args['context'] ); } + + function output_comment( $comment_id ) { + $args = $this->query_args(); + $output = $this->get_comment( $comment_id, $args['context'] ); + $this->api->output_early( 200, $output ); + } } class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint { @@ -2838,16 +3041,20 @@ class WPCOM_JSON_API_GET_Site_Endpoint extends WPCOM_JSON_API_Endpoint { } } + + /* * Set up endpoints */ + + /* * Site endpoints */ new WPCOM_JSON_API_GET_Site_Endpoint( array( 'description' => 'Information about a site ID/domain', - 'group' => 'Sites', + 'group' => 'sites', 'stat' => 'sites:X', 'method' => 'GET', @@ -2880,7 +3087,7 @@ new WPCOM_JSON_API_GET_Site_Endpoint( array( */ new WPCOM_JSON_API_List_Posts_Endpoint( array( 'description' => 'Return matching Posts', - 'group' => 'Posts', + 'group' => 'posts', 'stat' => 'posts', 'method' => 'GET', @@ -2907,11 +3114,7 @@ new WPCOM_JSON_API_List_Posts_Endpoint( array( 'before' => '(ISO 8601 datetime) Return posts dated on or before the specified datetime.', 'tag' => '(string) Specify the tag name or slug.', 'category' => '(string) Specify the category name or slug.', - 'type' => array( - 'post' => 'Return only blog posts.', - 'page' => 'Return only pages.', - 'any' => 'Return both blog posts and pages.', - ), + 'type' => "(string) Specify the post type. Defaults to 'post', use 'any' to query for both posts and pages. Post types besides post and page need to be whitelisted using the rest_api_allowed_post_types filter.", 'status' => array( 'publish' => 'Return only published posts.', 'private' => 'Return only private posts.', @@ -2924,6 +3127,8 @@ new WPCOM_JSON_API_List_Posts_Endpoint( array( 'sticky' => '(bool) Specify the stickiness.', 'author' => "(int) Author's user ID", 'search' => '(string) Search query', + 'meta_key' => '(string) Metadata key that the post should contain', + 'meta_value' => '(string) Metadata value that the post should contain. Will only be applied if a `meta_key` is also given', ), 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/en.blog.wordpress.com/posts/?number=5&pretty=1' @@ -2931,7 +3136,7 @@ new WPCOM_JSON_API_List_Posts_Endpoint( array( new WPCOM_JSON_API_Get_Post_Endpoint( array( 'description' => 'Return a single Post (by ID)', - 'group' => 'Posts', + 'group' => 'posts', 'stat' => 'posts:1', 'method' => 'GET', @@ -2961,7 +3166,7 @@ new WPCOM_JSON_API_Get_Post_Endpoint( array( new WPCOM_JSON_API_Get_Post_Endpoint( array( 'description' => 'Return a single Post (by slug)', - 'group' => 'Posts', + 'group' => 'posts', 'stat' => 'posts:slug', 'method' => 'GET', @@ -2976,7 +3181,7 @@ new WPCOM_JSON_API_Get_Post_Endpoint( array( new WPCOM_JSON_API_Update_Post_Endpoint( array( 'description' => 'Create a Post', - 'group' => 'Posts', + 'group' => 'posts', 'stat' => 'posts:new', 'method' => 'POST', @@ -3002,15 +3207,13 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( ), 'password' => '(string) The plaintext password protecting the post, or, more likely, the empty string if the post is not password protected.', 'parent' => "(int) The post ID of the new post's parent.", - 'type' => array( - 'post' => 'Create a blog post.', - 'page' => 'Create a page.', - ), + 'type' => "(string) The post type. Defaults to 'post'. Post types besides post and page need to be whitelisted using the rest_api_allowed_post_types filter.", 'categories' => "(array|string) Comma separated list or array of categories (name or id)", 'tags' => "(array|string) Comma separated list or array of tags (name or id)", 'format' => get_post_format_strings(), 'media' => "(media) An array of images to attach to the post. To upload media, the entire request should be multipart/form-data encoded. Multiple media items will be displayed in a gallery. Accepts images (image/gif, image/jpeg, image/png) only.

Example:
" . "curl \
--form 'title=Image' \
--form 'media[]=@/path/to/file.jpg' \
-H 'Authorization: BEARER your-token' \
'https://public-api.wordpress.com/rest/v1/sites/123/posts/new'
", + 'metadata' => "(array) Array of metadata objects containing the following properties: `key` (metadata key), `id` (meta ID), `previous_value` (if set, the action will only occur for the provided previous value), `value` (the new value to set the meta to), `operation` (the operation to perform: `update` or `add`; defaults to `update`). All unprotected meta keys are available by default for read requests. Both unprotected and protected meta keys are avaiable for authenticated requests with access. Protected meta keys can be made available with the rest_api_allowed_public_metadata filter.", 'comments_open' => "(bool) Should the post be open to comments? Defaults to the blog's preference.", 'pings_open' => "(bool) Should the post be open to comments? Defaults to the blog's preference.", ), @@ -3026,7 +3229,7 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( 'title' => 'Hello World', 'content' => 'Hello. I am a test post. I was created by the API', 'tags' => 'tests', - 'categories' => 'API' + 'categories' => 'API' ) ), @@ -3056,11 +3259,14 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( "pings_open": true, "comment_count": 0, "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, "featured_image": "", "format": "standard", "geo": false, "publicize_URLs": [ - + ], "tags": { "tests": { @@ -3093,6 +3299,13 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( } } }, + "metadata { + { + "id" : 123, + "key" : "test_meta_key", + "value" : "test_value", + } + }, "meta": { "links": { "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/30434183\/posts\/1270", @@ -3107,7 +3320,7 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( new WPCOM_JSON_API_Update_Post_Endpoint( array( 'description' => 'Edit a Post', - 'group' => 'Posts', + 'group' => 'posts', 'stat' => 'posts:1:POST', 'method' => 'POST', @@ -3138,6 +3351,7 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( 'format' => get_post_format_strings(), 'comments_open' => '(bool) Should the post be open to comments?', 'pings_open' => '(bool) Should the post be open to comments?', + 'metadata' => "(array) Array of metadata objects containing the following properties: `key` (metadata key), `id` (meta ID), `previous_value` (if set, the action will only occur for the provided previous value), `value` (the new value to set the meta to), `operation` (the operation to perform: `update` or `add`; defaults to `update`). All unprotected meta keys are available by default for read requests. Both unprotected and protected meta keys are avaiable for authenticated requests with access. Protected meta keys can be made available with the rest_api_allowed_public_metadata filter.", ), 'example_request' => 'https://public-api.wordpress.com/rest/v1/sites/30434183/posts/1222/', @@ -3151,7 +3365,7 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( 'title' => 'Hello World (Again)', 'content' => 'Hello. I am an edited post. I was edited by the API', 'tags' => 'tests', - 'categories' => 'API' + 'categories' => 'API' ) ), @@ -3181,11 +3395,14 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( "pings_open": true, "comment_count": 5, "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, "featured_image": "", "format": "standard", "geo": false, "publicize_URLs": [ - + ], "tags": { "tests": { @@ -3218,6 +3435,13 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( } } }, + "metadata { + { + "id" : 123, + "key" : "test_meta_key", + "value" : "test_value", + } + }, "meta": { "links": { "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/30434183\/posts\/1222", @@ -3232,8 +3456,8 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( ) ); new WPCOM_JSON_API_Update_Post_Endpoint( array( - 'description' => 'Delete a Post', - 'group' => 'Posts', + 'description' => 'Delete a Post. Note: If the post object is of type post or page and the trash is enabled, this request will send the post to the trash. A second request will permanently delete the post.', + 'group' => 'posts', 'stat' => 'posts:1:delete', 'method' => 'POST', @@ -3277,11 +3501,14 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( "pings_open": true, "comment_count": 5, "like_count": 0, + "i_like": false, + "is_reblogged": false, + "is_following": false, "featured_image": "", "format": "standard", "geo": false, "publicize_URLs": [ - + ], "tags": { "tests": { @@ -3298,6 +3525,13 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( } } }, + "metadata { + { + "id" : 123, + "key" : "test_meta_key", + "value" : "test_value", + } + }, "categories": { "API": { "name": "API", @@ -3332,7 +3566,7 @@ new WPCOM_JSON_API_Update_Post_Endpoint( array( */ new WPCOM_JSON_API_List_Comments_Endpoint( array( 'description' => 'Return recent Comments', - 'group' => 'Comments', + 'group' => 'comments', 'stat' => 'comments', 'method' => 'GET', @@ -3346,7 +3580,7 @@ new WPCOM_JSON_API_List_Comments_Endpoint( array( new WPCOM_JSON_API_List_Comments_Endpoint( array( 'description' => 'Return recent Comments for a Post', - 'group' => 'Comments', + 'group' => 'comments', 'stat' => 'posts:1:replies', 'method' => 'GET', @@ -3361,7 +3595,7 @@ new WPCOM_JSON_API_List_Comments_Endpoint( array( new WPCOM_JSON_API_Get_Comment_Endpoint( array( 'description' => 'Return a single Comment', - 'group' => 'Comments', + 'group' => 'comments', 'stat' => 'comments:1', 'method' => 'GET', @@ -3376,7 +3610,7 @@ new WPCOM_JSON_API_Get_Comment_Endpoint( array( new WPCOM_JSON_API_Update_Comment_Endpoint( array( 'description' => 'Create a Comment on a Post', - 'group' => 'Comments', + 'group' => 'comments', 'stat' => 'posts:1:replies:new', 'method' => 'POST', @@ -3447,7 +3681,7 @@ new WPCOM_JSON_API_Update_Comment_Endpoint( array( new WPCOM_JSON_API_Update_Comment_Endpoint( array( 'description' => 'Create a Comment as a reply to another Comment', - 'group' => 'Comments', + 'group' => 'comments', 'stat' => 'comments:1:replies:new', 'method' => 'POST', @@ -3517,7 +3751,7 @@ new WPCOM_JSON_API_Update_Comment_Endpoint( array( new WPCOM_JSON_API_Update_Comment_Endpoint( array( 'description' => 'Edit a Comment', - 'group' => 'Comments', + 'group' => 'comments', 'stat' => 'comments:1:POST', 'method' => 'POST', @@ -3592,7 +3826,7 @@ new WPCOM_JSON_API_Update_Comment_Endpoint( array( new WPCOM_JSON_API_Update_Comment_Endpoint( array( 'description' => 'Delete a Comment', - 'group' => 'Comments', + 'group' => 'comments', 'stat' => 'comments:1:delete', 'method' => 'POST', @@ -3654,7 +3888,7 @@ new WPCOM_JSON_API_Update_Comment_Endpoint( array( */ new WPCOM_JSON_API_Get_Taxonomy_Endpoint( array( 'description' => 'Returns information on a single Category', - 'group' => 'Taxonomy', + 'group' => 'taxonomy', 'stat' => 'categories:1', 'method' => 'GET', @@ -3669,7 +3903,7 @@ new WPCOM_JSON_API_Get_Taxonomy_Endpoint( array( new WPCOM_JSON_API_Get_Taxonomy_Endpoint( array( 'description' => 'Returns information on a single Tag', - 'group' => 'Taxonomy', + 'group' => 'taxonomy', 'stat' => 'tags:1', 'method' => 'GET', @@ -3684,7 +3918,7 @@ new WPCOM_JSON_API_Get_Taxonomy_Endpoint( array( new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( 'description' => 'Create a new Category', - 'group' => 'Taxonomy', + 'group' => 'taxonomy', 'stat' => 'categories:new', 'method' => 'POST', @@ -3727,7 +3961,7 @@ new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( 'description' => 'Create a new Tag', - 'group' => 'Taxonomy', + 'group' => 'taxonomy', 'stat' => 'tags:new', 'method' => 'POST', @@ -3769,7 +4003,7 @@ new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( 'description' => 'Edit a Tag', - 'group' => 'Taxonomy', + 'group' => 'taxonomy', 'stat' => 'tags:1:POST', 'method' => 'POST', @@ -3812,7 +4046,7 @@ new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( 'description' => 'Edit a Category', - 'group' => 'Taxonomy', + 'group' => 'taxonomy', 'stat' => 'categories:1:POST', 'method' => 'POST', @@ -3857,7 +4091,7 @@ new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( 'description' => 'Delete a Category', - 'group' => 'Taxonomy', + 'group' => 'taxonomy', 'stat' => 'categories:1:delete', 'method' => 'POST', @@ -3885,7 +4119,7 @@ new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( new WPCOM_JSON_API_Update_Taxonomy_Endpoint( array( 'description' => 'Delete a Tag', - 'group' => 'Taxonomy', + 'group' => 'taxonomy', 'stat' => 'tags:1:delete', 'method' => 'POST', diff --git a/plugins/jetpack/class.json-api.php b/plugins/jetpack/class.json-api.php index 5a322eb6..b94ce590 100644 --- a/plugins/jetpack/class.json-api.php +++ b/plugins/jetpack/class.json-api.php @@ -12,6 +12,7 @@ class WPCOM_JSON_API { var $method = ''; var $url = ''; var $path = ''; + var $version = null; var $query = array(); var $post_body = null; var $files = null; @@ -23,6 +24,7 @@ class WPCOM_JSON_API { var $public_api_scheme = 'https'; var $trapped_error = null; + var $did_output = false; static function init( $method = null, $url = null, $post_body = null ) { if ( !self::$self ) { @@ -78,7 +80,7 @@ class WPCOM_JSON_API { $this->accept = $_SERVER['HTTP_ACCEPT']; } - if ( 'POST' == $this->method ) { + if ( 'POST' === $this->method ) { if ( is_null( $post_body ) ) { $this->post_body = file_get_contents( 'php://input' ); @@ -122,11 +124,17 @@ class WPCOM_JSON_API { add_filter( 'comment_edit_pre', array( $this, 'comment_edit_pre' ) ); - $this->initialize(); + $initialization = $this->initialize(); + if ( is_wp_error( $initialization ) ) { + $this->output_error( $initialization ); + return; + } - // Normalize path + // Normalize path and extract API version $this->path = untrailingslashit( $this->path ); - $this->path = preg_replace( '#^/rest/v1#', '', $this->path ); + preg_match( '#^/rest/v1(\.\d+)*#', $this->path, $matches ); + $this->path = substr( $this->path, strlen( $matches[0] ) ); + $this->version = $matches[1]; $allowed_methods = array( 'GET', 'POST' ); $four_oh_five = false; @@ -156,7 +164,7 @@ class WPCOM_JSON_API { $methods = $allowed_methods; $find_all_matching_endpoints = true; $four_oh_five = true; - } + } } // Find which endpoint to serve @@ -238,25 +246,37 @@ class WPCOM_JSON_API { if ( !$response ) { return $this->output( 500, '', 'text/plain' ); } elseif ( is_wp_error( $response ) ) { - $status_code = $response->get_error_data(); - if ( !$status_code ) { - $status_code = 400; - } - $response = array( - 'error' => $response->get_error_code(), - 'message' => $response->get_error_message(), - ); - return $this->output( $status_code, $response ); + return $this->output_error( $response ); } return $this->output( 200, $response ); } function process_request( WPCOM_JSON_API_Endpoint $endpoint, $path_pieces ) { + $this->endpoint = $endpoint; return call_user_func_array( array( $endpoint, 'callback' ), $path_pieces ); } + function output_early( $status_code, $response = null, $content_type = 'application/json' ) { + $exit = $this->exit; + $this->exit = false; + if ( is_wp_error( $response ) ) + $this->output_error( $response ); + else + $this->output( $status_code, $response, $content_type ); + $this->exit = $exit; + $this->finish_request(); + } + function output( $status_code, $response = null, $content_type = 'application/json' ) { + // In case output() was called before the callback returned + if ( $this->did_output ) { + if ( $this->exit ) + exit; + return $content_type; + } + $this->did_output = true; + if ( is_null( $response ) ) { $response = new stdClass; } @@ -310,6 +330,22 @@ class WPCOM_JSON_API { return $content_type; } + function output_error( $error ) { + $status_code = $error->get_error_data(); + + if ( is_array( $status_code ) ) + $status_code = $status_code['status_code']; + + if ( !$status_code ) { + $status_code = 400; + } + $response = array( + 'error' => $error->get_error_code(), + 'message' => $error->get_error_message(), + ); + return $this->output( $status_code, $response ); + } + function ensure_http_scheme_of_home_url( $url, $path, $original_scheme ) { if ( $original_scheme ) { return $url; @@ -352,6 +388,18 @@ class WPCOM_JSON_API { return 0; } + function is_liked( $blog_id, $post_id ) { + return false; + } + + function is_reblogged( $blog_id, $post_id ) { + return false; + } + + function is_following( $blog_id ) { + return false; + } + function get_avatar_url( $email ) { add_filter( 'pre_option_show_avatars', '__return_true', 999 ); $_SERVER['HTTPS'] = 'off'; @@ -440,4 +488,9 @@ class WPCOM_JSON_API { 'message' => $this->trapped_error['message'], ) ); } + + function finish_request() { + if ( function_exists( 'fastcgi_finish_request' ) ) + return fastcgi_finish_request(); + } } diff --git a/plugins/jetpack/class.photon.php b/plugins/jetpack/class.photon.php index c0456885..b7e2ddfa 100644 --- a/plugins/jetpack/class.photon.php +++ b/plugins/jetpack/class.photon.php @@ -135,7 +135,7 @@ class Jetpack_Photon { $images = Jetpack_Photon::parse_images_from_html( $content ); if ( ! empty( $images ) ) { - global $content_width; + $content_width = Jetpack::get_content_width(); $image_sizes = self::image_sizes(); $upload_dir = wp_upload_dir(); @@ -309,6 +309,10 @@ class Jetpack_Photon { // Replace original tag with modified version $content = str_replace( $tag, $new_tag, $content ); } + } elseif ( preg_match( '#^http(s)?://i[\d]{1}.wp.com#', $src ) && ! empty( $images['link_url'][ $index ] ) && self::validate_image_url( $images['link_url'][ $index ] ) ) { + $new_tag = preg_replace( '#(href=["|\'])' . $images['link_url'][ $index ] . '(["|\'])#i', '\1' . jetpack_photon_url( $images['link_url'][ $index ] ) . '\2', $tag, 1 ); + + $content = str_replace( $tag, $new_tag, $content ); } } } diff --git a/plugins/jetpack/functions.gallery.php b/plugins/jetpack/functions.gallery.php index 9a9e71b5..fd9319ed 100644 --- a/plugins/jetpack/functions.gallery.php +++ b/plugins/jetpack/functions.gallery.php @@ -9,10 +9,10 @@ class Jetpack_Gallery_Settings { } function admin_init() { - $this->gallery_types = apply_filters( 'jetpack_gallery_types', array() ); + $this->gallery_types = apply_filters( 'jetpack_gallery_types', array( 'default' => __( 'Thumbnail Grid', 'jetpack' ) ) ); // Enqueue the media UI only if needed. - if ( ! empty( $this->gallery_types ) ) { + if ( count( $this->gallery_types ) > 1 ) { add_action( 'wp_enqueue_media', array( $this, 'wp_enqueue_media' ) ); add_action( 'print_media_templates', array( $this, 'print_media_templates' ) ); } @@ -32,14 +32,15 @@ class Jetpack_Gallery_Settings { * Outputs a view template which can be used with wp.media.template */ function print_media_templates() { + $default_gallery_type = apply_filters( 'jetpack_default_gallery_type', 'default' ); + ?> - - - - - - -
- -

-
    - 'id', - 'BLOG_TOKEN' => 'blog_token', - 'MASTER_USER' => 'master_user', - 'CERT' => 'fallback_no_verify_ssl_certs', - 'TIME_DIFF' => 'time_diff', - 'VERSION' => 'version', - 'OLD_VERSION' => 'old_version', - 'PUBLIC' => 'public', - ) as $label => $option_name ) : - ?> -
  • :
  • - -
  • USER_ID:
  • -
  • USER_TOKEN:
  • -
  • PHP_VERSION:
  • -
  • WORDPRESS_VERSION:
  • -
- - -
-

- ' . __( 'Jetpack by WordPress.com', 'jetpack' ) . ' → '; - printf( __( 'Configure %s', 'jetpack' ), $module['name'] ); - ?> -

- - -
-
- 'deactivate', - 'module' => $module - ) ), - "jetpack_deactivate-$module" - ); - } else { - $css = 'inactive'; - $toggle = __( 'Activate', 'jetpack' ); - $toggle_url = wp_nonce_url( - Jetpack::admin_url( array( - 'action' => 'activate', - 'module' => $module - ) ), - "jetpack_activate-$module" - ); - } - - if ( $counter % 4 == 0 ) { - $classes = $css . ' jetpack-newline'; - $counter = 0; - } else { - $classes = $css; - } - - $free_text = esc_html( $module_data['free'] ? __( 'Free', 'jetpack' ) : __( 'Purchase', 'jetpack' ) ); - $free_text = apply_filters( 'jetpack_module_free_text_' . $module, $free_text ); - $badge_text = $free_text; - - if ( !$jetpack_connected ) { - $classes = 'x disabled'; - } else if ( $jetpack_version_time + 604800 > $now ) { // 1 week - if ( version_compare( $module_data['introduced'], $jetpack_old_version, '>' ) ) { - $badge_text = esc_html__( 'New', 'jetpack' ); - $classes .= ' jetpack-new-module'; - } elseif ( isset( $module_data['changed'] ) && version_compare( $module_data['changed'], $jetpack_old_version, '>' ) ) { - $badge_text = esc_html__( 'Updated', 'jetpack' ); - $classes .= ' jetpack-updated-module'; - } else { - $badge_text = $free_text; - } - } - - ?> -
-

-
-
-

-
- -

-
- -
- - -   - - - - - ' . __( 'Configure', 'jetpack' ) . ''; - } - ?>  - - - - -
-
- - - - - - - -
8 - $counter ) echo ' style="display: none;"'; ?>> -

-
- '; - } - - function check_news_subscription() { - if ( !$this->current_user_is_connection_owner() ) { - exit; - } - - Jetpack::load_xml_rpc_client(); - $xml = new Jetpack_IXR_Client( array( - 'user_id' => JETPACK_MASTER_USER, - ) ); - $xml->query( 'jetpack.checkNewsSubscription' ); - if ( $xml->isError() ) { - printf( '%s: %s', $xml->getErrorCode(), $xml->getErrorMessage() ); - } else { - print_r( $xml->getResponse() ); - } - exit; - } - - function subscribe_to_news() { - if ( !$this->current_user_is_connection_owner() ) { - exit; - } - - Jetpack::load_xml_rpc_client(); - $xml = new Jetpack_IXR_Client( array( - 'user_id' => JETPACK_MASTER_USER, - ) ); - $xml->query( 'jetpack.subscribeToNews' ); - if ( $xml->isError() ) { - printf( '%s: %s', $xml->getErrorCode(), $xml->getErrorMessage() ); - } else { - print_r( $xml->getResponse() ); - } - exit; - } - -/* Client API */ - - /** - * Returns the requested Jetpack API URL - * - * @return string - */ - public static function api_url( $relative_url ) { - return trailingslashit( JETPACK__API_BASE . $relative_url ) . JETPACK__API_VERSION . '/'; - } - - /** - * Some hosts disable the OpenSSL extension and so cannot make outgoing HTTPS requsets - */ - public static function fix_url_for_bad_hosts( $url, &$args ) { - if ( 0 !== strpos( $url, 'https://' ) ) { - return $url; - } - - switch ( JETPACK_CLIENT__HTTPS ) { - case 'ALWAYS' : - return $url; - case 'NEVER' : - return substr_replace( $url, '', 4, 1 ); - // default : case 'AUTO' : - } - - $jetpack = Jetpack::init(); - - // Yay! Your host is good! - if ( wp_http_supports( array( 'ssl' => true ) ) ) { - return $url; - } - - // Boo! Your host is bad and makes Jetpack cry! - return substr_replace( $url, '', 4, 1 ); - } - - /** - * Returns the Jetpack XML-RPC API - * - * @return string - */ - public static function xmlrpc_api_url() { - $base = preg_replace( '#(https?://[^?/]+)(/?.*)?$#', '\\1', JETPACK__API_BASE ); - return untrailingslashit( $base ) . '/xmlrpc.php'; - } - - /** - * @return bool|WP_Error - */ - public static function register() { - Jetpack::update_option( 'register', wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ) ); - - @list( $secret_1, $secret_2, $secret_eol ) = explode( ':', Jetpack::get_option( 'register' ) ); - if ( empty( $secret_1 ) || empty( $secret_2 ) || empty( $secret_eol ) || $secret_eol < time() ) - return new Jetpack_Error( 'missing_secrets' ); - - $timeout = (int) ini_get( 'max_execution_time' ); - if ( !$timeout ) - $timeout = 30; - $timeout = intval( $timeout / 2 ); - - $gmt_offset = get_option( 'gmt_offset' ); - if ( !$gmt_offset ) { - $gmt_offset = 0; - } - - $stats_options = get_option( 'stats_options' ); - $stats_id = isset($stats_options['blog_id']) ? $stats_options['blog_id'] : null; - - $args = array( - 'method' => 'POST', - 'body' => array( - 'siteurl' => site_url(), - 'home' => home_url(), - 'gmt_offset' => $gmt_offset, - 'timezone_string' => (string) get_option( 'timezone_string' ), - 'site_name' => (string) get_option( 'blogname' ), - 'secret_1' => $secret_1, - 'secret_2' => $secret_2, - 'site_lang' => get_locale(), - 'timeout' => $timeout, - 'stats_id' => $stats_id, - ), - 'headers' => array( - 'Accept' => 'application/json', - ), - 'timeout' => $timeout, - ); - $response = Jetpack_Client::_wp_remote_request( Jetpack::fix_url_for_bad_hosts( Jetpack::api_url( 'register' ), $args ), $args, true ); - - if ( is_wp_error( $response ) ) { - return new Jetpack_Error( 'register_http_request_failed', $response->get_error_message() ); - } - - $code = wp_remote_retrieve_response_code( $response ); - $entity = wp_remote_retrieve_body( $response ); - - if ( $entity ) - $json = json_decode( $entity ); - else - $json = false; - - $code_type = intval( $code / 100 ); - if ( 5 == $code_type ) { - return new Jetpack_Error( 'wpcom_5??', sprintf( __( 'Error Details: %s', 'jetpack' ), $code ), $code ); - } elseif ( 408 == $code ) { - return new Jetpack_Error( 'wpcom_408', sprintf( __( 'Error Details: %s', 'jetpack' ), $code ), $code ); - } elseif ( !empty( $json->error ) ) { - $error_description = isset( $json->error_description ) ? sprintf( __( 'Error Details: %s', 'jetpack' ), (string) $json->error_description ) : ''; - return new Jetpack_Error( (string) $json->error, $error_description, $code ); - } elseif ( 200 != $code ) { - return new Jetpack_Error( 'wpcom_bad_response', sprintf( __( 'Error Details: %s', 'jetpack' ), $code ), $code ); - } - - // Jetpack ID error block - if ( empty( $json->jetpack_id ) ) { - return new Jetpack_Error( 'jetpack_id', sprintf( __( 'Error Details: Jetpack ID is empty. Do not publicly post this error message! %s', 'jetpack' ), $entity ), $entity ); - } elseif ( ! is_scalar( $json->jetpack_id ) ) { - return new Jetpack_Error( 'jetpack_id', sprintf( __( 'Error Details: Jetpack ID is not a scalar. Do not publicly post this error message! %s', 'jetpack' ) , $entity ), $entity ); - } elseif ( preg_match( '/[^0-9]/', $json->jetpack_id ) ) { - return new Jetpack_Error( 'jetpack_id', sprintf( __( 'Error Details: Jetpack ID begins with a numeral. Do not publicly post this error message! %s', 'jetpack' ) , $entity ), $entity); - } - - if ( empty( $json->jetpack_secret ) || !is_string( $json->jetpack_secret ) ) - return new Jetpack_Error( 'jetpack_secret', '', $code ); - - if ( isset( $json->jetpack_public ) ) { - $jetpack_public = (int) $json->jetpack_public; - } else { - $jetpack_public = false; - } - - Jetpack::update_options( array( - 'id' => (int) $json->jetpack_id, - 'blog_token' => (string) $json->jetpack_secret, - 'public' => $jetpack_public, - ) ); - - return true; - } - - -/* Client Server API */ - - /** - * Loads the Jetpack XML-RPC client - */ - public static function load_xml_rpc_client() { - require_once ABSPATH . WPINC . '/class-IXR.php'; - require_once dirname( __FILE__ ) . '/class.jetpack-ixr-client.php'; - } - - /** - * Authenticates XML-RPC and other requests from the Jetpack Server - */ - function authenticate_jetpack( $user, $username, $password ) { - if ( is_a( $user, 'WP_User' ) ) { - return $user; - } - - // It's not for us - if ( !isset( $_GET['token'] ) || empty( $_GET['signature'] ) ) { - return $user; - } - - @list( $token_key, $version, $user_id ) = explode( ':', $_GET['token'] ); - if ( - empty( $token_key ) - || - empty( $version ) || strval( JETPACK__API_VERSION ) !== $version - || - empty( $user_id ) || !ctype_digit( $user_id ) || !get_userdata( $user_id ) // only handle user_tokens for now, not blog_tokens - ) { - return $user; - } - - $token = Jetpack_Data::get_access_token( $user_id ); - if ( !$token ) { - return $user; - } - - if ( 0 !== strpos( $token->secret, "$token_key." ) ) { - return $user; - } - - require_once dirname( __FILE__ ) . '/class.jetpack-signature.php'; - - $jetpack_signature = new Jetpack_Signature( $token->secret, (int) Jetpack::get_option( 'time_diff' ) ); - if ( isset( $_POST['_jetpack_is_multipart'] ) ) { - $post_data = $_POST; - $file_hashes = array(); - foreach ( $post_data as $post_data_key => $post_data_value ) { - if ( 0 !== strpos( $post_data_key, '_jetpack_file_hmac_' ) ) { - continue; - } - $post_data_key = substr( $post_data_key, strlen( '_jetpack_file_hmac_' ) ); - $file_hashes[$post_data_key] = $post_data_value; - } - - foreach ( $file_hashes as $post_data_key => $post_data_value ) { - unset( $post_data["_jetpack_file_hmac_{$post_data_key}"] ); - $post_data[$post_data_key] = $post_data_value; - } - - ksort( $post_data ); - - $body = http_build_query( stripslashes_deep( $post_data ) ); - } elseif ( is_null( $this->HTTP_RAW_POST_DATA ) ) { - $body = file_get_contents( 'php://input' ); - } else { - $body = null; - } - $signature = $jetpack_signature->sign_current_request( array( - 'body' => is_null( $body ) ? $this->HTTP_RAW_POST_DATA : $body - ) ); - - if ( !$signature ) { - return $user; - } else if ( is_wp_error( $signature ) ) { - return $signature; - } else if ( $signature !== $_GET['signature'] ) { - return $user; - } - - $timestamp = (int) $_GET['timestamp']; - $nonce = stripslashes( (string) $_GET['nonce'] ); - - if ( !$this->add_nonce( $timestamp, $nonce ) ) { - return $user; - } - - nocache_headers(); - - return new WP_User( $token->external_user_id ); - } - - function add_nonce( $timestamp, $nonce ) { - global $wpdb; - static $nonces_used_this_request = array(); - - if ( isset( $nonces_used_this_request["$timestamp:$nonce"] ) ) { - return $nonces_used_this_request["$timestamp:$nonce"]; - } - - // This should always have gone through Jetpack_Signature::sign_request() first to check $timestamp an $nonce - $timestamp = (int) $timestamp; - $nonce = $wpdb->escape( $nonce ); - - // Raw query so we can avoid races: add_option will also update - $show_errors = $wpdb->show_errors( false ); - $return = $wpdb->query( $wpdb->prepare( - "INSERT INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, %s)", - "jetpack_nonce_{$timestamp}_{$nonce}", - time(), - 'no' - ) ); - $wpdb->show_errors( $show_errors ); - - $nonces_used_this_request["$timestamp:$nonce"] = $return; - - return $return; - } - - /** - * In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods. - * Capture it here so we can verify the signature later. - */ - function xmlrpc_methods( $methods ) { - $this->HTTP_RAW_POST_DATA = $GLOBALS['HTTP_RAW_POST_DATA']; - return $methods; - } - - function xmlrpc_options( $options ) { - $options['jetpack_version'] = array( - 'desc' => __( 'Jetpack Plugin Version' , 'jetpack'), - 'readonly' => true, - 'value' => JETPACK__VERSION, - ); - - $options['jetpack_client_id'] = array( - 'desc' => __( 'The Client ID/WP.com Blog ID of this site' , 'jetpack'), - 'readonly' => true, - 'value' => Jetpack::get_option( 'id' ), - ); - return $options; - } - - public static function clean_nonces( $all = false ) { - global $wpdb; - - $sql = "DELETE FROM `$wpdb->options` WHERE `option_name` LIKE %s"; - $sql_args = array( like_escape( 'jetpack_nonce_' ) . '%' ); - - if ( true !== $all ) { - $sql .= ' AND CAST( `option_value` AS UNSIGNED ) < %d'; - $sql_args[] = time() - 3600; - } - - $sql .= ' LIMIT 100'; - - $sql = $wpdb->prepare( $sql, $sql_args ); - - for ( $i = 0; $i < 1000; $i++ ) { - if ( !$wpdb->query( $sql ) ) { - break; - } - } - } - - /** - * State is passed via cookies from one request to the next, but never to subsequent requests. - * SET: state( $key, $value ); - * GET: $value = state( $key ); - * - * @param string $key - * @param string $value - * @param bool $restate private - */ - public static function state( $key = null, $value = null, $restate = false ) { - static $state = array(); - static $path, $domain; - if ( !isset( $path ) ) { - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); - $admin_url = Jetpack::admin_url(); - $bits = parse_url( $admin_url ); - - if ( is_array( $bits ) ) { - $path = ( isset( $bits['path'] ) ) ? dirname( $bits['path'] ) : null; - $domain = ( isset( $bits['host'] ) ) ? $bits['host'] : null; - } else { - $path = $domain = null; - } - } - - // Extract state from cookies and delete cookies - if ( isset( $_COOKIE[ 'jetpackState' ] ) && is_array( $_COOKIE[ 'jetpackState' ] ) ) { - $yum = $_COOKIE[ 'jetpackState' ]; - unset( $_COOKIE[ 'jetpackState' ] ); - foreach ( $yum as $k => $v ) { - if ( strlen( $v ) ) - $state[ $k ] = $v; - setcookie( "jetpackState[$k]", false, 0, $path, $domain ); - } - } - - if ( $restate ) { - foreach ( $state as $k => $v ) { - setcookie( "jetpackState[$k]", $v, 0, $path, $domain ); - } - return; - } - - // Get a state variable - if ( isset( $key ) && !isset( $value ) ) { - if ( array_key_exists( $key, $state ) ) - return $state[ $key ]; - return null; - } - - // Set a state variable - if ( isset ( $key ) && isset( $value ) ) { - $state[ $key ] = $value; - setcookie( "jetpackState[$key]", $value, 0, $path, $domain ); - } - } - - public static function restate() { - Jetpack::state( null, null, true ); - } - - public static function check_privacy( $file ) { - static $is_site_publicly_accessible = null; - - if ( is_null( $is_site_publicly_accessible ) ) { - $is_site_publicly_accessible = false; - - Jetpack::load_xml_rpc_client(); - $rpc = new Jetpack_IXR_Client(); - - $success = $rpc->query( 'jetpack.isSitePubliclyAccessible', home_url() ); - if ( $success ) { - $response = $rpc->getResponse(); - if ( $response ) { - $is_site_publicly_accessible = true; - } - } - - Jetpack::update_option( 'public', (int) $is_site_publicly_accessible ); - } - - if ( $is_site_publicly_accessible ) { - return; - } - - $module_slug = self::get_module_slug( $file ); - - $privacy_checks = Jetpack::state( 'privacy_checks' ); - if ( !$privacy_checks ) { - $privacy_checks = $module_slug; - } else { - $privacy_checks .= ",$module_slug"; - } - - Jetpack::state( 'privacy_checks', $privacy_checks ); - } - - /** - * Helper method for multicall XMLRPC. - */ - public static function xmlrpc_async_call() { - global $blog_id; - static $clients = array(); - - $client_blog_id = is_multisite() ? $blog_id : 0; - - if ( !isset( $clients[$client_blog_id] ) ) { - Jetpack::load_xml_rpc_client(); - $clients[$client_blog_id] = new Jetpack_IXR_ClientMulticall( array( - 'user_id' => JETPACK_MASTER_USER, - ) ); - ignore_user_abort( true ); - add_action( 'shutdown', array( 'Jetpack', 'xmlrpc_async_call' ) ); - } - - $args = func_get_args(); - - if ( !empty( $args[0] ) ) { - call_user_func_array( array( $clients[$client_blog_id], 'addCall' ), $args ); - } elseif ( is_multisite() ) { - foreach ( $clients as $client_blog_id => $client ) { - if ( !$client_blog_id || empty( $client->calls ) ) { - continue; - } - - $switch_success = switch_to_blog( $client_blog_id, true ); - if ( !$switch_success ) { - continue; - } - - flush(); - $client->query(); - - restore_current_blog(); - } - } else { - if ( isset( $clients[0] ) && !empty( $clients[0]->calls ) ) { - flush(); - $clients[0]->query(); - } - } - } - - public static function staticize_subdomain( $url ) { - $host = parse_url( $url, PHP_URL_HOST ); - if ( !preg_match( '/.?(?:wordpress|wp)\.com$/', $host ) ) { - return $url; - } - - if ( is_ssl() ) { - return preg_replace( '|https?://[^/]++/|', 'https://s-ssl.wordpress.com/', $url ); - } - - srand( crc32( basename( $url ) ) ); - $static_counter = rand( 0, 2 ); - srand(); // this resets everything that relies on this, like array_rand() and shuffle() - - return preg_replace( '|://[^/]+?/|', "://s$static_counter.wp.com/", $url ); - } - -/* JSON API Authorization */ - - /** - * Handles the login action for Authorizing the JSON API - */ - function login_form_json_api_authorization() { - $this->verify_json_api_authorization_request(); - - add_action( 'wp_login', array( &$this, 'store_json_api_authorization_token' ), 10, 2 ); - - add_action( 'login_message', array( &$this, 'login_message_json_api_authorization' ) ); - add_action( 'login_form', array( &$this, 'preserve_action_in_login_form_for_json_api_authorization' ) ); - add_filter( 'site_url', array( &$this, 'post_login_form_to_signed_url' ), 10, 3 ); - } - - // Make sure the login form is POSTed to the signed URL so we can reverify the request - function post_login_form_to_signed_url( $url, $path, $scheme ) { - if ( 'wp-login.php' !== $path || 'login_post' !== $scheme ) { - return $url; - } - - return "$url?{$_SERVER['QUERY_STRING']}"; - } - - // Make sure the POSTed request is handled by the same action - function preserve_action_in_login_form_for_json_api_authorization() { - echo "\n"; - } - - // If someone logs in to approve API access, store the Access Code in usermeta - function store_json_api_authorization_token( $user_login, $user ) { - add_filter( 'login_redirect', array( &$this, 'add_token_to_login_redirect_json_api_authorization' ), 10, 3 ); - add_filter( 'allowed_redirect_hosts', array( &$this, 'allow_wpcom_public_api_domain' ) ); - $token = wp_generate_password( 32, false ); - update_user_meta( $user->ID, 'jetpack_json_api_' . $this->json_api_authorization_request['client_id'], $token ); - } - - // Add public-api.wordpress.com to the safe redirect whitelist - only added when someone allows API access - function allow_wpcom_public_api_domain( $domains ) { - $domains[] = 'public-api.wordpress.com'; - return $domains; - } - - // Add the Access Code details to the public-api.wordpress.com redirect - function add_token_to_login_redirect_json_api_authorization( $redirect_to, $original_redirect_to, $user ) { - return add_query_arg( urlencode_deep( array( - 'jetpack-code' => get_user_meta( $user->ID, 'jetpack_json_api_' . $this->json_api_authorization_request['client_id'], true ), - 'jetpack-user-id' => (int) $user->ID, - 'jetpack-state' => $this->json_api_authorization_request['state'], - ) ), $redirect_to ); - } - - // Verifies the request by checking the signature - function verify_json_api_authorization_request() { - require_once dirname( __FILE__ ) . '/class.jetpack-signature.php'; - - $token = Jetpack_Data::get_access_token( JETPACK_MASTER_USER ); - if ( !$token || empty( $token->secret ) ) { - wp_die( __( 'You must connect your Jetpack plugin to WordPress.com to use this feature.' , 'jetpack') ); - } - - $die_error = __( 'Someone may be trying to trick you into giving them access to your site. Or it could be you just encountered a bug :). Either way, please close this window.', 'jetpack' ); - - $jetpack_signature = new Jetpack_Signature( $token->secret, (int) Jetpack::get_option( 'time_diff' ) ); - $signature = $jetpack_signature->sign_current_request( array( 'body' => null, 'method' => 'GET' ) ); - if ( !$signature ) { - wp_die( $die_error ); - } else if ( is_wp_error( $signature ) ) { - wp_die( $die_error ); - } else if ( $signature !== $_GET['signature'] ) { - if ( is_ssl() ) { - // If we signed an HTTP request on the Jetpack Servers, but got redirected to HTTPS by the local blog, check the HTTP signature as well - $signature = $jetpack_signature->sign_current_request( array( 'scheme' => 'http', 'body' => null, 'method' => 'GET' ) ); - if ( !$signature || is_wp_error( $signature ) || $signature !== $_GET['signature'] ) { - wp_die( $die_error ); - } - } else { - wp_die( $die_error ); - } - } - - $timestamp = (int) $_GET['timestamp']; - $nonce = stripslashes( (string) $_GET['nonce'] ); - - if ( !$this->add_nonce( $timestamp, $nonce ) ) { - // De-nonce the nonce, at least for 5 minutes. - // We have to reuse this nonce at least once (used the first time when the initial request is made, used a second time when the login form is POSTed) - $old_nonce_time = get_option( "jetpack_nonce_{$timestamp}_{$nonce}" ); - if ( $old_nonce_time < time() - 300 ) { - wp_die( __( 'The authorization process expired. Please go back and try again.' , 'jetpack') ); - } - } - - $data = json_decode( base64_decode( stripslashes( $_GET['data'] ) ) ); - $data_filters = array( - 'state' => 'opaque', - 'client_id' => 'int', - 'client_title' => 'string', - 'client_image' => 'url', - ); - - foreach ( $data_filters as $key => $sanitation ) { - if ( !isset( $data->$key ) ) { - wp_die( $die_error ); - } - - switch ( $sanitation ) { - case 'int' : - $this->json_api_authorization_request[$key] = (int) $data->$key; - break; - case 'opaque' : - $this->json_api_authorization_request[$key] = (string) $data->$key; - break; - case 'string' : - $this->json_api_authorization_request[$key] = wp_kses( (string) $data->$key, array() ); - break; - case 'url' : - $this->json_api_authorization_request[$key] = esc_url_raw( (string) $data->$key ); - break; - } - } - - if ( empty( $this->json_api_authorization_request['client_id'] ) ) { - wp_die( $die_error ); - } - } - - function login_message_json_api_authorization( $message ) { - return '

' . sprintf( - esc_html__( '%s wants to access your site’s data. Log in to authorize that access.' , 'jetpack'), - '' . esc_html( $this->json_api_authorization_request['client_title'] ) . '' - ) . '

'; - } -} - -class Jetpack_Client { - /** - * Makes an authorized remote request using Jetpack_Signature - * - * @return array|WP_Error WP HTTP response on success - */ - public static function remote_request( $args, $body = null ) { - $defaults = array( - 'url' => '', - 'user_id' => 0, - 'blog_id' => 0, - 'auth_location' => JETPACK_CLIENT__AUTH_LOCATION, - 'method' => 'POST', - 'timeout' => 10, - 'redirection' => 0, - ); - - $args = wp_parse_args( $args, $defaults ); - - $args['blog_id'] = (int) $args['blog_id']; - - if ( 'header' != $args['auth_location'] ) { - $args['auth_location'] = 'query_string'; - } - - $token = Jetpack_Data::get_access_token( $args['user_id'] ); - if ( !$token ) { - return new Jetpack_Error( 'missing_token' ); - } - - $method = strtoupper( $args['method'] ); - - $timeout = intval( $args['timeout'] ); - - $redirection = $args['redirection']; - - $request = compact( 'method', 'body', 'timeout', 'redirection' ); - - @list( $token_key, $secret ) = explode( '.', $token->secret ); - if ( empty( $token ) || empty( $secret ) ) { - return new Jetpack_Error( 'malformed_token' ); - } - - $token_key = sprintf( '%s:%d:%d', $token_key, JETPACK__API_VERSION, $token->external_user_id ); - - require_once dirname( __FILE__ ) . '/class.jetpack-signature.php'; - - $time_diff = (int) Jetpack::get_option( 'time_diff' ); - $jetpack_signature = new Jetpack_Signature( $token->secret, $time_diff ); - - $timestamp = time() + $time_diff; - $nonce = wp_generate_password( 10, false ); - - // Kind of annoying. Maybe refactor Jetpack_Signature to handle body-hashing - if ( is_null( $body ) ) { - $body_hash = ''; - } else { - if ( !is_string( $body ) ) { - return new Jetpack_Error( 'invalid_body', 'Body is malformed.' ); - } - $body_hash = jetpack_sha1_base64( $body ); - } - - $auth = array( - 'token' => $token_key, - 'timestamp' => $timestamp, - 'nonce' => $nonce, - 'body-hash' => $body_hash, - ); - - if ( false !== strpos( $args['url'], 'xmlrpc.php' ) ) { - $url_args = array( 'for' => 'jetpack' ); - } else { - $url_args = array(); - } - - if ( 'header' != $args['auth_location'] ) { - $url_args += $auth; - } - - $url = add_query_arg( urlencode_deep( $url_args ), $args['url'] ); - $url = Jetpack::fix_url_for_bad_hosts( $url, $request ); - - $signature = $jetpack_signature->sign_request( $token_key, $timestamp, $nonce, $body_hash, $method, $url, $body, false ); - - if ( !$signature || is_wp_error( $signature ) ) { - return $signature; - } - - // Send an Authorization header so various caches/proxies do the right thing - $auth['signature'] = $signature; - $auth['version'] = JETPACK__VERSION; - $header_pieces = array(); - foreach ( $auth as $key => $value ) { - $header_pieces[] = sprintf( '%s="%s"', $key, $value ); - } - $request['headers'] = array( - 'Authorization' => "X_JETPACK " . join( ' ', $header_pieces ), - ); - - if ( 'header' != $args['auth_location'] ) { - $url = add_query_arg( 'signature', urlencode( $signature ), $url ); - } - - return Jetpack_Client::_wp_remote_request( $url, $request ); - } - - /** - * Wrapper for wp_remote_request(). Turns off SSL verification for certain SSL errors. - * This is lame, but many, many, many hosts have misconfigured SSL. - * - * When Jetpack is registered, the jetpack_fallback_no_verify_ssl_certs option is set to the current time if: - * 1. a certificate error is found AND - * 2. not verifying the certificate works around the problem. - * - * The option is checked on each request. - * - * @internal - * @todo: Better fallbacks (bundled certs?), feedback, UI, .... - * @see Jetpack::fix_url_for_bad_hosts() - * - * @return array|WP_Error WP HTTP response on success - */ - public static function _wp_remote_request( $url, $args, $set_fallback = false ) { - $fallback = Jetpack::get_option( 'fallback_no_verify_ssl_certs' ); - if ( false === $fallback ) { - Jetpack::update_option( 'fallback_no_verify_ssl_certs', 0 ); - } - - if ( (int) $fallback ) { - // We're flagged to fallback - $args['sslverify'] = false; - } - - $response = wp_remote_request( $url, $args ); - - if ( - !$set_fallback // We're not allowed to set the flag on this request, so whatever happens happens - || - isset( $args['sslverify'] ) && !$args['sslverify'] // No verification - no point in doing it again - || - !is_wp_error( $response ) // Let it ride - ) { - Jetpack_Client::set_time_diff( $response, $set_fallback ); - return $response; - } - - // At this point, we're not flagged to fallback and we are allowed to set the flag on this request. - - $message = $response->get_error_message(); - - // Is it an SSL Certificate verification error? - if ( - false === strpos( $message, '14090086' ) // OpenSSL SSL3 certificate error - && - false === strpos( $message, '1407E086' ) // OpenSSL SSL2 certificate error - && - false === strpos( $message, 'error setting certificate verify locations' ) // cURL CA bundle not found - && - false === strpos( $message, 'Peer certificate cannot be authenticated with' ) // cURL CURLE_SSL_CACERT: CA bundle found, but not helpful - // different versions of curl have different error messages - // this string should catch them all - && - false === strpos( $message, 'Problem with the SSL CA cert' ) // cURL CURLE_SSL_CACERT_BADFILE: probably access rights - ) { - // No, it is not. - return $response; - } - - // Redo the request without SSL certificate verification. - $args['sslverify'] = false; - $response = wp_remote_request( $url, $args ); - - if ( !is_wp_error( $response ) ) { - // The request went through this time, flag for future fallbacks - Jetpack::update_option( 'fallback_no_verify_ssl_certs', time() ); - Jetpack_Client::set_time_diff( $response, $set_fallback ); - } - - return $response; - } - - public static function set_time_diff( &$response, $force_set = false ) { - $code = wp_remote_retrieve_response_code( $response ); - - // Only trust the Date header on some responses - if ( 200 != $code && 304 != $code && 400 != $code && 401 != $code ) { - return; - } - - if ( !$date = wp_remote_retrieve_header( $response, 'date' ) ) { - return; - } - - if ( 0 >= $time = (int) strtotime( $date ) ) { - return; - } - - $time_diff = $time - time(); - - if ( $force_set ) { // during register - Jetpack::update_option( 'time_diff', $time_diff ); - } else { // otherwise - $old_diff = Jetpack::get_option( 'time_diff' ); - if ( false === $old_diff || abs( $time_diff - (int) $old_diff ) > 10 ) { - Jetpack::update_option( 'time_diff', $time_diff ); - } - } - } -} - -class Jetpack_Data { - /** - * Gets locally stored token - * - * @return object|false - */ - public static function get_access_token( $user_id = false ) { - if ( $user_id ) { - if ( !$tokens = Jetpack::get_option( 'user_tokens' ) ) { - return false; - } - if ( $user_id === JETPACK_MASTER_USER ) { - if ( !$user_id = Jetpack::get_option( 'master_user' ) ) { - return false; - } - } - if ( !isset( $tokens[$user_id] ) || !$token = $tokens[$user_id] ) { - return false; - } - $token_chunks = explode( '.', $token ); - if ( empty( $token_chunks[1] ) || empty( $token_chunks[2] ) ) { - return false; - } - if ( $user_id != $token_chunks[2] ) { - return false; - } - $token = "{$token_chunks[0]}.{$token_chunks[1]}"; - } else { - $token = Jetpack::get_option( 'blog_token' ); - if ( empty( $token ) ) { - return false; - } - } - - return (object) array( - 'secret' => $token, - 'external_user_id' => (int) $user_id, - ); - } -} - -/** - * Client = Plugin - * Client Server = API Methods the Plugin must respond to - * - * @todo Roll this into Jetpack? There's only one 'public' method now: ::authorize(). - */ -class Jetpack_Client_Server { - function authorize() { - $data = stripslashes_deep( $_GET ); - - $args = array(); - - $redirect = isset( $data['redirect'] ) ? esc_url_raw( (string) $data['redirect'] ) : ''; - - do { - $jetpack = Jetpack::init(); - $role = $jetpack->translate_current_user_to_role(); - if ( !$role ) { - Jetpack::state( 'error', 'no_role' ); - break; - } - - $cap = $jetpack->translate_role_to_cap( $role ); - if ( !$cap ) { - Jetpack::state( 'error', 'no_cap' ); - break; - } - - check_admin_referer( "jetpack-authorize_{$role}_{$redirect}" ); - - if ( !empty( $data['error'] ) ) { - Jetpack::state( 'error', $data['error'] ); - break; - } - - if ( empty( $data['state'] ) ) { - Jetpack::state( 'error', 'no_state' ); - break; - } - - if ( !ctype_digit( $data['state'] ) ) { - Jetpack::state( 'error', 'invalid_state' ); - break; - } - - $current_user_id = get_current_user_id(); - if ( $current_user_id != $data['state'] ) { - Jetpack::state( 'error', 'wrong_state' ); - break; - } - - if ( empty( $data['code'] ) ) { - Jetpack::state( 'error', 'no_code' ); - break; - } - - $token = $this->get_token( $data ); - - if ( is_wp_error( $token ) ) { - if ( $error = $token->get_error_code() ) - Jetpack::state( 'error', $error ); - else - Jetpack::state( 'error', 'invalid_token' ); - - Jetpack::state( 'error_description', $token->get_error_message() ); - - break; - } - - if ( !$token ) { - Jetpack::state( 'error', 'no_token' ); - break; - } - - $is_master_user = ! Jetpack::is_active(); - - Jetpack::update_user_token( $current_user_id, sprintf( '%s.%d', $token, $current_user_id ), $is_master_user ); - - - if ( $is_master_user ) { - Jetpack::state( 'message', 'authorized' ); - } else { - Jetpack::state( 'message', 'linked' ); - // Don't activate anything since we are just connecting a user. - break; - } - - if ( $active_modules = Jetpack::get_option( 'active_modules' ) ) { - Jetpack::delete_option( 'active_modules' ); - - Jetpack::activate_default_modules( 999, 1, $active_modules ); - } else { - Jetpack::activate_default_modules(); - } - - $jetpack->sync->register( 'noop' ); // Spawn a sync to make sure the Jetpack Servers know what modules are active. - - // Start nonce cleaner - wp_clear_scheduled_hook( 'jetpack_clean_nonces' ); - wp_schedule_event( time(), 'hourly', 'jetpack_clean_nonces' ); - } while ( false ); - - if ( wp_validate_redirect( $redirect ) ) { - wp_safe_redirect( $redirect ); - } else { - wp_safe_redirect( Jetpack::admin_url() ); - } - - exit; - } - - public static function deactivate_plugin( $probable_file, $probable_title ) { - if ( is_plugin_active( $probable_file ) ) { - deactivate_plugins( $probable_file ); - return 1; - } else { - // If the plugin is not in the usual place, try looking through all active plugins. - $active_plugins = get_option( 'active_plugins', array() ); - foreach ( $active_plugins as $plugin ) { - $data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); - if ( $data['Name'] == $probable_title ) { - deactivate_plugins( $plugin ); - return 1; - } - } - } - - return 0; - } - - /** - * @return object|WP_Error - */ - function get_token( $data ) { - $jetpack = Jetpack::init(); - $role = $jetpack->translate_current_user_to_role(); - - if ( !$role ) { - return new Jetpack_Error( 'role', __( 'An administrator for this blog must set up the Jetpack connection.', 'jetpack' ) ); - } - - $client_secret = Jetpack_Data::get_access_token(); - if ( !$client_secret ) { - return new Jetpack_Error( 'client_secret', __( 'You need to register your Jetpack before connecting it.', 'jetpack' ) ); - } - - $redirect = isset( $data['redirect'] ) ? esc_url_raw( (string) $data['redirect'] ) : ''; - - $body = array( - 'client_id' => Jetpack::get_option( 'id' ), - 'client_secret' => $client_secret->secret, - 'grant_type' => 'authorization_code', - 'code' => $data['code'], - 'redirect_uri' => add_query_arg( array( - 'action' => 'authorize', - '_wpnonce' => wp_create_nonce( "jetpack-authorize_{$role}_{$redirect}" ), - 'redirect' => $redirect ? urlencode( $redirect ) : false, - ), menu_page_url( 'jetpack', false ) ), - ); - - $args = array( - 'method' => 'POST', - 'body' => $body, - 'headers' => array( - 'Accept' => 'application/json', - ), - ); - $response = Jetpack_Client::_wp_remote_request( Jetpack::fix_url_for_bad_hosts( Jetpack::api_url( 'token' ), $args ), $args ); - - if ( is_wp_error( $response ) ) { - return new Jetpack_Error( 'token_http_request_failed', $response->get_error_message() ); - } - - $code = wp_remote_retrieve_response_code( $response ); - $entity = wp_remote_retrieve_body( $response ); - - if ( $entity ) - $json = json_decode( $entity ); - else - $json = false; - - if ( 200 != $code || !empty( $json->error ) ) { - if ( empty( $json->error ) ) - return new Jetpack_Error( 'unknown', '', $code ); - - $error_description = isset( $json->error_description ) ? sprintf( __( 'Error Details: %s', 'jetpack' ), (string) $json->error_description ) : ''; - - return new Jetpack_Error( (string) $json->error, $error_description, $code ); - } - - if ( empty( $json->access_token ) || !is_scalar( $json->access_token ) ) { - return new Jetpack_Error( 'access_token', '', $code ); - } - - if ( empty( $json->token_type ) || 'X_JETPACK' != strtoupper( $json->token_type ) ) { - return new Jetpack_Error( 'token_type', '', $code ); - } - - if ( empty( $json->scope ) ) { - return new Jetpack_Error( 'scope', 'No Scope', $code ); - } - @list( $role, $hmac ) = explode( ':', $json->scope ); - if ( empty( $role ) || empty( $hmac ) ) { - return new Jetpack_Error( 'scope', 'Malformed Scope', $code ); - } - if ( $jetpack->sign_role( $role ) !== $json->scope ) { - return new Jetpack_Error( 'scope', 'Invalid Scope', $code ); - } - - if ( !$cap = $jetpack->translate_role_to_cap( $role ) ) - return new Jetpack_Error( 'scope', 'No Cap', $code ); - if ( !current_user_can( $cap ) ) - return new Jetpack_Error( 'scope', 'current_user_cannot', $code ); - - return (string) $json->access_token; - } -} - - -/** - * Request that a piece of data on this WordPress install be synced back to the - * Jetpack server for remote processing/notifications/etc - */ -class Jetpack_Sync { - // What modules want to sync what content - var $sync_conditions = array( 'posts' => array(), 'comments' => array() ); - - // We keep track of all the options registered for sync so that we can sync them all if needed - var $sync_options = array(); - - // Keep trac of status transitions, which we wouldn't always know about on the Jetpack Servers but are important when deciding what to do with the sync. - var $post_transitions = array(); - var $comment_transitions = array(); - - // Objects to sync - var $sync = array(); - - function __construct() { - // WP Cron action. Only used on upgrade - add_action( 'jetpack_sync_all_registered_options', array( $this, 'sync_all_registered_options' ) ); - } - -/* Static Methods for Modules */ - - /** - * @param string $file __FILE__ - * @param array settings: - * post_types => array( post_type slugs ): The post types to sync. Default: post, page - * post_stati => array( post_status slugs ): The post stati to sync. Default: publish - */ - static function sync_posts( $file, array $settings = null ) { - $jetpack = Jetpack::init(); - $args = func_get_args(); - return call_user_func_array( array( $jetpack->sync, 'posts' ), $args ); - } - - /** - * @param string $file __FILE__ - * @param array settings: - * post_types => array( post_type slugs ): The post types to sync. Default: post, page - * post_stati => array( post_status slugs ): The post stati to sync. Default: publish - * comment_types => array( comment_type slugs ): The comment types to sync. Default: '', comment, trackback, pingback - * comment_stati => array( comment_status slugs ): The comment stati to sync. Default: approved - */ - static function sync_comments( $file, array $settings = null ) { - $jetpack = Jetpack::init(); - $args = func_get_args(); - return call_user_func_array( array( $jetpack->sync, 'comments' ), $args ); - } - - /** - * @param string $file __FILE__ - * @param string $option, Option name to sync - * @param string $option ... - */ - static function sync_options( $file, $option /*, $option, ... */ ) { - $jetpack = Jetpack::init(); - $args = func_get_args(); - return call_user_func_array( array( $jetpack->sync, 'options' ), $args ); - } - -/* Internal Methods */ - - /** - * Create a sync object/request - * - * @param string $object Type of object to sync -- [ post | comment | option ] - * @param int $id Unique identifier - * @param array $settings - */ - function register( $object, $id = false, array $settings = null ) { - // Since we've registered something for sync, hook it up to execute on shutdown if we haven't already - if ( !$this->sync ) { - ignore_user_abort( true ); - add_action( 'shutdown', array( $this, 'sync' ), 9 ); // Right before async XML-RPC - } - - $defaults = array( - 'on_behalf_of' => array(), // What modules want this data - ); - $settings = wp_parse_args( $settings, $defaults ); - - if ( !isset( $this->sync[$object] ) ) { - $this->sync[$object] = array(); - } - - // Store the settings for this object - if ( - // First time for this object - !isset( $this->sync[$object][$id] ) - ) { - // Easy: store the current settings - $this->sync[$object][$id] = $settings; - } else { - // Not as easy: we have to manually merge the settings from previous runs for this object with the settings for this run - - $this->sync[$object][$id]['on_behalf_of'] = array_unique( array_merge( $this->sync[$object][$id]['on_behalf_of'], $settings['on_behalf_of'] ) ); - } - - $delete_prefix = 'delete_'; - if ( 0 === strpos( $object, $delete_prefix ) ) { - $unset_object = substr( $object, strlen( $delete_prefix ) ); - } else { - $unset_object = "{$delete_prefix}{$object}"; - } - - // Ensure post ... delete_post yields a delete operation - // Ensure delete_post ... post yields a sync post operation - // Ensure update_option() ... delete_option() ends up as a delete - // Ensure delete_option() ... update_option() ends up as an update - // Etc. - unset( $this->sync[$unset_object][$id] ); - - return true; - } - - function get_common_sync_data() { - $available_modules = Jetpack::get_available_modules(); - $active_modules = Jetpack::get_active_modules(); - $modules = array(); - foreach ( $available_modules as $available_module ) { - $modules[$available_module] = in_array( $available_module, $active_modules ); - } - $modules['vaultpress'] = class_exists( 'VaultPress' ) || function_exists( 'vaultpress_contact_service' ); - - $sync_data = array( - 'modules' => $modules, - 'version' => JETPACK__VERSION, - ); - - return $sync_data; - } - - /** - * Set up all the data and queue it for the outgoing XML-RPC request - */ - function sync() { - if ( !$this->sync ) { - return false; - } - - $sync_data = $this->get_common_sync_data(); - - $wp_importing = defined( 'WP_IMPORTING' ) && WP_IMPORTING; - - foreach ( $this->sync as $sync_operation_type => $sync_operations ) { - switch ( $sync_operation_type ) { - case 'post': - if ( $wp_importing ) { - break; - } - - $global_post = isset( $GLOBALS['post'] ) ? $GLOBALS['post'] : null; - $GLOBALS['post'] = null; - foreach ( $sync_operations as $post_id => $settings ) { - $sync_data['post'][$post_id] = $this->get_post( $post_id ); - if ( isset( $this->post_transitions[$post_id] ) ) { - $sync_data['post'][$post_id]['transitions'] = $this->post_transitions[$post_id]; - } else { - $sync_data['post'][$post_id]['transitions'] = array( false, false ); - } - $sync_data['post'][$post_id]['on_behalf_of'] = $settings['on_behalf_of']; - } - $GLOBALS['post'] = $global_post; - unset( $global_post ); - break; - case 'comment': - if ( $wp_importing ) { - break; - } - - $global_comment = isset( $GLOBALS['comment'] ) ? $GLOBALS['comment'] : null; - unset( $GLOBALS['comment'] ); - foreach ( $sync_operations as $comment_id => $settings ) { - $sync_data['comment'][$comment_id] = $this->get_comment( $comment_id ); - if ( isset( $this->comment_transitions[$comment_id] ) ) { - $sync_data['comment'][$comment_id]['transitions'] = $this->comment_transitions[$comment_id]; - } else { - $sync_data['comment'][$comment_id]['transitions'] = array( false, false ); - } - $sync_data['comment'][$comment_id]['on_behalf_of'] = $settings['on_behalf_of']; - } - $GLOBALS['comment'] = $global_comment; - unset( $global_comment ); - break; - case 'option' : - foreach ( $sync_operations as $option => $settings ) { - $sync_data['option'][$option] = array( 'value' => get_option( $option ) ); - } - break; - - case 'delete_post': - case 'delete_comment': - foreach ( $sync_operations as $object_id => $settings ) { - $sync_data[$sync_operation_type][$object_id] = array( 'on_behalf_of' => $settings['on_behalf_of'] ); - } - break; - case 'delete_option' : - foreach ( $sync_operations as $object_id => $settings ) { - $sync_data[$sync_operation_type][$object_id] = true; - } - break; - } - } - - Jetpack::xmlrpc_async_call( 'jetpack.syncContent', $sync_data ); - } - - /** - * Format and return content data from a direct xmlrpc request for it. - * - * @param array $content_ids: array( 'posts' => array of ids, 'comments' => array of ids, 'options' => array of options ) - */ - function get_content( $content_ids ) { - $sync_data = $this->get_common_sync_data(); - - if ( isset( $content_ids['posts'] ) ) { - foreach ( $content_ids['posts'] as $id ) { - $sync_data['post'][$id] = $this->get_post( $id ); - } - } - - if ( isset( $content_ids['comments'] ) ) { - foreach ( $content_ids['comments'] as $id ) { - $sync_data['comment'][$id] = $this->get_post( $id ); - } - } - - if ( isset( $content_ids['options'] ) ) { - foreach ( $content_ids['options'] as $option ) { - $sync_data['option'][$option] = array( 'value' => get_option( $option ) ); - } - } - - return $sync_data; - } - - /** - * Helper method for registering a post for sync - * - * @param int $id wp_posts.ID - * @param array $settings Sync data - */ - function register_post( $id, array $settings = null ) { - $id = (int) $id; - if ( !$id ) { - return false; - } - - $post = get_post( $id ); - if ( !$post ) { - return false; - } - - $settings = wp_parse_args( $settings, array( - 'on_behalf_of' => array(), - ) ); - - return $this->register( 'post', $id, $settings ); - } - - /** - * Helper method for registering a comment for sync - * - * @param int $id wp_comments.comment_ID - * @param array $settings Sync data - */ - function register_comment( $id, array $settings = null ) { - $id = (int) $id; - if ( !$id ) { - return false; - } - - $comment = get_comment( $id ); - if ( !$comment || empty( $comment->comment_post_ID ) ) { - return false; - } - - $post = get_post( $comment->comment_post_ID ); - if ( !$post ) { - return false; - } - - $settings = wp_parse_args( $settings, array( - 'on_behalf_of' => array(), - ) ); - - return $this->register( 'comment', $id, $settings ); - } - -/* Posts Sync */ - - function posts( $file, array $settings = null ) { - $module_slug = Jetpack::get_module_slug( $file ); - - $defaults = array( - 'post_types' => array( 'post', 'page' ), - 'post_stati' => array( 'publish' ), - ); - - $this->sync_conditions['posts'][$module_slug] = wp_parse_args( $settings, $defaults ); - - add_action( 'transition_post_status', array( $this, 'transition_post_status_action' ), 10, 3 ); - add_action( 'delete_post', array( $this, 'delete_post_action' ) ); - } - - function delete_post_action( $post_id ) { - $post = get_post( $post_id ); - if ( !$post ) { - return $this->register( 'delete_post', (int) $post_id ); - } - - $this->transition_post_status_action( 'delete', $post->post_status, $post ); - } - - function transition_post_status_action( $new_status, $old_status, $post ) { - $sync = $this->get_post_sync_operation( $new_status, $old_status, $post, $this->sync_conditions['posts'] ); - if ( !$sync ) { - // No module wants to sync this post - return false; - } - - // Track post transitions - if ( isset( $this->post_transitions[$post->ID] ) ) { - // status changed more than once - keep tha most recent $new_status - $this->post_transitions[$post->ID][0] = $new_status; - } else { - $this->post_transitions[$post->ID] = array( $new_status, $old_status ); - } - - $operation = $sync['operation']; - unset( $sync['operation'] ); - - switch ( $operation ) { - case 'delete' : - return $this->register( 'delete_post', (int) $post->ID, $sync ); - case 'submit' : - return $this->register_post( (int) $post->ID, $sync ); - } - } - - function get_post_sync_operation( $new_status, $old_status, $post, $module_conditions ) { - $delete_on_behalf_of = array(); - $submit_on_behalf_of = array(); - $delete_stati = array( 'delete' ); - - foreach ( $module_conditions as $module => $conditions ) { - if ( !in_array( $post->post_type, $conditions['post_types'] ) ) { - continue; - } - - $deleted_post = in_array( $new_status, $delete_stati ); - - if ( $deleted_post ) { - $delete_on_behalf_of[] = $module; - } else { - clean_post_cache( $post->ID ); - $new_status = get_post_status( $post->ID ); // Inherited status is resolved here - } - - $old_status_in_stati = in_array( $old_status, $conditions['post_stati'] ); - $new_status_in_stati = in_array( $new_status, $conditions['post_stati'] ); - - if ( $old_status_in_stati && !$new_status_in_stati ) { - // Jetpack no longer needs the post - if ( !$deleted_post ) { - $delete_on_behalf_of[] = $module; - } // else, we've already flagged it above - continue; - } - - if ( !$new_status_in_stati ) { - continue; - } - - // At this point, we know we want to sync the post, not delete it - $submit_on_behalf_of[] = $module; - } - - if ( !empty( $submit_on_behalf_of ) ) { - return array( 'operation' => 'submit', 'on_behalf_of' => $submit_on_behalf_of ); - } - - if ( !empty( $delete_on_behalf_of ) ) { - return array( 'operation' => 'delete', 'on_behalf_of' => $delete_on_behalf_of ); - } - - return false; - } - - /** - * Get a post and associated data in the standard JP format. - * Cannot be called statically - * - * @param int $id Post ID - * @return Array containing full post details - */ - function get_post( $id ) { - $post_obj = get_post( $id ); - if ( !$post_obj ) - return false; - - if ( is_callable( $post_obj, 'to_array' ) ) { - // WP >= 3.5 - $post = $post_obj->to_array(); - } else { - // WP < 3.5 - $post = get_object_vars( $post_obj ); - } - - if ( 0 < strlen( $post['post_password'] ) ) { - $post['post_password'] = 'auto-' . wp_generate_password( 10, false ); // We don't want the real password. Just pass something random. - } - - // local optimizations - unset( - $post['filter'], - $post['ancestors'], - $post['post_content_filtered'], - $post['to_ping'], - $post['pinged'] - ); - - if ( $this->is_post_public( $post ) ) { - $post['post_is_public'] = Jetpack::get_option( 'public' ); - } else { - //obscure content - $post['post_content'] = ''; - $post['post_excerpt'] = ''; - $post['post_is_public'] = false; - } - $post_type_obj = get_post_type_object( $post['post_type'] ); - $post['post_is_excluded_from_search'] = $post_type_obj->exclude_from_search; - - $post['tax'] = array(); - $taxonomies = get_object_taxonomies( $post_obj ); - foreach ( $taxonomies as $taxonomy ) { - $terms = get_object_term_cache( $post_obj->ID, $taxonomy ); - if ( empty( $terms ) ) - $terms = wp_get_object_terms( $post_obj->ID, $taxonomy ); - $term_names = array(); - foreach ( $terms as $term ) { - $term_names[] = $term->name; - } - $post['tax'][$taxonomy] = $term_names; - } - - $meta = get_post_meta( $post_obj->ID, false ); - $post['meta'] = array(); - foreach ( $meta as $key => $value ) { - $post['meta'][$key] = array_map( 'maybe_unserialize', $value ); - } - - $post['extra'] = array( - 'author' => get_the_author_meta( 'display_name', $post_obj->post_author ), - 'author_email' => get_the_author_meta( 'email', $post_obj->post_author ), - ); - - if ( $fid = get_post_thumbnail_id( $id ) ) { - $feature = wp_get_attachment_image_src( $fid, 'large' ); - if ( !empty( $feature[0] ) ) - $post['extra']['featured_image'] = $feature[0]; - } - - $post['permalink'] = get_permalink( $post_obj->ID ); - $post['shortlink'] = wp_get_shortlink( $post_obj->ID ); - return $post; - } - - /** - * Decide whether a post/page/attachment is visible to the public. - * - * @param array $post - * @return bool - */ - function is_post_public( $post ) { - if ( !is_array( $post ) ) { - $post = (array) $post; - } - - if ( 0 < strlen( $post['post_password'] ) ) - return false; - if ( ! in_array( $post['post_type'], get_post_types( array( 'public' => true ) ) ) ) - return false; - $post_status = get_post_status( $post['ID'] ); // Inherited status is resolved here. - if ( ! in_array( $post_status, get_post_stati( array( 'public' => true ) ) ) ) - return false; - return true; - } - -/* Comments Sync */ - - function comments( $file, array $settings = null ) { - $module_slug = Jetpack::get_module_slug( $file ); - - $defaults = array( - 'post_types' => array( 'post', 'page' ), // For what post types will we sync comments? - 'post_stati' => array( 'publish' ), // For what post stati will we sync comments? - 'comment_types' => array( '', 'comment', 'trackback', 'pingback' ), // What comment types will we sync? - 'comment_stati' => array( 'approved' ), // What comment stati will we sync? - ); - - $settings = wp_parse_args( $settings, $defaults ); - - $this->sync_conditions['comments'][$module_slug] = $settings; - - add_action( 'wp_insert_comment', array( $this, 'wp_insert_comment_action' ), 10, 2 ); - add_action( 'transition_comment_status', array( $this, 'transition_comment_status_action' ), 10, 3 ); - add_action( 'edit_comment', array( $this, 'edit_comment_action' ) ); - } - - /* - * This is really annoying. If you edit a comment, but don't change the status, WordPress doesn't fire the transition_comment_status hook. - * That means we have to catch these comments on the edit_comment hook, but ignore comments on that hook when the transition_comment_status does fire. - */ - function edit_comment_action( $comment_id ) { - $comment = get_comment( $comment_id ); - $new_status = $this->translate_comment_status( $comment->comment_approved ); - add_action( "comment_{$new_status}_{$comment->comment_type}", array( $this, 'transition_comment_status_for_comments_whose_status_does_not_change' ), 10, 2 ); - } - - function wp_insert_comment_action( $comment_id, $comment ) { - $this->transition_comment_status_action( $comment->comment_approved, 'new', $comment ); - } - - function transition_comment_status_for_comments_whose_status_does_not_change( $comment_id, $comment ) { - if ( isset( $this->comment_transitions[$comment_id] ) ) { - return $this->transition_comment_status_action( $comment->comment_approved, $this->comment_transitions[$comment_id][1], $comment ); - } - - return $this->transition_comment_status_action( $comment->comment_approved, $comment->comment_approved, $comment ); - } - - function translate_comment_status( $status ) { - switch ( (string) $status ) { - case '0' : - case 'hold' : - return 'unapproved'; - case '1' : - case 'approve' : - return 'approved'; - } - - return $status; - } - - function transition_comment_status_action( $new_status, $old_status, $comment ) { - $post = get_post( $comment->comment_post_ID ); - if ( !$post ) { - return false; - } - - foreach ( array( 'new_status', 'old_status' ) as $_status ) { - $$_status = $this->translate_comment_status( $$_status ); - } - - // Track comment transitions - if ( isset( $this->comment_transitions[$comment->comment_ID] ) ) { - // status changed more than once - keep tha most recent $new_status - $this->comment_transitions[$comment->comment_ID][0] = $new_status; - } else { - $this->comment_transitions[$comment->comment_ID] = array( $new_status, $old_status ); - } - - $post_sync = $this->get_post_sync_operation( $post->post_status, '_jetpack_test_sync', $post, $this->sync_conditions['comments'] ); - - if ( !$post_sync ) { - // No module wants to sync this comment because its post doesn't match any sync conditions - return false; - } - - if ( 'delete' == $post_sync['operation'] ) { - // Had we been looking at post sync operations (instead of comment sync operations), - // this comment's post would have been deleted. Don't sync the comment. - return false; - } - - $delete_on_behalf_of = array(); - $submit_on_behalf_of = array(); - $delete_stati = array( 'delete' ); - - foreach ( $this->sync_conditions['comments'] as $module => $conditions ) { - if ( !in_array( $comment->comment_type, $conditions['comment_types'] ) ) { - continue; - } - - $deleted_comment = in_array( $new_status, $delete_stati ); - - if ( $deleted_comment ) { - $delete_on_behalf_of[] = $module; - } - - $old_status_in_stati = in_array( $old_status, $conditions['comment_stati'] ); - $new_status_in_stati = in_array( $new_status, $conditions['comment_stati'] ); - - if ( $old_status_in_stati && !$new_status_in_stati ) { - // Jetpack no longer needs the comment - if ( !$deleted_comment ) { - $delete_on_behalf_of[] = $module; - } // else, we've already flagged it above - continue; - } - - if ( !$new_status_in_stati ) { - continue; - } - - // At this point, we know we want to sync the comment, not delete it - $submit_on_behalf_of[] = $module; - } - - if ( ! empty( $submit_on_behalf_of ) ) { - $this->register_post( $comment->comment_post_ID, array( 'on_behalf_of' => $submit_on_behalf_of ) ); - return $this->register_comment( $comment->comment_ID, array( 'on_behalf_of' => $submit_on_behalf_of ) ); - } - - if ( !empty( $delete_on_behalf_of ) ) { - return $this->register( 'delete_comment', $comment->comment_ID, array( 'on_behalf_of' => $delete_on_behalf_of ) ); - } - - return false; - } - - /** - * Get a comment and associated data in the standard JP format. - * Cannot be called statically - * - * @param int $id Comment ID - * @return Array containing full comment details - */ - function get_comment( $id ) { - $comment_obj = get_comment( $id ); - if ( !$comment_obj ) - return false; - $comment = get_object_vars( $comment_obj ); - - $meta = get_comment_meta( $id, false ); - $comment['meta'] = array(); - foreach ( $meta as $key => $value ) { - $comment['meta'][$key] = array_map( 'maybe_unserialize', $value ); - } - - return $comment; - } - -/* Options Sync */ - - /* Ah... so much simpler than Posts and Comments :) */ - function options( $file, $option /*, $option, ... */ ) { - $options = func_get_args(); - $file = array_shift( $options ); - - $module_slug = Jetpack::get_module_slug( $file ); - - if ( !isset( $this->sync_options[$module_slug] ) ) { - $this->sync_options[$module_slug] = array(); - } - - foreach ( $options as $option ) { - $this->sync_options[$module_slug][] = $option; - add_action( "delete_option_{$option}", array( $this, 'deleted_option_action' ) ); - add_action( "update_option_{$option}", array( $this, 'updated_option_action' ) ); - add_action( "add_option_{$option}", array( $this, 'added_option_action' ) ); - } - - $this->sync_options[$module_slug] = array_unique( $this->sync_options[$module_slug] ); - } - - function deleted_option_action( $option ) { - $this->register( 'delete_option', $option ); - } - - function updated_option_action( $old_value ) { - // The value of $option isn't passed to the filter - // Calculate it - $option = current_filter(); - $prefix = 'update_option_'; - if ( 0 !== strpos( $option, $prefix ) ) { - return; - } - $option = substr( $option, strlen( $prefix ) ); - - $this->added_option_action( $option ); - } - - function added_option_action( $option ) { - $this->register( 'option', $option ); - } - - function sync_all_module_options( $module_slug ) { - if ( empty( $this->sync_options[$module_slug] ) ) { - return; - } - - foreach ( $this->sync_options[$module_slug] as $option ) { - $this->added_option_action( $option ); - } - } - - function sync_all_registered_options( $options = array() ) { - if ( 'jetpack_sync_all_registered_options' == current_filter() ) { - $all_registered_options = array_unique( call_user_func_array( 'array_merge', $this->sync_options ) ); - foreach ( $all_registered_options as $option ) { - $this->added_option_action( $option ); - } - } else { - wp_schedule_single_event( time(), 'jetpack_sync_all_registered_options', array( $this->sync_options ) ); - } - } -} - -require_once dirname( __FILE__ ) . '/class.jetpack-user-agent.php'; -require_once dirname( __FILE__ ) . '/class.jetpack-post-images.php'; -require_once dirname( __FILE__ ) . '/class.photon.php'; -require dirname( __FILE__ ) . '/functions.photon.php'; -require dirname( __FILE__ ) . '/functions.compat.php'; -require dirname( __FILE__ ) . '/functions.gallery.php'; - -class Jetpack_Error extends WP_Error {} +// Constants for expressing human-readable intervals +// in their respective number of seconds. +// Introduced in WordPress 3.5, specified here for backward compatability. +defined( 'MINUTE_IN_SECONDS' ) or define( 'MINUTE_IN_SECONDS', 60 ); +defined( 'HOUR_IN_SECONDS' ) or define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS ); +defined( 'DAY_IN_SECONDS' ) or define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS ); +defined( 'WEEK_IN_SECONDS' ) or define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS ); +defined( 'YEAR_IN_SECONDS' ) or define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS ); + +// @todo: Abstract out the admin functions, and only include them if is_admin() +// @todo: Only include things like class.jetpack-sync.php if we're connected. +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-client.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-data.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-client-server.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-sync.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-options.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-user-agent.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-post-images.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-error.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-debugger.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-heartbeat.php' ); +require_once( JETPACK__PLUGIN_DIR . 'class.photon.php' ); +require_once( JETPACK__PLUGIN_DIR . 'functions.photon.php' ); +require_once( JETPACK__PLUGIN_DIR . 'functions.compat.php' ); +require_once( JETPACK__PLUGIN_DIR . 'functions.gallery.php' ); register_activation_hook( __FILE__, array( 'Jetpack', 'plugin_activation' ) ); register_deactivation_hook( __FILE__, array( 'Jetpack', 'plugin_deactivation' ) ); add_action( 'init', array( 'Jetpack', 'init' ) ); +add_action( 'init', array( 'Jetpack_Heartbeat', 'init' ), 100 ); add_action( 'plugins_loaded', array( 'Jetpack', 'load_modules' ), 100 ); add_filter( 'jetpack_static_url', array( 'Jetpack', 'staticize_subdomain' ) ); +/* +if ( is_admin() && ! Jetpack::check_identity_crisis() ) { + Jetpack_Sync::sync_options( __FILE__, 'db_version', 'jetpack_active_modules', 'active_plugins' ); +} +*/ + Jetpack_Sync::sync_options( __FILE__, 'widget_twitter' ); diff --git a/plugins/jetpack/languages/jetpack-ar.mo b/plugins/jetpack/languages/jetpack-ar.mo index 254be8e6..e057c917 100644 Binary files a/plugins/jetpack/languages/jetpack-ar.mo and b/plugins/jetpack/languages/jetpack-ar.mo differ diff --git a/plugins/jetpack/languages/jetpack-az.mo b/plugins/jetpack/languages/jetpack-az.mo index 033f8593..1a17b7b7 100644 Binary files a/plugins/jetpack/languages/jetpack-az.mo and b/plugins/jetpack/languages/jetpack-az.mo differ diff --git a/plugins/jetpack/languages/jetpack-bs_BA.mo b/plugins/jetpack/languages/jetpack-bs_BA.mo index 67cd4468..40cc45bd 100644 Binary files a/plugins/jetpack/languages/jetpack-bs_BA.mo and b/plugins/jetpack/languages/jetpack-bs_BA.mo differ diff --git a/plugins/jetpack/languages/jetpack-ca.mo b/plugins/jetpack/languages/jetpack-ca.mo index 2daa9e1c..68167b29 100644 Binary files a/plugins/jetpack/languages/jetpack-ca.mo and b/plugins/jetpack/languages/jetpack-ca.mo differ diff --git a/plugins/jetpack/languages/jetpack-cs_CZ.mo b/plugins/jetpack/languages/jetpack-cs_CZ.mo index 5e088773..220421d8 100644 Binary files a/plugins/jetpack/languages/jetpack-cs_CZ.mo and b/plugins/jetpack/languages/jetpack-cs_CZ.mo differ diff --git a/plugins/jetpack/languages/jetpack-da_DK.mo b/plugins/jetpack/languages/jetpack-da_DK.mo index 773e5b51..c5af6d83 100644 Binary files a/plugins/jetpack/languages/jetpack-da_DK.mo and b/plugins/jetpack/languages/jetpack-da_DK.mo differ diff --git a/plugins/jetpack/languages/jetpack-de_DE.mo b/plugins/jetpack/languages/jetpack-de_DE.mo index a93c1c7c..c9b11ee7 100644 Binary files a/plugins/jetpack/languages/jetpack-de_DE.mo and b/plugins/jetpack/languages/jetpack-de_DE.mo differ diff --git a/plugins/jetpack/languages/jetpack-el.mo b/plugins/jetpack/languages/jetpack-el.mo index 8538e68c..6487268b 100644 Binary files a/plugins/jetpack/languages/jetpack-el.mo and b/plugins/jetpack/languages/jetpack-el.mo differ diff --git a/plugins/jetpack/languages/jetpack-es_ES.mo b/plugins/jetpack/languages/jetpack-es_ES.mo index 3cc9243e..4f8be590 100644 Binary files a/plugins/jetpack/languages/jetpack-es_ES.mo and b/plugins/jetpack/languages/jetpack-es_ES.mo differ diff --git a/plugins/jetpack/languages/jetpack-fa_IR.mo b/plugins/jetpack/languages/jetpack-fa_IR.mo index f34c74e6..096ac421 100644 Binary files a/plugins/jetpack/languages/jetpack-fa_IR.mo and b/plugins/jetpack/languages/jetpack-fa_IR.mo differ diff --git a/plugins/jetpack/languages/jetpack-fi.mo b/plugins/jetpack/languages/jetpack-fi.mo index 591c0472..913b15a1 100644 Binary files a/plugins/jetpack/languages/jetpack-fi.mo and b/plugins/jetpack/languages/jetpack-fi.mo differ diff --git a/plugins/jetpack/languages/jetpack-fr_FR.mo b/plugins/jetpack/languages/jetpack-fr_FR.mo index 165c2b9e..5fa71ada 100644 Binary files a/plugins/jetpack/languages/jetpack-fr_FR.mo and b/plugins/jetpack/languages/jetpack-fr_FR.mo differ diff --git a/plugins/jetpack/languages/jetpack-gl_ES.mo b/plugins/jetpack/languages/jetpack-gl_ES.mo index e5f4c09a..2e88f28f 100644 Binary files a/plugins/jetpack/languages/jetpack-gl_ES.mo and b/plugins/jetpack/languages/jetpack-gl_ES.mo differ diff --git a/plugins/jetpack/languages/jetpack-he_IL.mo b/plugins/jetpack/languages/jetpack-he_IL.mo index 90d820c7..cf18acd8 100644 Binary files a/plugins/jetpack/languages/jetpack-he_IL.mo and b/plugins/jetpack/languages/jetpack-he_IL.mo differ diff --git a/plugins/jetpack/languages/jetpack-hr.mo b/plugins/jetpack/languages/jetpack-hr.mo index 8765f205..d1608ba4 100644 Binary files a/plugins/jetpack/languages/jetpack-hr.mo and b/plugins/jetpack/languages/jetpack-hr.mo differ diff --git a/plugins/jetpack/languages/jetpack-hu_HU.mo b/plugins/jetpack/languages/jetpack-hu_HU.mo index 11715656..27fbc982 100644 Binary files a/plugins/jetpack/languages/jetpack-hu_HU.mo and b/plugins/jetpack/languages/jetpack-hu_HU.mo differ diff --git a/plugins/jetpack/languages/jetpack-id_ID.mo b/plugins/jetpack/languages/jetpack-id_ID.mo index 8d3427dd..c0cddc06 100644 Binary files a/plugins/jetpack/languages/jetpack-id_ID.mo and b/plugins/jetpack/languages/jetpack-id_ID.mo differ diff --git a/plugins/jetpack/languages/jetpack-it_IT.mo b/plugins/jetpack/languages/jetpack-it_IT.mo index 7165de10..fc6d8f41 100644 Binary files a/plugins/jetpack/languages/jetpack-it_IT.mo and b/plugins/jetpack/languages/jetpack-it_IT.mo differ diff --git a/plugins/jetpack/languages/jetpack-ja.mo b/plugins/jetpack/languages/jetpack-ja.mo index f715cc91..698be13f 100644 Binary files a/plugins/jetpack/languages/jetpack-ja.mo and b/plugins/jetpack/languages/jetpack-ja.mo differ diff --git a/plugins/jetpack/languages/jetpack-ko_KR.mo b/plugins/jetpack/languages/jetpack-ko_KR.mo index 3a7a5295..46a7b085 100644 Binary files a/plugins/jetpack/languages/jetpack-ko_KR.mo and b/plugins/jetpack/languages/jetpack-ko_KR.mo differ diff --git a/plugins/jetpack/languages/jetpack-lt_LT.mo b/plugins/jetpack/languages/jetpack-lt_LT.mo index 55f190a5..3917f2f6 100644 Binary files a/plugins/jetpack/languages/jetpack-lt_LT.mo and b/plugins/jetpack/languages/jetpack-lt_LT.mo differ diff --git a/plugins/jetpack/languages/jetpack-mk_MK.mo b/plugins/jetpack/languages/jetpack-mk_MK.mo index 804e8a3b..4fc204dc 100644 Binary files a/plugins/jetpack/languages/jetpack-mk_MK.mo and b/plugins/jetpack/languages/jetpack-mk_MK.mo differ diff --git a/plugins/jetpack/languages/jetpack-my_MM.mo b/plugins/jetpack/languages/jetpack-my_MM.mo index 1d1604b7..02d9ab35 100644 Binary files a/plugins/jetpack/languages/jetpack-my_MM.mo and b/plugins/jetpack/languages/jetpack-my_MM.mo differ diff --git a/plugins/jetpack/languages/jetpack-nb_NO.mo b/plugins/jetpack/languages/jetpack-nb_NO.mo index 5600cf1d..ba9a07ea 100644 Binary files a/plugins/jetpack/languages/jetpack-nb_NO.mo and b/plugins/jetpack/languages/jetpack-nb_NO.mo differ diff --git a/plugins/jetpack/languages/jetpack-nl_NL.mo b/plugins/jetpack/languages/jetpack-nl_NL.mo index a125514d..3e5b3235 100644 Binary files a/plugins/jetpack/languages/jetpack-nl_NL.mo and b/plugins/jetpack/languages/jetpack-nl_NL.mo differ diff --git a/plugins/jetpack/languages/jetpack-nn_NO.mo b/plugins/jetpack/languages/jetpack-nn_NO.mo index 1157c955..e97633a0 100644 Binary files a/plugins/jetpack/languages/jetpack-nn_NO.mo and b/plugins/jetpack/languages/jetpack-nn_NO.mo differ diff --git a/plugins/jetpack/languages/jetpack-pl_PL.mo b/plugins/jetpack/languages/jetpack-pl_PL.mo index 3a5df93c..3e686606 100644 Binary files a/plugins/jetpack/languages/jetpack-pl_PL.mo and b/plugins/jetpack/languages/jetpack-pl_PL.mo differ diff --git a/plugins/jetpack/languages/jetpack-pt_BR.mo b/plugins/jetpack/languages/jetpack-pt_BR.mo index da51355f..a4aa2278 100644 Binary files a/plugins/jetpack/languages/jetpack-pt_BR.mo and b/plugins/jetpack/languages/jetpack-pt_BR.mo differ diff --git a/plugins/jetpack/languages/jetpack-pt_PT.mo b/plugins/jetpack/languages/jetpack-pt_PT.mo index 62d6331b..8afc9be6 100644 Binary files a/plugins/jetpack/languages/jetpack-pt_PT.mo and b/plugins/jetpack/languages/jetpack-pt_PT.mo differ diff --git a/plugins/jetpack/languages/jetpack-ro_RO.mo b/plugins/jetpack/languages/jetpack-ro_RO.mo index 6a76116e..6b6b6e34 100644 Binary files a/plugins/jetpack/languages/jetpack-ro_RO.mo and b/plugins/jetpack/languages/jetpack-ro_RO.mo differ diff --git a/plugins/jetpack/languages/jetpack-ru_RU.mo b/plugins/jetpack/languages/jetpack-ru_RU.mo index 392de6d0..12ab4527 100644 Binary files a/plugins/jetpack/languages/jetpack-ru_RU.mo and b/plugins/jetpack/languages/jetpack-ru_RU.mo differ diff --git a/plugins/jetpack/languages/jetpack-sa_IN.mo b/plugins/jetpack/languages/jetpack-sa_IN.mo index f7bfee62..6e87f221 100644 Binary files a/plugins/jetpack/languages/jetpack-sa_IN.mo and b/plugins/jetpack/languages/jetpack-sa_IN.mo differ diff --git a/plugins/jetpack/languages/jetpack-sk_SK.mo b/plugins/jetpack/languages/jetpack-sk_SK.mo index 0f6a8ea8..8cb30748 100644 Binary files a/plugins/jetpack/languages/jetpack-sk_SK.mo and b/plugins/jetpack/languages/jetpack-sk_SK.mo differ diff --git a/plugins/jetpack/languages/jetpack-sq.mo b/plugins/jetpack/languages/jetpack-sq.mo index 795f5abb..87856508 100644 Binary files a/plugins/jetpack/languages/jetpack-sq.mo and b/plugins/jetpack/languages/jetpack-sq.mo differ diff --git a/plugins/jetpack/languages/jetpack-sr_RS.mo b/plugins/jetpack/languages/jetpack-sr_RS.mo index 62d2959a..c6d753d8 100644 Binary files a/plugins/jetpack/languages/jetpack-sr_RS.mo and b/plugins/jetpack/languages/jetpack-sr_RS.mo differ diff --git a/plugins/jetpack/languages/jetpack-sv_SE.mo b/plugins/jetpack/languages/jetpack-sv_SE.mo index 382cbc3e..60b01b1c 100644 Binary files a/plugins/jetpack/languages/jetpack-sv_SE.mo and b/plugins/jetpack/languages/jetpack-sv_SE.mo differ diff --git a/plugins/jetpack/languages/jetpack-th.mo b/plugins/jetpack/languages/jetpack-th.mo index 13499189..f747b319 100644 Binary files a/plugins/jetpack/languages/jetpack-th.mo and b/plugins/jetpack/languages/jetpack-th.mo differ diff --git a/plugins/jetpack/languages/jetpack-tr_TR.mo b/plugins/jetpack/languages/jetpack-tr_TR.mo index 24eeccec..09c04155 100644 Binary files a/plugins/jetpack/languages/jetpack-tr_TR.mo and b/plugins/jetpack/languages/jetpack-tr_TR.mo differ diff --git a/plugins/jetpack/languages/jetpack-zh_CN.mo b/plugins/jetpack/languages/jetpack-zh_CN.mo index 17900fb1..d4fa8db8 100644 Binary files a/plugins/jetpack/languages/jetpack-zh_CN.mo and b/plugins/jetpack/languages/jetpack-zh_CN.mo differ diff --git a/plugins/jetpack/languages/jetpack-zh_TW.mo b/plugins/jetpack/languages/jetpack-zh_TW.mo index 38662136..fda55d22 100644 Binary files a/plugins/jetpack/languages/jetpack-zh_TW.mo and b/plugins/jetpack/languages/jetpack-zh_TW.mo differ diff --git a/plugins/jetpack/locales.php b/plugins/jetpack/locales.php index e910fbfc..5c306d49 100644 --- a/plugins/jetpack/locales.php +++ b/plugins/jetpack/locales.php @@ -1773,28 +1773,28 @@ class GP_Locales { } } - function &instance() { + static function instance() { if ( !isset( $GLOBALS['gp_locales'] ) ) $GLOBALS['gp_locales'] = new GP_Locales; return $GLOBALS['gp_locales']; } - function locales() { + static function locales() { $instance = GP_Locales::instance(); return $instance->locales; } - function exists( $slug ) { + static function exists( $slug ) { $instance = GP_Locales::instance(); return isset( $instance->locales[$slug] ); } - function by_slug( $slug ) { + static function by_slug( $slug ) { $instance = GP_Locales::instance(); return isset( $instance->locales[$slug] )? $instance->locales[$slug] : null; } - function by_field( $field_name, $field_value ) { + static function by_field( $field_name, $field_value ) { $instance = GP_Locales::instance(); $result = false; foreach( $instance->locales() as $locale ) { diff --git a/plugins/jetpack/modules/after-the-deadline.php b/plugins/jetpack/modules/after-the-deadline.php index 606f6488..cf98ec0c 100644 --- a/plugins/jetpack/modules/after-the-deadline.php +++ b/plugins/jetpack/modules/after-the-deadline.php @@ -4,21 +4,22 @@ * Module Description: Improve your spelling, style, and grammar with the After the Deadline Proofreading service. * Sort Order: 6 * First Introduced: 1.1 + * Requires Connection: Yes */ - + add_action( 'jetpack_modules_loaded', 'AtD_load' ); function AtD_load() { - Jetpack::enable_module_configurable( __FILE__ ); - Jetpack::module_configuration_load( __FILE__, 'AtD_configuration_load' ); + Jetpack::enable_module_configurable( __FILE__ ); + Jetpack::module_configuration_load( __FILE__, 'AtD_configuration_load' ); } function AtD_configuration_load() { wp_safe_redirect( get_edit_profile_url( get_current_user_id() ) . '#atd' ); - exit; + exit; } -/* +/* * Load necessary include files */ include( 'after-the-deadline/config-options.php' ); @@ -56,7 +57,7 @@ function AtD_addbuttons() { /* Don't bother doing this stuff if the current user lacks permissions */ if ( ! AtD_is_allowed() ) return; - + /* Add only in Rich Editor mode */ if ( get_user_option( 'rich_editing' ) == 'true' ) { add_filter( 'mce_external_plugins', 'add_AtD_tinymce_plugin' ); @@ -85,16 +86,16 @@ function register_AtD_button( $buttons ) { array_push( $buttons, '|', 'AtD' ); return $buttons; } - + /* - * Load the TinyMCE plugin : editor_plugin.js (wp2.5) + * Load the TinyMCE plugin : editor_plugin.js (wp2.5) */ function add_AtD_tinymce_plugin( $plugin_array ) { $plugin_array['AtD'] = plugins_url( 'after-the-deadline/tinymce/editor_plugin.js?v=' . ATD_VERSION, __FILE__ ); return $plugin_array; } -/* +/* * Update the TinyMCE init block with AtD specific settings */ function AtD_change_mce_settings( $init_array ) { @@ -116,15 +117,15 @@ function AtD_change_mce_settings( $init_array ) { return $init_array; } -/* +/* * Sanitizes AtD AJAX data to acceptable chars, caller needs to make sure ' is escaped */ function AtD_sanitize( $untrusted ) { return preg_replace( '/[^a-zA-Z0-9\-\',_ ]/i', "", $untrusted ); } -/* - * AtD HTML Editor Stuff +/* + * AtD HTML Editor Stuff */ function AtD_settings() { $user = wp_get_current_user(); @@ -156,20 +157,20 @@ function AtD_load_javascripts() { wp_enqueue_script( 'AtD_jquery', plugins_url( '/after-the-deadline/jquery.atd.js', __FILE__ ), array('jquery'), ATD_VERSION ); wp_enqueue_script( 'AtD_settings', admin_url() . 'admin-ajax.php?action=atd_settings', array('AtD_jquery'), ATD_VERSION ); wp_enqueue_script( 'AtD_autoproofread', plugins_url( '/after-the-deadline/atd-autoproofread.js', __FILE__ ), array('AtD_jquery'), ATD_VERSION ); - } + } } /* Spits out user options for auto-proofreading on publish/update */ function AtD_load_submit_check_javascripts() { global $pagenow; - + $user = wp_get_current_user(); if ( ! $user || $user->ID == 0 ) return; - + if ( AtD_should_load_on_page() ) { $atd_check_when = AtD_get_setting( $user->ID, 'AtD_check_when' ); - + if ( !empty( $atd_check_when ) ) { $check_when = array(); /* Set up the options in json */ @@ -238,7 +239,7 @@ add_action( 'init', 'AtD_addbuttons' ); /* setup hooks for our PHP functions we want to make available via an AJAX call */ add_action( 'wp_ajax_proxy_atd', 'AtD_redirect_call' ); -add_action( 'wp_ajax_atd_ignore', 'AtD_ignore_call' ); +add_action( 'wp_ajax_atd_ignore', 'AtD_ignore_call' ); add_action( 'wp_ajax_atd_settings', 'AtD_settings' ); /* load and install the localization stuff */ diff --git a/plugins/jetpack/modules/after-the-deadline/atd-autoproofread.js b/plugins/jetpack/modules/after-the-deadline/atd-autoproofread.js index b76a757c..53ef766d 100644 --- a/plugins/jetpack/modules/after-the-deadline/atd-autoproofread.js +++ b/plugins/jetpack/modules/after-the-deadline/atd-autoproofread.js @@ -37,13 +37,13 @@ function AtD_submit_check_callback(count) { } else { var original_post_status = jQuery('#original_post_status').val() - /* Okay, the user has tried to publish/update already but there are still errors. Ask them what to do */ + /* Okay, the user has tried to publish/update already but there are still errors. Ask them what to do */ var message; if ( original_post_status == 'publish' ) message = AtD.getLang('dialog_confirm_post_publish', 'The proofreader has suggestions for this post. Are you sure you want to publish it?\n\nPress OK to publish your post, or Cancel to view the suggestions and edit your post.'); else message = AtD.getLang('dialog_confirm_post_update', 'The proofreader has suggestions for this post. Are you sure you want to update it?\n\nPress OK to update your post, or Cancel to view the suggestions and edit your post.'); - + if ( confirm( message ) ) { AtD_update_post(); } else { @@ -66,7 +66,7 @@ function AtD_kill_autoproofread() { function AtD_update_post() { if ( typeof(tinyMCE) == 'undefined' || !tinyMCE.activeEditor || tinyMCE.activeEditor.isHidden() ) - AtD_restore_if_proofreading(); + AtD_restore_if_proofreading(); jQuery('#publish').unbind('click.AtD_submit_check').click(); } diff --git a/plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js b/plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js index 5d84497d..88f2d9c8 100644 --- a/plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js +++ b/plugins/jetpack/modules/after-the-deadline/atd-nonvis-editor-plugin.js @@ -3,7 +3,7 @@ var AtD_qtbutton; function AtD_restore_text_area() { /* clear the error HTML out of the preview div */ - AtD.remove('content'); + AtD.remove('content'); /* swap the preview div for the textarea, notice how I have to restore the appropriate class/id/style attributes */ var content = jQuery('#content').html(); @@ -13,7 +13,7 @@ function AtD_restore_text_area() jQuery('#content').replaceWith( AtD.content_canvas ); jQuery('#content').val( content.replace(/\<\;/g, '<').replace(/\>\;/g, '>').replace(/\&/g, '&') ); - jQuery('#content').height(AtD.height); + jQuery('#content').height(AtD.height); if ( AtD_qtbutton ) { /* change the link text back to its original label */ @@ -42,7 +42,7 @@ if ( typeof(QTags) != 'undefined' && QTags.addButton ) { } function AtD_restore_if_proofreading() { - if ( AtD_qtbutton && jQuery(AtD_qtbutton).val() == AtD.getLang('button_edit_text', 'edit text') ) + if ( AtD_qtbutton && jQuery(AtD_qtbutton).val() == AtD.getLang('button_edit_text', 'edit text') ) AtD_restore_text_area(); } @@ -84,8 +84,8 @@ function AtD_check(button) { /* If the text of the link says edit comment, then restore the textarea so the user can edit the text */ - if ( jQuery(AtD_qtbutton).val() == AtD.getLang('button_edit_text', 'edit text') ) { - AtD_restore_text_area(); + if ( jQuery(AtD_qtbutton).val() == AtD.getLang('button_edit_text', 'edit text') ) { + AtD_restore_text_area(); } else { /* initialize some of the stuff related to this plugin */ if ( !AtD.height ) { @@ -124,7 +124,7 @@ function AtD_check(button) { } else { jQuery('#content').replaceWith('
' + text + '
'); jQuery('#content').css( { 'overflow' : 'auto', 'background-color' : 'white', 'color' : 'black', 'white-space' : 'pre-wrap' } ); - jQuery('#content').height(AtD.height); + jQuery('#content').height(AtD.height); } /* kill autosave... :) */ @@ -144,16 +144,16 @@ function AtD_check(button) { ready: function(errorCount) { jQuery(AtD_qtbutton).attr('disabled', false); - if ( typeof callback === 'function' ) + if ( typeof callback === 'function' ) callback( errorCount ); }, error: function(reason) { jQuery(AtD_qtbutton).attr('disabled', false); - if ( typeof callback === 'function' ) + if ( typeof callback === 'function' ) callback( -1 ); - else + else alert( AtD.getLang('message_server_error', 'There was a problem communicating with the Proofreading service. Try again in one minute.') ); AtD_restore_if_proofreading(); @@ -164,7 +164,7 @@ function AtD_check(button) { if ( text != null ) element.replaceWith( text ); - }, + }, explain: function(url) { var left = (screen.width / 2) - (480 / 2); diff --git a/plugins/jetpack/modules/after-the-deadline/atd.core.js b/plugins/jetpack/modules/after-the-deadline/atd.core.js index 0e3d1c4c..5d6efc91 100644 --- a/plugins/jetpack/modules/after-the-deadline/atd.core.js +++ b/plugins/jetpack/modules/after-the-deadline/atd.core.js @@ -74,18 +74,18 @@ AtDCore.prototype.showTypes = function(string) { }); this.map(this.ignore_types, function(string) { - if (types[string] != undefined) + if (types[string] != undefined) ignore_types.push(string); }); this.ignore_types = ignore_types; }; -/* +/* * Error Parsing Code */ -AtDCore.prototype.makeError = function(error_s, tokens, type, seps, pre) { +AtDCore.prototype.makeError = function(error_s, tokens, type, seps, pre) { var struct = new Object(); struct.type = type; struct.string = error_s; @@ -110,20 +110,20 @@ AtDCore.prototype.makeError = function(error_s, tokens, type, seps, pre) { }; AtDCore.prototype.addToErrorStructure = function(errors, list, type, seps) { - var parent = this; + var parent = this; this.map(list, function(error) { var tokens = error["word"].split(/\s+/); var pre = error["pre"]; var first = tokens[0]; - if (errors['__' + first] == undefined) { + if (errors['__' + first] == undefined) { errors['__' + first] = new Object(); errors['__' + first].pretoks = {}; errors['__' + first].defaults = new Array(); } - if (pre == "") { + if (pre == "") { errors['__' + first].defaults.push(parent.makeError(error["word"], tokens, type, seps, pre)); } else { if (errors['__' + first].pretoks['__' + pre] == undefined) @@ -138,7 +138,7 @@ AtDCore.prototype.buildErrorStructure = function(spellingList, enrichmentList, g var seps = this._getSeparators(); var errors = {}; - this.addToErrorStructure(errors, spellingList, "hiddenSpellError", seps); + this.addToErrorStructure(errors, spellingList, "hiddenSpellError", seps); this.addToErrorStructure(errors, grammarList, "hiddenGrammarError", seps); this.addToErrorStructure(errors, enrichmentList, "hiddenSuggestion", seps); return errors; @@ -153,7 +153,7 @@ AtDCore.prototype._getSeparators = function() { re += '\\' + str.charAt(i); return "(?:(?:[\xa0" + re + "])|(?:\\-\\-))+"; -}; +}; AtDCore.prototype.processXML = function(responseXML) { @@ -183,8 +183,8 @@ AtDCore.prototype.processXML = function(responseXML) { var errorContext; - if (errors[i].getElementsByTagName('precontext').item(0).firstChild != null) - errorContext = errors[i].getElementsByTagName('precontext').item(0).firstChild.data; + if (errors[i].getElementsByTagName('precontext').item(0).firstChild != null) + errorContext = errors[i].getElementsByTagName('precontext').item(0).firstChild.data; else errorContext = ""; @@ -236,11 +236,11 @@ AtDCore.prototype.processXML = function(responseXML) { if (errorDescription == "Repeated Word") suggestion["description"] = this.getLang('menu_title_repeated_word', 'Repeated Word'); - + if (errorDescription == "Did you mean...") suggestion["description"] = this.getLang('menu_title_confused_word', 'Did you mean...'); } // end if ignore[errorString] == undefined - } // end if + } // end if } // end for loop var errorStruct; @@ -265,10 +265,10 @@ AtDCore.prototype.findSuggestion = function(element) { var errorDescription = undefined; var len = this.suggestions.length; - + for (var i = 0; i < len; i++) { var key = this.suggestions[i]["string"]; - + if ((context == "" || context == this.suggestions[i]["context"]) && this.suggestions[i]["matcher"].test(text)) { errorDescription = this.suggestions[i]; break; @@ -299,7 +299,7 @@ TokenIterator.prototype.next = function() { if (current[0] == "'") current = current.substring(1, current.length); - if (current[current.length - 1] == "'") + if (current[current.length - 1] == "'") current = current.substring(0, current.length - 1); } @@ -311,7 +311,7 @@ TokenIterator.prototype.hasNext = function() { }; TokenIterator.prototype.hasNextN = function(n) { - return (this.index + n) < this.tokens.length; + return (this.index + n) < this.tokens.length; }; TokenIterator.prototype.skip = function(m, n) { @@ -334,10 +334,10 @@ TokenIterator.prototype.peek = function(n) { return peepers; }; -/* +/* * code to manage highlighting of errors */ -AtDCore.prototype.markMyWords = function(container_nodes, errors) { +AtDCore.prototype.markMyWords = function(container_nodes, errors) { var seps = new RegExp(this._getSeparators()); var nl = new Array(); var ecount = 0; /* track number of highlighted errors */ @@ -345,16 +345,16 @@ AtDCore.prototype.markMyWords = function(container_nodes, errors) { /* Collect all text nodes */ /* Our goal--ignore nodes that are already wrapped */ - + this._walk(container_nodes, function(n) { if (n.nodeType == 3 && !parent.isMarkedNode(n)) nl.push(n); }); - - /* walk through the relevant nodes */ - + + /* walk through the relevant nodes */ + var iterator; - + this.map(nl, function(n) { var v; @@ -431,7 +431,7 @@ AtDCore.prototype.markMyWords = function(container_nodes, errors) { return parent.create(' ' + node.nodeValue.substr(1, node.nodeValue.length - 1).replace(regexp, result), false); else return parent.create(node.nodeValue.replace(regexp, result), false); - } + } else { var contents = parent.contents(node); @@ -462,8 +462,8 @@ AtDCore.prototype.markMyWords = function(container_nodes, errors) { parent.replaceWith(n, newNode); } - } - }); + } + }); return ecount; }; @@ -474,9 +474,9 @@ AtDCore.prototype._walk = function(elements, f) { f.call(f, elements[i]); this._walk(this.contents(elements[i]), f); } -}; +}; -AtDCore.prototype.removeWords = function(node, w) { +AtDCore.prototype.removeWords = function(node, w) { var count = 0; var parent = this; @@ -518,7 +518,7 @@ AtDCore.prototype.applySuggestion = function(element, suggestion) { } }; -/* +/* * Check for an error */ AtDCore.prototype.hasErrorMessage = function(xmlr) { diff --git a/plugins/jetpack/modules/after-the-deadline/atd.css b/plugins/jetpack/modules/after-the-deadline/atd.css index 5014feac..2f59bd21 100644 --- a/plugins/jetpack/modules/after-the-deadline/atd.css +++ b/plugins/jetpack/modules/after-the-deadline/atd.css @@ -25,7 +25,7 @@ * Project : http://jquery-spellchecker.googlecode.com */ -#suggestmenu +#suggestmenu { min-width: 122px; background: #ebeaeb; @@ -39,27 +39,27 @@ font-family: Tahoma, Verdana, Arial, Helvetica; } -#suggestmenu strong +#suggestmenu strong { background: #cccccc; font-weight: bold; - padding:3px 6px 3px 6px; - display:block; + padding:3px 6px 3px 6px; + display:block; border:1px solid #dddddd; - border-bottom: 1px solid #aaaaaa; + border-bottom: 1px solid #aaaaaa; color: black; } -#suggestmenu em +#suggestmenu em { - text-align:center; - padding:3px 6px 3px 6px; - display:block; + text-align:center; + padding:3px 6px 3px 6px; + display:block; border-top:1px solid #ccc; border-left:1px solid #ccc; } -#suggestmenu a, #suggestmenu a:visited +#suggestmenu a, #suggestmenu a:visited { background: #ebeaeb; border-left:1px solid #dddddd; @@ -72,34 +72,34 @@ outline:none } -#suggestmenu a.first, #suggestmenu a.first:visited +#suggestmenu a.first, #suggestmenu a.first:visited { border-top:1px solid #dddddd; } -.spell_sep_bottom +.spell_sep_bottom { border-bottom: 1px solid #dddddd; } -.spell_sep_top +.spell_sep_top { border-top: 1px solid #aaaaaa; } -#suggestmenu a:hover +#suggestmenu a:hover { color:#000; background: #f5f5f5; } -#suggestmenu .foot +#suggestmenu .foot { border-top:1px solid #aaaaaa; background:#fff } -#suggestmenu .foot a, #suggestmenu .foot a:visited +#suggestmenu .foot a, #suggestmenu .foot a:visited { outline:none } diff --git a/plugins/jetpack/modules/after-the-deadline/config-options.php b/plugins/jetpack/modules/after-the-deadline/config-options.php index 097b062d..db4a49c7 100644 --- a/plugins/jetpack/modules/after-the-deadline/config-options.php +++ b/plugins/jetpack/modules/after-the-deadline/config-options.php @@ -49,8 +49,8 @@ function AtD_display_options_form() {

-

'; AtD_print_option( 'onupdate', __('a post or page is updated', 'jetpack'), $options_check_when ); ?>

@@ -59,12 +59,12 @@ function AtD_display_options_form() {

-

'; AtD_print_option( 'Cliches', __('Clichés', 'jetpack'), $options_show_types ); echo '
'; - AtD_print_option( 'Complex Expression', __('Complex Phrases', 'jetpack'), $options_show_types ); + AtD_print_option( 'Complex Expression', __('Complex Phrases', 'jetpack'), $options_show_types ); echo '
'; AtD_print_option( 'Diacritical Marks', __('Diacritical Marks', 'jetpack'), $options_show_types ); echo '
'; @@ -72,15 +72,15 @@ function AtD_display_options_form() { echo '
'; AtD_print_option( 'Hidden Verbs', __('Hidden Verbs', 'jetpack'), $options_show_types ); echo '
'; - AtD_print_option( 'Jargon Language', __('Jargon', 'jetpack'), $options_show_types ); + AtD_print_option( 'Jargon Language', __('Jargon', 'jetpack'), $options_show_types ); echo '
'; - AtD_print_option( 'Passive voice', __('Passive Voice', 'jetpack'), $options_show_types ); + AtD_print_option( 'Passive voice', __('Passive Voice', 'jetpack'), $options_show_types ); echo '
'; - AtD_print_option( 'Phrases to Avoid', __('Phrases to Avoid', 'jetpack'), $options_show_types ); + AtD_print_option( 'Phrases to Avoid', __('Phrases to Avoid', 'jetpack'), $options_show_types ); echo '
'; - AtD_print_option( 'Redundant Expression', __('Redundant Phrases', 'jetpack'), $options_show_types ); + AtD_print_option( 'Redundant Expression', __('Redundant Phrases', 'jetpack'), $options_show_types ); ?>

-

Learn more about these options.', 'jetpack' ), 'http://support.wordpress.com/proofreading/' ); +

Learn more about these options.', 'jetpack' ), 'http://support.wordpress.com/proofreading/' ); ?>

@@ -103,14 +103,14 @@ function AtD_display_options_form() { */ function AtD_get_options( $user_id, $name ) { $options_raw = AtD_get_setting( $user_id, $name, 'single' ); - + $options = array(); $options['name'] = $name; if ( $options_raw ) - foreach ( explode( ',', $options_raw ) as $option ) + foreach ( explode( ',', $options_raw ) as $option ) $options[ $option ] = 1; - + return $options; } @@ -125,6 +125,6 @@ function AtD_update_options( $user_id, $name ) { } else { AtD_update_setting( $user_id, AtD_sanitize( $name ), ''); } - + return; } diff --git a/plugins/jetpack/modules/after-the-deadline/config-unignore.php b/plugins/jetpack/modules/after-the-deadline/config-unignore.php index 9d49fa20..84b18ff6 100644 --- a/plugins/jetpack/modules/after-the-deadline/config-unignore.php +++ b/plugins/jetpack/modules/after-the-deadline/config-unignore.php @@ -1,5 +1,5 @@ ">

- +

diff --git a/plugins/jetpack/modules/after-the-deadline/install_atd_l10n.js b/plugins/jetpack/modules/after-the-deadline/install_atd_l10n.js index 7d18bb9a..3215de66 100644 --- a/plugins/jetpack/modules/after-the-deadline/install_atd_l10n.js +++ b/plugins/jetpack/modules/after-the-deadline/install_atd_l10n.js @@ -2,7 +2,7 @@ function atd_sprintf(format, values) { var result = format; for (var x = 0; x < values.length; x++) - result = result.replace(new RegExp('%' + (x + 1) + '\\$', 'g'), values[x]); + result = result.replace(new RegExp('%' + (x + 1) + '\\$', 'g'), values[x]); return result; } @@ -15,7 +15,7 @@ function install_atd_l10n() { /* set the AtD l10n instance */ AtD.addI18n(AtD_l10n_r0ar); } - + /* document.ready() does not execute in IE6 unless it's at the bottom of the page. oi! */ if (navigator.appName == 'Microsoft Internet Explorer') setTimeout( install_atd_l10n, 2500 ); diff --git a/plugins/jetpack/modules/after-the-deadline/jquery.atd.js b/plugins/jetpack/modules/after-the-deadline/jquery.atd.js index e5201079..ee2ef6be 100644 --- a/plugins/jetpack/modules/after-the-deadline/jquery.atd.js +++ b/plugins/jetpack/modules/after-the-deadline/jquery.atd.js @@ -5,7 +5,7 @@ * Project : http://www.afterthedeadline.com/development.slp * Contact : raffi@automattic.com * - * Derived from: + * Derived from: * * jquery.spellchecker.js - a simple jQuery Spell Checker * Copyright (c) 2008 Richard Willis @@ -14,7 +14,7 @@ * Contact : willis.rh@gmail.com */ -var AtD = +var AtD = { rpc : '', /* see the proxy.php that came with the AtD/TinyMCE plugin */ rpc_css : 'http://www.polishmywriting.com/atd-jquery/server/proxycss.php?data=', /* you may use this, but be nice! */ @@ -46,8 +46,8 @@ AtD.showTypes = function(string) { AtD.checkCrossAJAX = function(container_id, callback_f) { /* checks if a global var for click stats exists and increments it if it does... */ - if (typeof AtD_proofread_click_count != "undefined") - AtD_proofread_click_count++; + if (typeof AtD_proofread_click_count != "undefined") + AtD_proofread_click_count++; AtD.callback_f = callback_f; /* remember the callback for later */ AtD.remove(container_id); @@ -74,7 +74,7 @@ AtD.checkCrossAJAX = function(container_id, callback_f) { xml = new ActiveXObject("Microsoft.XMLDOM"); xml.async = false; xml.loadXML(response); - } + } else { xml = (new DOMParser()).parseFromString(response, 'text/xml'); } @@ -85,7 +85,7 @@ AtD.checkCrossAJAX = function(container_id, callback_f) { AtD.callback_f.error(AtD.core.getErrorMessage(xml)); return; - } + } /* highlight the errors */ @@ -107,12 +107,12 @@ AtD.checkCrossAJAX = function(container_id, callback_f) { AtD.check = function(container_id, callback_f) { /* checks if a global var for click stats exists and increments it if it does... */ if (typeof AtD_proofread_click_count != "undefined") - AtD_proofread_click_count++; + AtD_proofread_click_count++; AtD.callback_f = callback_f; /* remember the callback for later */ - AtD.remove(container_id); - + AtD.remove(container_id); + var container = jQuery('#' + container_id); var html = container.html(); @@ -124,14 +124,14 @@ AtD.check = function(container_id, callback_f) { type : "POST", url : AtD.rpc + '/checkDocument', data : 'key=' + AtD.api_key + '&data=' + text, - format : 'raw', + format : 'raw', dataType : (jQuery.browser.msie) ? "text" : "xml", error : function(XHR, status, error) { if (AtD.callback_f != undefined && AtD.callback_f.error != undefined) AtD.callback_f.error(status + ": " + error); }, - + success : function(data) { /* apparently IE likes to return XML as plain text-- work around from: http://docs.jquery.com/Specifying_the_Data_Type_for_AJAX_Requests */ @@ -141,7 +141,7 @@ AtD.check = function(container_id, callback_f) { xml = new ActiveXObject("Microsoft.XMLDOM"); xml.async = false; xml.loadXML(data); - } + } else { xml = data; } @@ -169,7 +169,7 @@ AtD.check = function(container_id, callback_f) { } }); }; - + AtD.remove = function(container_id) { AtD._removeWords(container_id, null); }; @@ -182,7 +182,7 @@ AtD.clickListener = function(event) { AtD.processXML = function(container_id, responseXML) { var results = AtD.core.processXML(responseXML); - + if (results.count > 0) results.count = AtD.core.markMyWords(jQuery('#' + container_id).contents(), results.errors); @@ -214,7 +214,7 @@ AtD.editSelection = function() { }; AtD.ignoreSuggestion = function() { - AtD.core.removeParent(AtD.errorElement); + AtD.core.removeParent(AtD.errorElement); AtD.counter --; if (AtD.counter == 0 && AtD.callback_f != undefined && AtD.callback_f.success != undefined) @@ -253,7 +253,7 @@ AtD.suggest = function(element) { suggest.hide(); } - /* find the correct suggestions object */ + /* find the correct suggestions object */ errorDescription = AtD.core.findSuggestion(element); @@ -297,7 +297,7 @@ AtD.suggest = function(element) { suggest.append('' + AtD.getLang('menu_option_ignore_always', 'Ignore always') + ''); else suggest.append('' + AtD.getLang('menu_option_ignore_all', 'Ignore all') + ''); - + suggest.append('' + AtD.getLang('menu_option_edit_selection', 'Edit Selection...') + ''); } else { @@ -313,8 +313,8 @@ AtD.suggest = function(element) { var width = jQuery(element).width(); /* a sanity check for Internet Explorer--my favorite browser in every possible way */ - if (width > 100) - width = 50; + if (width > 100) + width = 50; jQuery(suggest).css({ left: (pos.left + width) + 'px', top: pos.top + 'px' }); @@ -327,13 +327,13 @@ AtD.suggest = function(element) { setTimeout(function() { jQuery("body").bind("click", function() { if (!AtD.suggestShow) - jQuery('#suggestmenu').fadeOut(200); + jQuery('#suggestmenu').fadeOut(200); }); }, 1); setTimeout(function() { AtD.suggestShow = false; - }, 2); + }, 2); }; AtD._removeWords = function(container_id, w) { @@ -341,7 +341,7 @@ AtD._removeWords = function(container_id, w) { }; /* - * Set prototypes used by AtD Core UI + * Set prototypes used by AtD Core UI */ AtD.initCoreModule = function() { var core = new AtDCore(); diff --git a/plugins/jetpack/modules/after-the-deadline/proxy.php b/plugins/jetpack/modules/after-the-deadline/proxy.php index 04bbd285..3d5ef3b6 100644 --- a/plugins/jetpack/modules/after-the-deadline/proxy.php +++ b/plugins/jetpack/modules/after-the-deadline/proxy.php @@ -21,21 +21,21 @@ function AtD_http_post( $request, $host, $path, $port = 80 ) { $AtD_url = "http://{$host}{$path}"; $response = wp_remote_post( $AtD_url, $http_args ); $code = (int) wp_remote_retrieve_response_code( $response ); - + if ( is_wp_error( $response ) ) { do_action( 'atd_http_post_error', 'http-error' ); return array(); } elseif ( 200 != $code ) { do_action( 'atd_http_post_error', $code ); } - + return array( - wp_remote_retrieve_headers( $response ), + wp_remote_retrieve_headers( $response ), wp_remote_retrieve_body( $response ), ); } -/* +/* * This function is called as an action handler to admin-ajax.php */ function AtD_redirect_call() { diff --git a/plugins/jetpack/modules/after-the-deadline/tinymce/editor_plugin.js b/plugins/jetpack/modules/after-the-deadline/tinymce/editor_plugin.js index fc9f01fe..f9251cd9 100644 --- a/plugins/jetpack/modules/after-the-deadline/tinymce/editor_plugin.js +++ b/plugins/jetpack/modules/after-the-deadline/tinymce/editor_plugin.js @@ -1,5 +1,5 @@ /* - * TinyMCE Writing Improvement Tool Plugin + * TinyMCE Writing Improvement Tool Plugin * Author: Raphael Mudge (raffi@automattic.com) * * http://www.afterthedeadline.com @@ -15,15 +15,15 @@ * Moxiecode Spell Checker plugin released under the LGPL with TinyMCE */ -(function() +(function() { - var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; + var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; - tinymce.create('tinymce.plugins.AfterTheDeadlinePlugin', + tinymce.create('tinymce.plugins.AfterTheDeadlinePlugin', { - getInfo : function() + getInfo : function() { - return + return ({ longname : 'After The Deadline', author : 'Raphael Mudge', @@ -40,12 +40,12 @@ core.map = each; - core.getAttrib = function(node, key) - { - return editor.dom.getAttrib(node, key); + core.getAttrib = function(node, key) + { + return editor.dom.getAttrib(node, key); }; - core.findSpans = function(parent) + core.findSpans = function(parent) { if (parent == undefined) return editor.dom.select('span'); @@ -53,39 +53,39 @@ return editor.dom.select('span', parent); }; - core.hasClass = function(node, className) - { - return editor.dom.hasClass(node, className); + core.hasClass = function(node, className) + { + return editor.dom.hasClass(node, className); }; - - core.contents = function(node) - { - return node.childNodes; + + core.contents = function(node) + { + return node.childNodes; }; - core.replaceWith = function(old_node, new_node) - { - return editor.dom.replace(new_node, old_node); + core.replaceWith = function(old_node, new_node) + { + return editor.dom.replace(new_node, old_node); }; - core.create = function(node_html) - { + core.create = function(node_html) + { return editor.dom.create('span', { 'class': 'mceItemHidden' }, node_html); }; - core.removeParent = function(node) + core.removeParent = function(node) { editor.dom.remove(node, 1); return node; }; - core.remove = function(node) - { - editor.dom.remove(node); + core.remove = function(node) + { + editor.dom.remove(node); }; - core.getLang = function(key, defaultk) - { + core.getLang = function(key, defaultk) + { return editor.getLang("AtD." + key, defaultk); }; @@ -93,9 +93,9 @@ core.showTypes(editor.getParam("atd_show_types", "")); return core; }, - + /* called when the plugin is initialized */ - init : function(ed, url) + init : function(ed, url) { if ( typeof(AtDCore) == 'undefined' ) return; @@ -118,7 +118,7 @@ } /* add a command to request a document check and process the results. */ - editor.addCommand('mceWritingImprovementTool', function(callback) + editor.addCommand('mceWritingImprovementTool', function(callback) { /* checks if a global var for click stats exists and increments it if it does... */ if (typeof AtD_proofread_click_count != "undefined") @@ -162,7 +162,7 @@ if (results.count > 0) { ecount = plugin.markMyWords(results.errors); - ed.suggestions = results.suggestions; + ed.suggestions = results.suggestions; } if (ecount == 0 && (!callback || callback == undefined)) @@ -171,9 +171,9 @@ callback(ecount); }); }); - + /* load cascading style sheet for this plugin */ - editor.onInit.add(function() + editor.onInit.add(function() { /* loading the content.css file, why? I have no clue */ if (editor.settings.content_css !== false) @@ -189,13 +189,13 @@ editor.onContextMenu.add(plugin._showMenu, plugin); /* strip out the markup before the contents is serialized (and do it on a copy of the markup so we don't affect the user experience) */ - editor.onPreProcess.add(function(sender, object) + editor.onPreProcess.add(function(sender, object) { var dom = sender.dom; - each(dom.select('span', object.node).reverse(), function(n) + each(dom.select('span', object.node).reverse(), function(n) { - if (n && (dom.hasClass(n, 'hiddenGrammarError') || dom.hasClass(n, 'hiddenSpellError') || dom.hasClass(n, 'hiddenSuggestion') || dom.hasClass(n, 'mceItemHidden') || (dom.getAttrib(n, 'class') == "" && dom.getAttrib(n, 'style') == "" && dom.getAttrib(n, 'id') == "" && !dom.hasClass(n, 'Apple-style-span') && dom.getAttrib(n, 'mce_name') == ""))) + if (n && (dom.hasClass(n, 'hiddenGrammarError') || dom.hasClass(n, 'hiddenSpellError') || dom.hasClass(n, 'hiddenSuggestion') || dom.hasClass(n, 'mceItemHidden') || (dom.getAttrib(n, 'class') == "" && dom.getAttrib(n, 'style') == "" && dom.getAttrib(n, 'id') == "" && !dom.hasClass(n, 'Apple-style-span') && dom.getAttrib(n, 'mce_name') == ""))) { dom.remove(n, 1); } @@ -203,7 +203,7 @@ }); /* cleanup the HTML before executing certain commands */ - editor.onBeforeExecCommand.add(function(editor, command) + editor.onBeforeExecCommand.add(function(editor, command) { if (command == 'mceCodeEditor') { @@ -214,15 +214,15 @@ plugin._done(); } }); - - ed.addButton('AtD', { + + ed.addButton('AtD', { title: ed.getLang('AtD.button_proofread_tooltip', 'Proofread Writing'), - image: ed.getParam('atd_button_url', url + '/atdbuttontr.gif'), + image: ed.getParam('atd_button_url', url + '/atdbuttontr.gif'), cmd: 'mceWritingImprovementTool' }); }, - _removeWords : function(w) + _removeWords : function(w) { var ed = this.editor, dom = ed.dom, se = ed.selection, b = se.getBookmark(); @@ -247,17 +247,17 @@ return ecount; }, - _showMenu : function(ed, e) + _showMenu : function(ed, e) { var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()); var plugin = this; - if (!m) + if (!m) { p1 = DOM.getPos(ed.getContentAreaContainer()); //p2 = DOM.getPos(ed.getContainer()); - m = ed.controlManager.createDropMenu('spellcheckermenu', + m = ed.controlManager.createDropMenu('spellcheckermenu', { offset_x : p1.x, offset_y : p1.y, @@ -292,8 +292,8 @@ (function(sugg) { m.add({ - title : sugg, - onclick : function() + title : sugg, + onclick : function() { ed.core.applySuggestion(e.target, sugg); t._checkDone(); @@ -304,14 +304,14 @@ m.addSeparator(); } - + if (errorDescription != undefined && errorDescription["moreinfo"] != null) { (function(url) { m.add({ title : plugin.editor.getLang('AtD.menu_option_explain', 'Explain...'), - onclick : function() + onclick : function() { ed.windowManager.open({ url : url, @@ -328,7 +328,7 @@ m.add({ title : plugin.editor.getLang('AtD.menu_option_ignore_once', 'Ignore suggestion'), - onclick : function() + onclick : function() { dom.remove(e.target, 1); t._checkDone(); @@ -339,7 +339,7 @@ { m.add({ title : plugin.editor.getLang('AtD.menu_option_ignore_always', 'Ignore always'), - onclick : function() + onclick : function() { var url = t.editor.getParam('atd_ignore_rpc_url', '{backend}'); @@ -347,10 +347,10 @@ { /* Default scheme is to save ignore preferences in a cookie */ - var ignore = tinymce.util.Cookie.getHash('atd_ignore'); + var ignore = tinymce.util.Cookie.getHash('atd_ignore'); if (ignore == undefined) { ignore = {}; } ignore[e.target.innerHTML] = 1; - + tinymce.util.Cookie.setHash('atd_ignore', ignore, new Date( (new Date().getTime()) + 157680000000) ); } else @@ -370,7 +370,7 @@ }, error : function( type, req, o ) { - alert( "Ignore preference save failed\n" + type + "\n" + req.status + "\nAt: " + o.url ); + alert( "Ignore preference save failed\n" + type + "\n" + req.status + "\nAt: " + o.url ); } }); @@ -387,7 +387,7 @@ { m.add({ title : plugin.editor.getLang('menu_option_ignore_all', 'Ignore all'), - onclick : function() + onclick : function() { t._removeWords(e.target.innerHTML); t._checkDone(); @@ -401,7 +401,7 @@ m.showMenu(p1.x, p1.y + e.target.offsetHeight - vp.y); return tinymce.dom.Event.cancel(e); - } + } else { m.hideMenu(); @@ -409,11 +409,11 @@ }, /* loop through editor DOM, call _done if no mce tags exist. */ - _checkDone : function() + _checkDone : function() { var t = this, ed = t.editor, dom = ed.dom, o; - each(dom.select('span'), function(n) + each(dom.select('span'), function(n) { if (n && dom.hasClass(n, 'mceItemHidden')) { @@ -429,7 +429,7 @@ }, /* remove all tags, hide the menu, and fire a dom change event */ - _done : function() + _done : function() { var plugin = this; plugin._removeWords(); @@ -448,24 +448,24 @@ var url = this.editor.getParam("atd_rpc_url", "{backend}"); var plugin = this; - if (url == '{backend}' || id == '12345678') + if (url == '{backend}' || id == '12345678') { this.editor.setProgressState(0); alert('Please specify: atd_rpc_url and atd_rpc_id'); return; } - + tinymce.util.XHR.send({ url : url + "/" + file, content_type : 'text/xml', type : "POST", - data : "data=" + encodeURI(data).replace(/&/g, '%26') + "&key=" + id, + data : "data=" + encodeURI(data).replace(/&/g, '%26') + "&key=" + id, async : true, success : success, error : function( type, req, o ) { plugin.editor.setProgressState(0); - alert( type + "\n" + req.status + "\nAt: " + o.url ); + alert( type + "\n" + req.status + "\nAt: " + o.url ); } }); } diff --git a/plugins/jetpack/modules/carousel.php b/plugins/jetpack/modules/carousel.php index 2637f43d..e8db24b7 100644 --- a/plugins/jetpack/modules/carousel.php +++ b/plugins/jetpack/modules/carousel.php @@ -5,6 +5,7 @@ * Module Description: Transform your standard image galleries into an immersive full-screen experience. * Sort Order: 4 * First Introduced: 1.5 + * Requires Connection: No */ include dirname( __FILE__ ) . '/carousel/jetpack-carousel.php'; diff --git a/plugins/jetpack/modules/carousel/jetpack-carousel.css b/plugins/jetpack/modules/carousel/jetpack-carousel.css index 49bdad8e..05854495 100644 --- a/plugins/jetpack/modules/carousel/jetpack-carousel.css +++ b/plugins/jetpack/modules/carousel/jetpack-carousel.css @@ -48,7 +48,7 @@ only screen and (min-device-pixel-ratio: 1.5) { background: #68c9e8; /* Safari */ color: #fff; } - + .jp-carousel-info ::-moz-selection { background: #68c9e8; /* Firefox */ color: #fff; @@ -133,7 +133,7 @@ div.jp-carousel-buttons a { padding: 5px 2px 5px 0; text-decoration: none !important; text-shadow: none !important; - vertical-align: baseline !important; + vertical-align: middle; -webkit-font-smoothing: subpixel-antialiased; } @@ -481,7 +481,7 @@ div#carousel-reblog-box { display: none; } -.jp-carousel-photo-info h1:before, +.jp-carousel-photo-info h1:before, .jp-carousel-photo-info h1:after, .jp-carousel-left-column-wrapper h1:before, .jp-carousel-left-column-wrapper h1:after { @@ -693,7 +693,7 @@ textarea#jp-carousel-comment-form-comment-field { border-radius: 3px; overflow: hidden; -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; + -moz-box-sizing: border-box; box-sizing: border-box; } @@ -791,7 +791,7 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder } #jp-carousel-comment-post-results { - display: none; + display: none; overflow:auto; width:100%; } @@ -1050,14 +1050,14 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder margin: 0 10px !important; } - .jp-carousel-next-button, .jp-carousel-previous-button { - display: none !important; + .jp-carousel-next-button, .jp-carousel-previous-button { + display: none !important; } .jp-carousel-buttons { display: none !important; } - + .jp-carousel-image-meta { float: none !important; width: 100% !important; @@ -1065,31 +1065,31 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder -webkit-box-sizing:border-box; box-sizing: border-box; } - + .jp-carousel-close-hint { font-weight: 800 !important; font-size: 26px !important; position: fixed !important; top: -10px; } - + .jp-carousel-slide img { filter: alpha(opacity=100); opacity: 1; } - + .jp-carousel-wrap { - background-color: #000; + background-color: #000; } - + .jp-carousel-fadeaway { display: none; } - + #jp-carousel-comment-form-container { display: none !important; } - + .jp-carousel-titleanddesc { padding-top: 0 !important; border: none !important; @@ -1097,8 +1097,8 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder .jp-carousel-titleanddesc-title { font-size: 1em !important; } - + .jp-carousel-left-column-wrapper { padding: 0; - } + } } diff --git a/plugins/jetpack/modules/carousel/jetpack-carousel.js b/plugins/jetpack/modules/carousel/jetpack-carousel.js index 43f1d1f7..f101dbf5 100644 --- a/plugins/jetpack/modules/carousel/jetpack-carousel.js +++ b/plugins/jetpack/modules/carousel/jetpack-carousel.js @@ -54,9 +54,69 @@ jQuery(document).ready(function($) { }, 200); }; - var prepareGallery = function(){ - if (!overlay) { + // For each image in the carousel, emit likes widget markup + var getCarouselLikeWidgets = function( dataCarouselExtra ) { + + // Only do this if likes is enabled + if ( "undefined" === typeof jetpackLikesWidgetQueue ) + return ""; + + var blogId = dataCarouselExtra.likes_blog_id; + var attachmentId = 0; + var protocol = 'http'; + var originDomain = 'http://wordpress.com'; + + if ( dataCarouselExtra.permalink.length ) { + var parts = dataCarouselExtra.permalink.split( ':' ); + var protocol = parts[0]; + if ( ( protocol != 'http' ) && ( protocol != 'https' ) ) { + protocol = 'http'; + } + + parts = dataCarouselExtra.permalink.split( '/' ); + if ( parts.length >= 2 ) { + originDomain = protocol + "://" + parts[2]; + } + } + + var likesWidgetContainer = $(""); + + $( 'div.gallery, div.tiled-gallery' ).find( 'img' ).each( function() { + + attachmentId = $( this ).attr( "data-attachment-id" ); + var dataSource = protocol + "://widgets.wp.com/likes/#blog_id=" + blogId + "&post_id=" + attachmentId + "&slim=1&origin=" + originDomain; + + if ( 'en' !== jetpackCarouselStrings.lang ) { + dataSource += "&lang=" + jetpackCarouselStrings.lang; + } + + var likesWidgetWrapper = $( "
" ); + likesWidgetWrapper.addClass( "jetpack-likes-widget-wrapper" ) + .addClass( "jetpack-likes-widget-unloaded" ) + .addClass( "slim-likes-widget" ) + .attr( "id", "like-post-wrapper-" + blogId + "-" + attachmentId ) + .attr( "data-src", dataSource ) + .attr( "data-name", "like-post-frame-" + blogId + "-" + attachmentId ) + .attr( "data-attachment-id", attachmentId ) + .css( "display", "none" ) + .css( "vertical-align", "middle" ); + + var likesWidget = $( "" ); + likesWidget.attr( "name", "like-post-frame-" + blogId + "-" + attachmentId ) + .attr( "src", dataSource ); + likesWidget.css( "display", "inline-block" ); + likesWidgetWrapper.append( likesWidget ); + + likesWidgetWrapper.append( "
" ); + + likesWidgetContainer.append( likesWidgetWrapper ); + }); + + return likesWidgetContainer.html(); + }; + var prepareGallery = function( dataCarouselExtra ){ + if (!overlay) { overlay = $('
') .addClass('jp-carousel-overlay') .css({ @@ -68,6 +128,9 @@ jQuery(document).ready(function($) { }); buttons = ''; + if ( 1 == jetpackCarouselStrings.is_logged_in ) { + } + buttons += getCarouselLikeWidgets( dataCarouselExtra ); buttons = $(''); caption = $('

'); @@ -81,6 +144,11 @@ jQuery(document).ready(function($) { 'width' : '250px' }); + imageMeta.append( buttons ); + imageMeta.append( "" ); + imageMeta.append( "" ); + imageMeta.append( "" ); + titleAndDescription = $('
') .addClass('jp-carousel-titleanddesc') .css({ @@ -99,15 +167,20 @@ jQuery(document).ready(function($) { commentFormMarkup += ''; } else if ( jetpackCarouselStrings.local_comments_commenting_as && jetpackCarouselStrings.local_comments_commenting_as.length ) { // Jetpack comments not enabled, fallback to local comments - commentFormMarkup += ''; + + if ( 1 != jetpackCarouselStrings.is_logged_in && 1 == jetpackCarouselStrings.comment_registration ) { + commentFormMarkup += ''; + } else { + commentFormMarkup += ''; + } } commentFormMarkup += '
'; @@ -134,10 +207,6 @@ jQuery(document).ready(function($) { }); leftWidth = ( $(window).width() - ( screenPadding * 2 ) ) - (imageMeta.width() + 40); - if ( $.browser.mozilla ) - leftWidth -= 55; - else if ( $.browser.msie ) - leftWidth -= 20; leftWidth += 'px'; if (isMobile) @@ -259,6 +328,10 @@ jQuery(document).ready(function($) { container.animate({scrollTop: parseInt(info.position()['top'], 10)}, 'fast'); $('#jp-carousel-comment-form-submit-and-info-wrapper').slideDown('fast'); $('#jp-carousel-comment-form-comment-field').focus(); + } else if ( target.hasClass('jp-carousel-comment-login') ) { + var url = jetpackCarouselStrings.login_url + '%23jp-carousel-' + attachment_id; + + document.location.href = url; } else if ( target.parents('#jp-carousel-comment-form-container').length ) { var textarea = $('#jp-carousel-comment-form-comment-field') .blur(function(){ @@ -320,12 +393,14 @@ jQuery(document).ready(function($) { ajaxData['author'] = authorField.val(); ajaxData['url'] = urlField.val(); - if ( ! ajaxData['email'].length || ! ajaxData['email'].match('@') ) { - gallery.jp_carousel('postCommentError', {'field': 'jp-carousel-comment-form-email-field', 'error': jetpackCarouselStrings.no_comment_email}); - return; - } else if ( ! ajaxData['author'].length ) { - gallery.jp_carousel('postCommentError', {'field': 'jp-carousel-comment-form-author-field', 'error': jetpackCarouselStrings.no_comment_author}); - return; + if ( 1 == jetpackCarouselStrings.require_name_email ) { + if ( ! ajaxData['email'].length || ! ajaxData['email'].match('@') ) { + gallery.jp_carousel('postCommentError', {'field': 'jp-carousel-comment-form-email-field', 'error': jetpackCarouselStrings.no_comment_email}); + return; + } else if ( ! ajaxData['author'].length ) { + gallery.jp_carousel('postCommentError', {'field': 'jp-carousel-comment-form-author-field', 'error': jetpackCarouselStrings.no_comment_author}); + return; + } } } @@ -369,8 +444,14 @@ jQuery(document).ready(function($) { $(window).unbind('keydown', keyListener); $(window).unbind('resize', resizeListener); - document.location.hash = ''; $(window).scrollTop(scroll); + }) + .bind('jp_carousel.afterClose', function(){ + if ( history.pushState ) { + history.pushState("", document.title, window.location.pathname + window.location.search); + } else { + document.location.hash = ''; + } gallery.opened = false; }); @@ -382,6 +463,10 @@ jQuery(document).ready(function($) { preventDefaultEvents: true }); + $( '.jetpack-likes-widget-unloaded' ).each( function() { + jetpackLikesWidgetQueue.push( this.id ); + }); + nextButton.add(previousButton).click(function(e){ e.preventDefault(); e.stopPropagation(); @@ -397,8 +482,9 @@ jQuery(document).ready(function($) { var methods = { testForData: function(gallery) { gallery = $( gallery ); // make sure we have it as a jQuery object. - if ( ! gallery.length || undefined == gallery.data( 'carousel-extra' ) ) + if ( ! gallery.length || undefined == gallery.data( 'carousel-extra' ) ) { return false; + } return true; }, @@ -418,8 +504,8 @@ jQuery(document).ready(function($) { if ( !data ) return; // don't run if the default gallery functions weren't used - prepareGallery(); - + prepareGallery( data ); + if ( gallery.jp_carousel( 'testIfOpened' ) ) return; // don't open if already opened @@ -429,8 +515,13 @@ jQuery(document).ready(function($) { $('body').css('overflow', 'hidden'); // prevent html from overflowing on some of the new themes. originalHOverflow = $('html').css('overflow'); - $('html').css('overflow', 'hidden'); - + $('html').css('overflow', 'hidden'); + + // Re-apply inline-block style here and give an initial value for the width + // This value will get replaced with a more appropriate value once the slide is loaded + // This avoids the likes widget appearing initially full width below the comment button and then shuffling up + jQuery( '.slim-likes-widget' ).find( 'iframe' ).css( 'display', 'inline-block' ).css( 'width', '60px' ); + container.data('carousel-extra', data); return this.each(function() { @@ -510,6 +601,10 @@ jQuery(document).ready(function($) { }, resetButtons : function(current) { + if ( current.data('liked') ) + $('.jp-carousel-buttons a.jp-carousel-like').addClass('liked').text(jetpackCarouselStrings.unlike); + else + $('.jp-carousel-buttons a.jp-carousel-like').removeClass('liked').text(jetpackCarouselStrings.like); }, loopSlides : function(reverse){ @@ -604,14 +699,13 @@ jQuery(document).ready(function($) { gallery.jp_carousel('resetButtons', current); container.trigger('jp_carousel.selectSlide', [current]); - $( 'div.jp-carousel-image-meta', 'div.jp-carousel-wrap' ).html(''); - - gallery.jp_carousel('getTitleDesc', { title: current.data('title'), desc: current.data('desc') } ); - gallery.jp_carousel('getMeta', current.data('image-meta')); - gallery.jp_carousel('getFullSizeLink', current); - gallery.jp_carousel('getMap', current.data('image-meta')); - gallery.jp_carousel('testCommentsOpened', current.data('comments-opened')); - gallery.jp_carousel('getComments', {'attachment_id': current.data('attachment-id'), 'offset': 0, 'clear': true}); + gallery.jp_carousel( 'getTitleDesc', { title: current.data( 'title' ), desc: current.data( 'desc' ) } ); + gallery.jp_carousel( 'updateLikesWidgetVisibility', current.data( 'attachment-id' ) ) + gallery.jp_carousel( 'updateExif', current.data( 'image-meta' ) ); + gallery.jp_carousel( 'updateFullSizeLink', current ); + gallery.jp_carousel( 'updateMap', current.data( 'image-meta' ) ); + gallery.jp_carousel( 'testCommentsOpened', current.data( 'comments-opened' ) ); + gallery.jp_carousel( 'getComments', { 'attachment_id': current.data( 'attachment-id' ), 'offset': 0, 'clear': true } ); $('#jp-carousel-comment-post-results').slideUp(); @@ -832,11 +926,11 @@ jQuery(document).ready(function($) { if ( 'undefined' == typeof args.medium_file || 'undefined' == typeof args.large_file ) return args.orig_file; - var medium_size = args.medium_file.replace(/^https?:\/\/.+-([\d]+x[\d]+)\..+$/, '$1'), + var medium_size = args.medium_file.replace(/-([\d]+x[\d]+)\..+$/, '$1'), medium_size_parts = (medium_size != args.medium_file) ? medium_size.split('x') : [args.orig_width, 0], medium_width = parseInt( medium_size_parts[0], 10 ), medium_height = parseInt( medium_size_parts[1], 10 ), - large_size = args.large_file.replace(/^https?:\/\/.+-([\d]+x[\d]+)\..+$/, '$1'), + large_size = args.large_file.replace(/-([\d]+x[\d]+)\..+$/, '$1'), large_size_parts = (large_size != args.large_file) ? large_size.split('x') : [args.orig_width, 0], large_width = parseInt( large_size_parts[0], 10 ), large_height = parseInt( large_size_parts[1], 10 ); @@ -955,11 +1049,25 @@ jQuery(document).ready(function($) { $( 'div#jp-carousel-comments-loading' ).css('margin-top', '20px'); }, - getMeta: function( meta ) { + updateLikesWidgetVisibility: function( attachmentId ) { + // Hide all likes widgets except for the one for the attachmentId passed in + + $( '.jp-carousel-buttons' ).find( '.jetpack-likes-widget-wrapper' ).each( function() { + var widgetWrapper = $( this ); + if ( widgetWrapper.attr('data-attachment-id') == attachmentId ) { + widgetWrapper.css( 'display', 'inline-block' ); + } else { + widgetWrapper.css( 'display', 'none' ); + } + }); + }, + + // updateExif updates the contents of the exif UL (.jp-carousel-image-exif) + updateExif: function( meta ) { if ( !meta || 1 != jetpackCarouselStrings.display_exif ) return false; - var $ul = $( '
    ' ); + var $ul = $( "" ); $.each( meta, function( key, val ) { if ( 0 === parseFloat(val) || !val.length || -1 === $.inArray( key, [ 'camera', 'aperture', 'shutter_speed', 'focal_length' ] ) ) return; @@ -982,14 +1090,12 @@ jQuery(document).ready(function($) { $ul.append( '
  • ' + jetpackCarouselStrings[key] + '
    ' + val + '
  • ' ); }); - $( 'div.jp-carousel-image-meta', 'div.jp-carousel-wrap' ) - .append( $( buttons ) ); - - $( 'div.jp-carousel-image-meta', 'div.jp-carousel-wrap' ) - .append( $ul ); + // Update (replace) the content of the ul + $( 'div.jp-carousel-image-meta ul.jp-carousel-image-exif' ).replaceWith( $ul ); }, - getFullSizeLink: function(current) { + // updateFullSizeLink updates the contents of the jp-carousel-image-download link + updateFullSizeLink: function(current) { if(!current || !current.data) return false; var original = current.data('orig-file').replace(/\?.+$/, ''), @@ -999,11 +1105,11 @@ jQuery(document).ready(function($) { .attr( 'href', original ) .attr( 'target', '_blank' ); - $( 'div.jp-carousel-image-meta', 'div.jp-carousel-wrap' ) - .append( permalink ); + // Update (replace) the content of the anchor + $( 'div.jp-carousel-image-meta a.jp-carousel-image-download' ).replaceWith( permalink ); }, - getMap: function( meta ) { + updateMap: function( meta ) { if ( !meta.latitude || !meta.longitude || 1 != jetpackCarouselStrings.display_geo ) return; @@ -1186,11 +1292,18 @@ jQuery(document).ready(function($) { // Set an interval on page load to load the carousel if hash exists and not already opened. // Makes carousel work on page load and when back button leads to same URL with carousel hash (ie: no actual document.ready trigger) $(document).ready(function(){ + last_known_location_hash = ''; + var jp_carousel_open_interval = window.setInterval(function(){ // We should have a URL hash by now. if ( ! document.location.hash || ! document.location.hash.match(/jp-carousel-(\d+)/) ) return; + if ( document.location.hash == last_known_location_hash ) + return; + + last_known_location_hash = document.location.hash; + var gallery = $('div.gallery, div.tiled-gallery'), index = -1, n = document.location.hash.match(/jp-carousel-(\d+)/); if ( ! $(this).jp_carousel( 'testForData', gallery ) ) diff --git a/plugins/jetpack/modules/carousel/jetpack-carousel.php b/plugins/jetpack/modules/carousel/jetpack-carousel.php index 314dd7b2..787f177a 100644 --- a/plugins/jetpack/modules/carousel/jetpack-carousel.php +++ b/plugins/jetpack/modules/carousel/jetpack-carousel.php @@ -92,9 +92,12 @@ class Jetpack_Carousel { // Also: not hardcoding path since there is no guarantee site is running on site root in self-hosted context. $is_logged_in = is_user_logged_in(); $current_user = wp_get_current_user(); + $comment_registration = intval( get_option( 'comment_registration' ) ); + $require_name_email = intval( get_option( 'require_name_email' ) ); $localize_strings = array( 'widths' => $this->prebuilt_widths, 'is_logged_in' => $is_logged_in, + 'lang' => strtolower( substr( get_locale(), 0, 2 ) ), 'ajaxurl' => admin_url( 'admin-ajax.php', is_ssl() ? 'https' : 'http' ), 'nonce' => wp_create_nonce( 'carousel_nonce' ), 'display_exif' => $this->test_1or0_option( get_option( 'carousel_display_exif' ), true ), @@ -114,6 +117,9 @@ class Jetpack_Carousel { 'aperture' => __( 'Aperture', 'jetpack' ), 'shutter_speed' => __( 'Shutter Speed', 'jetpack' ), 'focal_length' => __( 'Focal Length', 'jetpack' ), + 'comment_registration' => $comment_registration, + 'require_name_email' => $require_name_email, + 'login_url' => wp_login_url( apply_filters( 'the_permalink', get_permalink() ) ), ); if ( ! isset( $localize_strings['jetpack_comments_iframe_src'] ) || empty( $localize_strings['jetpack_comments_iframe_src'] ) ) { @@ -122,13 +128,18 @@ class Jetpack_Carousel { if ( $is_logged_in ) { $localize_strings['local_comments_commenting_as'] = ''; } else { - $localize_strings['local_comments_commenting_as'] = '' - . '
    ' - . '
    ' - . '
    ' - . '
    ' - . '
    ' - . '
    '; + if ( $comment_registration ) { + $localize_strings['local_comments_commenting_as'] = ''; + } else { + $required = ( $require_name_email ) ? __( '%s (Required)', 'jetpack' ) : '%s'; + $localize_strings['local_comments_commenting_as'] = '' + . '
    ' + . '
    ' + . '
    ' + . '
    ' + . '
    ' + . '
    '; + } } } @@ -225,7 +236,21 @@ class Jetpack_Carousel { if ( isset( $post ) ) { $blog_id = (int) get_current_blog_id(); - $extra_data = array( 'data-carousel-extra' => array( 'blog_id' => $blog_id, 'permalink' => get_permalink( $post->ID ) ) ); + + if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { + $likes_blog_id = $blog_id; + } else { + $jetpack = Jetpack::init(); + $likes_blog_id = $jetpack->get_option( 'id' ); + } + + $extra_data = array( + 'data-carousel-extra' => array( + 'blog_id' => $blog_id, + 'permalink' => get_permalink( $post->ID ), + 'likes_blog_id' => $likes_blog_id + ) + ); $extra_data = apply_filters( 'jp_carousel_add_data_to_container', $extra_data ); foreach ( (array) $extra_data as $data_key => $data_values ) { @@ -265,11 +290,10 @@ class Jetpack_Carousel { // Can't just send the results, they contain the commenter's email address. foreach ( $comments as $comment ) { - $author_markup = '' . esc_html( $comment->comment_author ) . ''; $out[] = array( 'id' => $comment->comment_ID, 'parent_id' => $comment->comment_parent, - 'author_markup' => $author_markup, + 'author_markup' => get_comment_author_link( $comment->comment_ID ), 'gravatar_markup' => get_avatar( $comment->comment_author_email, 64 ), 'date_gmt' => $comment->comment_date_gmt, 'content' => wpautop($comment->comment_content), @@ -326,23 +350,26 @@ class Jetpack_Carousel { $email = $_POST['email']; $url = $_POST['url']; - if ( empty( $display_name ) ) - die( json_encode( array( 'error' => __( 'Please provide your name.', 'jetpack' ) ) ) ); + if ( get_option( 'require_name_email' ) ) { + if ( empty( $display_name ) ) + die( json_encode( array( 'error' => __( 'Please provide your name.', 'jetpack' ) ) ) ); - if ( empty( $email ) ) - die( json_encode( array( 'error' => __( 'Please provide an email address.', 'jetpack' ) ) ) ); + if ( empty( $email ) ) + die( json_encode( array( 'error' => __( 'Please provide an email address.', 'jetpack' ) ) ) ); - if ( ! is_email( $email ) ) - die( json_encode( array( 'error' => __( 'Please provide a valid email address.', 'jetpack' ) ) ) ); + if ( ! is_email( $email ) ) + die( json_encode( array( 'error' => __( 'Please provide a valid email address.', 'jetpack' ) ) ) ); + } } $comment_data = array( - 'comment_content' => $comment, - 'comment_post_ID' => $_post_id, - 'comment_author' => $display_name, + 'comment_content' => $comment, + 'comment_post_ID' => $_post_id, + 'comment_author' => $display_name, 'comment_author_email' => $email, - 'comment_author_url' => $url, - 'comment_approved' => 0, + 'comment_author_url' => $url, + 'comment_approved' => 0, + 'comment_type' => '', ); if ( ! empty( $user_id ) ) diff --git a/plugins/jetpack/modules/carousel/rtl/jetpack-carousel-rtl.css b/plugins/jetpack/modules/carousel/rtl/jetpack-carousel-rtl.css index 0d010eb5..c34fcfba 100644 --- a/plugins/jetpack/modules/carousel/rtl/jetpack-carousel-rtl.css +++ b/plugins/jetpack/modules/carousel/rtl/jetpack-carousel-rtl.css @@ -1,4 +1,4 @@ -/* This file was automatically generated on Jan 29 2013 22:51:19 */ +/* This file was automatically generated on Apr 17 2013 14:28:54 */ * { line-height:inherit; /* prevent declarations of line-height in the universal selector */ @@ -50,7 +50,7 @@ only screen and (min-device-pixel-ratio: 1.5) { background: #68c9e8; /* Safari */ color: #fff; } - + .jp-carousel-info ::-moz-selection { background: #68c9e8; /* Firefox */ color: #fff; @@ -135,7 +135,7 @@ div.jp-carousel-buttons a { padding: 5px 0 5px 2px; text-decoration: none !important; text-shadow: none !important; - vertical-align: baseline !important; + vertical-align: middle; -webkit-font-smoothing: subpixel-antialiased; } @@ -483,7 +483,7 @@ div#carousel-reblog-box { display: none; } -.jp-carousel-photo-info h1:before, +.jp-carousel-photo-info h1:before, .jp-carousel-photo-info h1:after, .jp-carousel-left-column-wrapper h1:before, .jp-carousel-left-column-wrapper h1:after { @@ -695,7 +695,7 @@ textarea#jp-carousel-comment-form-comment-field { border-radius: 3px; overflow: hidden; -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; + -moz-box-sizing: border-box; box-sizing: border-box; } @@ -793,7 +793,7 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder } #jp-carousel-comment-post-results { - display: none; + display: none; overflow:auto; width:100%; } @@ -1052,14 +1052,14 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder margin: 0 10px !important; } - .jp-carousel-next-button, .jp-carousel-previous-button { - display: none !important; + .jp-carousel-next-button, .jp-carousel-previous-button { + display: none !important; } .jp-carousel-buttons { display: none !important; } - + .jp-carousel-image-meta { float: none !important; width: 100% !important; @@ -1067,31 +1067,31 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder -webkit-box-sizing:border-box; box-sizing: border-box; } - + .jp-carousel-close-hint { font-weight: 800 !important; font-size: 26px !important; position: fixed !important; top: -10px; } - + .jp-carousel-slide img { filter: alpha(opacity=100); opacity: 1; } - + .jp-carousel-wrap { - background-color: #000; + background-color: #000; } - + .jp-carousel-fadeaway { display: none; } - + #jp-carousel-comment-form-container { display: none !important; } - + .jp-carousel-titleanddesc { padding-top: 0 !important; border: none !important; @@ -1099,8 +1099,8 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder .jp-carousel-titleanddesc-title { font-size: 1em !important; } - + .jp-carousel-left-column-wrapper { padding: 0; - } + } } diff --git a/plugins/jetpack/modules/comments.php b/plugins/jetpack/modules/comments.php index d5d4da4d..26bc504f 100644 --- a/plugins/jetpack/modules/comments.php +++ b/plugins/jetpack/modules/comments.php @@ -5,6 +5,7 @@ * Module Description: A new comment system that has integrated social media login options. * First Introduced: 1.4 * Sort Order: 2 + * Requires Connection: Yes */ require dirname( __FILE__ ) . '/comments/comments.php'; diff --git a/plugins/jetpack/modules/comments/admin.php b/plugins/jetpack/modules/comments/admin.php index 342b7f64..946f4733 100644 --- a/plugins/jetpack/modules/comments/admin.php +++ b/plugins/jetpack/modules/comments/admin.php @@ -30,7 +30,7 @@ class Jetpack_Comments_Settings { return $instance; } - + public function __construct( Highlander_Comments_Base $jetpack_comments ) { $this->jetpack_comments = $jetpack_comments; diff --git a/plugins/jetpack/modules/comments/base.php b/plugins/jetpack/modules/comments/base.php index f1b5440e..858b6e3e 100644 --- a/plugins/jetpack/modules/comments/base.php +++ b/plugins/jetpack/modules/comments/base.php @@ -102,22 +102,22 @@ class Highlander_Comments_Base { */ function comments_array( $comments ) { global $wpdb, $post; - + $commenter = $this->get_current_commenter(); if ( !$commenter['user_id'] ) return $comments; - + if ( !$commenter['comment_author'] ) return $comments; - + $in_moderation_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `$wpdb->comments` WHERE `comment_post_ID` = %d AND `user_id` = 0 AND `comment_author` = %s AND `comment_author_email` = %s AND `comment_approved` = '0' ORDER BY `comment_date_gmt` /* Highlander_Comments_Base::comments_array() */", $post->ID, wp_specialchars_decode( $commenter['comment_author'], ENT_QUOTES ), $commenter['comment_author_email'] ) ); - + if ( !$in_moderation_comments ) return $comments; @@ -180,7 +180,7 @@ class Highlander_Comments_Base { /** * Allows a logged out user to leave a comment as a facebook or twitter credentialed user. * Overrides WordPress' core comment_registration option to treat these commenters as "registered" (verified) users. - * + * * @since JetpackComments (1.4) * @return If no */ @@ -256,12 +256,12 @@ class Highlander_Comments_Base { if ( empty( $comment ) || is_wp_error( $comment ) ) { return; } - + $id_source = $this->is_highlander_comment_post(); if ( empty( $id_source ) ) { return; } - + // Set comment author cookies if ( ( 'wordpress' != $id_source ) && is_user_logged_in() ) { $comment_cookie_lifetime = apply_filters( 'comment_cookie_lifetime', 30000000 ); diff --git a/plugins/jetpack/modules/comments/comments.php b/plugins/jetpack/modules/comments/comments.php index 8dae39b7..fa156bb6 100644 --- a/plugins/jetpack/modules/comments/comments.php +++ b/plugins/jetpack/modules/comments/comments.php @@ -141,19 +141,19 @@ class Jetpack_Comments extends Highlander_Comments_Base { // it's not a comment - bail return $avatar; } - + if ( false === strpos( $comment->comment_author_url, '/www.facebook.com/' ) && false === strpos( $comment->comment_author_url, '/twitter.com/' ) ) { // It's neither FB nor Twitter - bail return $avatar; } - + // It's a FB or Twitter avatar $foreign_avatar = get_comment_meta( $comment->comment_ID, 'hc_avatar', true ); if ( empty( $foreign_avatar ) ) { // Can't find the avatar details - bail return $avatar; } - + // Return the FB or Twitter avatar return preg_replace( '#src=([\'"])[^\'"]+\\1#', 'src=\\1' . esc_url( $this->photon_avatar( $foreign_avatar, $size ) ) . '\\1', $avatar ); } @@ -184,14 +184,14 @@ class Jetpack_Comments extends Highlander_Comments_Base { // If users are required to be logged in, and they're not, then we don't need to do anything else if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) { - echo '

    ' . sprintf( apply_filters( 'jetpack_must_log_in_to_comment', __( 'You must log in to post a comment.', 'jetpack' ) ), wp_login_url( get_permalink() . '#respond' ) ) . '

    '; + echo ''; return; } if ( in_array( 'subscriptions', Jetpack::get_active_modules() ) ) { $stb_enabled = get_option( 'stb_enabled', 1 ); $stb_enabled = empty( $stb_enabled ) ? 0 : 1; - + $stc_enabled = get_option( 'stc_enabled', 1 ); $stc_enabled = empty( $stc_enabled ) ? 0 : 1; } else { @@ -209,6 +209,7 @@ class Jetpack_Comments extends Highlander_Comments_Base { 'show_avatars' => ( get_option( 'show_avatars' ) ? '1' : '0' ), 'avatar_default' => get_option( 'avatar_default' ), 'greeting' => get_option( 'highlander_comment_form_prompt', __( 'Leave a Reply', 'jetpack' ) ), + 'greeting_reply' => apply_filters( 'jetpack_comment_form_prompt_reply', __( 'Leave a Reply to %s' , 'jetpack' ) ), 'color_scheme' => get_option( 'jetpack_comment_form_color_scheme', $this->default_color_scheme ), 'lang' => get_bloginfo( 'language' ), 'jetpack_version' => JETPACK__VERSION, @@ -246,9 +247,11 @@ class Jetpack_Comments extends Highlander_Comments_Base { // The actual iframe (loads comment form from Jetpack server) ?> -
    - - +
    +

    +
    + +
    diff --git a/plugins/jetpack/modules/contact-form.php b/plugins/jetpack/modules/contact-form.php index d53fc4c9..21f409ff 100644 --- a/plugins/jetpack/modules/contact-form.php +++ b/plugins/jetpack/modules/contact-form.php @@ -1,9 +1,10 @@ - #menu-posts-feedback .wp-menu-image img { display: none; } - #adminmenu .menu-icon-feedback:hover div.wp-menu-image, #adminmenu .menu-icon-feedback.wp-has-current-submenu div.wp-menu-image, #adminmenu .menu-icon-feedback.current div.wp-menu-image { background: url("' .GRUNION_PLUGIN_URL . 'images/grunion-menu-hover.png") no-repeat 7px 7px !important; } - #adminmenu .menu-icon-feedback div.wp-menu-image, #adminmenu .menu-icon-feedback div.wp-menu-image, #adminmenu .menu-icon-feedback div.wp-menu-image { background: url("' . GRUNION_PLUGIN_URL . 'images/grunion-menu.png") no-repeat 7px 7px !important; } - .grunion-menu-button { background: url("' . GRUNION_PLUGIN_URL . 'images/grunion-form.png") no-repeat; width: 13px; height: 13px; display: inline-block; vertical-align: middle; ) } - @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) { - #adminmenu .menu-icon-feedback:hover div.wp-menu-image, #adminmenu .menu-icon-feedback.wp-has-current-submenu div.wp-menu-image, #adminmenu .menu-icon-feedback.current div.wp-menu-image { background: url("' .GRUNION_PLUGIN_URL . 'images/grunion-menu-hover-2x.png") no-repeat 7px 7px !important; background-size: 15px 16px !important; } - #adminmenu .menu-icon-feedback div.wp-menu-image, #adminmenu .menu-icon-feedback div.wp-menu-image, #adminmenu .menu-icon-feedback div.wp-menu-image { background: url("' . GRUNION_PLUGIN_URL . 'images/grunion-menu-2x.png") no-repeat 7px 7px !important; background-size: 15px 16px !important; } - .grunion-menu-button { background-image: url("' . GRUNION_PLUGIN_URL . 'images/grunion-form-2x.png"); background-size: 13px 12px !important; vertical-align: bottom; } - } - '; +function grunion_menu_alter() { + wp_enqueue_style( 'grunion-menu-alter', plugins_url( 'css/menu-alter.css', __FILE__ ) ); } -add_action('admin_head', 'menu_alter'); +add_action( 'admin_enqueue_scripts', 'grunion_menu_alter' ); /** * Add a contact form button to the post composition screen @@ -27,8 +16,13 @@ function grunion_media_button( ) { $title = esc_attr( __( 'Add a custom form', 'jetpack' ) ); $plugin_url = esc_url( GRUNION_PLUGIN_URL ); $site_url = esc_url( admin_url( "/admin-ajax.php?post_id={$iframe_post_id}&action=grunion_form_builder&TB_iframe=true&width=768" ) ); + ?> + + + + - echo '
    '; + id ) + if ( ! in_array( $current_screen->id, array( 'edit-feedback', 'jetpack_page_omnisearch', 'dashboard_page_omnisearch' ) ) ) return; wp_enqueue_script( 'wp-lists' ); ?> - - - var safecssAceSrcPath = ; - - ( function ( $ ) { - var safe, win; - - safecssResize = function () { - safe.height( win.height() - safe.offset().top - 250 ); - }; - - safecssInit = function() { - safe = $('#safecss'); - win = $(window); - - postboxes.add_postbox_toggles('editcss'); - safecssResize(); - var button = document.getElementById( 'preview' ); - button.onclick = function ( event ) { - - document.forms["safecssform"].target = "csspreview"; - document.forms["safecssform"].action.value = 'preview'; - document.forms["safecssform"].submit(); - document.forms["safecssform"].target = ""; - document.forms["safecssform"].action.value = 'save'; - - event = event || window.event; - - if ( event.preventDefault ) - event.preventDefault(); - - return false; - } - }; - - window.onresize = safecssResize; - addLoadEvent( safecssInit ); - } )( jQuery ); - - jQuery( function ( $ ) { - $( '.edit-preprocessor' ).bind( 'click', function ( e ) { - e.preventDefault(); - - $( '#preprocessor-select' ).slideDown(); - $( this ).hide(); - } ); - - $( '.cancel-preprocessor' ).bind( 'click', function ( e ) { - e.preventDefault(); - - $( '#preprocessor-select' ).slideUp( function () { - $( '.edit-preprocessor' ).show(); - $( '#preprocessor_choices' ).val( $( '#custom_css_preprocessor' ).val() ); - } ); - } ); - - $( '.save-preprocessor' ).bind( 'click', function ( e ) { - e.preventDefault(); - - $( '#preprocessor-select' ).slideUp(); - $( '#preprocessor-display' ).text( $( '#preprocessor_choices option:selected' ).text() ); - $( '#custom_css_preprocessor' ).val( $( '#preprocessor_choices' ).val() ); - $( '.edit-preprocessor' ).show(); - } ); - } ); - /*]]>*/ - -
    @@ -833,6 +725,103 @@ class Jetpack_Custom_CSS { +
    + + + +
    + +

    + More info.)', 'jetpack' ), + '', + apply_filters( 'safecss_limit_width_link', 'http://jetpack.me/support/custom-css/#limited-width' ) + ); + + ?> +

    + Name; + else + $current_theme = get_current_theme(); + + ?> +

    + + + +
    + +
    +
    @@ -897,34 +886,6 @@ class Jetpack_Custom_CSS {
    -
    @@ -1012,9 +973,15 @@ class Jetpack_Custom_CSS { update_post_meta( $safecss_post_id, 'custom_css_add', 'yes' ); update_post_meta( $safecss_post_id, 'content_width', false ); update_post_meta( $safecss_post_id, 'custom_css_preprocessor', '' ); + + delete_option( 'safecss_add' ); + delete_option( 'safecss_content_width' ); + update_metadata( 'post', $safecss_revision['ID'], 'custom_css_add', 'yes' ); update_metadata( 'post', $safecss_revision['ID'], 'content_width', false ); update_metadata( 'post', $safecss_revision['ID'], 'custom_css_preprocessor', '' ); + + delete_option( 'safecss_preview_add' ); } static function is_customizer_preview() { @@ -1072,9 +1039,15 @@ class Jetpack_Custom_CSS { update_metadata( 'post', $safecss_revision['ID'], 'content_width', $content_width ); update_metadata( 'post', $safecss_revision['ID'], 'custom_css_add', $custom_css_add ); update_metadata( 'post', $safecss_revision['ID'], 'custom_css_preprocessor', $preprocessor ); + + delete_option( 'safecss_add' ); + delete_option( 'safecss_content_width' ); + update_post_meta( $_post->ID, 'content_width', $content_width ); update_post_meta( $_post->ID, 'custom_css_add', $custom_css_add ); update_post_meta( $_post->ID, 'custom_css_preprocessor', $preprocessor ); + + delete_option( 'safecss_preview_add' ); } /** @@ -1194,6 +1167,40 @@ class Jetpack_Custom_CSS { return esc_url_raw( $post_link ); } + + /** + * When on the edit screen, make sure the custom content width + * setting is applied to the large image size. + */ + static function editor_max_image_size( $dims, $size = 'medium', $context = null ) { + list( $width, $height ) = $dims; + + if ( 'large' == $size && 'edit' == $context ) + $width = Jetpack::get_content_width(); + + return array( $width, $height ); + } + + /** + * Override the content_width with a custom value if one is set. + */ + static function jetpack_content_width( $content_width ) { + $custom_content_width = 0; + + if ( Jetpack_Custom_CSS::is_preview() ) { + $safecss_post = Jetpack_Custom_CSS::get_current_revision(); + $custom_content_width = intval( get_post_meta( $safecss_post['ID'], 'content_width', true ) ); + } else if ( ! Jetpack_Custom_CSS::is_freetrial() ) { + $custom_css_post_id = Jetpack_Custom_CSS::post_id(); + if ( $custom_css_post_id ) + $custom_content_width = intval( get_post_meta( $custom_css_post_id, 'content_width', true ) ); + } + + if ( $custom_content_width > 0 ) + $content_width = $custom_content_width; + + return $content_width; + } } class Jetpack_Safe_CSS { diff --git a/plugins/jetpack/modules/custom-css/custom-css/js/ace/ace.js b/plugins/jetpack/modules/custom-css/custom-css/js/ace/ace.js index 520b8fca..375915bf 100644 --- a/plugins/jetpack/modules/custom-css/custom-css/js/ace/ace.js +++ b/plugins/jetpack/modules/custom-css/custom-css/js/ace/ace.js @@ -8,4 +8,3 @@ ace[key] = a[key]; }); })(); - \ No newline at end of file diff --git a/plugins/jetpack/modules/custom-css/custom-css/js/ace/worker-css.js b/plugins/jetpack/modules/custom-css/custom-css/js/ace/worker-css.js index 59ceeaf5..54c2a3e0 100644 --- a/plugins/jetpack/modules/custom-css/custom-css/js/ace/worker-css.js +++ b/plugins/jetpack/modules/custom-css/custom-css/js/ace/worker-css.js @@ -1 +1,7886 @@ -"no use strict";function initBaseUrls(e){require.tlns=e}function initSender(){var e=require(null,"ace/lib/event_emitter").EventEmitter,t=require(null,"ace/lib/oop"),n=function(){};return function(){t.implement(this,e),this.callback=function(e,t){postMessage({type:"call",id:t,data:e})},this.emit=function(e,t){postMessage({type:"event",name:e,data:t})}}.call(n.prototype),new n}if(typeof window!="undefined"&&window.document)throw"atempt to load ace worker into main window instead of webWorker";var console={log:function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})},error:function(){var e=Array.prototype.slice.call(arguments,0);postMessage({type:"log",data:e})}},window={console:console},normalizeModule=function(e,t){if(t.indexOf("!")!==-1){var n=t.split("!");return normalizeModule(e,n[0])+"!"+normalizeModule(e,n[1])}if(t.charAt(0)=="."){var r=e.split("/").slice(0,-1).join("/"),t=r+"/"+t;while(t.indexOf(".")!==-1&&i!=t)var i=t,t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},require=function(e,t){if(!t.charAt)throw new Error("worker.js require() accepts only (parentId, id) as arguments");var t=normalizeModule(e,t),n=require.modules[t];if(n)return n.initialized||(n.initialized=!0,n.exports=n.factory().exports),n.exports;var r=t.split("/");r[0]=require.tlns[r[0]]||r[0];var i=r.join("/")+".js";return require.id=t,importScripts(i),require(e,t)};require.modules={},require.tlns={};var define=function(e,t,n){arguments.length==2?(n=t,typeof e!="string"&&(t=e,e=require.id)):arguments.length==1&&(n=e,e=require.id);if(e.indexOf("text!")===0)return;var r=function(t,n){return require(e,t,n)};require.modules[e]={factory:function(){var e={exports:{}},t=n(r,e.exports,e);return t&&(e.exports=t),e}}},main,sender;onmessage=function(e){var t=e.data;if(t.command){if(!main[t.command])throw new Error("Unknown command:"+t.command);main[t.command].apply(main,t.args)}else if(t.init){initBaseUrls(t.tlns),require(null,"ace/lib/fixoldbrowsers"),sender=initSender();var n=require(null,t.module)[t.classname];main=new n(sender)}else t.event&&sender&&sender._emit(t.event,t.data)},define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(e,t,n){e("./regexp"),e("./es5-shim")}),define("ace/lib/regexp",["require","exports","module"],function(e,t,n){function o(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function u(e,t,n){if(Array.prototype.indexOf)return e.indexOf(t,n);for(var r=n||0;r1&&u(t,"")>-1&&(a=RegExp(this.source,r.replace.call(o(this),"g","")),r.replace.call(e.slice(t.index),a,function(){for(var e=1;et.index&&this.lastIndex--}return t},s||(RegExp.prototype.test=function(e){var t=r.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t})}),define("ace/lib/es5-shim",["require","exports","module"],function(e,t,n){function m(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(t){}}Function.prototype.bind||(Function.prototype.bind=function(t){var n=this;if(typeof n!="function")throw new TypeError;var r=o.call(arguments,1),i=function(){if(this instanceof i){var e=function(){};e.prototype=n.prototype;var s=new e,u=n.apply(s,r.concat(o.call(arguments)));return u!==null&&Object(u)===u?u:s}return n.apply(t,r.concat(o.call(arguments)))};return i});var r=Function.prototype.call,i=Array.prototype,s=Object.prototype,o=i.slice,u=r.bind(s.toString),a=r.bind(s.hasOwnProperty),f,l,c,h,p;if(p=a(s,"__defineGetter__"))f=r.bind(s.__defineGetter__),l=r.bind(s.__defineSetter__),c=r.bind(s.__lookupGetter__),h=r.bind(s.__lookupSetter__);Array.isArray||(Array.isArray=function(t){return u(t)=="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function(t){var n=D(this),r=arguments[1],i=0,s=n.length>>>0;if(u(t)!="[object Function]")throw new TypeError;while(i>>0,i=Array(r),s=arguments[1];if(u(t)!="[object Function]")throw new TypeError;for(var o=0;o>>0,i=[],s=arguments[1];if(u(t)!="[object Function]")throw new TypeError;for(var o=0;o>>0,i=arguments[1];if(u(t)!="[object Function]")throw new TypeError;for(var s=0;s>>0,i=arguments[1];if(u(t)!="[object Function]")throw new TypeError;for(var s=0;s>>0;if(u(t)!="[object Function]")throw new TypeError;if(!r&&arguments.length==1)throw new TypeError;var i=0,s;if(arguments.length>=2)s=arguments[1];else do{if(i in n){s=n[i++];break}if(++i>=r)throw new TypeError}while(!0);for(;i>>0;if(u(t)!="[object Function]")throw new TypeError;if(!r&&arguments.length==1)throw new TypeError;var i,s=r-1;if(arguments.length>=2)i=arguments[1];else do{if(s in n){i=n[s--];break}if(--s<0)throw new TypeError}while(!0);do s in this&&(i=t.call(void 0,i,n[s],s,n));while(s--);return i}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t){var n=D(this),r=n.length>>>0;if(!r)return-1;var i=0;arguments.length>1&&(i=M(arguments[1])),i=i>=0?i:Math.max(0,r+i);for(;i>>0;if(!r)return-1;var i=r-1;arguments.length>1&&(i=Math.min(i,M(arguments[1]))),i=i>=0?i:r-Math.abs(i);for(;i>=0;i--)if(i in n&&t===n[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(t){return t.__proto__||(t.constructor?t.constructor.prototype:s)});if(!Object.getOwnPropertyDescriptor){var d="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(t,n){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(d+t);if(!a(t,n))return;var r,i,o;r={enumerable:!0,configurable:!0};if(p){var u=t.__proto__;t.__proto__=s;var i=c(t,n),o=h(t,n);t.__proto__=u;if(i||o)return i&&(r.get=i),o&&(r.set=o),r}return r.value=t[n],r}}Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(t){return Object.keys(t)});if(!Object.create){var v;Object.prototype.__proto__===null?v=function(){return{__proto__:null}}:v=function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(t,n){var r;if(t===null)r=v();else{if(typeof t!="object")throw new TypeError("typeof prototype["+typeof t+"] != 'object'");var i=function(){};i.prototype=t,r=new i,r.__proto__=t}return n!==void 0&&Object.defineProperties(r,n),r}}if(Object.defineProperty){var g=m({}),y=typeof document=="undefined"||m(document.createElement("div"));if(!g||!y)var b=Object.defineProperty}if(!Object.defineProperty||b){var w="Property description must be an object: ",E="Object.defineProperty called on non-object: ",S="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(t,n,r){if(typeof t!="object"&&typeof t!="function"||t===null)throw new TypeError(E+t);if(typeof r!="object"&&typeof r!="function"||r===null)throw new TypeError(w+r);if(b)try{return b.call(Object,t,n,r)}catch(i){}if(a(r,"value"))if(p&&(c(t,n)||h(t,n))){var o=t.__proto__;t.__proto__=s,delete t[n],t[n]=r.value,t.__proto__=o}else t[n]=r.value;else{if(!p)throw new TypeError(S);a(r,"get")&&f(t,n,r.get),a(r,"set")&&l(t,n,r.set)}return t}}Object.defineProperties||(Object.defineProperties=function(t,n){for(var r in n)a(n,r)&&Object.defineProperty(t,r,n[r]);return t}),Object.seal||(Object.seal=function(t){return t}),Object.freeze||(Object.freeze=function(t){return t});try{Object.freeze(function(){})}catch(x){Object.freeze=function(t){return function(n){return typeof n=="function"?n:t(n)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(t){return t}),Object.isSealed||(Object.isSealed=function(t){return!1}),Object.isFrozen||(Object.isFrozen=function(t){return!1}),Object.isExtensible||(Object.isExtensible=function(t){if(Object(t)===t)throw new TypeError;var n="";while(a(t,n))n+="?";t[n]=!0;var r=a(t,n);return delete t[n],r});if(!Object.keys){var T=!0,N=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],C=N.length;for(var k in{toString:null})T=!1;Object.keys=function P(e){if(typeof e!="object"&&typeof e!="function"||e===null)throw new TypeError("Object.keys called on a non-object");var P=[];for(var t in e)a(e,t)&&P.push(t);if(T)for(var n=0,r=C;n9999?"+":"")+("00000"+Math.abs(i)).slice(0<=i&&i<=9999?-4:-6),n=t.length;while(n--)r=t[n],r<10&&(t[n]="0"+r);return i+"-"+t.slice(0,2).join("-")+"T"+t.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"};Date.now||(Date.now=function(){return(new Date).getTime()}),Date.prototype.toJSON||(Date.prototype.toJSON=function(t){if(typeof this.toISOString!="function")throw new TypeError;return this.toISOString()}),Date.parse("+275760-09-13T00:00:00.000Z")!==864e13&&(Date=function(e){var t=function i(t,n,r,s,o,u,a){var f=arguments.length;if(this instanceof e){var l=f==1&&String(t)===t?new e(i.parse(t)):f>=7?new e(t,n,r,s,o,u,a):f>=6?new e(t,n,r,s,o,u):f>=5?new e(t,n,r,s,o):f>=4?new e(t,n,r,s):f>=3?new e(t,n,r):f>=2?new e(t,n):f>=1?new e(t):new e;return l.constructor=i,l}return e.apply(this,arguments)},n=new RegExp("^(\\d{4}|[+-]\\d{6})(?:-(\\d{2})(?:-(\\d{2})(?:T(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d{3}))?)?(?:Z|(?:([-+])(\\d{2}):(\\d{2})))?)?)?)?$");for(var r in e)t[r]=e[r];return t.now=e.now,t.UTC=e.UTC,t.prototype=e.prototype,t.prototype.constructor=t,t.parse=function(r){var i=n.exec(r);if(i){i.shift();for(var s=1;s<7;s++)i[s]=+(i[s]||(s<3?1:0)),s==1&&i[s]--;var o=+i.pop(),u=+i.pop(),a=i.pop(),f=0;if(a){if(u>23||o>59)return NaN;f=(u*60+o)*6e4*(a=="+"?-1:1)}var l=+i[0];return 0<=l&&l<=99?(i[0]=l+400,e.UTC.apply(this,i)+f-126227808e5):e.UTC.apply(this,i)+f}return e.parse.apply(this,arguments)},t}(Date));var L=" \n \f\r   ᠎              \u2028\u2029";if(!String.prototype.trim||L.trim()){L="["+L+"]";var A=new RegExp("^"+L+L+"*"),O=new RegExp(L+L+"*$");String.prototype.trim=function(){return String(this).replace(A,"").replace(O,"")}}var M=function(e){return e=+e,e!==e?e=0:e!==0&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e},_="a"[0]!="a",D=function(e){if(e==null)throw new TypeError;return _&&typeof e=="string"&&e?e.split(""):Object(e)}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,n){var r={};r._emit=r._dispatchEvent=function(e,t){this._eventRegistry=this._eventRegistry||{},this._defaultHandlers=this._defaultHandlers||{};var n=this._eventRegistry[e]||[],r=this._defaultHandlers[e];if(!n.length&&!r)return;if(typeof t!="object"||!t)t={};t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=function(){this.propagationStopped=!0}),t.preventDefault||(t.preventDefault=function(){this.defaultPrevented=!0});for(var i=0;i=t&&(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length),e},this.insert=function(e,t){if(!t||t.length===0)return e;e=this.$clipPosition(e),this.getLength()<=1&&this.$detectNewLine(t);var n=this.$split(t),r=n.splice(0,1)[0],i=n.length==0?null:n.splice(n.length-1,1)[0];return e=this.insertInLine(e,r),i!==null&&(e=this.insertNewLine(e),e=this.insertLines(e.row,n),e=this.insertInLine(e,i||"")),e},this.insertLines=function(e,t){if(t.length==0)return{row:e,column:0};if(t.length>65535){var n=this.insertLines(e,t.slice(65535));t=t.slice(0,65535)}var r=[e,0];r.push.apply(r,t),this.$lines.splice.apply(this.$lines,r);var i=new s(e,0,e+t.length,0),o={action:"insertLines",range:i,lines:t};return this._emit("change",{data:o}),n||i.end},this.insertNewLine=function(e){e=this.$clipPosition(e);var t=this.$lines[e.row]||"";this.$lines[e.row]=t.substring(0,e.column),this.$lines.splice(e.row+1,0,t.substring(e.column,t.length));var n={row:e.row+1,column:0},r={action:"insertText",range:s.fromPoints(e,n),text:this.getNewLineCharacter()};return this._emit("change",{data:r}),n},this.insertInLine=function(e,t){if(t.length==0)return e;var n=this.$lines[e.row]||"";this.$lines[e.row]=n.substring(0,e.column)+t+n.substring(e.column);var r={row:e.row,column:e.column+t.length},i={action:"insertText",range:s.fromPoints(e,r),text:t};return this._emit("change",{data:i}),r},this.remove=function(e){e.start=this.$clipPosition(e.start),e.end=this.$clipPosition(e.end);if(e.isEmpty())return e.start;var t=e.start.row,n=e.end.row;if(e.isMultiLine()){var r=e.start.column==0?t:t+1,i=n-1;e.end.column>0&&this.removeInLine(n,0,e.end.column),i>=r&&this.removeLines(r,i),r!=t&&(this.removeInLine(t,e.start.column,this.getLine(t).length),this.removeNewLine(e.start.row))}else this.removeInLine(t,e.start.column,e.end.column);return e.start},this.removeInLine=function(e,t,n){if(t==n)return;var r=new s(e,t,e,n),i=this.getLine(e),o=i.substring(t,n),u=i.substring(0,t)+i.substring(n,i.length);this.$lines.splice(e,1,u);var a={action:"removeText",range:r,text:o};return this._emit("change",{data:a}),r.start},this.removeLines=function(e,t){var n=new s(e,0,t+1,0),r=this.$lines.splice(e,t-e+1),i={action:"removeLines",range:n,nl:this.getNewLineCharacter(),lines:r};return this._emit("change",{data:i}),r},this.removeNewLine=function(e){var t=this.getLine(e),n=this.getLine(e+1),r=new s(e,t.length,e+1,0),i=t+n;this.$lines.splice(e,2,i);var o={action:"removeText",range:r,text:this.getNewLineCharacter()};this._emit("change",{data:o})},this.replace=function(e,t){if(t.length==0&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);if(t)var n=this.insert(e.start,t);else n=e.start;return n},this.applyDeltas=function(e){for(var t=0;t=0;t--){var n=e[t],r=s.fromPoints(n.range.start,n.range.end);n.action=="insertLines"?this.removeLines(r.start.row,r.end.row-1):n.action=="insertText"?this.remove(r):n.action=="removeLines"?this.insertLines(r.start.row,n.lines):n.action=="removeText"&&this.insert(r.start,n.text)}}}).call(u.prototype),t.Document=u}),define("ace/range",["require","exports","module"],function(e,t,n){var r=function(e,t,n,r){this.start={row:e,column:t},this.end={row:n,column:r}};(function(){this.isEqual=function(e){return this.start.row==e.start.row&&this.end.row==e.end.row&&this.start.column==e.start.column&&this.end.column==e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return this.compare(e,t)==0},this.compareRange=function(e){var t,n=e.end,r=e.start;return t=this.compare(n.row,n.column),t==1?(t=this.compare(r.row,r.column),t==1?2:t==0?1:0):t==-1?-2:(t=this.compare(r.row,r.column),t==-1?-1:t==1?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return this.comparePoint(e.start)==0&&this.comparePoint(e.end)==0},this.intersects=function(e){var t=this.compareRange(e);return t==-1||t==0||t==1},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){typeof e=="object"?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){typeof e=="object"?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)||this.isStart(e,t)?!1:!0:!1},this.insideStart=function(e,t){return this.compare(e,t)==0?this.isEnd(e,t)?!1:!0:!1},this.insideEnd=function(e,t){return this.compare(e,t)==0?this.isStart(e,t)?!1:!0:!1},this.compare=function(e,t){return!this.isMultiLine()&&e===this.start.row?tthis.end.column?1:0:ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var n={row:t+1,column:0};if(this.start.row>t)var i={row:t+1,column:0};if(this.start.rowthis.row)return;if(n.start.row==this.row&&n.start.column>this.column)return;var r=this.row,i=this.column;t.action==="insertText"?n.start.row===r&&n.start.column<=i?n.start.row===n.end.row?i+=n.end.column-n.start.column:(i-=n.start.column,r+=n.end.row-n.start.row):n.start.row!==n.end.row&&n.start.row=i?i=n.start.column:i=Math.max(0,i-(n.end.column-n.start.column)):n.start.row!==n.end.row&&n.start.row=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n}}).call(s.prototype)}),define("ace/mode/css/csslint",["require","exports","module"],function(require,exports,module){function Reporter(e,t){this.messages=[],this.stats=[],this.lines=e,this.ruleset=t}var parserlib={};(function(){function e(){this._listeners={}}function t(e){this._input=e.replace(/\n\r?/g,"\n"),this._line=1,this._col=1,this._cursor=0}function n(e,t,n){this.col=n,this.line=t,this.message=e}function r(e,t,n,r){this.col=n,this.line=t,this.text=e,this.type=r}function i(e,n){this._reader=e?new t(e.toString()):null,this._token=null,this._tokenData=n,this._lt=[],this._ltIndex=0,this._ltIndexCache=[]}e.prototype={constructor:e,addListener:function(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)},fire:function(e){typeof e=="string"&&(e={type:e}),typeof e.target!="undefined"&&(e.target=this);if(typeof e.type=="undefined")throw new Error("Event object missing 'type' property.");if(this._listeners[e.type]){var t=this._listeners[e.type].concat();for(var n=0,r=t.length;n=0&&this._ltIndex-1&&!t[u.type].hide&&(u.channel=t[u.type].channel,this._token=u,this._lt.push(u),this._ltIndexCache.push(this._lt.length-this._ltIndex+i),this._lt.length>5&&this._lt.shift(),this._ltIndexCache.length>5&&this._ltIndexCache.shift(),this._ltIndex=this._lt.length),a=t[u.type],a&&(a.hide||a.channel!==undefined&&e!==a.channel)?this.get(e):u.type},LA:function(e){var t=e,n;if(e>0){if(e>5)throw new Error("Too much lookahead.");while(t)n=this.get(),t--;while(tthis._tokenData.length?"UNKNOWN_TOKEN":this._tokenData[e].name},tokenType:function(e){return this._tokenData[e]||-1},unget:function(){if(!this._ltIndexCache.length)throw new Error("Too much lookahead.");this._ltIndex-=this._ltIndexCache.pop(),this._token=this._lt[this._ltIndex-1]}},parserlib.util={StringReader:t,SyntaxError:n,SyntaxUnit:r,EventTarget:e,TokenStreamBase:i}})(),function(){function Combinator(e,t,n){SyntaxUnit.call(this,e,t,n,Parser.COMBINATOR_TYPE),this.type="unknown",/^\s+$/.test(e)?this.type="descendant":e==">"?this.type="child":e=="+"?this.type="adjacent-sibling":e=="~"&&(this.type="sibling")}function MediaFeature(e,t){SyntaxUnit.call(this,"("+e+(t!==null?":"+t:"")+")",e.startLine,e.startCol,Parser.MEDIA_FEATURE_TYPE),this.name=e,this.value=t}function MediaQuery(e,t,n,r,i){SyntaxUnit.call(this,(e?e+" ":"")+(t?t+" ":"")+n.join(" and "),r,i,Parser.MEDIA_QUERY_TYPE),this.modifier=e,this.mediaType=t,this.features=n}function Parser(e){EventTarget.call(this),this.options=e||{},this._tokenStream=null}function PropertyName(e,t,n,r){SyntaxUnit.call(this,e,n,r,Parser.PROPERTY_NAME_TYPE),this.hack=t}function PropertyValue(e,t,n){SyntaxUnit.call(this,e.join(" "),t,n,Parser.PROPERTY_VALUE_TYPE),this.parts=e}function PropertyValueIterator(e){this._i=0,this._parts=e.parts,this._marks=[],this.value=e}function PropertyValuePart(text,line,col){SyntaxUnit.call(this,text,line,col,Parser.PROPERTY_VALUE_PART_TYPE),this.type="unknown";var temp;if(/^([+\-]?[\d\.]+)([a-z]+)$/i.test(text)){this.type="dimension",this.value=+RegExp.$1,this.units=RegExp.$2;switch(this.units.toLowerCase()){case"em":case"rem":case"ex":case"px":case"cm":case"mm":case"in":case"pt":case"pc":case"ch":this.type="length";break;case"deg":case"rad":case"grad":this.type="angle";break;case"ms":case"s":this.type="time";break;case"hz":case"khz":this.type="frequency";break;case"dpi":case"dpcm":this.type="resolution"}}else/^([+\-]?[\d\.]+)%$/i.test(text)?(this.type="percentage",this.value=+RegExp.$1):/^([+\-]?[\d\.]+)%$/i.test(text)?(this.type="percentage",this.value=+RegExp.$1):/^([+\-]?\d+)$/i.test(text)?(this.type="integer",this.value=+RegExp.$1):/^([+\-]?[\d\.]+)$/i.test(text)?(this.type="number",this.value=+RegExp.$1):/^#([a-f0-9]{3,6})/i.test(text)?(this.type="color",temp=RegExp.$1,temp.length==3?(this.red=parseInt(temp.charAt(0)+temp.charAt(0),16),this.green=parseInt(temp.charAt(1)+temp.charAt(1),16),this.blue=parseInt(temp.charAt(2)+temp.charAt(2),16)):(this.red=parseInt(temp.substring(0,2),16),this.green=parseInt(temp.substring(2,4),16),this.blue=parseInt(temp.substring(4,6),16))):/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1,this.green=+RegExp.$2,this.blue=+RegExp.$3):/^rgb\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1*255/100,this.green=+RegExp.$2*255/100,this.blue=+RegExp.$3*255/100):/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1,this.green=+RegExp.$2,this.blue=+RegExp.$3,this.alpha=+RegExp.$4):/^rgba\(\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.red=+RegExp.$1*255/100,this.green=+RegExp.$2*255/100,this.blue=+RegExp.$3*255/100,this.alpha=+RegExp.$4):/^hsl\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*\)/i.test(text)?(this.type="color",this.hue=+RegExp.$1,this.saturation=+RegExp.$2/100,this.lightness=+RegExp.$3/100):/^hsla\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*,\s*([\d\.]+)\s*\)/i.test(text)?(this.type="color",this.hue=+RegExp.$1,this.saturation=+RegExp.$2/100,this.lightness=+RegExp.$3/100,this.alpha=+RegExp.$4):/^url\(["']?([^\)"']+)["']?\)/i.test(text)?(this.type="uri",this.uri=RegExp.$1):/^([^\(]+)\(/i.test(text)?(this.type="function",this.name=RegExp.$1,this.value=text):/^["'][^"']*["']/.test(text)?(this.type="string",this.value=eval(text)):Colors[text.toLowerCase()]?(this.type="color",temp=Colors[text.toLowerCase()].substring(1),this.red=parseInt(temp.substring(0,2),16),this.green=parseInt(temp.substring(2,4),16),this.blue=parseInt(temp.substring(4,6),16)):/^[\,\/]$/.test(text)?(this.type="operator",this.value=text):/^[a-z\-\u0080-\uFFFF][a-z0-9\-\u0080-\uFFFF]*$/i.test(text)&&(this.type="identifier",this.value=text)}function Selector(e,t,n){SyntaxUnit.call(this,e.join(" "),t,n,Parser.SELECTOR_TYPE),this.parts=e,this.specificity=Specificity.calculate(this)}function SelectorPart(e,t,n,r,i){SyntaxUnit.call(this,n,r,i,Parser.SELECTOR_PART_TYPE),this.elementName=e,this.modifiers=t}function SelectorSubPart(e,t,n,r){SyntaxUnit.call(this,e,n,r,Parser.SELECTOR_SUB_PART_TYPE),this.type=t,this.args=[]}function Specificity(e,t,n,r){this.a=e,this.b=t,this.c=n,this.d=r}function isHexDigit(e){return e!==null&&h.test(e)}function isDigit(e){return e!==null&&/\d/.test(e)}function isWhitespace(e){return e!==null&&/\s/.test(e)}function isNewLine(e){return e!==null&&nl.test(e)}function isNameStart(e){return e!==null&&/[a-z_\u0080-\uFFFF\\]/i.test(e)}function isNameChar(e){return e!==null&&(isNameStart(e)||/[0-9\-\\]/.test(e))}function isIdentStart(e){return e!==null&&(isNameStart(e)||/\-\\/.test(e))}function mix(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function TokenStream(e){TokenStreamBase.call(this,e,Tokens)}function ValidationError(e,t,n){this.col=n,this.line=t,this.message=e}var EventTarget=parserlib.util.EventTarget,TokenStreamBase=parserlib.util.TokenStreamBase,StringReader=parserlib.util.StringReader,SyntaxError=parserlib.util.SyntaxError,SyntaxUnit=parserlib.util.SyntaxUnit,Colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};Combinator.prototype=new SyntaxUnit,Combinator.prototype.constructor=Combinator,MediaFeature.prototype=new SyntaxUnit,MediaFeature.prototype.constructor=MediaFeature,MediaQuery.prototype=new SyntaxUnit,MediaQuery.prototype.constructor=MediaQuery,Parser.DEFAULT_TYPE=0,Parser.COMBINATOR_TYPE=1,Parser.MEDIA_FEATURE_TYPE=2,Parser.MEDIA_QUERY_TYPE=3,Parser.PROPERTY_NAME_TYPE=4,Parser.PROPERTY_VALUE_TYPE=5,Parser.PROPERTY_VALUE_PART_TYPE=6,Parser.SELECTOR_TYPE=7,Parser.SELECTOR_PART_TYPE=8,Parser.SELECTOR_SUB_PART_TYPE=9,Parser.prototype=function(){var e=new EventTarget,t,n={constructor:Parser,DEFAULT_TYPE:0,COMBINATOR_TYPE:1,MEDIA_FEATURE_TYPE:2,MEDIA_QUERY_TYPE:3,PROPERTY_NAME_TYPE:4,PROPERTY_VALUE_TYPE:5,PROPERTY_VALUE_PART_TYPE:6,SELECTOR_TYPE:7,SELECTOR_PART_TYPE:8,SELECTOR_SUB_PART_TYPE:9,_stylesheet:function(){var e=this._tokenStream,t=null,n,r,i;this.fire("startstylesheet"),this._charset(),this._skipCruft();while(e.peek()==Tokens.IMPORT_SYM)this._import(),this._skipCruft();while(e.peek()==Tokens.NAMESPACE_SYM)this._namespace(),this._skipCruft();i=e.peek();while(i>Tokens.EOF){try{switch(i){case Tokens.MEDIA_SYM:this._media(),this._skipCruft();break;case Tokens.PAGE_SYM:this._page(),this._skipCruft();break;case Tokens.FONT_FACE_SYM:this._font_face(),this._skipCruft();break;case Tokens.KEYFRAMES_SYM:this._keyframes(),this._skipCruft();break;case Tokens.UNKNOWN_SYM:e.get();if(!!this.options.strict)throw new SyntaxError("Unknown @ rule.",e.LT(0).startLine,e.LT(0).startCol);this.fire({type:"error",error:null,message:"Unknown @ rule: "+e.LT(0).value+".",line:e.LT(0).startLine,col:e.LT(0).startCol}),n=0;while(e.advance([Tokens.LBRACE,Tokens.RBRACE])==Tokens.LBRACE)n++;while(n)e.advance([Tokens.RBRACE]),n--;break;case Tokens.S:this._readWhitespace();break;default:if(!this._ruleset())switch(i){case Tokens.CHARSET_SYM:throw r=e.LT(1),this._charset(!1),new SyntaxError("@charset not allowed here.",r.startLine,r.startCol);case Tokens.IMPORT_SYM:throw r=e.LT(1),this._import(!1),new SyntaxError("@import not allowed here.",r.startLine,r.startCol);case Tokens.NAMESPACE_SYM:throw r=e.LT(1),this._namespace(!1),new SyntaxError("@namespace not allowed here.",r.startLine,r.startCol);default:e.get(),this._unexpectedToken(e.token())}}}catch(s){if(!(s instanceof SyntaxError&&!this.options.strict))throw s;this.fire({type:"error",error:s,message:s.message,line:s.line,col:s.col})}i=e.peek()}i!=Tokens.EOF&&this._unexpectedToken(e.token()),this.fire("endstylesheet")},_charset:function(e){var t=this._tokenStream,n,r,i,s;t.match(Tokens.CHARSET_SYM)&&(i=t.token().startLine,s=t.token().startCol,this._readWhitespace(),t.mustMatch(Tokens.STRING),r=t.token(),n=r.value,this._readWhitespace(),t.mustMatch(Tokens.SEMICOLON),e!==!1&&this.fire({type:"charset",charset:n,line:i,col:s}))},_import:function(e){var t=this._tokenStream,n,r,i,s=[];t.mustMatch(Tokens.IMPORT_SYM),i=t.token(),this._readWhitespace(),t.mustMatch([Tokens.STRING,Tokens.URI]),r=t.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/,"$1"),this._readWhitespace(),s=this._media_query_list(),t.mustMatch(Tokens.SEMICOLON),this._readWhitespace(),e!==!1&&this.fire({type:"import",uri:r,media:s,line:i.startLine,col:i.startCol})},_namespace:function(e){var t=this._tokenStream,n,r,i,s;t.mustMatch(Tokens.NAMESPACE_SYM),n=t.token().startLine,r=t.token().startCol,this._readWhitespace(),t.match(Tokens.IDENT)&&(i=t.token().value,this._readWhitespace()),t.mustMatch([Tokens.STRING,Tokens.URI]),s=t.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/,"$1"),this._readWhitespace(),t.mustMatch(Tokens.SEMICOLON),this._readWhitespace(),e!==!1&&this.fire({type:"namespace",prefix:i,uri:s,line:n,col:r})},_media:function(){var e=this._tokenStream,t,n,r;e.mustMatch(Tokens.MEDIA_SYM),t=e.token().startLine,n=e.token().startCol,this._readWhitespace(),r=this._media_query_list(),e.mustMatch(Tokens.LBRACE),this._readWhitespace(),this.fire({type:"startmedia",media:r,line:t,col:n});for(;;)if(e.peek()==Tokens.PAGE_SYM)this._page();else if(!this._ruleset())break;e.mustMatch(Tokens.RBRACE),this._readWhitespace(),this.fire({type:"endmedia",media:r,line:t,col:n})},_media_query_list:function(){var e=this._tokenStream,t=[];this._readWhitespace(),(e.peek()==Tokens.IDENT||e.peek()==Tokens.LPAREN)&&t.push(this._media_query());while(e.match(Tokens.COMMA))this._readWhitespace(),t.push(this._media_query());return t},_media_query:function(){var e=this._tokenStream,t=null,n=null,r=null,i=[];e.match(Tokens.IDENT)&&(n=e.token().value.toLowerCase(),n!="only"&&n!="not"?(e.unget(),n=null):r=e.token()),this._readWhitespace(),e.peek()==Tokens.IDENT?(t=this._media_type(),r===null&&(r=e.token())):e.peek()==Tokens.LPAREN&&(r===null&&(r=e.LT(1)),i.push(this._media_expression()));if(t===null&&i.length===0)return null;this._readWhitespace();while(e.match(Tokens.IDENT))e.token().value.toLowerCase()!="and"&&this._unexpectedToken(e.token()),this._readWhitespace(),i.push(this._media_expression());return new MediaQuery(n,t,i,r.startLine,r.startCol)},_media_type:function(){return this._media_feature()},_media_expression:function(){var e=this._tokenStream,t=null,n,r=null;return e.mustMatch(Tokens.LPAREN),t=this._media_feature(),this._readWhitespace(),e.match(Tokens.COLON)&&(this._readWhitespace(),n=e.LT(1),r=this._expression()),e.mustMatch(Tokens.RPAREN),this._readWhitespace(),new MediaFeature(t,r?new SyntaxUnit(r,n.startLine,n.startCol):null)},_media_feature:function(){var e=this._tokenStream;return e.mustMatch(Tokens.IDENT),SyntaxUnit.fromToken(e.token())},_page:function(){var e=this._tokenStream,t,n,r=null,i=null;e.mustMatch(Tokens.PAGE_SYM),t=e.token().startLine,n=e.token().startCol,this._readWhitespace(),e.match(Tokens.IDENT)&&(r=e.token().value,r.toLowerCase()==="auto"&&this._unexpectedToken(e.token())),e.peek()==Tokens.COLON&&(i=this._pseudo_page()),this._readWhitespace(),this.fire({type:"startpage",id:r,pseudo:i,line:t,col:n}),this._readDeclarations(!0,!0),this.fire({type:"endpage",id:r,pseudo:i,line:t,col:n})},_margin:function(){var e=this._tokenStream,t,n,r=this._margin_sym();return r?(t=e.token().startLine,n=e.token().startCol,this.fire({type:"startpagemargin",margin:r,line:t,col:n}),this._readDeclarations(!0),this.fire({type:"endpagemargin",margin:r,line:t,col:n}),!0):!1},_margin_sym:function(){var e=this._tokenStream;return e.match([Tokens.TOPLEFTCORNER_SYM,Tokens.TOPLEFT_SYM,Tokens.TOPCENTER_SYM,Tokens.TOPRIGHT_SYM,Tokens.TOPRIGHTCORNER_SYM,Tokens.BOTTOMLEFTCORNER_SYM,Tokens.BOTTOMLEFT_SYM,Tokens.BOTTOMCENTER_SYM,Tokens.BOTTOMRIGHT_SYM,Tokens.BOTTOMRIGHTCORNER_SYM,Tokens.LEFTTOP_SYM,Tokens.LEFTMIDDLE_SYM,Tokens.LEFTBOTTOM_SYM,Tokens.RIGHTTOP_SYM,Tokens.RIGHTMIDDLE_SYM,Tokens.RIGHTBOTTOM_SYM])?SyntaxUnit.fromToken(e.token()):null},_pseudo_page:function(){var e=this._tokenStream;return e.mustMatch(Tokens.COLON),e.mustMatch(Tokens.IDENT),e.token().value},_font_face:function(){var e=this._tokenStream,t,n;e.mustMatch(Tokens.FONT_FACE_SYM),t=e.token().startLine,n=e.token().startCol,this._readWhitespace(),this.fire({type:"startfontface",line:t,col:n}),this._readDeclarations(!0),this.fire({type:"endfontface",line:t,col:n})},_operator:function(){var e=this._tokenStream,t=null;return e.match([Tokens.SLASH,Tokens.COMMA])&&(t=e.token(),this._readWhitespace()),t?PropertyValuePart.fromToken(t):null},_combinator:function(){var e=this._tokenStream,t=null,n;return e.match([Tokens.PLUS,Tokens.GREATER,Tokens.TILDE])&&(n=e.token(),t=new Combinator(n.value,n.startLine,n.startCol),this._readWhitespace()),t},_unary_operator:function(){var e=this._tokenStream;return e.match([Tokens.MINUS,Tokens.PLUS])?e.token().value:null},_property:function(){var e=this._tokenStream,t=null,n=null,r,i,s,o;return e.peek()==Tokens.STAR&&this.options.starHack&&(e.get(),i=e.token(),n=i.value,s=i.startLine,o=i.startCol),e.match(Tokens.IDENT)&&(i=e.token(),r=i.value,r.charAt(0)=="_"&&this.options.underscoreHack&&(n="_",r=r.substring(1)),t=new PropertyName(r,n,s||i.startLine,o||i.startCol),this._readWhitespace()),t},_ruleset:function(){var e=this._tokenStream,t,n;try{n=this._selectors_group()}catch(r){if(r instanceof SyntaxError&&!this.options.strict){this.fire({type:"error",error:r,message:r.message,line:r.line,col:r.col}),t=e.advance([Tokens.RBRACE]);if(t!=Tokens.RBRACE)throw r;return!0}throw r}return n&&(this.fire({type:"startrule",selectors:n,line:n[0].line,col:n[0].col}),this._readDeclarations(!0),this.fire({type:"endrule",selectors:n,line:n[0].line,col:n[0].col})),n},_selectors_group:function(){var e=this._tokenStream,t=[],n;n=this._selector();if(n!==null){t.push(n);while(e.match(Tokens.COMMA))this._readWhitespace(),n=this._selector(),n!==null?t.push(n):this._unexpectedToken(e.LT(1))}return t.length?t:null},_selector:function(){var e=this._tokenStream,t=[],n=null,r=null,i=null;n=this._simple_selector_sequence();if(n===null)return null;t.push(n);do{r=this._combinator();if(r!==null)t.push(r),n=this._simple_selector_sequence(),n===null?this._unexpectedToken(e.LT(1)):t.push(n);else{if(!this._readWhitespace())break;i=new Combinator(e.token().value,e.token().startLine,e.token().startCol),r=this._combinator(),n=this._simple_selector_sequence(),n===null?r!==null&&this._unexpectedToken(e.LT(1)):(r!==null?t.push(r):t.push(i),t.push(n))}}while(!0);return new Selector(t,t[0].line,t[0].col)},_simple_selector_sequence:function(){var e=this._tokenStream,t=null,n=[],r="",i=[function(){return e.match(Tokens.HASH)?new SelectorSubPart(e.token().value,"id",e.token().startLine,e.token().startCol):null},this._class,this._attrib,this._pseudo,this._negation],s=0,o=i.length,u=null,a=!1,f,l;f=e.LT(1).startLine,l=e.LT(1).startCol,t=this._type_selector(),t||(t=this._universal()),t!==null&&(r+=t);for(;;){if(e.peek()===Tokens.S)break;while(s1&&e.unget()),null)},_class:function(){var e=this._tokenStream,t;return e.match(Tokens.DOT)?(e.mustMatch(Tokens.IDENT),t=e.token(),new SelectorSubPart("."+t.value,"class",t.startLine,t.startCol-1)):null},_element_name:function(){var e=this._tokenStream,t;return e.match(Tokens.IDENT)?(t=e.token(),new SelectorSubPart(t.value,"elementName",t.startLine,t.startCol)):null},_namespace_prefix:function(){var e=this._tokenStream,t="";if(e.LA(1)===Tokens.PIPE||e.LA(2)===Tokens.PIPE)e.match([Tokens.IDENT,Tokens.STAR])&&(t+=e.token().value),e.mustMatch(Tokens.PIPE),t+="|";return t.length?t:null},_universal:function(){var e=this._tokenStream,t="",n;return n=this._namespace_prefix(),n&&(t+=n),e.match(Tokens.STAR)&&(t+="*"),t.length?t:null},_attrib:function(){var e=this._tokenStream,t=null,n,r;return e.match(Tokens.LBRACKET)?(r=e.token(),t=r.value,t+=this._readWhitespace(),n=this._namespace_prefix(),n&&(t+=n),e.mustMatch(Tokens.IDENT),t+=e.token().value,t+=this._readWhitespace(),e.match([Tokens.PREFIXMATCH,Tokens.SUFFIXMATCH,Tokens.SUBSTRINGMATCH,Tokens.EQUALS,Tokens.INCLUDES,Tokens.DASHMATCH])&&(t+=e.token().value,t+=this._readWhitespace(),e.mustMatch([Tokens.IDENT,Tokens.STRING]),t+=e.token().value,t+=this._readWhitespace()),e.mustMatch(Tokens.RBRACKET),new SelectorSubPart(t+"]","attribute",r.startLine,r.startCol)):null},_pseudo:function(){var e=this._tokenStream,t=null,n=":",r,i;return e.match(Tokens.COLON)&&(e.match(Tokens.COLON)&&(n+=":"),e.match(Tokens.IDENT)?(t=e.token().value,r=e.token().startLine,i=e.token().startCol-n.length):e.peek()==Tokens.FUNCTION&&(r=e.LT(1).startLine,i=e.LT(1).startCol-n.length,t=this._functional_pseudo()),t&&(t=new SelectorSubPart(n+t,"pseudo",r,i))),t},_functional_pseudo:function(){var e=this._tokenStream,t=null;return e.match(Tokens.FUNCTION)&&(t=e.token().value,t+=this._readWhitespace(),t+=this._expression(),e.mustMatch(Tokens.RPAREN),t+=")"),t},_expression:function(){var e=this._tokenStream,t="";while(e.match([Tokens.PLUS,Tokens.MINUS,Tokens.DIMENSION,Tokens.NUMBER,Tokens.STRING,Tokens.IDENT,Tokens.LENGTH,Tokens.FREQ,Tokens.ANGLE,Tokens.TIME,Tokens.RESOLUTION]))t+=e.token().value,t+=this._readWhitespace();return t.length?t:null},_negation:function(){var e=this._tokenStream,t,n,r="",i,s=null;return e.match(Tokens.NOT)&&(r=e.token().value,t=e.token().startLine,n=e.token().startCol,r+=this._readWhitespace(),i=this._negation_arg(),r+=i,r+=this._readWhitespace(),e.match(Tokens.RPAREN),r+=e.token().value,s=new SelectorSubPart(r,"not",t,n),s.args.push(i)),s},_negation_arg:function(){var e=this._tokenStream,t=[this._type_selector,this._universal,function(){return e.match(Tokens.HASH)?new SelectorSubPart(e.token().value,"id",e.token().startLine,e.token().startCol):null},this._class,this._attrib,this._pseudo],n=null,r=0,i=t.length,s,o,u,a;o=e.LT(1).startLine,u=e.LT(1).startCol;while(r0?new PropertyValue(t,t[0].line,t[0].col):null},_term:function(){var e=this._tokenStream,t=null,n=null,r,i,s;return t=this._unary_operator(),t!==null&&(i=e.token().startLine,s=e.token().startCol),e.peek()==Tokens.IE_FUNCTION&&this.options.ieFilters?(n=this._ie_function(),t===null&&(i=e.token().startLine,s=e.token().startCol)):e.match([Tokens.NUMBER,Tokens.PERCENTAGE,Tokens.LENGTH,Tokens.ANGLE,Tokens.TIME,Tokens.FREQ,Tokens.STRING,Tokens.IDENT,Tokens.URI,Tokens.UNICODE_RANGE])?(n=e.token().value,t===null&&(i=e.token().startLine,s=e.token().startCol),this._readWhitespace()):(r=this._hexcolor(),r===null?(t===null&&(i=e.LT(1).startLine,s=e.LT(1).startCol),n===null&&(e.LA(3)==Tokens.EQUALS&&this.options.ieFilters?n=this._ie_function():n=this._function())):(n=r.value,t===null&&(i=r.startLine,s=r.startCol))),n!==null?new PropertyValuePart(t!==null?t+n:n,i,s):null},_function:function(){var e=this._tokenStream,t=null,n=null,r;if(e.match(Tokens.FUNCTION)){t=e.token().value,this._readWhitespace(),n=this._expr(),t+=n;if(this.options.ieFilters&&e.peek()==Tokens.EQUALS)do{this._readWhitespace()&&(t+=e.token().value),e.LA(0)==Tokens.COMMA&&(t+=e.token().value),e.match(Tokens.IDENT),t+=e.token().value,e.match(Tokens.EQUALS),t+=e.token().value,r=e.peek();while(r!=Tokens.COMMA&&r!=Tokens.S&&r!=Tokens.RPAREN)e.get(),t+=e.token().value,r=e.peek()}while(e.match([Tokens.COMMA,Tokens.S]));e.match(Tokens.RPAREN),t+=")",this._readWhitespace()}return t},_ie_function:function(){var e=this._tokenStream,t=null,n=null,r;if(e.match([Tokens.IE_FUNCTION,Tokens.FUNCTION])){t=e.token().value;do{this._readWhitespace()&&(t+=e.token().value),e.LA(0)==Tokens.COMMA&&(t+=e.token().value),e.match(Tokens.IDENT),t+=e.token().value,e.match(Tokens.EQUALS),t+=e.token().value,r=e.peek();while(r!=Tokens.COMMA&&r!=Tokens.S&&r!=Tokens.RPAREN)e.get(),t+=e.token().value,r=e.peek()}while(e.match([Tokens.COMMA,Tokens.S]));e.match(Tokens.RPAREN),t+=")",this._readWhitespace()}return t},_hexcolor:function(){var e=this._tokenStream,t=null,n;if(e.match(Tokens.HASH)){t=e.token(),n=t.value;if(!/#[a-f0-9]{3,6}/i.test(n))throw new SyntaxError("Expected a hex color but found '"+n+"' at line "+t.startLine+", col "+t.startCol+".",t.startLine,t.startCol);this._readWhitespace()}return t},_keyframes:function(){var e=this._tokenStream,t,n,r,i="";e.mustMatch(Tokens.KEYFRAMES_SYM),t=e.token(),/^@\-([^\-]+)\-/.test(t.value)&&(i=RegExp.$1),this._readWhitespace(),r=this._keyframe_name(),this._readWhitespace(),e.mustMatch(Tokens.LBRACE),this.fire({type:"startkeyframes",name:r,prefix:i,line:t.startLine,col:t.startCol}),this._readWhitespace(),n=e.peek();while(n==Tokens.IDENT||n==Tokens.PERCENTAGE)this._keyframe_rule(),this._readWhitespace(),n=e.peek();this.fire({type:"endkeyframes",name:r,prefix:i,line:t.startLine,col:t.startCol}),this._readWhitespace(),e.mustMatch(Tokens.RBRACE)},_keyframe_name:function(){var e=this._tokenStream,t;return e.mustMatch([Tokens.IDENT,Tokens.STRING]),SyntaxUnit.fromToken(e.token())},_keyframe_rule:function(){var e=this._tokenStream,t,n=this._key_list();this.fire({type:"startkeyframerule",keys:n,line:n[0].line,col:n[0].col}),this._readDeclarations(!0),this.fire({type:"endkeyframerule",keys:n,line:n[0].line,col:n[0].col})},_key_list:function(){var e=this._tokenStream,t,n,r=[];r.push(this._key()),this._readWhitespace();while(e.match(Tokens.COMMA))this._readWhitespace(),r.push(this._key()),this._readWhitespace();return r},_key:function(){var e=this._tokenStream,t;if(e.match(Tokens.PERCENTAGE))return SyntaxUnit.fromToken(e.token());if(e.match(Tokens.IDENT)){t=e.token();if(/from|to/i.test(t.value))return SyntaxUnit.fromToken(t);e.unget()}this._unexpectedToken(e.LT(1))},_skipCruft:function(){while(this._tokenStream.match([Tokens.S,Tokens.CDO,Tokens.CDC]));},_readDeclarations:function(e,t){var n=this._tokenStream,r;this._readWhitespace(),e&&n.mustMatch(Tokens.LBRACE),this._readWhitespace();try{for(;;){if(!(n.match(Tokens.SEMICOLON)||t&&this._margin())){if(!this._declaration())break;if(!n.match(Tokens.SEMICOLON))break}this._readWhitespace()}n.mustMatch(Tokens.RBRACE),this._readWhitespace()}catch(i){if(!(i instanceof SyntaxError&&!this.options.strict))throw i;this.fire({type:"error",error:i,message:i.message,line:i.line,col:i.col}),r=n.advance([Tokens.SEMICOLON,Tokens.RBRACE]);if(r==Tokens.SEMICOLON)this._readDeclarations(!1,t);else if(r!=Tokens.RBRACE)throw i}},_readWhitespace:function(){var e=this._tokenStream,t="";while(e.match(Tokens.S))t+=e.token().value;return t},_unexpectedToken:function(e){throw new SyntaxError("Unexpected token '"+e.value+"' at line "+e.startLine+", col "+e.startCol+".",e.startLine,e.startCol)},_verifyEnd:function(){this._tokenStream.LA(1)!=Tokens.EOF&&this._unexpectedToken(this._tokenStream.LT(1))},_validateProperty:function(e,t){Validation.validate(e,t)},parse:function(e){this._tokenStream=new TokenStream(e,Tokens),this._stylesheet()},parseStyleSheet:function(e){return this.parse(e)},parseMediaQuery:function(e){this._tokenStream=new TokenStream(e,Tokens);var t=this._media_query();return this._verifyEnd(),t},parsePropertyValue:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._expr();return this._readWhitespace(),this._verifyEnd(),t},parseRule:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._ruleset();return this._readWhitespace(),this._verifyEnd(),t},parseSelector:function(e){this._tokenStream=new TokenStream(e,Tokens),this._readWhitespace();var t=this._selector();return this._readWhitespace(),this._verifyEnd(),t},parseStyleAttribute:function(e){e+="}",this._tokenStream=new TokenStream(e,Tokens),this._readDeclarations()}};for(t in n)n.hasOwnProperty(t)&&(e[t]=n[t]);return e}();var Properties={"alignment-adjust":"auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | | ","alignment-baseline":"baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical",animation:1,"animation-delay":{multi:"
    @@ -178,8 +190,9 @@ class Publicize_UI { } - function global_checkbox( $service_name, $id ) { - if ( current_user_can( Publicize::GLOBAL_CAP ) ) : ?> + public static function global_checkbox( $service_name, $id ) { + global $publicize; + if ( current_user_can( $publicize->GLOBAL_CAP ) ) : ?>

    @@ -195,7 +208,7 @@ class Publicize_UI { @@ -363,7 +376,7 @@ jQuery( function($) { function post_page_metabox() { global $post; - if ( 'post' != $post->post_type ) + if ( ! $this->publicize->post_type_is_publicizeable( $post->post_type ) ) return; $user_id = empty( $post->post_author ) ? $GLOBALS['user_ID'] : $post->post_author; @@ -400,7 +413,13 @@ jQuery( function($) { foreach ( $services as $name => $connections ) { foreach ( $connections as $connection ) { - if ( !$continue = apply_filters( 'wpas_submit_post?', true, $post->ID, $name ) ) + $connection_data = ''; + if ( method_exists( $connection, 'get_meta' ) ) + $connection_data = $connection->get_meta( 'connection_data' ); + elseif ( ! empty( $connection['connection_data'] ) ) + $connection_data = $connection['connection_data']; + + if ( !$continue = apply_filters( 'wpas_submit_post?', true, $post->ID, $name, $connection_data ) ) continue; if ( !empty( $connection->unique_id ) ) @@ -436,7 +455,7 @@ jQuery( function($) { // those connections, don't let them change it $cmeta = $this->publicize->get_connection_meta( $connection ); $hidden_checkbox = false; - if ( !$done && ( 0 == $cmeta['connection_data']['user_id'] && !current_user_can( Publicize::GLOBAL_CAP ) ) ) { + if ( !$done && ( 0 == $cmeta['connection_data']['user_id'] && !current_user_can( $this->publicize->GLOBAL_CAP ) ) ) { $disabled = ' disabled="disabled"'; $hidden_checkbox = true; } diff --git a/plugins/jetpack/modules/sharedaddy.php b/plugins/jetpack/modules/sharedaddy.php index f6f4ad6e..924176fa 100644 --- a/plugins/jetpack/modules/sharedaddy.php +++ b/plugins/jetpack/modules/sharedaddy.php @@ -1,10 +1,11 @@ -= 0 ) { var button = response.substring( 0, response.indexOf( '' ) ); var preview = response.substring( response.indexOf( '' ) + 6 ); - + if ( $( item ).is( ':submit' ) === true ) { // Update the DOM using a bit of cut/paste technology - + $( item ).parents( 'li:first' ).replaceWith( button ); } $( '#live-preview ul.archive li.preview-' + $( item ).parents( 'form' ).find( 'input[name=service]' ).val() ).replaceWith( preview ); } - + // Update preview update_preview(); - + // Restore the icon $( item ).parents( 'li:first' ).removeAttr( 'style' ); } ); @@ -163,9 +163,17 @@ return true; } + function showExtraOptions( service ) { + jQuery( '.' + service + '-extra-options' ).css( { backgroundColor: '#ffffcc' } ).fadeIn(); + } + + function hideExtraOptions( service ) { + jQuery( '.' + service + '-extra-options' ).fadeOut( 'slow' ); + } + function save_services() { $( '#enabled-services h3 img' ).show(); - + // Toggle various dividers/help texts if ( $( '#enabled-services ul.services-enabled li.service' ).length > 0 ) { $( '#drag-instructions' ).hide(); @@ -173,21 +181,28 @@ else { $( '#drag-instructions' ).show(); } - + if ( $( '#enabled-services li.service' ).length > 0 ) { $( '#live-preview .services h2' ).hide(); } else { $( '#live-preview .services h2' ).show(); } - + // Gather the modules var visible = [], hidden = []; - + $( 'ul.services-enabled li' ).each( function() { if ( $( this ).hasClass( 'service' ) ) { // Ready for saving visible[visible.length] = $( this ).attr( 'id' ); + showExtraOptions( $( this ).attr( 'id' ) ); + } + } ); + + $( 'ul.services-available li' ).each( function() { + if ( $( this ).hasClass( 'service' ) ) { + hideExtraOptions( $( this ).attr( 'id' ) ); } } ); @@ -195,15 +210,16 @@ if ( $( this ).hasClass( 'service' ) ) { // Ready for saving hidden[hidden.length] = $( this ).attr( 'id' ); + showExtraOptions( $( this ).attr( 'id' ) ); } } ); // Set the hidden element values $( '#save-enabled-shares input[name=visible]' ).val( visible.join( ',' ) ); $( '#save-enabled-shares input[name=hidden]' ).val( hidden.join( ',' ) ); - + update_preview(); - + // Save it $( '#save-enabled-shares' ).ajaxSubmit( function() { $( '#enabled-services h3 img' ).hide(); @@ -234,7 +250,7 @@ }, helper: function( event, ui ) { ui.find( '.advanced-form' ).hide(); - + return ui.clone(); }, start: function( event, ui ) { @@ -262,13 +278,13 @@ $( '.advanced-form' ).hide(); } } ); - + // Live preview 'hidden' button $( '.preview-hidden a' ).click( function() { $( this ).parent().find( '.preview' ).toggle(); return false; } ); - + // Add service $( '#new-service form' ).ajaxForm( { beforeSubmit: function() { @@ -278,7 +294,7 @@ }, success: function( response ) { $( '#new-service-form img' ).hide(); - + if ( response == '1' ) { $( '#new-service-form .inerror' ).removeClass( 'inerror' ).addClass( 'error' ); $( '#new-service-form .error' ).show(); @@ -290,38 +306,38 @@ } } ); - + function init_handlers() { $( '#services-config a.remove' ).unbind( 'click' ).click( function() { var form = $( this ).parent().next(); - + // Loading icon $( this ).parents( 'li:first' ).css( 'backgroundImage', 'url("' + sharing_loading_icon + '")' ); - + // Save form.ajaxSubmit( function( response ) { // Remove the item form.parents( 'li:first' ).fadeOut( function() { $( this ).remove(); - + // Update preview update_preview(); } ); } ); - + return false; } ); } - + $( '#button_style' ).change( function() { update_preview(); return true; } ).change(); - + $( 'input[name=sharing_label]' ).blur( function() { $('#live-preview h3.sd-title').html( $( '

    ' ).text( $( this ).val() ).html() ); } ); - + init_handlers(); enable_share_button(); } ); diff --git a/plugins/jetpack/modules/sharedaddy/images/facebook.png b/plugins/jetpack/modules/sharedaddy/images/facebook.png index 8850a80b..91d3702f 100644 Binary files a/plugins/jetpack/modules/sharedaddy/images/facebook.png and b/plugins/jetpack/modules/sharedaddy/images/facebook.png differ diff --git a/plugins/jetpack/modules/sharedaddy/images/facebook@2x.png b/plugins/jetpack/modules/sharedaddy/images/facebook@2x.png index a88a52f6..10b36803 100644 Binary files a/plugins/jetpack/modules/sharedaddy/images/facebook@2x.png and b/plugins/jetpack/modules/sharedaddy/images/facebook@2x.png differ diff --git a/plugins/jetpack/modules/sharedaddy/images/googleplus1.png b/plugins/jetpack/modules/sharedaddy/images/googleplus1.png index 5f0a05e5..ee687af1 100644 Binary files a/plugins/jetpack/modules/sharedaddy/images/googleplus1.png and b/plugins/jetpack/modules/sharedaddy/images/googleplus1.png differ diff --git a/plugins/jetpack/modules/sharedaddy/images/googleplus1@2x.png b/plugins/jetpack/modules/sharedaddy/images/googleplus1@2x.png index 26054392..60dd1c03 100644 Binary files a/plugins/jetpack/modules/sharedaddy/images/googleplus1@2x.png and b/plugins/jetpack/modules/sharedaddy/images/googleplus1@2x.png differ diff --git a/plugins/jetpack/modules/sharedaddy/images/icon-facebook-2x.png b/plugins/jetpack/modules/sharedaddy/images/icon-facebook-2x.png index a5c71943..10b36803 100644 Binary files a/plugins/jetpack/modules/sharedaddy/images/icon-facebook-2x.png and b/plugins/jetpack/modules/sharedaddy/images/icon-facebook-2x.png differ diff --git a/plugins/jetpack/modules/sharedaddy/images/icon-facebook.png b/plugins/jetpack/modules/sharedaddy/images/icon-facebook.png index de6a8a14..91d3702f 100644 Binary files a/plugins/jetpack/modules/sharedaddy/images/icon-facebook.png and b/plugins/jetpack/modules/sharedaddy/images/icon-facebook.png differ diff --git a/plugins/jetpack/modules/sharedaddy/recaptchalib.php b/plugins/jetpack/modules/sharedaddy/recaptchalib.php index a9716772..205a4a2d 100644 --- a/plugins/jetpack/modules/sharedaddy/recaptchalib.php +++ b/plugins/jetpack/modules/sharedaddy/recaptchalib.php @@ -108,7 +108,7 @@ function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false) if ($pubkey == null || $pubkey == '') { die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); } - + if ($use_ssl) { $server = RECAPTCHA_API_SECURE_SERVER; } else { @@ -159,8 +159,8 @@ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $ex die ("For security reasons, you must pass the remote ip to reCAPTCHA"); } - - + + //discard spam submissions if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) { $recaptcha_response = new ReCaptchaResponse(); @@ -215,7 +215,7 @@ function _recaptcha_aes_encrypt($val,$ky) { if (! function_exists ("mcrypt_encrypt")) { die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed."); } - $mode=MCRYPT_MODE_CBC; + $mode=MCRYPT_MODE_CBC; $enc=MCRYPT_RIJNDAEL_128; $val=_recaptcha_aes_pad($val); return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); @@ -232,11 +232,11 @@ function recaptcha_mailhide_url($pubkey, $privkey, $email) { die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " . "you can do so at http://www.google.com/recaptcha/mailhide/apikey"); } - + $ky = pack('H*', $privkey); $cryptmail = _recaptcha_aes_encrypt ($email, $ky); - + return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail); } @@ -267,7 +267,7 @@ function _recaptcha_mailhide_email_parts ($email) { function recaptcha_mailhide_html($pubkey, $privkey, $email) { $emailparts = _recaptcha_mailhide_email_parts ($email); $url = recaptcha_mailhide_url ($pubkey, $privkey, $email); - + return htmlentities($emailparts[0]) . "...@" . htmlentities ($emailparts [1]); diff --git a/plugins/jetpack/modules/sharedaddy/sharedaddy.php b/plugins/jetpack/modules/sharedaddy/sharedaddy.php index ab8085ca..cefecf75 100644 --- a/plugins/jetpack/modules/sharedaddy/sharedaddy.php +++ b/plugins/jetpack/modules/sharedaddy/sharedaddy.php @@ -59,14 +59,14 @@ function sharing_meta_box_save( $post_id ) { } } } - + return $post_id; } function sharing_meta_box_protected( $protected, $meta_key, $meta_type ) { if ( 'sharing_disabled' == $meta_key ) $protected = true; - + return $protected; } @@ -83,7 +83,7 @@ function sharing_add_plugin_settings($links, $file) { $links[] = '' . __( 'Settings', 'jetpack' ) . ''; $links[] = '' . __( 'Support', 'jetpack' ) . ''; } - + return $links; } diff --git a/plugins/jetpack/modules/sharedaddy/sharing-service.php b/plugins/jetpack/modules/sharedaddy/sharing-service.php index c8efee33..8b10b6e0 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing-service.php +++ b/plugins/jetpack/modules/sharedaddy/sharing-service.php @@ -54,6 +54,7 @@ class Sharing_Service { 'google-plus-1' => 'Share_GooglePlus1', 'tumblr' => 'Share_Tumblr', 'pinterest' => 'Share_Pinterest', + 'pocket' => 'Share_Pocket', ); // Add any custom services in @@ -416,7 +417,9 @@ function sharing_add_footer() { endif; endif; - wp_print_scripts( 'sharing-js' ); + wp_enqueue_script( 'sharing-js' ); + $recaptcha__options = array( 'lang' => get_base_recaptcha_lang_code() ); + wp_localize_script('sharing-js', 'recaptcha_options', $recaptcha__options); } $sharer = new Sharing_Service(); @@ -452,9 +455,9 @@ function sharing_process_requests() { } } } -add_action( 'template_redirect', 'sharing_process_requests' ); +add_action( 'template_redirect', 'sharing_process_requests', 9 ); -function sharing_display( $text = '' ) { +function sharing_display( $text = '', $echo = false ) { global $post, $wp_current_filter; if ( is_preview() ) { @@ -518,7 +521,7 @@ function sharing_display( $text = '' ) { $sharing_content = ''; if ( $show ) { - $enabled = $sharer->get_blog_services(); + $enabled = apply_filters( 'sharing_enabled', $sharer->get_blog_services() ); if ( count( $enabled['all'] ) > 0 ) { global $post; @@ -584,7 +587,7 @@ function sharing_display( $text = '' ) { $sharing_content .= '
    '; } - $sharing_content .= '
    '; + $sharing_content .= ''; // Register our JS wp_register_script( 'sharing-js', plugin_dir_url( __FILE__ ).'sharing.js', array( 'jquery' ), '20121205' ); @@ -592,8 +595,35 @@ function sharing_display( $text = '' ) { } } - return $text.$sharing_content; + if ( $echo ) + echo $text.$sharing_content; + else + return $text.$sharing_content; } add_filter( 'the_content', 'sharing_display', 19 ); add_filter( 'the_excerpt', 'sharing_display', 19 ); +function get_base_recaptcha_lang_code() { + + $base_recaptcha_lang_code_mapping = array( + 'en' => 'en', + 'nl' => 'nl', + 'fr' => 'fr', + 'fr-be' => 'fr', + 'fr-ca' => 'fr', + 'fr-ch' => 'fr', + 'de' => 'de', + 'pt' => 'pt', + 'pt-br' => 'pt', + 'ru' => 'ru', + 'es' => 'es', + 'tr' => 'tr' + ); + + $blog_lang_code = function_exists( 'get_blog_lang_code' ) ? get_blog_lang_code() : get_bloginfo( 'language' ); + if( isset( $base_recaptcha_lang_code_mapping[ $blog_lang_code ] ) ) + return $base_recaptcha_lang_code_mapping[ $blog_lang_code ]; + + // if no base mapping is found return default 'en' + return 'en'; +} diff --git a/plugins/jetpack/modules/sharedaddy/sharing-sources.php b/plugins/jetpack/modules/sharedaddy/sharing-sources.php index 256513cb..53164741 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing-sources.php +++ b/plugins/jetpack/modules/sharedaddy/sharing-sources.php @@ -197,7 +197,7 @@ class Share_Email extends Sharing_Source { } public function get_name() { - return __( 'Email', 'jetpack' ); + return _x( 'Email', 'as sharing source', 'jetpack' ); } // Default does nothing @@ -317,6 +317,9 @@ class Share_Email extends Sharing_Source { class Share_Twitter extends Sharing_Source { var $shortname = 'twitter'; + // 'https://dev.twitter.com/docs/api/1.1/get/help/configuration' ( 2013/06/24 ) short_url_length is 22 + var $short_url_length = 24; + public function __construct( $id, array $settings ) { parent::__construct( $id, $settings ); @@ -402,8 +405,8 @@ class Share_Twitter extends Sharing_Source { $sig = ''; } - $suffix_length = $strlen( " {$post_link}{$sig}" ); + $suffix_length = $this->short_url_length + $strlen( " {$sig}" ); // $sig is handled by twitter in their 'via' argument. // $post_link is handled by twitter in their 'url' argument. if ( 140 < $strlen( $post_title ) + $suffix_length ) { @@ -600,28 +603,14 @@ class Share_LinkedIn extends Sharing_Source { public function process_request( $post, array $post_data ) { - setup_postdata( $post ); - $post_link = $this->get_share_url( $post->ID ); - // http://www.linkedin.com/shareArticle?mini=true&url={articleUrl}&title={articleTitle}&summary={articleSummary}&source={articleSource} - - $encoded_title = rawurlencode( $post->post_title ); - if( strlen( $encoded_title ) > 200 ) - $encoded_title = substr( $encoded_title, 0, 197 ) . '...'; - - $encoded_summary = rawurlencode( strip_tags( get_the_excerpt() ) ); - if( strlen( $encoded_summary ) > 256 ) - $encoded_summary = substr( $encoded_summary, 0, 253 ) . '...'; - - $source = get_bloginfo( 'name' ); + // Using the same URL as the official button, which is *not* LinkedIn's documented sharing link + // http://www.linkedin.com/cws/share?url={url}&token=&isFramed=false $linkedin_url = add_query_arg( array( - 'title' => $encoded_title, 'url' => rawurlencode( $post_link ), - 'source' => rawurlencode( $source ), - 'summary' => $encoded_summary, - ), 'http://www.linkedin.com/shareArticle?mini=true' ); + ), 'http://www.linkedin.com/cws/share?token=&isFramed=false' ); // Record stats parent::process_request( $post, $post_data ); @@ -1214,6 +1203,8 @@ class Share_Pinterest extends Sharing_Source { s.src = window.location.protocol + "//assets.pinterest.com/js/pinit.js"; var x = document.getElementsByTagName("script")[0]; x.parentNode.insertBefore(s, x); + // if 'Pin it' button has 'counts' make container wider + jQuery(window).load( function(){ jQuery( 'li.share-pinterest a span:visible' ).closest( '.share-pinterest' ).width( '80px' ); } ); + js_dialog( $this->shortname, array( 'width' => 450, 'height' => 450 ) ); + endif; + + } + +} + diff --git a/plugins/jetpack/modules/sharedaddy/sharing.css b/plugins/jetpack/modules/sharedaddy/sharing.css index 95a09d0e..1d1719c8 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing.css +++ b/plugins/jetpack/modules/sharedaddy/sharing.css @@ -1,4 +1,4 @@ -div.sharedaddy ul, +li.share-print a.sd-button > spandiv.sharedaddy ul, div.sharedaddy li { margin: 0; padding: 0; @@ -7,15 +7,15 @@ div.sharedaddy li { background: none; } -div.sharedaddy, -#content div.sharedaddy, +div.sharedaddy, +#content div.sharedaddy, #main div.sharedaddy { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; clear: both; } -div.sharedaddy, +div.sharedaddy, div.sharedaddy div { -webkit-border-radius: 0 !important; -moz-border-radius: 0 !important; @@ -41,7 +41,7 @@ div.sharedaddy h3, } /* @noflip */ -.rtl div.sharedaddy h3, +.rtl div.sharedaddy h3, .rtl #content div.sharedaddy h3, .rtl #main div.sharedaddy h3, .rtl #primary div.sharedaddy h3 { @@ -49,7 +49,7 @@ div.sharedaddy h3, text-align: right; } -div.sharedaddy ul, +div.sharedaddy ul, div.sharedaddy li { margin: 0 !important; padding: 0 !important; @@ -60,29 +60,24 @@ div.sharedaddy li::before { content: ""; } -div.sharedaddy div.sharing-clear { - margin: 0 !important; - padding: 0 !important; -} - div.sharedaddy div.pd-rating { margin: 0; min-height: 23px; } -div.sharedaddy a, -div.sharedaddy a:link, +div.sharedaddy a, +div.sharedaddy a:link, div.sharedaddy a:visited { font-style: normal; } /* ClearFix trick */ -div.sharedaddy:before, +div.sharedaddy:before, div.sharedaddy:after, -div.sharedaddy .sd-block:before, +div.sharedaddy .sd-block:before, div.sharedaddy .sd-block:after, -div.sharedaddy ul:before, +div.sharedaddy ul:before, div.sharedaddy ul:after { content: "\0020"; display: block; @@ -120,7 +115,7 @@ div.sharedaddy.sharedaddy-dark .sd-block { } div.sharedaddy .sd-content { - width: 82.125%; /* 530px / 640px */ + width: 82.125%; /* 530px / 640px */ float: right; margin: -2px 0 0 0; } @@ -315,6 +310,14 @@ li.share-pinterest a.sd-button > span { background-image: url('images/pinterest.png'); } +li.share-pocket a.sd-button > span { + background-image: url('images/pocket.png'); +} + +li.share-kindle a.sd-button > span { + background-image: url('images/kindle.png'); +} + li.share-email a.sd-button > span { background-image: url('images/email.png'); } @@ -327,23 +330,23 @@ a.sd-button.share-more span { background-image: url('images/more.png'); } -@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) { +@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), only screen and (min-resolution: 120dpi) { li.share-facebook a.sd-button > span { background-image: url('images/facebook@2x.png'); background-size: 16px 16px; } - + li.share-tumblr a.sd-button > span { background-image: url('images/tumblr@2x.png'); background-size: 16px 16px; } - + li.share-twitter a.sd-button > span { background-image: url('images/twitter@2x.png?1'); background-size: 16px 16px; } - + li.share-google-plus-1 a.sd-button > span { background-image: url('images/googleplus1@2x.png'); background-size: 16px 16px; @@ -353,42 +356,52 @@ a.sd-button.share-more span { background-image: url('images/linkedin@2x.png'); background-size: 16px 16px; } - + li.share-press-this a.sd-button > span { background-image: url('images/wordpress@2x.png'); background-size: 16px 16px; } - + li.share-digg a.sd-button > span { background-image: url('images/digg@2x.png?1'); background-size: 16px 16px; } - + li.share-stumbleupon a.sd-button > span { background-image: url('images/stumbleupon@2x.png'); background-size: 16px 16px; } - + li.share-reddit a.sd-button > span { background-image: url('images/reddit@2x.png'); background-size: 16px 16px; } - + li.share-pinterest a.sd-button > span { background-image: url('images/pinterest@2x.png'); background-size: 16px 16px; } - + + li.share-pocket a.sd-button > span { + background-image: url('images/pocket@2x.png'); + background-size: 16px 16px; + } + + li.share-kindle a.sd-button > span { + background-image: url('images/kindle@2x.png'); + background-size: 16px 16px; + } + li.share-email a.sd-button > span { background-image: url('images/email@2x.png?1'); background-size: 16px 16px; } - + li.share-print a.sd-button > span { background-image: url('images/print@2x.png'); background-size: 16px 16px; } - + a.sd-button.share-more span { background-image: url('images/more@2x.png?1'); background-size: 16px 16px; diff --git a/plugins/jetpack/modules/sharedaddy/sharing.js b/plugins/jetpack/modules/sharedaddy/sharing.js index 68482c60..c996bb6f 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing.js +++ b/plugins/jetpack/modules/sharedaddy/sharing.js @@ -71,7 +71,7 @@ var WPCOMSharing = { // Touchscreen device: use click. // Non-touchscreen device: use click if not already appearing due to a hover event - $more_sharing_buttons.click( function() { + $more_sharing_buttons.on( 'click', function() { var $more_sharing_button = $( this ), $more_sharing_pane = $more_sharing_button.parents( 'div:first' ).find( '.inner' ); @@ -183,6 +183,11 @@ var WPCOMSharing = { // Add click functionality $( '.sharedaddy ul' ).each( function( item ) { + + if ( 'yep' == $( this ).data( 'has-click-events' ) ) + return; + $( this ).data( 'has-click-events', 'yep' ); + printUrl = function ( uniqueId, urlToPrint ) { $( 'body:first' ).append( '' ) }; @@ -233,7 +238,7 @@ var WPCOMSharing = { } ); // Email button - $( this ).find( 'a.share-email' ).click( function() { + $( 'a.share-email', this ).on( 'click', function() { var url = $( this ).attr( 'href' ), key; if ( $( '#sharing_email' ).is( ':visible' ) ) @@ -251,7 +256,7 @@ var WPCOMSharing = { key = $( '#recaptcha_public_key' ).val(); // Update the recaptcha - Recaptcha.create( key, 'sharing_recaptcha' ); + Recaptcha.create( key, 'sharing_recaptcha', { lang : recaptcha_options.lang } ); // Show dialog $( '#sharing_email' ).css( { diff --git a/plugins/jetpack/modules/sharedaddy/sharing.php b/plugins/jetpack/modules/sharedaddy/sharing.php index 118f851c..974fe741 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing.php +++ b/plugins/jetpack/modules/sharedaddy/sharing.php @@ -281,7 +281,6 @@ class Sharing_Admin { endforeach; ?>
  • -

    diff --git a/plugins/jetpack/modules/shortcodes.php b/plugins/jetpack/modules/shortcodes.php index e10805ca..ce54d632 100644 --- a/plugins/jetpack/modules/shortcodes.php +++ b/plugins/jetpack/modules/shortcodes.php @@ -6,6 +6,7 @@ * Sort Order: 11 * First Introduced: 1.1 * Major Changes In: 1.2 + * Requires Connection: No */ /** @@ -21,7 +22,7 @@ */ function shortcode_new_to_old_params( $params, $old_format_support = false ) { $str = ''; - + if ( $old_format_support && isset( $params[0] ) ) { $str = ltrim( $params[0], '=' ); } elseif ( is_array( $params ) ) { @@ -30,13 +31,39 @@ function shortcode_new_to_old_params( $params, $old_format_support = false ) { $str = $key . '=' . $params[$key]; } } - - return str_replace( array( '&', '&' ), '&', $str ); + + return str_replace( array( '&', '&' ), '&', $str ); } function jetpack_load_shortcodes() { + global $wp_version; + + $shortcode_includes = array(); + foreach ( Jetpack::glob_php( dirname( __FILE__ ) . '/shortcodes' ) as $file ) { - include $file; + $shortcode_includes[] = $file; + } + + $shortcode_includes = apply_filters( 'jetpack_shortcodes_to_include', $shortcode_includes ); + + foreach ( $shortcode_includes as $include ) { + if ( version_compare( $wp_version, '3.6-z', '>=' ) && stristr( $include, 'audio.php' ) ) + continue; + + include $include; + } +} + +global $wp_version; + +if ( version_compare( $wp_version, '3.6-z', '>=' ) ) { + add_filter( 'shortcode_atts_audio', 'jetpack_audio_atts_handler', 10, 3 ); + + function jetpack_audio_atts_handler( $out, $pairs, $atts ) { + if( isset( $atts[0] ) ) + $out['src'] = $atts[0]; + + return $out; } } diff --git a/plugins/jetpack/modules/shortcodes/archives.php b/plugins/jetpack/modules/shortcodes/archives.php index b4c78f3c..c407978f 100644 --- a/plugins/jetpack/modules/shortcodes/archives.php +++ b/plugins/jetpack/modules/shortcodes/archives.php @@ -3,7 +3,7 @@ /* * Archives shortcode * @author bubel & nickmomrik - * [archives limit=10] + * [archives limit=10] */ add_shortcode( 'archives', 'archives_shortcode' ); diff --git a/plugins/jetpack/modules/shortcodes/audio.php b/plugins/jetpack/modules/shortcodes/audio.php index 9c6b49eb..744cf49c 100644 --- a/plugins/jetpack/modules/shortcodes/audio.php +++ b/plugins/jetpack/modules/shortcodes/audio.php @@ -16,6 +16,16 @@ class AudioShortcode { add_action( 'infinite_scroll_render', array( $this, 'audio_shortcode_infinite' ), 11 ); } + /** + * Return the $url of the audio + */ + static function get_audio_id( $atts ) { + if ( isset( $atts[0] ) ) + return $atts[0]; + else + return 0; + } + /** * Shortcode for audio * [audio http://wpcom.files.wordpress.com/2007/01/mattmullenweg-interview.mp3|width=180|titles=1|artists=2] @@ -31,7 +41,12 @@ class AudioShortcode { } if ( ! isset( $atts[0] ) ) { - return ''; + if ( isset( $atts['src'] ) ) { + $atts[0] = $atts['src']; + unset( $atts['src'] ); + } else { + return ''; + } } // add the special .js @@ -79,6 +94,13 @@ class AudioShortcode { $data = preg_split( "/\|/", $src ); $sound_file = $data[0]; $sound_files = explode( ',', $sound_file ); + + if ( is_ssl() ) { + for ( $i = 0; $i < count( $sound_files ); $i++ ) { + $sound_files[ $i ] = preg_replace( '#^http://([^.]+).files.wordpress.com/#', 'https://$1.files.wordpress.com/', $sound_files[ $i ] ); + } + } + $sound_files = array_map( 'trim', $sound_files ); $sound_files = array_map( array( $this, 'rawurlencode_spaces' ), $sound_files ); $sound_files = array_map( 'esc_url_raw', $sound_files ); // Ensure each is a valid URL @@ -232,9 +254,14 @@ CONTROLS; } $html5_audio .= ""; + if ( is_ssl() ) + $protocol = 'https'; + else + $protocol = 'http'; + $swfurl = apply_filters( 'jetpack_static_url', - 'http://en.wordpress.com/wp-content/plugins/audio-player/player.swf' ); + "$protocol://en.wordpress.com/wp-content/plugins/audio-player/player.swf" ); // all the fancy javascript is causing Google Reader to break, just include flash in GReader // override html5 audio code w/ just not supported code diff --git a/plugins/jetpack/modules/shortcodes/blip.php b/plugins/jetpack/modules/shortcodes/blip.php index e757dc4b..0245522a 100644 --- a/plugins/jetpack/modules/shortcodes/blip.php +++ b/plugins/jetpack/modules/shortcodes/blip.php @@ -2,10 +2,10 @@ /** * Blip.tv embed code: - * + * * Blip.tv shortcode is: [blip.tv url-or-something-else] * */ - + function blip_embed_to_shortcode( $content ) { if ( false === stripos( $content, '/blip.tv/play/' ) ) return $content; @@ -47,7 +47,7 @@ function blip_shortcode( $atts ) { return ""; elseif ( preg_match( '|^http://blip.tv/play/[.\w]+$|', urldecode( $src ) ) ) // WLS return ""; - + return ""; } diff --git a/plugins/jetpack/modules/shortcodes/css/rtl/slideshow-shortcode-rtl.css b/plugins/jetpack/modules/shortcodes/css/rtl/slideshow-shortcode-rtl.css index 167ec706..eea868af 100644 --- a/plugins/jetpack/modules/shortcodes/css/rtl/slideshow-shortcode-rtl.css +++ b/plugins/jetpack/modules/shortcodes/css/rtl/slideshow-shortcode-rtl.css @@ -1,4 +1,4 @@ -/* This file was automatically generated on Jan 06 2013 05:39:50 */ +/* This file was automatically generated on Mar 25 2013 08:14:36 */ .slideshow-window { background-color: #222; @@ -25,6 +25,8 @@ body div.slideshow-window * img { /* Override any styles that might be present in the page stylesheet */ border-width: 0 !important; + margin-left: auto !important; + margin-right: auto !important; padding: 0 !important; background-color: transparent !important; background-image: none !important; diff --git a/plugins/jetpack/modules/shortcodes/css/slideshow-shortcode.css b/plugins/jetpack/modules/shortcodes/css/slideshow-shortcode.css index e6d05b23..13cef497 100644 --- a/plugins/jetpack/modules/shortcodes/css/slideshow-shortcode.css +++ b/plugins/jetpack/modules/shortcodes/css/slideshow-shortcode.css @@ -23,6 +23,8 @@ body div.slideshow-window * img { /* Override any styles that might be present in the page stylesheet */ border-width: 0 !important; + margin-right: auto !important; + margin-left: auto !important; padding: 0 !important; background-color: transparent !important; background-image: none !important; diff --git a/plugins/jetpack/modules/shortcodes/dailymotion.php b/plugins/jetpack/modules/shortcodes/dailymotion.php index a6daed9d..fe2e6ab6 100644 --- a/plugins/jetpack/modules/shortcodes/dailymotion.php +++ b/plugins/jetpack/modules/shortcodes/dailymotion.php @@ -6,13 +6,13 @@ /** * Original codes: - * + * * * * * *
    Ghinzu - Cold Love (Mirror Mirror)
    Uploaded by GhinzuTV. - Watch more music videos, in HD! - * + * * Code as of 01.01.11: *
    Sexy Surprise
    Uploaded by GilLavie. - Find more steamy, sexy videos. * movie param enforces anti-xss protection @@ -53,29 +53,29 @@ add_filter( 'pre_kses', 'dailymotion_embed_to_shortcode' ); /** * DailyMotion shortcode - * - * The documented shortcode is: - * [dailymotion id=x8oma9] - * + * + * The documented shortcode is: + * [dailymotion id=x8oma9] + * * Possibilities, according to the old parsing regexp: * [dailymotion x8oma9] - * [dailymotion=x8oma9] - * + * [dailymotion=x8oma9] + * * Hypothetical option, according to the old shortcode function is * [dailymotion id=1&title=2&user=3&video=4] - * - * The new style is now: - * [dailymotion id=x8oma9 title=2 user=3 video=4] - * + * + * The new style is now: + * [dailymotion id=x8oma9 title=2 user=3 video=4] + * * @param array $atts - * @return string html + * @return string html * - */ + */ function dailymotion_shortcode( $atts ) { global $content_width; - if ( isset( $atts[0] ) ) { + if ( isset( $atts[0] ) ) { $id = ltrim( $atts[0], '=' ); $atts['id'] = $id; } else { @@ -85,7 +85,7 @@ function dailymotion_shortcode( $atts ) { if ( isset( $atts['id'] ) ) $id = $atts['id']; - else + else return ''; if ( !empty( $content_width ) ) diff --git a/plugins/jetpack/modules/shortcodes/diggthis.php b/plugins/jetpack/modules/shortcodes/diggthis.php index ee1195fa..0077a468 100644 --- a/plugins/jetpack/modules/shortcodes/diggthis.php +++ b/plugins/jetpack/modules/shortcodes/diggthis.php @@ -1,17 +1,17 @@ +/* + * */ function flickr_embed_to_shortcode( $content ) { @@ -94,7 +94,7 @@ function flickr_shortcode_handler( $atts ) { if ( isset( $atts['video'] ) ) { $showing = 'video'; - $src = $atts['video']; + $src = $atts['video']; } elseif ( isset( $atts['photo'] ) ) { $showing = 'photo'; $src = $atts['photo']; @@ -113,7 +113,7 @@ function flickr_shortcode_handler( $atts ) { elseif ( in_array( $atts['show_info'], array( 'false', 'no' ) ) ) $atts['show_info'] = 'false'; - if ( isset( $atts['secret'] ) ) + if ( isset( $atts['secret'] ) ) $atts['secret'] = preg_replace( '![^\w]+!i', '', $atts['secret'] ); return flickr_shortcode_video_markup( $atts ); @@ -125,7 +125,7 @@ function flickr_shortcode_handler( $atts ) { function flickr_shortcode_video_markup( $atts ) { $atts = array_map( 'esc_attr', $atts ); - $photo_vars = "photo_id=$atts[photo_id]"; + $photo_vars = "photo_id=$atts[photo_id]"; if ( isset( $atts['secret'] ) ) $photo_vars .= "&photo_secret=$atts[secret]"; diff --git a/plugins/jetpack/modules/shortcodes/googlemaps.php b/plugins/jetpack/modules/shortcodes/googlemaps.php index fe79a9e6..224654fa 100644 --- a/plugins/jetpack/modules/shortcodes/googlemaps.php +++ b/plugins/jetpack/modules/shortcodes/googlemaps.php @@ -75,6 +75,10 @@ function jetpack_googlemaps_shortcode( $atts ) { } } $url = substr( $url, 0, -5 ); + + if( is_ssl() ) + $url = str_replace( 'http://', 'https://', $url ); + $link_url = preg_replace( '!output=embed!', 'source=embed', $url ); return '

    View Larger Map
    '; diff --git a/plugins/jetpack/modules/shortcodes/googlevideo.php b/plugins/jetpack/modules/shortcodes/googlevideo.php index 83074fbf..cbd709c9 100644 --- a/plugins/jetpack/modules/shortcodes/googlevideo.php +++ b/plugins/jetpack/modules/shortcodes/googlevideo.php @@ -2,7 +2,7 @@ /** * google video is replaced by youtube, but its embeds will probably continue working indefinitely. - * [googlevideo=http://video.google.com/googleplayer.swf?docId=-6006084025483872237] + * [googlevideo=http://video.google.com/googleplayer.swf?docId=-6006084025483872237] */ function googlevideo_shortcode( $atts ) { @@ -10,7 +10,7 @@ function googlevideo_shortcode( $atts ) { return ''; $src = ltrim( $atts[0], '=' ); - + if ( 0 !== strpos( $src, 'http://video.google.com/googleplayer.swf' ) ) { if ( !preg_match( '|^http://(video\.google\.[a-z]{2,3}(?:.[a-z]{2})?)/|', $src ) || !preg_match( '|.*docid=([0-9-]+).*|i', $src, $match ) || !is_numeric( $match[1] ) ) return ''; diff --git a/plugins/jetpack/modules/shortcodes/js/audio-shortcode.js b/plugins/jetpack/modules/shortcodes/js/audio-shortcode.js index 7697258e..400219e4 100644 --- a/plugins/jetpack/modules/shortcodes/js/audio-shortcode.js +++ b/plugins/jetpack/modules/shortcodes/js/audio-shortcode.js @@ -50,7 +50,7 @@ window.audioshortcode = { } // bail if there are no more good files - if ( 0 == this[player_id].files.length ) { + if ( 0 === this[player_id].files.length ) { return; } player.src = this[player_id].files[0]; @@ -64,7 +64,7 @@ window.audioshortcode = { audioshortcode.remove_track( player_id, audioshortcode[player_id].i ); if ( 0 < audioshortcode[player_id].files.length ) { audioshortcode[player_id].i--; - audioshortcode.next_track( player_id, false, loop ); + audioshortcode.next_track( player_id, false, loop ); } }, false ); @@ -91,7 +91,7 @@ window.audioshortcode = { this[player_id].titles.splice( index, 1 ); // get rid of player/controls if they can't be played - if ( 0 == this[player_id].files.length ) { + if ( 0 === this[player_id].files.length ) { $( '#wp-as-' + player_id + '-container' ).html( $( '#wp-as-' + player_id + '-nope' ).html() ); $( '#wp-as-' + player_id + '-controls' ).html( '' ); } else if ( 1 == this[player_id].files.length ) { @@ -115,9 +115,9 @@ window.audioshortcode = { prev_track: function( player_id ) { var player = $( '#wp-as-' + player_id ).get(0); var files = this[player_id].files; - if ( player.paused || 0 == this[player_id].i ) { - return - }; + if ( player.paused || 0 === this[player_id].i ) { + return; + } player.pause(); if ( 0 < this[player_id].i ) { diff --git a/plugins/jetpack/modules/shortcodes/js/jquery.cycle.js b/plugins/jetpack/modules/shortcodes/js/jquery.cycle.js index 89d583eb..d12df1ba 100644 --- a/plugins/jetpack/modules/shortcodes/js/jquery.cycle.js +++ b/plugins/jetpack/modules/shortcodes/js/jquery.cycle.js @@ -22,7 +22,7 @@ if ($.support === undefined) { function debug(s) { if ($.fn.cycle.debug) log(s); -} +} function log() { if (window.console && console.log) console.log('[cycle] ' + Array.prototype.join.call(arguments,' ')); @@ -66,7 +66,7 @@ $.fn.cycle = function(options, arg2) { return; opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink; - + // stop existing slideshow for this container (if there is one) if (this.cycleTimeout) clearTimeout(this.cycleTimeout); @@ -184,7 +184,7 @@ function handleArguments(cont, options, arg2) { return false; } return options; - + function checkInstantResume(isPaused, arg2, cont) { if (!isPaused && arg2 === true) { // resume now! var options = $(cont).data('cycle.opts'); @@ -214,7 +214,7 @@ function destroy(cont, opts) { $(opts.next).unbind(opts.prevNextEvent); if (opts.prev) $(opts.prev).unbind(opts.prevNextEvent); - + if (opts.pager || opts.pagerAnchorBuilder) $.each(opts.pagerAnchors || [], function() { this.unbind().remove(); @@ -268,7 +268,7 @@ function buildOptions($cont, $slides, els, options, o) { opts.startingSlide = parseInt(opts.startingSlide,10); if (opts.startingSlide >= els.length || opts.startSlide < 0) opts.startingSlide = 0; // catch bogus input - else + else startingSlideSpecified = true; } else if (opts.backwards) @@ -361,7 +361,7 @@ function buildOptions($cont, $slides, els, options, o) { }); }); } - + // stretch container var reshape = (opts.containerResize || opts.containerResizeHeight) && !$cont.innerHeight(); if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9 @@ -447,7 +447,7 @@ function buildOptions($cont, $slides, els, options, o) { opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed,10); if (!opts.sync) opts.speed = opts.speed / 2; - + var buffer = opts.fx == 'none' ? 0 : opts.fx == 'shuffle' ? 500 : 250; while((opts.timeout - opts.speed) < buffer) // sanitize timeout opts.timeout += opts.speed; @@ -705,7 +705,7 @@ function go(els, opts, manual, fwd) { }; debug('tx firing('+fx+'); currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide); - + // get ready to perform the transition opts.busy = 1; if (opts.fxFn) // fx function provided? @@ -760,7 +760,7 @@ function go(els, opts, manual, fwd) { } if (changed && opts.pager) opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass); - + function queueNext() { // stage the next transition var ms = 0, timeout = opts.timeout; @@ -857,7 +857,7 @@ $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { } else a = ''+(i+1)+''; - + if (!a) return; var $a = $(a); @@ -879,7 +879,7 @@ $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { opts.pagerAnchors = opts.pagerAnchors || []; opts.pagerAnchors.push($a); - + var pagerFn = function(e) { e.preventDefault(); opts.nextSlide = i; @@ -894,30 +894,30 @@ $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { go(els,opts,1,opts.currSlide < i); // trigger the trans // return false; // <== allow bubble }; - + if ( /mouseenter|mouseover/i.test(opts.pagerEvent) ) { $a.hover(pagerFn, function(){/* no-op */} ); } else { $a.bind(opts.pagerEvent, pagerFn); } - + if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble) $a.bind('click.cycle', function(){return false;}); // suppress click - + var cont = opts.$cont[0]; var pauseFlag = false; // https://github.com/malsup/cycle/issues/44 if (opts.pauseOnPagerHover) { $a.hover( - function() { + function() { pauseFlag = true; - cont.cyclePause++; + cont.cyclePause++; triggerPause(cont,true,true); - }, function() { + }, function() { if (pauseFlag) - cont.cyclePause--; + cont.cyclePause--; triggerPause(cont,true,true); - } + } ); } }; @@ -990,7 +990,7 @@ $.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) { }; $l.animate(opts.animOut, speedOut, easeOut, function() { $l.css(opts.cssAfter); - if (!opts.sync) + if (!opts.sync) fn(); }); if (opts.sync) fn(); diff --git a/plugins/jetpack/modules/shortcodes/polldaddy.php b/plugins/jetpack/modules/shortcodes/polldaddy.php index 7eb30edf..6b46da7f 100644 --- a/plugins/jetpack/modules/shortcodes/polldaddy.php +++ b/plugins/jetpack/modules/shortcodes/polldaddy.php @@ -8,7 +8,7 @@ class PolldaddyShortcode { static $add_script = false; static $scripts = false; - + /** * Add all the actions & resgister the shortcode */ @@ -27,7 +27,7 @@ class PolldaddyShortcode { function polldaddy_shortcode( $atts ) { global $post; global $content_width; - + extract( shortcode_atts( array( 'survey' => null, 'link_text' => 'Take Our Survey', @@ -52,48 +52,48 @@ class PolldaddyShortcode { 'domain' => '', 'id' => '' ), $atts ) ); - + if ( ! is_array( $atts ) ) { return ''; } - + $inline = false; $no_script = false; $infinite_scroll = false; - + if ( is_home() && current_theme_supports( 'infinite-scroll' ) ) $infinite_scroll = true; - + if ( defined( 'PADPRESS_LOADED' ) ) $inline = true; - + if ( function_exists( 'get_option' ) && get_option( 'polldaddy_load_poll_inline' ) ) $inline = true; - + if ( is_feed() || ( defined( 'DOING_AJAX' ) && !$infinite_scroll ) ) $no_script = false; - + self::$add_script = $infinite_scroll; - - if ( intval( $rating ) > 0 && !$no_script ) { //rating embed - + + if ( intval( $rating ) > 0 && !$no_script ) { //rating embed + if ( empty( $unique_id ) ) $unique_id = is_page() ? 'wp-page-'.$post->ID : 'wp-post-'.$post->ID; - + if ( empty( $item_id ) ) $item_id = is_page() ? '_page_'.$post->ID : '_post_'.$post->ID; - + if ( empty( $title ) ) $title = apply_filters( 'wp_title', $post->post_title, '', '' ); - + if ( empty( $permalink ) ) $permalink = get_permalink( $post->ID ); - + $rating = intval( $rating ); $unique_id = wp_strip_all_tags( $unique_id ); $item_id = wp_strip_all_tags( $item_id ); $item_id = preg_replace( '/[^_a-z0-9]/i', '', $item_id ); - + $settings = json_encode( array( 'id' => $rating, 'unique_id' => $unique_id, @@ -101,10 +101,10 @@ class PolldaddyShortcode { 'permalink' => esc_url( $permalink ), 'item_id' => $item_id ) ); - + $item_id = esc_js( $item_id ); - - if ( $inline ) { + + if ( $inline ) { return << @@ -305,15 +305,15 @@ polldaddy.add( {$settings} ); //--> CONTAINER; - } + } } else return ''; } - + function generate_scripts() { $script = ''; - + if ( is_array( self::$scripts ) ) { if ( isset( self::$scripts['rating'] ) ) { $script = ""; - + } - + if ( isset( self::$scripts['poll'] ) ) { foreach( self::$scripts['poll'] as $poll ) { $script .= ""; } } } - + self::$scripts = false; echo $script; } @@ -365,8 +365,8 @@ CONTAINER; wp_pd_js.type = 'text/javascript'; wp_pd_js.src = $script_url; wp_pd_js.async = true; - wp_pd_js.onload = function() { - jQuery( document.body ).trigger( 'pd-script-load' ); + wp_pd_js.onload = function() { + jQuery( document.body ).trigger( 'pd-script-load' ); }; document.getElementsByTagName( 'head' )[0].appendChild( wp_pd_js ); } else { @@ -375,7 +375,7 @@ CONTAINER; //]]> SCRIPT; - + } } } @@ -388,7 +388,7 @@ if ( !function_exists( 'polldaddy_link' ) ) { function polldaddy_link( $content ) { return preg_replace( '!(?:\n|\A)http://polldaddy.com/poll/([0-9]+?)/(.+)?(?:\n|\Z)!i', "\n\n", $content ); } - + // higher priority because we need it before auto-link and autop get to it add_filter( 'the_content', 'polldaddy_link', 1 ); add_filter( 'the_content_rss', 'polldaddy_link', 1 ); diff --git a/plugins/jetpack/modules/shortcodes/slideshare.php b/plugins/jetpack/modules/shortcodes/slideshare.php index 012b9c7b..97d9d446 100644 --- a/plugins/jetpack/modules/shortcodes/slideshare.php +++ b/plugins/jetpack/modules/shortcodes/slideshare.php @@ -1,8 +1,8 @@ ID, 'full' ); $attachment_image_src = $attachment_image_src[0]; // [url, width, height] - $caption = wptexturize( strip_tags( $attachment->post_excerpt ) ); + $caption = apply_filters( 'jetpack_slideshow_slide_caption', wptexturize( strip_tags( $attachment->post_excerpt ) ), $attachment->ID ); $gallery[] = (object) array( 'src' => (string) esc_url_raw( $attachment_image_src ), diff --git a/plugins/jetpack/modules/shortcodes/ted.php b/plugins/jetpack/modules/shortcodes/ted.php index afd35961..4edc2882 100644 --- a/plugins/jetpack/modules/shortcodes/ted.php +++ b/plugins/jetpack/modules/shortcodes/ted.php @@ -13,6 +13,10 @@ wp_oembed_add_provider( '!https?://(www\.)?ted.com/talks/view/id/.+!i', 'http://www.ted.com/talks/oembed.json', true ); wp_oembed_add_provider( '!https?://(www\.)?ted.com/talks/[a-zA-Z\-\_]+\.html!i', 'http://www.ted.com/talks/oembed.json', true ); +function jetpack_shortcode_get_ted_id( $atts ) { + return ( ! empty( $atts['id'] ) ? $atts['id'] : 0 ); +} + add_shortcode( 'ted', 'shortcode_ted' ); function shortcode_ted( $atts, $content = '' ) { global $wp_embed; diff --git a/plugins/jetpack/modules/shortcodes/videopress.php b/plugins/jetpack/modules/shortcodes/videopress.php index 6aebae03..6a3a75b0 100644 --- a/plugins/jetpack/modules/shortcodes/videopress.php +++ b/plugins/jetpack/modules/shortcodes/videopress.php @@ -8,7 +8,7 @@ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html */ -/* +/* Plugin Name: VideoPress Plugin URI: http://wordpress.org/extend/plugins/video/ Description: Upload new videos to VideoPress, edit metadata, and easily insert VideoPress videos into posts and pages using shortcodes. Requires a WordPress.com account and a WordPress.com blog with the VideoPress upgrade to store and serve uploaded videos. @@ -113,7 +113,7 @@ class VideoPress { public static function find_all_shortcodes( $content ) { $r = preg_match_all( '/(.?)\[(wpvideo|videopress)\b(.*?)(?:(\/))?\](?:(.+?)\[\/\2\])?(.?)/s', $content, $matches, PREG_SET_ORDER ); - if ( $r === false || $r === 0 ) + if ( $r === false || $r === 0 ) return array(); $guids = array(); @@ -187,11 +187,11 @@ class VideoPress { wp_enqueue_script( 'swfobject', $swfobject, false. '2.2' ); wp_enqueue_script( 'jquery', $jquery, false, '1.4.4' ); wp_enqueue_script( 'videopress', $vpjs, array( 'jquery','swfobject' ), '1.09' ); - + $this->js_loaded = true; return true; } - + /** * Print the VideoPress JS files now. * Used to load the JS in the footer, if it hasn't already been loaded in the header. @@ -218,7 +218,7 @@ class VideoPress { $guid = $attr[0]; if ( ! self::is_valid_guid( $guid ) ) return ''; - + if ( array_key_exists( $guid, $this->shown ) ) $this->shown[$guid]++; else @@ -238,7 +238,7 @@ class VideoPress { */ if ( $freedom === false && (bool) get_option( 'video_player_freedom', false ) ) $freedom = true; - + $forcestatic = get_option( 'video_player_static', false ); /** @@ -360,7 +360,7 @@ class VideoPress_Video { * * @var int * @since 1.3 - */ + */ public $calculated_height; /** @@ -787,7 +787,7 @@ class VideoPress_Player { public function asXML() { if ( empty( $this->video ) || is_wp_error( $this->video ) ) return ''; - + if ( isset( $this->options['freedom'] ) && $this->options['freedom'] === true ) $content = $this->html5_static(); else @@ -883,7 +883,7 @@ class VideoPress_Player { * @link https://developer.mozilla.org/en/JavaScript/Reference/global_objects/date Mozilla JavaScript Reference: Date */ $html .= ' name='admin_bar' id='admin_bar' /> - - + + +
    + $details ) { + ?> +
    + +
    makes the world a better place but should still work when hidden', 'jetpack' ); ?> <?php esc_attr_e( 'Smiley face', 'jetpack' ); ?> @@ -544,7 +567,7 @@ function stats_configuration_screen() { - +

    ' />

    @@ -552,6 +575,14 @@ function stats_configuration_screen() { + $post ) { + if ( $post['post_id'] == 0 ) { + unset( $top_posts[$i] ); + continue; + } $post_ids[] = $post['post_id']; + } // cache get_posts( array( 'include' => join( ',', array_unique( $post_ids ) ) ) ); $searches = array(); - foreach ( $search_terms = stats_get_csv( 'searchterms', "days=$options[search]$csv_args[search]" ) as $search_term ) + foreach ( $search_terms = stats_get_csv( 'searchterms', "days=$options[search]$csv_args[search]" ) as $search_term ) { + if ( $search_term['searchterm'] == 'encrypted_search_terms' ) + continue; $searches[] = esc_html( $search_term['searchterm'] ); + } ?> diff --git a/plugins/jetpack/modules/subscriptions.php b/plugins/jetpack/modules/subscriptions.php index 39c639ff..22366d07 100644 --- a/plugins/jetpack/modules/subscriptions.php +++ b/plugins/jetpack/modules/subscriptions.php @@ -4,10 +4,11 @@ * Module Description: Allow users to subscribe to your posts and comments to receive a notification via email. * Sort Order: 3 * First Introduced: 1.2 + * Requires Connection: Yes */ add_action( 'jetpack_modules_loaded', 'jetpack_subscriptions_load' ); - + Jetpack_Sync::sync_options( __FILE__, 'home', 'blogname', @@ -42,7 +43,7 @@ class Jetpack_Subscriptions { * Singleton * @static */ - function init() { + static function init() { static $instance = false; if ( !$instance ) { @@ -101,7 +102,7 @@ class Jetpack_Subscriptions { * * Jetpack Subscriptions configuration screen. */ - function configure() { + function configure() { // Create the section add_settings_section( 'jetpack_subscriptions', @@ -139,37 +140,37 @@ class Jetpack_Subscriptions { 'discussion', 'stc_enabled' ); - + /** Subscription Messaging Options ******************************************************/ - - register_setting( - 'reading', - 'subscription_options', - array( $this, 'validate_settings' ) + + register_setting( + 'reading', + 'subscription_options', + array( $this, 'validate_settings' ) ); - add_settings_section( - 'email_settings', - __( 'Follower Settings', 'jetpack' ), - array( $this, 'reading_section' ), + add_settings_section( + 'email_settings', + __( 'Follower Settings', 'jetpack' ), + array( $this, 'reading_section' ), 'reading' ); - + add_settings_field( 'invitation', - __( 'Blog follow email text' , 'jetpack' ), - array( $this, 'setting_invitation' ), - 'reading', + __( 'Blog follow email text' , 'jetpack' ), + array( $this, 'setting_invitation' ), + 'reading', 'email_settings' ); add_settings_field( 'comment-follow', - __( 'Comment follow email text', 'jetpack' ), - array( $this, 'setting_comment_follow' ), - 'reading', + __( 'Comment follow email text', 'jetpack' ), + array( $this, 'setting_comment_follow' ), + 'reading', 'email_settings' - ); + ); } /** @@ -255,11 +256,11 @@ class Jetpack_Subscriptions { 'comment_follow' => __( "Howdy.\n\nYou recently followed one of my posts. This means you will receive an email when new comments are posted.\n\nTo activate, click confirm below. If you believe this is an error, ignore this message and we'll never bother you again." , 'jetpack') ); } - + function get_settings() { return wp_parse_args( (array) get_option( 'subscription_options', array() ), $this->get_default_settings() ); } - + /** * Jetpack_Subscriptions::subscribe() * @@ -658,7 +659,7 @@ class Jetpack_Subscriptions_Widget extends WP_Widget { return $instance; } - function defaults() { + public static function defaults() { return array( 'title' => esc_html__( 'Subscribe to Blog via Email', 'jetpack' ), 'subscribe_text' => esc_html__( 'Enter your email address to subscribe to this blog and receive notifications of new posts by email.', 'jetpack' ), @@ -680,7 +681,7 @@ class Jetpack_Subscriptions_Widget extends WP_Widget { if ( 'failed' == $subs_fetch['status'] ) { printf( '

    ' . __( '%s: %s', 'jetpack' ) . '

    ', esc_html( $subs_fetch['code'] ), esc_html( $subs_fetch['message'] ) ); - + } $subscribers_total = number_format_i18n( $subs_fetch['value'] ); @@ -706,7 +707,7 @@ class Jetpack_Subscriptions_Widget extends WP_Widget {

    gallery_classes() . ' data-original-width="' . esc_attr( self::get_content_width() ) . '">'; $blog_id = (int) get_current_blog_id(); - $extra_data = array( 'data-carousel-extra' => array( 'blog_id' => $blog_id, 'permalink' => get_permalink( $post->ID ) ) ); + + if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { + $likes_blog_id = $blog_id; + } else { + $jetpack = Jetpack::init(); + $likes_blog_id = $jetpack->get_option( 'id' ); + } + + $extra_data = array( 'data-carousel-extra' => array( 'blog_id' => $blog_id, 'permalink' => get_permalink( $post->ID ), 'likes_blog_id' => $likes_blog_id ) ); foreach ( (array) $extra_data as $data_key => $data_values ) { $html = str_replace( '
    atts['type'] ) . '"'; + $classes = 'class="tiled-gallery type-' . esc_attr( $this->atts['type'] ) . ' tiled-gallery-unresized"'; return $classes; } @@ -283,9 +292,7 @@ class Jetpack_Tiled_Gallery { } public static function get_content_width() { - global $content_width; - - $tiled_gallery_content_width = $content_width; + $tiled_gallery_content_width = Jetpack::get_content_width(); if ( ! $tiled_gallery_content_width ) $tiled_gallery_content_width = 500; @@ -297,12 +304,24 @@ class Jetpack_Tiled_Gallery { * Media UI integration */ function jetpack_gallery_types( $types ) { - $types['rectangular'] = __( 'Tiles', 'jetpack' ); + if ( get_option( 'tiled_galleries' ) && isset( $types['default'] ) ) { + // Tiled is set as the default, meaning that type='default' + // will still display the mosaic. + $types['thumbnails'] = $types['default']; + unset( $types['default'] ); + } + + $types['rectangular'] = __( 'Tiled Mosaic', 'jetpack' ); $types['square'] = __( 'Square Tiles', 'jetpack' ); $types['circle'] = __( 'Circles', 'jetpack' ); + return $types; } + function jetpack_default_gallery_type( $default ) { + return ( get_option( 'tiled_galleries' ) ? 'rectangular' : 'default' ); + } + /** * Add a checkbox field to the Carousel section in Settings > Media * for setting tiled galleries as the default. @@ -348,8 +367,7 @@ class Jetpack_Tiled_Gallery_Shape { } public function is_wide_theme() { - global $content_width; - return $content_width > 1000; + return Jetpack::get_content_width() > 1000; } public static function set_last_shape( $last_shape ) { diff --git a/plugins/jetpack/modules/tiled-gallery/tiled-gallery/rtl/tiled-gallery-rtl.css b/plugins/jetpack/modules/tiled-gallery/tiled-gallery/rtl/tiled-gallery-rtl.css index 007c0ccf..a6b7aef0 100644 --- a/plugins/jetpack/modules/tiled-gallery/tiled-gallery/rtl/tiled-gallery-rtl.css +++ b/plugins/jetpack/modules/tiled-gallery/tiled-gallery/rtl/tiled-gallery-rtl.css @@ -1,4 +1,4 @@ -/* This file was automatically generated on Jan 05 2013 15:45:53 */ +/* This file was automatically generated on Jul 03 2013 18:11:40 */ /* =Tiled Gallery Default Styles -------------------------------------------------------------- */ @@ -13,13 +13,13 @@ } .tiled-gallery .gallery-group { float: right; - overflow-y: hidden; position: relative; } .tiled-gallery .tiled-gallery-item { float: right; margin: 0; position: relative; + width: inherit; /* prevents ie8 bug with inline width styles */ } .tiled-gallery .gallery-row { overflow: hidden; @@ -62,6 +62,14 @@ font-size: 11px; } +/* Hide galleries in widgets until they've been resized to fit. + Gallery widgets are almost guaranteed to need resizing, and + the jump is a little more obvious than galleries in content. */ +.widget-gallery .tiled-gallery-unresized { + visibility: hidden; + height: 0px; + overflow: hidden; +} /* =Greyscale -------------------------------------------------------------- */ @@ -85,4 +93,5 @@ .tiled-gallery.type-circle .tiled-gallery-caption { display: none; opacity: 0; -} \ No newline at end of file +} + diff --git a/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.css b/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.css index 3a1924df..c80a5b0d 100644 --- a/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.css +++ b/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.css @@ -17,6 +17,7 @@ float: left; margin: 0; position: relative; + width: inherit; /* prevents ie8 bug with inline width styles */ } .tiled-gallery .gallery-row { overflow: hidden; @@ -59,6 +60,14 @@ font-size: 11px; } +/* Hide galleries in widgets until they've been resized to fit. + Gallery widgets are almost guaranteed to need resizing, and + the jump is a little more obvious than galleries in content. */ +.widget-gallery .tiled-gallery-unresized { + visibility: hidden; + height: 0px; + overflow: hidden; +} /* =Greyscale -------------------------------------------------------------- */ @@ -82,4 +91,5 @@ .tiled-gallery.type-circle .tiled-gallery-caption { display: none; opacity: 0; -} \ No newline at end of file +} + diff --git a/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.js b/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.js index 90f8ed76..bedb5b52 100644 --- a/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.js +++ b/plugins/jetpack/modules/tiled-gallery/tiled-gallery/tiled-gallery.js @@ -9,13 +9,13 @@ var TiledGallery = function() { $( window ).on( 'resize', function () { clearTimeout( self.resizeTimeout ); - + self.resizeTimeout = setTimeout( function () { self.resize(); }, 150 ); } ); // Make any new galleries loaded by Infinite Scroll flexible $( 'body' ).on( 'post-load', $.proxy( self.initialize, self ) ); - + // Populate and set up captions on newdash galleries. $( document ).on( 'page-rendered.wpcom-newdash', $.proxy( self.populate, self ) ); @@ -51,9 +51,10 @@ TiledGallery.prototype.Captions = function() { /* Hide captions */ this.caption.hide(); - this.item.on( 'hover', function() { - $( this ).find( '.tiled-gallery-caption' ).slideToggle( 'fast' ); - }); + this.item.hover( + function() { $( this ).find( '.tiled-gallery-caption' ).slideDown( 'fast' ); }, + function() { $( this ).find( '.tiled-gallery-caption' ).slideUp( 'fast' ); } + ); }; TiledGallery.prototype.resize = function() { @@ -61,7 +62,7 @@ TiledGallery.prototype.resize = function() { this.gallery.each( function ( galleryIndex, galleryElement ) { var thisGallery = $( galleryElement ); - + // All images must be loaded before proceeding. var imagesLoaded = true; @@ -134,6 +135,8 @@ TiledGallery.prototype.resize = function() { .width( Math.floor( resizeRatio * thisGalleryElement.data( 'original-width' ) ) - thisGalleryElement.data( 'extra-width' ) ) .height( Math.floor( resizeRatio * thisGalleryElement.data( 'original-height' ) ) - thisGalleryElement.data( 'extra-height' ) ); } ); + + thisGallery.removeClass( 'tiled-gallery-unresized' ); } ); }; diff --git a/plugins/jetpack/modules/vaultpress.php b/plugins/jetpack/modules/vaultpress.php index a9b809c2..7766f539 100644 --- a/plugins/jetpack/modules/vaultpress.php +++ b/plugins/jetpack/modules/vaultpress.php @@ -1,4 +1,4 @@ -normalize_facebook_args( $instance['like_args'] ); - + if ( empty( $like_args['href'] ) || ! $this->is_valid_facebook_url( $like_args['href'] ) ) { if ( current_user_can('edit_theme_options') ) { echo $before_widget; @@ -51,7 +51,7 @@ class WPCOM_Widget_Facebook_LikeBox extends WP_Widget { echo ''; return; } - + $title = apply_filters( 'widget_title', $instance['title'] ); $page_url = ( is_ssl() ) ? str_replace( 'http://', 'https://', $like_args['href'] ) : $like_args['href']; @@ -59,16 +59,17 @@ class WPCOM_Widget_Facebook_LikeBox extends WP_Widget { $like_args['show_faces'] = (bool) $like_args['show_faces'] ? 'true' : 'false'; $like_args['stream'] = (bool) $like_args['stream'] ? 'true' : 'false'; $like_args['force_wall'] = (bool) $like_args['force_wall'] ? 'true' : 'false'; + $like_args['show_border']= (bool) $like_args['show_border'] ? 'true' : 'false'; $like_args['header'] = (bool) $like_args['header'] ? 'true' : 'false'; - $like_bg_colour = ( 'dark' == $like_args['colorscheme'] ) ? '#000' : '#fff'; - + $like_bg_colour = apply_filters( 'jetpack_fb_likebox_bg', ( 'dark' == $like_args['colorscheme'] ? '#000' : '#fff' ), $like_args['colorscheme'] ); + $locale = $this->get_locale(); if ( $locale && 'en_US' != $locale ) $like_args['locale'] = $locale; $like_args = urlencode_deep( $like_args ); $like_url = add_query_arg( $like_args, sprintf( '%swww.facebook.com/plugins/likebox.php', ( is_ssl() ) ? 'https://' : 'http://' ) ); - + echo $before_widget; if ( ! empty( $title ) ) : @@ -85,13 +86,13 @@ class WPCOM_Widget_Facebook_LikeBox extends WP_Widget { } function update( $new_instance, $old_instance ) { - $instance = array( + $instance = array( 'title' => '', 'like_args' => $this->get_default_args(), ); $instance['title'] = trim( strip_tags( stripslashes( $new_instance['title'] ) ) ); - + // Set up widget values $instance['like_args'] = array( 'href' => trim( strip_tags( stripslashes( $new_instance['href'] ) ) ), @@ -100,30 +101,31 @@ class WPCOM_Widget_Facebook_LikeBox extends WP_Widget { 'colorscheme' => $new_instance['colorscheme'], 'show_faces' => (bool) $new_instance['show_faces'], 'stream' => (bool) $new_instance['stream'], + 'show_border' => (bool) $new_instance['show_border'], 'header' => false, // The header just displays "Find us on Facebook"; it's redundant with the title 'force_wall' => (bool) $new_instance['force_wall'], ); - + $instance['like_args'] = $this->normalize_facebook_args( $instance['like_args'] ); return $instance; } function form( $instance ) { - $instance = wp_parse_args( (array) $instance, array( + $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'like_args' => $this->get_default_args() ) ); $like_args = $this->normalize_facebook_args( $instance['like_args'] ); ?> - +

    - +

    - +

    - +

    - - +

    - +

    +

    + +

    +

    - + '', @@ -196,13 +206,14 @@ class WPCOM_Widget_Facebook_LikeBox extends WP_Widget { 'colorscheme' => $this->default_colorscheme, 'show_faces' => true, 'stream' => false, + 'show_border' => true, 'header' => false, 'force_wall' => false, ); return apply_filters( 'jetpack_facebook_likebox_defaults', $defaults ); } - + function normalize_facebook_args( $args ) { $args = wp_parse_args( (array) $args, $this->get_default_args() ); @@ -219,6 +230,7 @@ class WPCOM_Widget_Facebook_LikeBox extends WP_Widget { $args['colorscheme'] = $this->normalize_text_value( $args['colorscheme'], $this->default_colorscheme, $this->allowed_colorschemes ); $args['show_faces'] = (bool) $args['show_faces']; $args['stream'] = (bool) $args['stream']; + $args['show_border'] = (bool) $args['show_border']; $args['force_wall'] = (bool) $args['force_wall']; // The height used to be dependent on other widget settings @@ -233,32 +245,32 @@ class WPCOM_Widget_Facebook_LikeBox extends WP_Widget { $args['height'] = 432; } } - + return $args; } - + function is_valid_facebook_url( $url ) { return ( FALSE !== strpos( $url, 'facebook.com' ) ) ? TRUE : FALSE; } - + function normalize_int_value( $value, $default = 0, $max = 0, $min = 0 ) { $value = (int) $value; - + if ( $max < $value || $min > $value ) $value = $default; - + return (int) $value; } - + function normalize_text_value( $value, $default = '', $allowed = array() ) { $allowed = (array) $allowed; - + if ( empty( $value ) || ( ! empty( $allowed ) && ! in_array( $value, $allowed ) ) ) $value = $default; - - return $value; + + return $value; } - + function guess_locale_from_lang( $lang ) { if ( 'en' == $lang || 'en_US' == $lang || !$lang ) { return 'en_US'; diff --git a/plugins/jetpack/modules/widgets/gravatar-profile.css b/plugins/jetpack/modules/widgets/gravatar-profile.css index 1663ae07..9b1e70cc 100644 --- a/plugins/jetpack/modules/widgets/gravatar-profile.css +++ b/plugins/jetpack/modules/widgets/gravatar-profile.css @@ -11,7 +11,7 @@ list-style: none; display: inline; } - + .widget-grofile ul.grofile-accounts li::before { content: "" !important; /* Kubrick :( */ } diff --git a/plugins/jetpack/modules/widgets/readmill.php b/plugins/jetpack/modules/widgets/readmill.php index 7729ed3e..2fe189eb 100644 --- a/plugins/jetpack/modules/widgets/readmill.php +++ b/plugins/jetpack/modules/widgets/readmill.php @@ -44,7 +44,7 @@ class Jetpack_Readmill_Widget extends WP_Widget { $size = isset( $instance['size'] ) ? $instance['size'] : $this->default_size; ?> -

    the Readmill WordPress Widget support page." ), 'http://en.support.wordpress.com/widgets/readmill/' ); ?>

    +

    the Readmill WordPress Widget support page.", 'jetpack' ), 'http://en.support.wordpress.com/widgets/readmill/' ); ?>

    diff --git a/plugins/jetpack/modules/widgets/rsslinks-widget.php b/plugins/jetpack/modules/widgets/rsslinks-widget.php index 15309151..cd930ccb 100644 --- a/plugins/jetpack/modules/widgets/rsslinks-widget.php +++ b/plugins/jetpack/modules/widgets/rsslinks-widget.php @@ -136,7 +136,7 @@ class Jetpack_RSS_Links_Widget extends WP_Widget { $type_text = __( 'Comments', 'jetpack' ); $rss_type = 'comments_rss2_url'; } - + $subscribe_to = sprintf( __( 'Subscribe to %s', 'jetpack'), $type_text ); $link_item = ''; diff --git a/plugins/jetpack/modules/widgets/top-posts.php b/plugins/jetpack/modules/widgets/top-posts.php index b6f2c8d7..ec55fe74 100644 --- a/plugins/jetpack/modules/widgets/top-posts.php +++ b/plugins/jetpack/modules/widgets/top-posts.php @@ -57,7 +57,7 @@ class Jetpack_Top_Posts_Widget extends WP_Widget { } $count = isset( $instance['count'] ) ? (int) $instance['count'] : 10; - if ( $count < 1 || 20 < $count ) { + if ( $count < 1 || 10 < $count ) { $count = 10; } @@ -75,8 +75,8 @@ class Jetpack_Top_Posts_Widget extends WP_Widget {

    - - + +

    @@ -101,7 +101,7 @@ class Jetpack_Top_Posts_Widget extends WP_Widget { } $instance['count'] = (int) $new_instance['count']; - if ( $instance['count'] < 1 || 20 < $instance['count'] ) { + if ( $instance['count'] < 1 || 10 < $instance['count'] ) { $instance['count'] = 10; } @@ -121,7 +121,7 @@ class Jetpack_Top_Posts_Widget extends WP_Widget { $title = apply_filters( 'widget_title', $title ); $count = isset( $instance['count'] ) ? (int) $instance['count'] : false; - if ( $count < 1 || 20 < $count ) { + if ( $count < 1 || 10 < $count ) { $count = 10; } @@ -175,7 +175,7 @@ class Jetpack_Top_Posts_Widget extends WP_Widget { case 'grid' : wp_enqueue_style( 'widget-grid-and-list' ); foreach ( $posts as &$post ) { - $image = Jetpack_PostImages::get_image( $post['post_id'] ); + $image = Jetpack_PostImages::get_image( $post['post_id'], array( 'fallback_to_avatars' => true ) ); $post['image'] = $image['src']; if ( 'blavatar' != $image['from'] && 'gravatar' != $image['from'] ) { $size = (int) $get_image_options['avatar_size']; @@ -268,6 +268,10 @@ class Jetpack_Top_Posts_Widget extends WP_Widget { if ( !$post ) continue; + // Only posts and pages, no attachments + if ( 'attachment' == $post->post_type ) + continue; + // hide private and password protected posts if ( 'publish' != $post->post_status || !empty( $post->post_password ) || empty( $post->ID ) ) continue; diff --git a/plugins/jetpack/readme.txt b/plugins/jetpack/readme.txt index f4808dd2..c66fce3c 100644 --- a/plugins/jetpack/readme.txt +++ b/plugins/jetpack/readme.txt @@ -1,9 +1,9 @@ === Jetpack by WordPress.com === -Contributors: automattic, apeatling, beaulebens, hugobaeta, Joen, mdawaffe, andy, designsimply, hew, westi, eoigal, tmoorewp, matt, pento, cfinke, daniloercoli, chellycat, gibrown, jblz, jshreve, barry, alternatekev, azaozz, ethitter, johnjamesjacoby, lancewillett, martinremy, nickmomrik, stephdau, yoavf, matveb, jeherve +Contributors: automattic, alternatekev, andy, apeatling, azaozz, barry, beaulebens, blobaugh, cfinke, chellycat, danielbachhuber, daniloercoli, designsimply, eoigal, ethitter, gibrown, georgestephanis, hew, hugobaeta, iammattthomas, jblz, jeherve, jkudish, Joen, johnjamesjacoby, jshreve, lancewillett, martinremy, matt, matveb, mdawaffe, migueluy, nickmomrik, pento, stephdau, tmoorewp, Viper007Bond, westi, yoavf Tags: WordPress.com, statistics, stats, views, tweets, twitter, widget, gravatar, hovercards, profile, equations, latex, math, maths, youtube, shortcode, archives, audio, blip, bliptv, dailymotion, digg, flickr, googlevideo, google, googlemaps, kyte, kytetv, livevideo, redlasso, rockyou, rss, scribd, slide, slideshare, soundcloud, vimeo, shortlinks, wp.me, subscriptions, notifications, notes, json, api, rest, mosaic, gallery, slideshow Requires at least: 3.3 Tested up to: 3.5 -Stable tag: 2.2 +Stable tag: 2.3.3 Supercharge your WordPress site with powerful features previously only available to WordPress.com users. @@ -36,6 +36,8 @@ Features include: * Mobile push notifications for new comments via WordPress mobile apps. * The ability to allow applications to securely authenticate and access your site with your permission. * Creative formats for your image galleries: mosaic, circles, squares, and a slideshow view. +* Add post sliders and other highlights to your theme with Featured Content. +* Search once, get results from everything! A single search box that lets you search posts, pages, comments, and plugins * and *many* more to come! Note: The stats portion of Jetpack uses Quantcast to enhance its data. @@ -58,25 +60,12 @@ Jetpack requires a connection to [WordPress.com](http://wordpress.com/) to enabl Once you've installed Jetpack, your stats will be available via the "Site Stats" menu which appears in the new Jetpack menu (under your Dashboard menu within WordPress). -= How do I embed media? = - -Use [shortcodes](http://support.wordpress.com/shortcodes/) to embed your media. Currently, Jetpack provides the following shortcodes. - -* [[archives]](http://support.wordpress.com/archives-shortcode/) -* [[audio]](http://support.wordpress.com/audio/) -* [[blip.tv]](http://support.wordpress.com/videos/bliptv/) -* [[dailymotion]](http://support.wordpress.com/videos/dailymotion/) -* [[digg]](http://support.wordpress.com/digg/) -* [[flickr]](http://support.wordpress.com/videos/flickr-video/) -* [[googlemaps]](http://en.support.wordpress.com/google-maps/) -* [[googlevideo]](http://support.wordpress.com/videos/google-video/) -* [[polldaddy]](http://support.polldaddy.com/wordpress-shortcodes/) -* [[scribd]](http://support.wordpress.com/scribd/) -* [[slideshare]](http://support.wordpress.com/slideshows/slideshare/) -* [[soundcloud]](http://support.wordpress.com/audio/soundcloud-audio-player/) -* [[videopress]](http://support.wordpress.com/videopress/) -* [[vimeo]](http://support.wordpress.com/videos/vimeo/) -* [[youtube]](http://support.wordpress.com/videos/youtube/) += How do I contribute to Jetpack? = + +Easy! There are a couple of ways (more coming soon): + +* Give us a hand answering questions in our [support forum](http://wordpress.org/support/plugin/jetpack) +* Report bugs, with reproduction steps, or post patches on our [Trac](http://plugins.trac.wordpress.org/newticket?component=jetpack) == Screenshots == @@ -91,6 +80,185 @@ Use [shortcodes](http://support.wordpress.com/shortcodes/) to embed your media. == Changelog == += 2.3.3 = +* Bug Fix: We were inadvertently overwriting cron schedules with our Jetpack heartbeat. This should now be fixed. +* Enhancement: New Facebook Sharing icons. +* Enhancement: Minor update to the Minileven stylesheet. + += 2.3.2 = +* Bug Fix: Fixed an issue where Facebook Pages were not available when connecting a Publicize account. +* Bug Fix: For some web hosts, fixed an issue where 'Jetpack ID' error would occur consistently on connecting to WordPress.com. +* Enhancement: Adding some new stats and heartbeat checking to Jetpack. + += 2.3.1 = +* Enhancement: Social Links: Retooling the class for better consistency and performance behind the scenes. +* Enhancement: Omnisearch: Make it easier to search Custom Post Types. No longer need to extend the class, if all you want is a basic display. Just call `new Jetpack_Omnisearch_Posts( 'cpt' );` +* Enhancement: Sharing Buttons: LinkedIn: Use the official button's sharing link on the Jetpack implementation for a more consistent sharing experience and produce better results on LinkedIn's end. +* Enhancement: Debug / Connection: Better logic in determining whether the server can use SSL to connect to WPCOM servers. +* Enhancement: Sharing: Twitter: Calculate the size of the Tweet based on the short URL rather than the full URL size. +* Enhancement: Debug: More readable and understandable messages. +* Enhancement: Likes: Including some MP6 styles. +* Enhancement: Comments: Add new core classes to comment form. See http://core.trac.wordpress.org/changeset/24525 +* Bug Fix: Omnisearch: Don't load everything initially, run the providers off admin_init, and then issue an action for folks to hook into. +* Bug Fix: Omnisearch: Modify some child class functions to match the parent's parameters and avoid strict notices in newer versions of PHP. +* Bug Fix: Omnisearch: Hide the search form in the module description if the current user can't use it. +* Bug Fix: Comment Form: Use edit_pages, not edit_page (fixes glitch in previous beta, never publicly released). +* Bug Fix: Twitter Timeline Widget: Additional testing of values and casting to default if they are nonconforming. +* Bug Fix: Sharing: Pinterest: Make the button wider if there's a count to avoid overlapping with others. +* Bug Fix: Post By Email: Change configuration_redirect to static. +* Bug Fix: Likes: Don't call configuration_redirect as a static, do it as a method. +* Bug Fix: Add some further security measures to module activation. + += 2.3 = +* Enhancement: Omnisearch: Search once, get results from everything! Omnisearch is a single search box that lets you search many different things +* Enhancement: Debugger: this module helps you debug connection issues right from your dashboard, and contact the Jetpack support team if needed +* Enhancement: Social Links: this module is a canonical source, based on Publicize, that themes can use to let users specify where social icons should link to +* Enhancement: It’s now easier to find out if a module is active or note, thanks to the new Jetpack::is_module_active() +* Enhancement: Contact Form: You are now able to customize the submit button text thanks to the submit_button_text parameter +* Enhancement: Comments: We've added a filter to let users customize the Comment Reply label, and users can now also customize the prompt on the comment form again. +* Enhancement: Mobile Theme: Add genericons.css and registering it so it’s easily accessible to other modules that may want it +* Enhancement: Tiled Galleries: You can now customize the captions, thanks to the jetpack_slideshow_slide_caption filter +* Enhancement: Widgets: Twitter Timeline: Add the noscrollbar option +* Enhancement: Widgets: Facebook Like Box Widget: add a show_border attribute +* Enhancement: Widgets: FB Like Box: let Jetpack users override the iframe background color set in an inline style attribute by using the jetpack_fb_likebox_bg filter +* Bug Fix: Carousel: Fix a bug where double-clicking a gallery thumbnail broke the carousel functionality +* Bug Fix: Comments: Change “must-log-in” to class from ID +* Bug Fix: Contact Form: Make the Add Contact Form link a button, ala Add Media in core +* Bug Fix: Contact Form: Fix encoding of field labels +* Bug Fix: Contact Form: Remove references to missing images +* Bug Fix: Fix 2 XSS vulnerabilities +* Bug Fix: JSON API: Minor fixes for bbPress compatibility +* Bug Fix: JSON API: Fix metadata bugs +* Bug Fix: JSON API: Add a new hook that is fired when a post is posted using the API +* Bug Fix: JSON API: Prefork/REST: update path normalizer to accept versions other than 1 +* Bug Fix: JSON API: Remove extra parenthesis in CSS +* Bug Fix: Custom CSS: Move content width filters higher up so that they’re active for all users, not just logged-in admins. +* Bug Fix: Custom CSS: All CSS properties that accept images as values need to be allowed to be declared multiple times so that cross-browser gradients work +* Bug Fix: Infinite Scroll: Allow themes to define a custom function to render the IS footer +* Bug Fix: Infinite Scroll: Fix up Twenty Thirteen styles for RTL and small viewports. +* Bug Fix: Likes: Fix ‘Call to undefined function’ +* Bug Fix: Likes: Add scrolling no to iframe to make sure that like button in admin bar does not show scrollbars +* Bug Fix: Likes: Remove setInterval( JetpackLikesWidgetQueueHandler, 250 ) call that was causing heavy CPU load +* Bug Fix: Mobile Theme: Remove unused variable & function call +* Bug Fix: Publicize: Fix LinkedIn profile URL generation +* Bug Fix: Publicize: Better refresh handling for services such as LinkedIn and Facebook +* Bug Fix: Shortcodes: Audio shortcode: Treat src as element 0. Fixes audio shortcodes created by wp_embed_register_handler when an audio url is on a line by itself +* Bug Fix: Bandcamp: Updates to the Bandcamp shortcode +* Bug Fix: Stats: Fix missing function get_editable_roles on non-admin page loads +* Bug Fix: Widgets: Twitter Timeline: Fix HTML links in admin; set default values for width/height; change some of the sanitization functions +* Bug Fix: Widgets: Top Posts Widget: Exclude attachments +* Bug Fix: Widgets: Top Posts Widget: fix data validation for number of posts +* Bug Fix: Fix PHP warnings non-static method called dynamically +* Bug Fix: Fixed an issue in image extraction from HTML content +* Bug Fix: Open Graph: Change default minimum size for og:image too 200×200 +* Note: The old Twitter widget was removed in favour of Twitter Timeline widget +* Note: Add is_module_active() to make it easier to detect what is and what isn’t +* Note: Compressing images via lossless methods +* Note: Tidying up jetpack’s CSS +* Note: Set the max DB version for our retina overrides that were meant to stop for WordPress 3.5 +* Note: Updating spin.js to the current version, and shifting to the canonical jquery.spin.js library +* Note: Adding Jetpack_Options class, and abstracting out options functions to it + += 2.2.5 = +* Enhancement: Stats: Counting of registered users' views can now be enabled for specific roles +* Bug Fix: Security tightening for metadata support in the REST API +* Bug Fix: Update the method for checking Twitter Timeline widget_id and update coding standards +* Bug Fix: Custom CSS: Allow the content width setting to be larger than the theme's content width +* Bug Fix: Custom CSS: Fix possible missing argument warning. + += 2.2.4 = +* Bug Fix: JSON API compat file include was not assigning a variable correctly, thus throwing errors. This has been resolved. + += 2.2.3 = +* Enhancement: Comments - Add the reply-title H3 to the comment form so that themes or user CSS can style it +* Enhancement: Custom CSS - Support for the CSS @viewport +* Enhancement: JSON API - Support for i_like, is_following, and is_reblogged +* Enhancement: JSON API: Custom Post Type Support +* Enhancement: JSON API: Meta Data Support +* Enhancement: JSON API: Bundled Support for bbPress +* Enhancement: JSON API: Additions of following, reblog, and like status for post endpoints. +* Enhancement: Shortcodes - Add Bandcamp shortcode +* Enhancement: Tiled Galleries - Add code to get blog_id +* Bug Fix: Carousel - Support relative image paths incase a plugin is filtering attachment URLs to be relative instead of absolute +* Bug Fix: Carousel - Add likes widget to images / Respect comment settings for name/email +* Bug Fix: Carousel - Make name and email optional if the setting in the admin area says they are +* Bug Fix: Contact Form - Bug fixes, including a fix for WP-CLI +* Bug Fix: Contact Form - Remove deprecated .live calls, delegate lazily to jQuery(document) since it's all in an iframe modal +* Bug Fix: Contact Form - RTL styles +* Bug Fix: Contact Form - Better handle MP6 icons +* Bug Fix: Custom CSS - array_shift() took a variable by reference, so avoid passing it the result of a function +* Bug Fix: Custom CSS - Allow case-insensitive CSS properties (ref) +* Bug Fix: Infinite Scroll - Maintain main query's `post__not_in` values when querying posts for IS +* Bug Fix: Infinite Scroll - Ensure that IS's `pre_get_posts` method isn't applied in the admin. Also fixes an incorrect use of `add_filter()` where `add_action()` was meant. Fixes #1696-plugins +* Bug Fix: Infinite Scroll - CSS update - IS footer was too large in Firefox +* Bug Fix: Infinite Scroll - Add bundled support for Twenty Thirteen default theme +* Bug Fix: Infinite Scroll - Include posts table's prefix when modifying the SQL WordPress generates to retrieve posts for Infinite Scroll +* Bug Fix: JSON API - Use wp_set_comment_status to change the comment status, to make sure actions are run where needed +* Bug Fix: Likes - Update style and logic for matching id's +* Bug Fix: Mobile Theme - Ensure that minileven_actual_current_theme() is child-theme compatible + other updates +* Bug Fix: Mobile Theme - Update method for finding currently active theme. +* Bug Fix: Notifications - Remove the postmessage.js enqueue since this feature solely supports native postMessage +* Bug Fix: Notifications - Clean up script enqueues and use core versions of underscore and backbone on wpcom as fallbacks +* Bug Fix: Notifications - Enqueue v2 scripts and style +* Bug Fix: Notifications - Prefix module-specific scripts and style to prevent collision +* Bug Fix: Notifications - Include lang and dir attributes on #wpnt-notes-panel so the notifications iframe can use these to display correctly +* Bug Fix: Open Graph: Use the profile OG type instead of author. Add tags for first/last names +* Bug Fix: Publicize - Remove the Yahoo! service because they stopped supporting that API entirely +* Bug Fix: Publicize - fix fatal errors caused by using a method on a non-object. Props @ipstenu +* Bug Fix: Sharing - Adding 2x graphics for Pocket sharing service +* Bug Fix: Sharing - Bug fixes, and a new filter +* Bug Fix: Shortcodes - Audio: make sure that the Jetpack audion shortcode does not override the 3.6 core audio shortcode. Also, we need to filter the old Jetpack-style shortcode to properly set the params for the Core audio shortcode. +* Bug Fix: Shortcodes - Audio: Re-enable the flash player +* Bug Fix: Shortcodes - Slideshow: RTL styling update +* Bug Fix: Tiled Galleries - Fix IE8 display bug where it doesn't honor inline CSS for width on images +* Bug Fix: Tiled Galleries - Remove depreacted hover call, use mouseenter mouseleave instead +* Enhancement: Twitter Timeline Widget: New JavaScript based widget. Old one will discontinue May 7th. + += 2.2.2 = +* Enhancement: Mobile Theme: Add controls for custom CSS. +* Enhancement: Sharing: Add Pocket to the available services. +* Bug Fix: Custom CSS: Update the method for generating content width setting. +* Bug Fix: JSON API: Security updates. +* Bug Fix: Likes: Add settings for email notifications and misc style updates. +* Bug Fix: Notifications: Add the post types to sync after init. +* Bug Fix: Publicize: RTL styling. +* Bug Fix: Shortcodes: security fixes and function prefixing. +* Bug Fix: Widgets: Update wording on the Top Posts widget for clarity. +* Bug Fix: Jetpack Post Images security fixes. + += 2.2.1 = +* Enhancement: Development Mode: Define the `JETPACK_DEV_DEBUG` constant to `true` to enable an offline mode for localhost development. Only modules that don't require a WordPress.com connection can be enabled in this mode. +* Enhancement: Likes: Added the number of likes to the wp-admin/edit.php screens. +* Enhancement: Mobile Theme - design refresh +* Enhancement: Shortcodes - Add a filter to the shortcode loading section so that a plugin can override what Jetpack loads for shortcodes +* Enhancement: Widgets - Filter Jetpack's widgets so that a plugin can control which widgets get loaded +* Bug Fix: Comments - Add in a wrapper div with id='commentform' +* Bug Fix: Contact Form - Added date field with datepicker +* Bug Fix: Contact Form - Allowed non-text widgets to use contact forms by running their output through the widget_text filter +* Bug Fix: Custom CSS - Allowing color values to be defined multiple times +* Bug Fix: Custom CSS - Dynamically loading the correct CSS/LESS/SCSS mode for the CSS editor if the user changes the preprocessor +* Bug Fix: Custom CSS - Using the unminified worker CSS +* Bug Fix: Custom CSS - Added rule: reminder about using .custom-background on body selector +* Bug Fix: Custom CSS - Modified rule: Removed portion of overqualification rule that deems 'a.foo' overqualified if there are no other 'a' rules +* Bug Fix: Custom CSS - Ensuring that the editor and the textarea behind it are using the same font so that the cursor appears in the correct location +* Bug Fix: Custom CSS - Fix a bug that caused some sites to always ignore the base theme's CSS when in preview mode +* Bug Fix: Custom CSS - Run stripslashes() before passing CSS to save() +* Bug Fix: Custom CSS - Moving inline CSS and JavaScript into external files +* Bug Fix: Infinite Scroll - Use the `is_main_query()` function and query method +* Bug Fix: Infinite Scroll - Remove unused styles and an unnecessary margin setting +* Bug Fix: Infinite Scroll - Allow the query used with IS to be filtered, so IS can be applied to a new query within a page template +* Bug Fix: JSON API - Catch the 'User cannot view password protected post' error from can_view_post and bypass it for likes actions if the user has the password entered +* Bug Fix: Likes - Bump cache buster, Don't show likes for password protected posts +* Bug Fix: Notifications - Remove a redundant span closing tag +* Bug Fix: Photon - If an image is already served from Photon but the anchor tag that surrounds it hasn't had its `href` value rewritten to use Photon, do so. Accounts for WP galleries whose individual items are linked to the original image files +* Bug Fix: Publicize - Allows GLOBAL_CAP to be filtered, Adds an AYS to connection deletion, UI improvement for MP6 (and in general) +* Bug Fix: Sharedaddy - Fire the sharing redirect earlier for increased plugin compatibility +* Bug Fix: Stats - Move the display:none CSS output to wp_head so it gets written inside the HEAD tag if the option to hide the stats smilie is active +* Bug Fix: Tiled Galleries - A more descriptive name for the default gallery type +* Bug Fix: Tiled Galleries - Hide the Columns setting for gallery types that don't support it +* Bug Fix: Run the admin_menu action late so that plugins hooking into it get a chance to run +* Bug Fix: Prophylactic strict equality check + = 2.2 = * Enhancement: Likes: Allow your readers to show their appreciation of your posts. * Enhancement: Shortcodes: SoundCloud: Update to version 2.3 of the SoundCloud plugin (HTML5 default player, various fixes). -- cgit v1.2.3-18-g5258