Plugin Directory

Changeset 1787375


Ignore:
Timestamp:
12/15/2017 01:13:55 AM (8 years ago)
Author:
divspark
Message:

1.1.3

Location:
admin-tag-ui/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin-tag-ui/trunk/admin-tag-ui.php

    r1770394 r1787375  
    44* Plugin URI:        http://divspark.com/product/admin-tag-ui
    55* Description:       Changes appearance of tag sections in the admin backend post pages.
    6 * Version:           1.1.2
     6* Version:           1.1.3
    77* Author:            DivSpark
    88* Author URI:        http://divspark.com
     
    1717class Admin_Tag_UI_Plugin
    1818{
    19     const version = '1.1.2';
     19    const version = '1.1.3';
    2020
    2121    private $settings;
     
    103103        return array_merge( $links, $add_links );
    104104    }
    105 
    106 
    107     /**
    108      * Disabled now, not sure if this will be used in the future.
    109      * Was running from __construct:
    110      *      if ( $this->settings['number_to_show'] == 'all' ) {
    111      *          add_filter( 'gettext', array( $this, 'change_show_tags_text'), 1, 3 );
    112      *      }
    113      */
    114     /*public function change_show_tags_text( $translated_text, $text, $domain )
    115     {
    116         if ( 'Choose from the most used tags' == $text ) // && 'your-post-type' == $typenow
    117         {
    118             $translated_text = __( 'Choose from all tags', 'admin-tag-ui' );
    119         }
    120         return $translated_text;
    121     }*/
    122 
    123105
    124106    /**
     
    150132     * Adds css <style> to the head section of the page
    151133     * - action admin_head - __construct()
    152      *
    153      * 1.1.2 - WordPress 4.9 changed tag cloud's html structure in the page. Styles had to be changed.
    154134     */
    155135    public function add_style_to_head()
     
    182162                display: inline-block;
    183163                width: 100%;
     164                word-wrap: break-word;
    184165            }
    185166            .the-tagcloud ul li {
     
    198179                display: inline-block;
    199180                width: 100%;
     181                word-wrap: break-word;
    200182            }
    201183           
     
    250232     * - action admin_footer-post.php - __construct()
    251233     * - action admin_footer-post-new.php - __construct()
    252      *
    253      * 1.1.0
    254      *  - Moved {$tag_link_wording} within jQuery.ready() function
    255      *  - Prevented the screen from jumping back to the tag input field by disabling it temporarily (focus does not jump to disabled elements).
    256      *  - Added atui_check_tag_selection() to highlight tags which have been selected in the selectable tags section.
    257      *  - Used setTimeout() to let other events fire. May need to review this and attempt another approach?
    258      *
    259      * 1.1.1
    260      *  - Changed ".the-tagcloud > a[class^=tag-link-]" to ".the-tagcloud > a[class*=tag-link-]" (makes it compatible with WordPress 4.8)
    261      *  - find tags to highlight by using .filter(). :contains caused additional tags to be matched.
    262      *
    263      * 1.1.2
    264      *  - WordPress 4.9 changed tag cloud's html structure in the page. Selectors had to be changed.
    265      *  - Added listener to "Add" button. Will now run highlight tag function after being clicked.
    266234     */
    267235    public function add_script_to_footer()
     
    272240        {
    273241            $all = __( 'all', 'admin-tag-ui' );
    274             $tag_link_wording = "var tag_wording = jQuery( '.tagcloud-link' ).text().replace( 'the most used', '{$all}' );\n";
    275             $tag_link_wording .= "jQuery( '.tagcloud-link' ).text( tag_wording );\n";
    276             $tag_link_wording .= "jQuery( '.tagcloud-link' ).css( 'visibility', 'visible' );\n";
     242            $tag_link_wording = "$( '.tagcloud-link' ).each( function() {\n";
     243                $tag_link_wording .= "var tag_wording = jQuery( this ).text().replace( 'the most used', '{$all}' );\n";
     244                $tag_link_wording .= "jQuery( this ).text( tag_wording );\n";
     245                $tag_link_wording .= "jQuery( this ).css( 'visibility', 'visible' );\n";
     246            $tag_link_wording .= "});";
    277247        }
    278248        else
     
    293263                    });
    294264                   
    295                     // Adds the selected class back to tags which have been selected
    296                     jQuery( '.tagchecklist span.screen-reader-text' ).each( function() {
    297                        
    298                         selected_tag_text = jQuery( this ).text().replace( 'Remove term: ', '' ).trim().toLowerCase();
    299                        
    300                         // console.log( 'selected tag: ' + jQuery( this ).text().replace( 'Remove term: ', '' ).trim().toLowerCase() + ' ' );
    301                        
    302                         jQuery( '.the-tagcloud a[class*=tag-link-]' ).filter( function() {
    303                                  
    304                             // console.log( 'selectable tag: ' + jQuery( this ).text().trim().toLowerCase() + ' ' );
     265                    // find the tag boxes within the screen. ^= is starts with. Also needs .postbox otherwise will incorrectly match other elements
     266                    jQuery( 'div[id^="tagsdiv-"].postbox' ).each( function( i, tagsdiv )
     267                    {
     268                        // Adds the selected class back to tags which have been selected
     269                        jQuery( tagsdiv ).find( '.tagchecklist span.screen-reader-text' ).each( function()
     270                        {
     271                            selected_tag_text = jQuery( this ).text().replace( 'Remove term: ', '' ).trim().toLowerCase();
    305272                           
    306                             if ( jQuery( this ).text().trim().toLowerCase() === selected_tag_text ) {
     273                            // console.log( 'selected tag: ' + jQuery( this ).text().replace( 'Remove term: ', '' ).trim().toLowerCase() + ' ' );
     274                           
     275                            jQuery( tagsdiv ).find( '.the-tagcloud a[class*=tag-link-]' ).filter( function() {
     276                                     
     277                                // console.log( 'selectable tag: ' + jQuery( this ).text().trim().toLowerCase() + ' ' );
    307278                               
    308                                 jQuery( this ).addClass( 'atui-tag-selected' );
    309                                
    310                                 // console.log( 'matching tag: ' + jQuery( this ).text().trim().toLowerCase() + ' ' );
    311                             }
    312                         });
    313 
    314                     });
     279                                if ( jQuery( this ).text().trim().toLowerCase() === selected_tag_text ) {
     280                                   
     281                                    jQuery( this ).addClass( 'atui-tag-selected' );
     282                                   
     283                                    // console.log( 'matching tag: ' + jQuery( this ).text().trim().toLowerCase() + ' ' );
     284                                }
     285                            });
     286   
     287                        });
     288                    });
    315289                }
    316290               
  • admin-tag-ui/trunk/readme.txt

    r1770394 r1787375  
    44Requires at least: 4.4
    55Tested up to: 4.9
    6 Stable tag: 1.1.2
     6Stable tag: 1.1.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868== Changelog ==
    6969
     70= 1.1.3 =
     71* Added compatibility for multiple tag boxes appear in the post edit screen (such as when there is a custom taxonomy)
     72* Fixed non-breaking tags that were too long
     73
    7074= 1.1.2 =
    71 * Added compatability for WordPress 4.9
     75* Added compatibility for WordPress 4.9
    7276* Fixed tags not being highlighted when adding tags with Add button
    7377
Note: See TracChangeset for help on using the changeset viewer.