Changeset 720987
- Timestamp:
- 05/31/2013 07:17:48 PM (13 years ago)
- Location:
- sinking-dropdowns
- Files:
-
- 30 added
- 8 edited
-
tags/1.11 (added)
-
tags/1.11/controller (added)
-
tags/1.11/controller/constants.php (added)
-
tags/1.11/controller/plugin.php (added)
-
tags/1.11/css (added)
-
tags/1.11/css/backend.css (added)
-
tags/1.11/css/fontello.css (added)
-
tags/1.11/css/sinking_dropdowns.css (added)
-
tags/1.11/css/spectrum.css (added)
-
tags/1.11/font (added)
-
tags/1.11/font/LICENSE.txt (added)
-
tags/1.11/font/fontello.eot (added)
-
tags/1.11/font/fontello.svg (added)
-
tags/1.11/font/fontello.ttf (added)
-
tags/1.11/font/fontello.woff (added)
-
tags/1.11/images (added)
-
tags/1.11/images/logoSocialInk.png (added)
-
tags/1.11/js (added)
-
tags/1.11/js/admin.js (added)
-
tags/1.11/js/sinking_dropdowns.ie7fix.js (added)
-
tags/1.11/js/sinking_dropdowns.js (added)
-
tags/1.11/js/spectrum.js (added)
-
tags/1.11/readme.txt (added)
-
tags/1.11/screenshot-1.jpg (added)
-
tags/1.11/screenshot-2.jpg (added)
-
tags/1.11/screenshot-3.jpg (added)
-
tags/1.11/sinking_dropdowns.php (added)
-
tags/1.11/views (added)
-
tags/1.11/views/backend_credits.php (added)
-
tags/1.11/views/config.php (added)
-
trunk/controller/constants.php (modified) (1 diff)
-
trunk/controller/plugin.php (modified) (1 diff)
-
trunk/css/backend.css (modified) (2 diffs)
-
trunk/js/sinking_dropdowns.js (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/screenshot-1.JPG (modified) (previous)
-
trunk/sinking_dropdowns.php (modified) (3 diffs)
-
trunk/views/config.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sinking-dropdowns/trunk/controller/constants.php
r720447 r720987 3 3 4 4 define('SINKDROPDOWNS_title', 'sinking dropdowns WordPress'); 5 define('SINKDROPDOWNS_version', '1. 0');5 define('SINKDROPDOWNS_version', '1.11'); 6 6 7 7 define('SINKDROPDOWNS_DEFAULT_reveal', 'hover'); 8 8 define('SINKDROPDOWNS_DEFAULT_responsive_break', '800'); 9 define('SINKDROPDOWNS_DEFAULT_prevent_top_clicks', 'allow'); 9 10 10 11 define('SINKDROPDOWNS_THEMEPATH', SINKDROPDOWNS_PATH_INT . 'css/themes/'); -
sinking-dropdowns/trunk/controller/plugin.php
r720447 r720987 8 8 update_option('sinkdropdowns_menushow',SINKDROPDOWNS_DEFAULT_reveal); 9 9 update_option('sinkdropdowns_responsive_break',SINKDROPDOWNS_DEFAULT_responsive_break); 10 update_option('sinkdropdowns_prevent_top_clicks',SINKDROPDOWNS_DEFAULT_prevent_top_clicks); 10 11 11 12 //default colors -
sinking-dropdowns/trunk/css/backend.css
r720447 r720987 7 7 8 8 /** 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 } 9 16 10 17 .sinking_dropdowns .section { … … 48 55 } 49 56 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 } 50 69 #sinkdropdowns_responsive_break { 51 70 width:40px; -
sinking-dropdowns/trunk/js/sinking_dropdowns.js
r720447 r720987 5 5 contact us for forking or other permissions 6 6 */ 7 8 var prevent_top_clicks = (sinkingdropdowns.prevent_top_clicks == 'prevent'); 7 9 8 10 var responsive_break = parseInt(sinkingdropdowns.responsive_break); //.parseInt(); //800 //modify this to break earlier or later … … 28 30 }); 29 31 32 if(prevent_top_clicks) { 33 $('.sink_dropdown_container a.parent.toplink').parent().addClass('nonclicking'); 34 } 30 35 31 36 adjustMenu(); … … 36 41 }); 37 42 38 function adjustMenu() { 43 function adjustMenu() { 44 39 45 if ((ww < responsive_break) || reveal_action_click) { 46 //click action 40 47 $(".responsive").show(); 41 48 $(".sink_dropdown li").unbind('mouseenter mouseleave'); … … 43 50 // must be attached to anchor element to prevent bubbling 44 51 e.preventDefault(); 52 var $parent_li = $(this).parent("li"); 45 53 46 54 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"); 51 58 }); 52 59 53 60 } else { 54 // $(".toggleMenu").css("display", "none"); 61 //hover action 62 55 63 $(".responsive").hide(); 56 64 $(".sink_dropdown li a").unbind("click"); … … 60 68 }); 61 69 } 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 63 83 }); -
sinking-dropdowns/trunk/readme.txt
r720447 r720987 2 2 Contributors: yonisink 3 3 Donate link: http://www.social-ink.net 4 Tags: dropdown, menus, hover, responsive 4 Tags: dropdown, menus, hover, responsive, jquery, appearance,drop-down, menu 5 5 Requires at least: 3.1 6 6 Tested up to: 3.5.1 7 Stable Tag: 1.1 7 Stable Tag: 1.11 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 11 12 Convert WordPress menu to a responsive hover/click dropdown menu.12 Convert default WordPress menu to a responsive hover/click dropdown menu. 13 13 14 14 == Description == 15 15 16 Create a WordPress menu (up to three levels) and havea nice responsive dropdown using template tags.16 Create 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. 17 17 18 18 Choose 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"). … … 33 33 == Frequently Asked Questions == 34 34 35 Nothing yet! 35 = Can I prevent the top items from being clickable on a manual basis (in hover mode)? = 36 36 37 Definitely - 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. 37 38 38 39 == Changelog == 39 40 41 = 1.1.1 = 42 43 Added ability to prevent clickthroughs. 44 40 45 = 1.1 = 41 46 42 Added color choice override options, including alpha transparency choosing .47 Added color choice override options, including alpha transparency choosing, and preventing top clicks. 43 48 44 49 = 1 = -
sinking-dropdowns/trunk/sinking_dropdowns.php
r720447 r720987 4 4 Plugin URI: http://www.social-ink.net 5 5 Author URI: http://www.social-ink.net 6 Version: 1 6 Version: 1.11 7 7 Author: Yonatan Reinberg of Social Ink 8 8 Description: Responsive Dropdown Plugin … … 42 42 $sinkdropdowns_menushow = get_option('sinkdropdowns_menushow'); 43 43 $sinkdropdowns_responsive_break = get_option('sinkdropdowns_responsive_break'); 44 $sinkdropdowns_prevent_top_clicks = get_option('sinkdropdowns_prevent_top_clicks'); 45 46 //custom colors 44 47 $sinkdropdowns_sink_dropdown_themeoverwrite = get_option('sinkdropdowns_sink_dropdown_themeoverwrite'); 45 48 46 49 if($sinkdropdowns_sink_dropdown_themeoverwrite) { 47 //colors50 48 51 $sinkdropdowns_sink_dropdown_top = get_option('sinkdropdowns_sink_dropdown_top'); 49 52 $sinkdropdowns_sink_dropdown_top_link = get_option('sinkdropdowns_sink_dropdown_top_link'); … … 61 64 /* <![CDATA[ */ 62 65 var sinkingdropdowns = { "reveal_action":'<?php echo $sinkdropdowns_menushow ?>', 66 "prevent_top_clicks":'<?php echo $sinkdropdowns_prevent_top_clicks ?>', 63 67 "responsive_break":'<?php echo $sinkdropdowns_responsive_break ?>' }; 64 68 /* ]]> */ -
sinking-dropdowns/trunk/views/config.php
r720447 r720987 11 11 $sinkdropdowns_menushow = get_option('sinkdropdowns_menushow'); 12 12 $sinkdropdowns_responsive_break = get_option('sinkdropdowns_responsive_break'); 13 $sinkdropdowns_prevent_top_clicks = get_option('sinkdropdowns_prevent_top_clicks'); 13 14 14 15 //colors … … 54 55 <p><b>Click or hover to reveal dropdown:</b></p> 55 56 <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> 58 67 </p> 59 68 </div> … … 69 78 <div class="field"> 70 79 <p> 71 <label for="sinkdropdowns_sink_dropdown_themeoverwrite" class="checkbox_label"><strong>Overwrite CSS colors with custom colors:</strong></label>80 72 81 <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> 74 83 </p> 75 84
Note: See TracChangeset
for help on using the changeset viewer.