Plugin Directory

Changeset 720987


Ignore:
Timestamp:
05/31/2013 07:17:48 PM (13 years ago)
Author:
yonisink
Message:

Upgrade to 1.11 including clickthrough prevention and some bugfixes.

Location:
sinking-dropdowns
Files:
30 added
8 edited

Legend:

Unmodified
Added
Removed
  • sinking-dropdowns/trunk/controller/constants.php

    r720447 r720987  
    33
    44define('SINKDROPDOWNS_title', 'sinking dropdowns WordPress');
    5 define('SINKDROPDOWNS_version', '1.0');
     5define('SINKDROPDOWNS_version', '1.11');
    66
    77define('SINKDROPDOWNS_DEFAULT_reveal', 'hover');
    88define('SINKDROPDOWNS_DEFAULT_responsive_break', '800');
     9define('SINKDROPDOWNS_DEFAULT_prevent_top_clicks', 'allow');
    910
    1011define('SINKDROPDOWNS_THEMEPATH', SINKDROPDOWNS_PATH_INT . 'css/themes/');
  • sinking-dropdowns/trunk/controller/plugin.php

    r720447 r720987  
    88        update_option('sinkdropdowns_menushow',SINKDROPDOWNS_DEFAULT_reveal);
    99        update_option('sinkdropdowns_responsive_break',SINKDROPDOWNS_DEFAULT_responsive_break);     
     10        update_option('sinkdropdowns_prevent_top_clicks',SINKDROPDOWNS_DEFAULT_prevent_top_clicks);     
    1011       
    1112        //default colors
  • sinking-dropdowns/trunk/css/backend.css

    r720447 r720987  
    77
    88/** admin styles **/
     9
     10.metabox-holder h3 {
     11    font-size: 1.5em;
     12    font-family: Helvetica,Arial,sans-serif;
     13    font-weight: bold;
     14    padding-left: 0;
     15}
    916
    1017.sinking_dropdowns .section {
     
    4855}
    4956
     57.sinking_dropdowns .introsection input {
     58    margin-right: 5px;
     59}
     60
     61.sinking_dropdowns .introsection label {
     62    margin-right: 20px;
     63}
     64
     65.sinking_dropdowns input#sinkdropdowns_responsive_break {
     66    display: block;
     67    margin-left: 0;
     68}
    5069#sinkdropdowns_responsive_break {
    5170    width:40px;
  • sinking-dropdowns/trunk/js/sinking_dropdowns.js

    r720447 r720987  
    55contact us for forking or other permissions
    66*/
     7
     8var prevent_top_clicks = (sinkingdropdowns.prevent_top_clicks == 'prevent');
    79
    810var responsive_break = parseInt(sinkingdropdowns.responsive_break); //.parseInt(); //800    //modify this to break earlier or later
     
    2830    });
    2931   
     32    if(prevent_top_clicks) {
     33        $('.sink_dropdown_container a.parent.toplink').parent().addClass('nonclicking');
     34    }
    3035
    3136    adjustMenu();
     
    3641    });
    3742   
    38     function adjustMenu() {
     43    function adjustMenu() {
     44   
    3945        if ((ww < responsive_break) || reveal_action_click) {
     46            //click action
    4047            $(".responsive").show();
    4148            $(".sink_dropdown li").unbind('mouseenter mouseleave');
     
    4350                // must be attached to anchor element to prevent bubbling
    4451                e.preventDefault();
     52                var $parent_li = $(this).parent("li");
    4553
    4654                if((ww > responsive_break) && $(this).is('.toplink'))
    47                     $(".sink_dropdown li").removeClass("hover");
    48    
    49                 $(this).parent("li").toggleClass("hover");
    50                
     55                    $(".sink_dropdown li").not($parent_li).removeClass("hover");
     56                   
     57                $parent_li.toggleClass("hover");               
    5158            });
    5259           
    5360        } else {
    54         //  $(".toggleMenu").css("display", "none");   
     61            //hover action
     62
    5563            $(".responsive").hide();
    5664            $(".sink_dropdown li a").unbind("click");
     
    6068            });
    6169        }           
    62     }                       
     70    }
     71
     72    $('.sink_dropdown_container li.nonclicking a.parent').click(function(e) {   
     73        e.preventDefault();
     74    });
     75   
     76    $('body').mouseup(function (e) {
     77        var container = $(".sink_dropdown_container");
     78        if (container.has(e.target).length === 0) {
     79            $('.sink_dropdown_container li a.parent').parent().removeClass('hover');
     80        }
     81    });
     82   
    6383});
  • sinking-dropdowns/trunk/readme.txt

    r720447 r720987  
    22Contributors: yonisink
    33Donate link: http://www.social-ink.net
    4 Tags: dropdown, menus, hover, responsive
     4Tags: dropdown, menus, hover, responsive, jquery, appearance,drop-down, menu
    55Requires at least: 3.1
    66Tested up to: 3.5.1
    7 Stable Tag: 1.1
     7Stable Tag: 1.11
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    1111
    12 Convert WordPress menu to a responsive hover/click dropdown menu.
     12Convert default WordPress menu to a responsive hover/click dropdown menu.
    1313
    1414== Description ==
    1515
    16 Create a WordPress menu (up to three levels) and have a nice responsive dropdown using template tags.
     16Create a WordPress menu (up to three levels) with the WP appearances built-in menu builder and convert it to a nice responsive dropdown using template tags.
    1717
    1818Choose your colors, and whether you want a hover or click (click will be permanent on responsive break due to mobile devices' use of hover as a "pre-click").
     
    3333== Frequently Asked Questions ==
    3434
    35 Nothing yet!
     35= Can I prevent the top items from being clickable on a manual basis (in hover mode)? =
    3636
     37Definitely - go to your WP appearances > menu and reveal the CSS classes for menu items. Then add a "nonclicking" class to the menu items that are just placeholders and shouldn't actually click through.
    3738
    3839== Changelog ==
    3940
     41= 1.1.1 =
     42
     43Added ability to prevent clickthroughs.
     44
    4045= 1.1 =
    4146
    42 Added color choice override options, including alpha transparency choosing.
     47Added color choice override options, including alpha transparency choosing, and preventing top clicks.
    4348
    4449= 1 =
  • sinking-dropdowns/trunk/sinking_dropdowns.php

    r720447 r720987  
    44Plugin URI: http://www.social-ink.net
    55Author URI: http://www.social-ink.net
    6 Version: 1
     6Version: 1.11
    77Author: Yonatan Reinberg of Social Ink
    88Description: Responsive Dropdown Plugin
     
    4242            $sinkdropdowns_menushow = get_option('sinkdropdowns_menushow');
    4343            $sinkdropdowns_responsive_break = get_option('sinkdropdowns_responsive_break');
     44            $sinkdropdowns_prevent_top_clicks = get_option('sinkdropdowns_prevent_top_clicks');
     45           
     46            //custom colors
    4447            $sinkdropdowns_sink_dropdown_themeoverwrite = get_option('sinkdropdowns_sink_dropdown_themeoverwrite');
    4548
    4649            if($sinkdropdowns_sink_dropdown_themeoverwrite) {
    47                 //colors
     50               
    4851                $sinkdropdowns_sink_dropdown_top = get_option('sinkdropdowns_sink_dropdown_top');
    4952                $sinkdropdowns_sink_dropdown_top_link = get_option('sinkdropdowns_sink_dropdown_top_link');
     
    6164                            /* <![CDATA[ */
    6265                            var sinkingdropdowns = {    "reveal_action":'<?php echo $sinkdropdowns_menushow ?>',
     66                                                        "prevent_top_clicks":'<?php echo $sinkdropdowns_prevent_top_clicks ?>',
    6367                                                        "responsive_break":'<?php echo $sinkdropdowns_responsive_break ?>'  };
    6468                            /* ]]> */               
  • sinking-dropdowns/trunk/views/config.php

    r720447 r720987  
    1111$sinkdropdowns_menushow = get_option('sinkdropdowns_menushow');
    1212$sinkdropdowns_responsive_break = get_option('sinkdropdowns_responsive_break');
     13$sinkdropdowns_prevent_top_clicks = get_option('sinkdropdowns_prevent_top_clicks');
    1314
    1415//colors
     
    5455                                            <p><b>Click or hover to reveal dropdown:</b></p>
    5556                                            <p>
    56                                                 <label for="menushow_click">Click</label><input id="menushow_click" type="radio" name="sinkdropdowns_menushow" <?php if($sinkdropdowns_menushow=='click') echo 'checked="checked"' ?> value="click">
    57                                                 <label for="menushow_hover">Hover</label><input id="menushow_hover" type="radio" name="sinkdropdowns_menushow" <?php if($sinkdropdowns_menushow=='hover') echo 'checked="checked"' ?>  value="hover">
     57                                                <input id="menushow_click" type="radio" name="sinkdropdowns_menushow" <?php if($sinkdropdowns_menushow=='click') echo 'checked="checked"' ?> value="click"><label for="menushow_click">Click</label>
     58                                                <input id="menushow_hover" type="radio" name="sinkdropdowns_menushow" <?php if($sinkdropdowns_menushow=='hover') echo 'checked="checked"' ?>  value="hover"><label for="menushow_hover">Hover</label>
     59                                            </p>
     60                                        </div>                                     
     61                                       
     62                                        <div class="field">
     63                                            <p><b>Prevent click-through of the top links.</b> This will only work in click mode; use when your top links are just placeholders and aren't actually destinations.  <i>Tip: add the class "nonclicking" manually to menu items on a one-by-one basis if you don't want the setting below to apply site-wide.</i></p>
     64                                            <p>
     65                                                <input id="prevent_allow" type="radio" name="sinkdropdowns_prevent_top_clicks" <?php if($sinkdropdowns_prevent_top_clicks=='allow') echo 'checked="checked"' ?> value="allow"><label for="prevent_allow">Allow</label>
     66                                                <input id="prevent_prevent" type="radio" name="sinkdropdowns_prevent_top_clicks" <?php if($sinkdropdowns_prevent_top_clicks=='prevent') echo 'checked="checked"' ?>  value="prevent"><label for="prevent_prevent">Prevent</label>
    5867                                            </p>
    5968                                        </div>
     
    6978                                        <div class="field">
    7079                                            <p>
    71                                                 <label for="sinkdropdowns_sink_dropdown_themeoverwrite" class="checkbox_label"><strong>Overwrite CSS colors with custom colors:</strong></label>
     80                                               
    7281                                                <input type="hidden" name="sinkdropdowns_sink_dropdown_themeoverwrite" value="" /> 
    73                                                 <input type="checkbox" name="sinkdropdowns_sink_dropdown_themeoverwrite" id="sinkdropdowns_sink_dropdown_themeoverwrite" value="true" <?php if ($sinkdropdowns_sink_dropdown_themeoverwrite) { echo 'checked=checked'; } ?> />
     82                                                <input type="checkbox" name="sinkdropdowns_sink_dropdown_themeoverwrite" id="sinkdropdowns_sink_dropdown_themeoverwrite" value="true" <?php if ($sinkdropdowns_sink_dropdown_themeoverwrite) { echo 'checked=checked'; } ?> /><label for="sinkdropdowns_sink_dropdown_themeoverwrite" class="checkbox_label"><strong>Overwrite CSS colors with custom colors:</strong></label>
    7483                                            </p>
    7584                                           
Note: See TracChangeset for help on using the changeset viewer.