<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[34977] trunk/src/wp-admin/js: JS: in event callbacks replace the very outdated `return false` with `preventDefault()`.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/34977">34977</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/34977","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>azaozz</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-10-09 01:26:46 +0000 (Fri, 09 Oct 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>JS: in event callbacks replace the very outdated `return false` with `preventDefault()`.
Props adamsilverstein.
Fixes <a href="https://core.trac.wordpress.org/ticket/18590">#18590</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminjsdashboardjs">trunk/src/wp-admin/js/dashboard.js</a></li>
<li><a href="#trunksrcwpadminjseditcommentsjs">trunk/src/wp-admin/js/edit-comments.js</a></li>
<li><a href="#trunksrcwpadminjsgalleryjs">trunk/src/wp-admin/js/gallery.js</a></li>
<li><a href="#trunksrcwpadminjsinlineeditpostjs">trunk/src/wp-admin/js/inline-edit-post.js</a></li>
<li><a href="#trunksrcwpadminjsplugininstalljs">trunk/src/wp-admin/js/plugin-install.js</a></li>
<li><a href="#trunksrcwpadminjspostjs">trunk/src/wp-admin/js/post.js</a></li>
<li><a href="#trunksrcwpadminjspostboxjs">trunk/src/wp-admin/js/postbox.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminjsdashboardjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/dashboard.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/dashboard.js 2015-10-09 00:24:36 UTC (rev 34976)
+++ trunk/src/wp-admin/js/dashboard.js 2015-10-09 01:26:46 UTC (rev 34977)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,7 +67,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $( '#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]' ).prop( 'disabled' , false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- t = $('#quick-press').submit( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ t = $('#quick-press').submit( function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> $('#dashboard_quick_press #publishing-action .spinner').show();
</span><span class="cx" style="display: block; padding: 0 10px"> $('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', true);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,8 +88,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> latestPost.css('background', 'none');
</span><span class="cx" style="display: block; padding: 0 10px"> }, 1000);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
</span></span></pre></div>
<a id="trunksrcwpadminjseditcommentsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/edit-comments.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/edit-comments.js 2015-10-09 00:24:36 UTC (rev 34976)
+++ trunk/src/wp-admin/js/edit-comments.js 2015-10-09 01:26:46 UTC (rev 34977)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,13 +284,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> a.attr('class', 'vim-z vim-destructive');
</span><span class="cx" style="display: block; padding: 0 10px"> $('.avatar', el).first().clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- a.click(function(){
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ a.click(function( e ){
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> list.wpList.del(this);
</span><span class="cx" style="display: block; padding: 0 10px"> $('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){
</span><span class="cx" style="display: block; padding: 0 10px"> $(this).remove();
</span><span class="cx" style="display: block; padding: 0 10px"> $('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show(); });
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -854,8 +854,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> setCommentsList();
</span><span class="cx" style="display: block; padding: 0 10px"> commentReply.init();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $(document).delegate('span.delete a.delete', 'click', function(){return false;});
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $(document).on( 'click', 'span.delete a.delete', function( e ) {
+ e.preventDefault();
+ });
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( typeof $.table_hotkeys != 'undefined' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> make_hotkeys_redirect = function(which) {
</span><span class="cx" style="display: block; padding: 0 10px"> return function() {
</span></span></pre></div>
<a id="trunksrcwpadminjsgalleryjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/gallery.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/gallery.js 2015-10-09 00:24:36 UTC (rev 34976)
+++ trunk/src/wp-admin/js/gallery.js 2015-10-09 01:26:46 UTC (rev 34977)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,33 +38,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#asc').click( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#asc').click( function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> desc = false;
</span><span class="cx" style="display: block; padding: 0 10px"> sortIt();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#desc').click( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#desc').click( function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> desc = true;
</span><span class="cx" style="display: block; padding: 0 10px"> sortIt();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#clear').click( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#clear').click( function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> clearAll(1);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#showall').click( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#showall').click( function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> $('#sort-buttons span a').toggle();
</span><span class="cx" style="display: block; padding: 0 10px"> $('a.describe-toggle-on').hide();
</span><span class="cx" style="display: block; padding: 0 10px"> $('a.describe-toggle-off, table.slidetoggle').show();
</span><span class="cx" style="display: block; padding: 0 10px"> $('img.pinkynail').toggle(false);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#hideall').click( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#hideall').click( function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> $('#sort-buttons span a').toggle();
</span><span class="cx" style="display: block; padding: 0 10px"> $('a.describe-toggle-on').show();
</span><span class="cx" style="display: block; padding: 0 10px"> $('a.describe-toggle-off, table.slidetoggle').hide();
</span><span class="cx" style="display: block; padding: 0 10px"> $('img.pinkynail').toggle(true);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // initialize sortable
</span></span></pre></div>
<a id="trunksrcwpadminjsinlineeditpostjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/inline-edit-post.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/inline-edit-post.js 2015-10-09 00:24:36 UTC (rev 34976)
+++ trunk/src/wp-admin/js/inline-edit-post.js 2015-10-09 01:26:46 UTC (rev 34977)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,9 +48,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // add events
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#the-list').on('click', 'a.editinline', function(){
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#the-list').on( 'click', 'a.editinline', function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> inlineEditPost.edit(this);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $('#bulk-edit').find('fieldset:first').after(
</span></span></pre></div>
<a id="trunksrcwpadminjsplugininstalljs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/plugin-install.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/plugin-install.js 2015-10-09 00:24:36 UTC (rev 34976)
+++ trunk/src/wp-admin/js/plugin-install.js 2015-10-09 01:26:46 UTC (rev 34977)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,15 +38,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> tb_position();
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( '.plugin-card, .plugins .plugin-version-author-uri' ).on( 'click', 'a.thickbox', function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '.plugin-card, .plugins .plugin-version-author-uri' ).on( 'click', 'a.thickbox', function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> tb_click.call(this);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $('#TB_title').css({'background-color':'#23282d','color':'#cfcfcf'});
</span><span class="cx" style="display: block; padding: 0 10px"> $('#TB_ajaxWindowTitle').html( '<strong>' + plugininstallL10n.plugin_information + '</strong> ' + $(this).data( 'title' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $('#TB_iframeContent').attr( 'title', plugininstallL10n.plugin_information + ' ' + $(this).data( 'title' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $('#TB_closeWindowButton').focus();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* Plugin install related JS */
</span></span></pre></div>
<a id="trunksrcwpadminjspostjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/post.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/post.js 2015-10-09 00:24:36 UTC (rev 34976)
+++ trunk/src/wp-admin/js/post.js 2015-10-09 01:26:46 UTC (rev 34977)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -432,7 +432,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> settingName = 'cats';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.js
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('a', '#' + taxonomy + '-tabs').click( function(){
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('a', '#' + taxonomy + '-tabs').click( function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> var t = $(this).attr('href');
</span><span class="cx" style="display: block; padding: 0 10px"> $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
</span><span class="cx" style="display: block; padding: 0 10px"> $('#' + taxonomy + '-tabs').siblings('.tabs-panel').hide();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -441,7 +442,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> deleteUserSetting( settingName );
</span><span class="cx" style="display: block; padding: 0 10px"> else
</span><span class="cx" style="display: block; padding: 0 10px"> setUserSetting( settingName, 'pop' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( getUserSetting( settingName ) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -483,11 +483,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> addAfter: catAddAfter
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $('#' + taxonomy + '-add-toggle').click( function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $('#' + taxonomy + '-add-toggle').click( function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> $('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
</span><span class="cx" style="display: block; padding: 0 10px"> $('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click();
</span><span class="cx" style="display: block; padding: 0 10px"> $('#new'+taxonomy).focus();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $('#' + taxonomy + 'checklist, #' + taxonomy + 'checklist-pop').on( 'click', 'li.popular-category > label input[type="checkbox"]', function() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -608,7 +608,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( '#visibility .edit-visibility').click( function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '#visibility .edit-visibility').click( function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $postVisibilitySelect.is(':hidden') ) {
</span><span class="cx" style="display: block; padding: 0 10px"> updateVisibility();
</span><span class="cx" style="display: block; padding: 0 10px"> $postVisibilitySelect.slideDown( 'fast', function() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -616,7 +617,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> $(this).hide();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $postVisibilitySelect.find('.cancel-post-visibility').click( function( event ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -742,11 +742,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> revert_e = e.html();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> buttons.html('<button type="button" class="save button button-small">'+postL10n.ok+'</button> <a class="cancel" href="#">'+postL10n.cancel+'</a>');
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- buttons.children('.save').click(function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ buttons.children('.save').click( function( e ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var new_slug = e.children('input').val();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( new_slug == $('#editable-post-name-full').text() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> buttons.children('.cancel').click();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $.post(ajaxurl, {
</span><span class="cx" style="display: block; padding: 0 10px"> action: 'sample-permalink',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -768,17 +769,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> real_slug.val(new_slug);
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.edit-slug' ).focus();
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- buttons.children('.cancel').click(function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ buttons.children('.cancel').click( function( e ) {
+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> $('#view-post-btn').show();
</span><span class="cx" style="display: block; padding: 0 10px"> e.html(revert_e);
</span><span class="cx" style="display: block; padding: 0 10px"> buttons.html(buttonsOrig);
</span><span class="cx" style="display: block; padding: 0 10px"> permalink.html(permalinkOrig);
</span><span class="cx" style="display: block; padding: 0 10px"> real_slug.val(revert_slug);
</span><span class="cx" style="display: block; padding: 0 10px"> $( '.edit-slug' ).focus();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> for ( i = 0; i < full.length; ++i ) {
</span></span></pre></div>
<a id="trunksrcwpadminjspostboxjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/postbox.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/postbox.js 2015-10-09 00:24:36 UTC (rev 34976)
+++ trunk/src/wp-admin/js/postbox.js 2015-10-09 01:26:46 UTC (rev 34977)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -56,10 +56,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> e.stopPropagation();
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $( '.postbox a.dismiss' ).bind( 'click.postboxes', function() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $( '.postbox a.dismiss' ).on( 'click.postboxes', function( e ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var hide_id = $(this).parents('.postbox').attr('id') + '-hide';
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ e.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> $( '#' + hide_id ).prop('checked', false).triggerHandler('click');
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return false;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $('.hide-postbox-tog').bind('click.postboxes', function() {
</span></span></pre>
</div>
</div>
</body>
</html>