Plugin Directory

Changeset 672024


Ignore:
Timestamp:
02/23/2013 12:14:07 AM (13 years ago)
Author:
maxaud
Message:

address javascript errors as per support forum

Location:
expandable-menus/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • expandable-menus/trunk/expandable-menus.php

    r669399 r672024  
    55Description: Allows you to expand and collapse theme menus in WordPress admin.
    66Author: Dustin Dempsey
    7 Version: 2.0
     7Version: 2.1
    88Author URI: http://playforward.net
    99*/
     
    1515        // echo css and javascript
    1616        $plus_path = includes_url('/images/admin-bar-sprite.png');
     17       
    1718        echo '
    1819            <style>
     
    7677               
    7778                function expand_get( c_name ) {
    78                     var i,x,y,ARRcookies = document.cookie.split(";");
    79                     for ( i=0; i<ARRcookies.length; i++ ) {
    80                         x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
    81                         y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
    82                         x=x.replace(/^\s+|\s+$/g,"");
    83                         if ( x == c_name ) {
    84                             return unescape( y );
    85                         }
    86                     }   
     79                    if ( document.cookie ) {
     80                        var i,x,y,ARRcookies = document.cookie.split(";");
     81                        for ( i=0; i<ARRcookies.length; i++ ) {
     82                            x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
     83                            y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
     84                            x=x.replace(/^\s+|\s+$/g,"");
     85                            if ( x == c_name ) {
     86                                return unescape( y );
     87                            }
     88                        }
     89                    } else {
     90                        return false;
     91                    }
    8792                }
    8893               
     
    293298                    var process_cookie = function() {
    294299                   
    295                         // if we still have items in the array to process
    296                         if ( cookies.length > 0 ) {
    297                        
    298                             // trigger double click on item
    299                             var current_item = cookies[0];
    300                             jQuery("#"+current_item).trigger( "dblclick" );
    301                            
    302                             // remove item from array
    303                             cookies.splice( 0, 1 );
    304                            
    305                             // process again
     300                        if ( cookies ) {
     301                       
     302                            // if we still have items in the array to process
     303                            if ( cookies.length > 0 ) {
     304                           
     305                                // trigger double click on item
     306                                var current_item = cookies[0];
     307                                jQuery("#"+current_item).trigger( "dblclick" );
     308                               
     309                                // remove item from array
     310                                cookies.splice( 0, 1 );
     311                               
     312                                // process again
     313                                process_cookie();
     314                            }
     315                        }
     316                    }
     317                   
     318                    if ( cookie ) {
     319                   
     320                        // get minimized items and revrse array to work backwards
     321                        var cookies = cookie.split("|");
     322                       
     323                        if ( cookies ) {
     324                       
     325                            cookies = cookies.reverse();
     326                           
     327                            // process cookie items
    306328                            process_cookie();
    307                        
    308329                        }
    309330                    }
    310                    
    311                     // get minimized items and revrse array to work backwards
    312                     var cookies = cookie.split("|");
    313                     cookies = cookies.reverse();
    314                    
    315                     // process cookie items
    316                     process_cookie();
    317331                });
    318332            </script>
  • expandable-menus/trunk/readme.txt

    r669399 r672024  
    55Requires at least: 3.0
    66Tested up to: 3.6
    7 Stable tag: 2.0
     7Stable tag: 2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6969* Saves minimized menus in a cookie so you don't have to minimize every time the page is loaded.
    7070
     71= 2.1 =
     72
     73* Addresses a javascript error, see support forum.
     74
    7175== Upgrade Notice ==
    7276
     
    8589* Different indicators on hover and when minimized
    8690* Saves minimized menus in a cookie so you don't have to minimize every time the page is loaded.
     91
     92= 2.1 =
     93
     94* Addresses a javascript error, see support forum.
Note: See TracChangeset for help on using the changeset viewer.