From 7715a50c0bfe5a898c7d0ba53c21536284316764 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 27 Jun 2015 02:15:24 +0000 Subject: [PATCH] Press This: fix iOS bug that prevents closing of the split button when tapping outside of it. See #32757. Built from https://develop.svn.wordpress.org/trunk@32966 git-svn-id: http://core.svn.wordpress.org/trunk@32937 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/press-this.js | 6 ++++++ wp-admin/js/press-this.min.js | 2 +- wp-includes/version.php | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/wp-admin/js/press-this.js b/wp-admin/js/press-this.js index c42e8f40f5..c65da9228d 100644 --- a/wp-admin/js/press-this.js +++ b/wp-admin/js/press-this.js @@ -16,6 +16,7 @@ isOffScreen = 'is-off-screen', isHidden = 'is-hidden', offscreenHidden = isOffScreen + ' ' + isHidden, + iOS = /iPad|iPod|iPhone/.test( window.navigator.userAgent ), transitionEndEvent = ( function() { var style = document.documentElement.style; @@ -619,6 +620,11 @@ if ( window.tagBox ) { window.tagBox.init(); } + + // iOS doesn't fire click events on "standard" elements without this... + if ( iOS ) { + $( document.body ).css( 'cursor', 'pointer' ); + } } /** diff --git a/wp-admin/js/press-this.min.js b/wp-admin/js/press-this.min.js index cef2b3e00e..45d5cc1459 100644 --- a/wp-admin/js/press-this.min.js +++ b/wp-admin/js/press-this.min.js @@ -1 +1 @@ -!function(a,b){var c=function(){function c(a){return a&&b.pressThisL10n?b.pressThisL10n[a]||a:a||""}function d(a){return a=a||"",a.replace(/|$)/g,"").replace(/<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/gi,"").replace(/<\/?[a-z][\s\S]*?(>|$)/gi,"")}function e(a){var b=d(a);try{I.innerHTML=b,b=d(I.value)}catch(c){}return b}function f(b){return b=a.trim(b||""),/^(?:https?:)?\/\//.test(b)?(b=d(b),b.replace(/["\\]+/g,"")):""}function g(){a(".spinner").addClass("is-active"),a(".post-actions button").attr("disabled","disabled")}function h(){a(".spinner").removeClass("is-active"),a(".post-actions button").removeAttr("disabled")}function i(){var b=a("#title-container");return b.find("img.emoji").each(function(){var b=a(this);b.replaceWith(a("").text(b.attr("alt")))}),e(b.text())}function j(){var c=a("#pressthis-form"),d=a('');E&&E.save(),a("#post_title").val(i()),b.tagBox&&a("div.tagsdiv").each(function(){b.tagBox.flushTags(this,!1,1)}),a(".categories-select .category").each(function(b,e){var f=a(e);f.hasClass("selected")&&c.append(d.clone().val(f.attr("data-term-id")||""))})}function k(d){var e;H=!1,g(),"publish"===d&&a("#post_status").val("publish"),j(),e=a("#pressthis-form").serialize(),a.ajax({type:"post",url:b.ajaxurl,data:e}).always(function(){h(),q()}).done(function(a){if(a.success)if(a.data.redirect)if(b.opener&&K.redirInParent){try{b.opener.location.href=a.data.redirect}catch(c){}b.self.close()}else b.location.href=a.data.redirect;else a.data.postSaved;else p(a.data.errorMessage)}).fail(function(){p(c("serverError"))})}function l(a){var b,c,d="";E&&(b=f(a.attr("data-wp-src")||""),c=f(L.u),a.hasClass("is-image")?(c||(c=b),d=''):d="[embed]"+b+"[/embed]",N?E.execCommand("mceInsertContent",!1,d):E.setContent("

"+d+"

"+E.getContent()))}function m(){var c,d=a("#new-category").val();d&&(c={action:"press-this-add-category",post_id:a("#post_ID").val()||0,name:d,new_cat_nonce:a("#_ajax_nonce-add-category").val()||"",parent:a("#new-category-parent").val()||0},a.post(b.ajaxurl,c,function(b){if(b.success){var c,d,e=a("ul.categories-select");a.each(b.data,function(b,f){var g=a("
  • ").append(a('