Plugin Directory

Changeset 1500238


Ignore:
Timestamp:
09/22/2016 10:41:57 AM (9 years ago)
Author:
marclarr
Message:

updated to version 1.5.2

Location:
fast-page-switch
Files:
2 edited
7 copied

Legend:

Unmodified
Added
Removed
  • fast-page-switch/tags/1.5.2/fast-page-switch.php

    r1500080 r1500238  
    44Plugin URI:     https://marcwiest.com
    55Description:    Save time switching between posts of any post-type in wp-admin.
    6 Version:        1.5.1
     6Version:        1.5.2
    77Author:         Marc Wiest
    88Author URI:     https://marcwiest.com
     
    138138        <script>
    139139        jQuery(document).ready(function($) {
    140             'use strict';
    141140
    142141            var fps = $('#fast-page-switch'),
     
    150149            }
    151150
    152             fps.on( 'change', function(e) {
     151            fps.on( 'select2:select', function(e) {
    153152                e.preventDefault;
    154153
    155                 $(this).parent('#fps-wrapper').addClass('fps-js-reveal-spinner');
    156 
    157                 if ( fps.val() !== '<?php echo $post->ID; ?>' ) {
    158 
    159                     location_change( $(this).val() );
     154                var val = $(this).val();
     155
     156                if ( val !== '<?php echo $post->ID; ?>' ) {
     157
     158                    location_change( val );
     159
     160                    reveal_spinner();
    160161
    161162                    // - Select2 was getting stuck on the new value when a
     
    164165                    //   the old method for reseting a value is also used.
    165166                    if ( s2Exists ) {
    166                         fps.select2('val','<?php echo $post->ID; ?>'); // Select2 v3
     167                        fps.select2( 'val', val ); // Select2 v3
    167168                    }
    168                     fps.val('<?php echo $post->ID; ?>').trigger('change'); // Select2 v4
     169                    fps.val( val ).trigger( 'change' ); // select & Select2 v4
    169170                }
    170171            });
     
    173174                var admin_url = '<?php trailingslashit(admin_url()); ?>';
    174175                window.location.href = admin_url + 'post.php?post=' + post_id + '&action=edit';
     176            }
     177
     178            // The only scenario not working is if the user confirms to "leave",
     179            // because there is no way to check the reurn of the confirm window.
     180            // Source Code: wp-admin/js/post.js line 482
     181            function reveal_spinner() {
     182                var editor = typeof tinymce !== 'undefined' && tinymce.get('content');
     183                if ( ( editor && ! editor.isHidden() && editor.isDirty() ) ||
     184                    ( wp.autosave && wp.autosave.server.postChanged() ) ) {
     185                    $('#fps-wrapper').removeClass('fps-js-reveal-spinner');
     186                } else {
     187                    $('#fps-wrapper').addClass('fps-js-reveal-spinner');
     188                }
    175189            }
    176190
  • fast-page-switch/tags/1.5.2/readme.txt

    r1500078 r1500238  
    44Requires at least: 3.1
    55Tested up to: 4.7
    6 Stable tag: 1.5.1
     6Stable tag: 1.5.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424
    2525== Changelog ==
     26
     27= 1.5.2 - September 21, 2016 =
     28* Improved select2 JS.
    2629
    2730= 1.5.1 - September 21, 2016 =
  • fast-page-switch/trunk/fast-page-switch.php

    r1500080 r1500238  
    44Plugin URI:     https://marcwiest.com
    55Description:    Save time switching between posts of any post-type in wp-admin.
    6 Version:        1.5.1
     6Version:        1.5.2
    77Author:         Marc Wiest
    88Author URI:     https://marcwiest.com
     
    138138        <script>
    139139        jQuery(document).ready(function($) {
    140             'use strict';
    141140
    142141            var fps = $('#fast-page-switch'),
     
    150149            }
    151150
    152             fps.on( 'change', function(e) {
     151            fps.on( 'select2:select', function(e) {
    153152                e.preventDefault;
    154153
    155                 $(this).parent('#fps-wrapper').addClass('fps-js-reveal-spinner');
    156 
    157                 if ( fps.val() !== '<?php echo $post->ID; ?>' ) {
    158 
    159                     location_change( $(this).val() );
     154                var val = $(this).val();
     155
     156                if ( val !== '<?php echo $post->ID; ?>' ) {
     157
     158                    location_change( val );
     159
     160                    reveal_spinner();
    160161
    161162                    // - Select2 was getting stuck on the new value when a
     
    164165                    //   the old method for reseting a value is also used.
    165166                    if ( s2Exists ) {
    166                         fps.select2('val','<?php echo $post->ID; ?>'); // Select2 v3
     167                        fps.select2( 'val', val ); // Select2 v3
    167168                    }
    168                     fps.val('<?php echo $post->ID; ?>').trigger('change'); // Select2 v4
     169                    fps.val( val ).trigger( 'change' ); // select & Select2 v4
    169170                }
    170171            });
     
    173174                var admin_url = '<?php trailingslashit(admin_url()); ?>';
    174175                window.location.href = admin_url + 'post.php?post=' + post_id + '&action=edit';
     176            }
     177
     178            // The only scenario not working is if the user confirms to "leave",
     179            // because there is no way to check the reurn of the confirm window.
     180            // Source Code: wp-admin/js/post.js line 482
     181            function reveal_spinner() {
     182                var editor = typeof tinymce !== 'undefined' && tinymce.get('content');
     183                if ( ( editor && ! editor.isHidden() && editor.isDirty() ) ||
     184                    ( wp.autosave && wp.autosave.server.postChanged() ) ) {
     185                    $('#fps-wrapper').removeClass('fps-js-reveal-spinner');
     186                } else {
     187                    $('#fps-wrapper').addClass('fps-js-reveal-spinner');
     188                }
    175189            }
    176190
  • fast-page-switch/trunk/readme.txt

    r1500078 r1500238  
    44Requires at least: 3.1
    55Tested up to: 4.7
    6 Stable tag: 1.5.1
     6Stable tag: 1.5.2
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424
    2525== Changelog ==
     26
     27= 1.5.2 - September 21, 2016 =
     28* Improved select2 JS.
    2629
    2730= 1.5.1 - September 21, 2016 =
Note: See TracChangeset for help on using the changeset viewer.