]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/press-this.js
WordPress 4.4
[autoinstalls/wordpress.git] / wp-admin / js / press-this.js
index beaca67224cf1eb05d2904a113b31918a22fa498..bf2e8300dfefec08fe557cc48f963df5e8824fd9 100644 (file)
                                        link = src;
                                }
 
-                               newContent = '<a href="' + link + '"><img class="alignnone size-full" src="' + src + '" /></a>';
+                               newContent = '<a href="' + link + '"><img class="alignnone size-full" src="' + src + '" alt="" /></a>';
                        } else {
                                newContent = '[embed]' + src + '[/embed]';
                        }
 
                        // Publish, Draft and Preview buttons
                        $( '.post-actions' ).on( 'click.press-this', function( event ) {
-                               var $target = $( event.target ),
+                               var location,
+                                       $target = $( event.target ),
                                        $button = $target.closest( 'button' );
 
                                if ( $button.length ) {
                                                submitPost( 'draft' );
                                        } else if ( $button.hasClass( 'publish-button' ) ) {
                                                $button.addClass( 'is-saving' );
+
+                                               if ( window.history.replaceState ) {
+                                                       location = window.location.href;
+                                                       location += ( location.indexOf( '?' ) !== -1 ) ? '&' : '?';
+                                                       location += 'wp-press-this-reload=true';
+
+                                                       window.history.replaceState( null, null, location );
+                                               }
+
                                                submitPost( 'publish' );
                                        } else if ( $button.hasClass( 'preview-button' ) ) {
                                                prepareFormData();