Changeset 888392
- Timestamp:
- 04/06/2014 03:53:04 PM (12 years ago)
- Location:
- shortcode-menu/trunk
- Files:
-
- 6 edited
-
help.php (modified) (8 diffs)
-
js/enhance.menu.js (modified) (2 diffs)
-
readme.txt (modified) (6 diffs)
-
shortcode-menu.css (modified) (3 diffs)
-
shortcode-menu.php (modified) (8 diffs)
-
style.css (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shortcode-menu/trunk/help.php
r843188 r888392 49 49 </tr> 50 50 51 < tr>51 <!--<tr> 52 52 <td>List Style (Optional)<div class="example">( Ordered | Unordered )</div></td> 53 53 <td><label for="shortcode_list"><input type="checkbox" id="shortcode_list"/> Ordered List Style (Defualt Unordered)</label></td> 54 </tr> 54 </tr>--> 55 55 56 56 … … 63 63 <td>Enhance (Optional) <div class="example">( true | false )</div></td> 64 64 <td><input checked="checked" type="checkbox" id="shortcode_enhance"/><label for="shortcode_enhance"> Enhance List (Defualt true)</label></td> 65 </tr> 66 67 <tr> 68 <td colspan="2" class="wpsm-highlighter-row"><span>Design your menu on fly</span></td> 69 </tr> 70 71 <tr> 72 <td>Menu Background Color (Optional)</td> 73 <td><input type="text" value="#fff" id="wpsm-color-field" class="color-picker" /><input type="checkbox" checked="checked" id="wpsm-color-field-check" class="field-check"/><label for="wpsm-color-field-check"> Disable</label></td> 74 </tr> 75 76 <tr> 77 <td>Menu Anchor Color (Optional)</td> 78 <td><input type="text" value="#fff" id="wpsm-anchor-color-field" class="color-picker"/><input type="checkbox" checked="checked" id="wpsm-anchor-color-field-check" class="field-check" /><label for="wpsm-anchor-color-field-check"> Disable</label></td> 79 </tr> 80 81 <tr> 82 <td>Menu Anchor Hover Color (Optional)</td> 83 <td><input type="text" value="#fff" id="wpsm-anchor-hover-color-field" class="color-picker"/><input type="checkbox" checked="checked" id="wpsm-anchor-hover-color-field-check" class="field-check" /><label for="wpsm-anchor-hover-color-field-check"> Disable</label></td> 84 </tr> 85 86 <tr class="hide-field"> 87 <td>Sub Menu Background Color (Optional)</td> 88 <td><input type="text" value="#000" id="wpsm-submenu-color-field" class="color-picker"/><input type="checkbox" id="wpsm-submenu-color-field-check" class="field-check" /><label for="wpsm-submenu-color-field-check"> Disable</label><br/> 89 <span>Opacity:</span> <input type="text" value="0.8" id="wpsm-submenu-transparency" style="width:2.5em" onchange="generate_shortcode();" /> <span>(Max: 1)</span></td> 90 </tr> 91 92 93 <tr class="hide-field"> 94 <td>Sub Menu Anchor Color (Optional)</td> 95 <td><input type="text" value="#e0e0e0" id="wpsm-submenu-anchor-color-field" class="color-picker" /><input type="checkbox" id="wpsm-submenu-anchor-color-field-check" class="field-check" /><label for="wpsm-submenu-anchor-color-field-check"> Disable</label></td> 96 </tr> 97 98 <tr class="hide-field"> 99 <td>Sub Menu Anchor Hover Color (Optional)</td> 100 <td><input type="text" value="#fff" id="wpsm-submenu-anchor-hover-color-field" class="color-picker" /><input type="checkbox" id="wpsm-submenu-anchor-hover-color-field-check" class="field-check" /><label for="wpsm-submenu-anchor-hover-color-field-check"> Disable</label></td> 101 </tr> 102 103 <tr class="hide-field"> 104 <td>Enable arrow (Optional)</div></td> 105 <td><input checked="checked" type="checkbox" id="shortcode_arrow" class="field-check"/><label for="shortcode_arrow"> Menu Arrow (Defualt true)</label></td> 106 </tr> 107 108 <tr class="hide-field"> 109 <td>Custom CSS (Optional)</div></td> 110 <td><textarea id="sm_custom_css" name="sm_custom_css" onchange="generate_shortcode();"></textarea></td> 65 111 </tr> 66 112 … … 73 119 </div><!-- .postbox --> 74 120 </div><!-- .postbox-container --> 75 <div class="postbox-container"> 121 122 <div class="postbox-container"> 123 <div class="postbox"> 124 <h3>Connect with me</h3> 125 126 <div class="inner"> 127 <div id="server_msg"></div> 128 <form method="post" id="wpsm_support_form"> 129 <div class="field field-last"> 130 <label for="your_name">Your name</label> 131 <input type="text" id="your_name" required="required" name="your_name" placeholder="Your name"/> 132 </div> 133 <div class="field field-last"> 134 <label for="your_email">Your Email</label> 135 <input type="text" id="your_email" name="your_email" required="required" placeholder="Your email"/> 136 </div> 137 <div class="field field-last"> 138 <label for="your_message">Your Message</label> 139 <textarea id="your_message" name="your_message" required="required" placeholder="Your message"></textarea> 140 </div> 141 </form> 142 <div class="field field-last"> 143 <input type="button" name="wpsm_submit" id="wpsm_submit" onclick="send_support()" value="Send" class="button"/> 144 </div> 145 </div> 146 </div> 147 </div> 148 149 <div class="postbox-container"> 150 <div class="postbox"> 151 <h3>Donation</h3> 152 <div class="field field-last"> 153 <form id="paypal_form" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank"> 154 Enjoyed this plugin? You can donate to this plugin using PayPal. Click to donate.<br/> 155 <input type="hidden" name="cmd" value="_s-xclick"> 156 <input type="hidden" name="hosted_button_id" value="6KENHJ854VL7J"> 157 <input type="image" class="donate" src="<?php echo plugins_url('/images/donate.png',__FILE__); ?>" border="0" name="submit" alt="PayPal – The safer, easier way to pay online."> 158 <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1"> 159 </form> 160 </div> 161 </div> 162 </div> 163 164 <div class="postbox-container"> 165 <div class="postbox"> 166 <h3>Are you CSS lover? Customize your menu (Add in your theme's style.css)</h3> 167 168 <div class="inner"> 169 <code> 170 <strong>/* style main menu */</strong></code> 171 <code> 172 ul.shortcode_menu.YOUR_MENU_CLASS 173 { 174 175 }</code> 176 <code> 177 ul.shortcode_menu.YOUR_MENU_CLASS li 178 { 179 180 }</code> 181 <code> 182 ul.shortcode_menu.YOUR_MENU_CLASS li:hover 183 { 184 185 }</code> 186 <code> 187 ul.shortcode_menu.YOUR_MENU_CLASS li a 188 { 189 190 } 191 </code> 192 <code> 193 ul.shortcode_menu.YOUR_MENU_CLASS li:hover a 194 { 195 196 } 197 </code> 198 <code> 199 <strong>/* style sub menus */</strong></code> 200 <code> 201 ul.shortcode_menu.YOUR_MENU_CLASS li ul.sub-menu 202 { 203 204 }</code> 205 <code> 206 ul.shortcode_menu.YOUR_MENU_CLASS li ul.sub-menu li 207 { 208 209 }</code> 210 <code> 211 ul.shortcode_menu.YOUR_MENU_CLASS li ul.sub-menu li:hover 212 { 213 214 }</code> 215 <code> 216 ul.shortcode_menu.YOUR_MENU_CLASS li ul.sub-menu li a 217 { 218 219 }</code> 220 <code> 221 ul.shortcode_menu.YOUR_MENU_CLASS li ul.sub-menu li:hover a 222 { 223 224 }</code> 225 <code> 226 <strong>/* style arrows */</strong></code> 227 <code> 228 ul.shortcode_menu.YOUR_MENU_CLASS ul.wpsm-arrow-enabled:before 229 { 230 231 }</code> 232 <code> 233 ul.shortcode_menu.YOUR_MENU_CLASS ul.wpsm-arrow-enabled.wpsm-left-arrow:before 234 { 235 236 }</code> 237 <code> 238 ul.shortcode_menu.YOUR_MENU_CLASS ul.wpsm-arrow-enabled.wpsm-up-arrow:before 239 { 240 241 } 242 </code> 243 244 </div> 245 246 </div><!-- .postbox --> 247 </div><!-- .postbox-container --> 248 249 250 <div class="postbox-container"> 76 251 <div class="postbox"> 77 252 <h3>Supported Attributes</h3> … … 91 266 </tr> 92 267 93 < tr>268 <!--<tr> 94 269 <td><strong>list</strong></td> 95 270 <td>: To display <em>oredered</em> or <em>unordered list</em> (default : ul) 96 <span id="list_help" class="help_button" onclick="show_help(this.id)"><img src="<?php echo plugins_url('/images/q-icon.png',__FILE__); ?>"/></span>271 <span id="list_help" class="help_button" onclick="show_help(this.id)"><img src="<?php //echo plugins_url('/images/q-icon.png',__FILE__); ?>"/></span> 97 272 </td> 98 </tr> 273 </tr>--> 99 274 <tr> 100 275 <td><strong>display</strong></td> … … 114 289 </div><!-- .postbox-container --> 115 290 116 <div class="postbox-container">117 <div class="postbox">118 <h3>Donation</h3>119 <div class="field field-last">120 <form id="paypal_form" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">121 Enjoyed this plugin? You can donate to this plugin using PayPal. Click to donate.<br/>122 <input type="hidden" name="cmd" value="_s-xclick">123 <input type="hidden" name="hosted_button_id" value="6KENHJ854VL7J">124 <input type="image" class="donate" src="<?php echo plugins_url('/images/donate.png',__FILE__); ?>" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">125 <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">126 </form>127 </div>128 </div>129 </div>130 291 131 <div class="postbox-container clear">132 <div class="postbox">133 <h3>Shortcodes</h3>134 <div class="field">135 <h4>Basic : </h4>136 <input type="text" readonly value="[shortmenu menu='menu name/slug']"/><br/>137 <div class="example">Example : [shortmenu menu="Main Menu"]</div>138 </div>139 140 <div class="field">141 <h4>Attributes : </h4>142 <input type="text" readonly value='[shortmenu menu="menu name/slug" id="id" class="class"]'/><br/>143 <div class="example">Example : [shortmenu menu="Main Menu" id="myMenu" class="myMenuClass"]</div>144 </div>145 146 <div class="field">147 <h4>Display (To display menu inline - default:block): </h4>148 <input type="text" readonly value='[shortmenu menu="menu name/slug" display="inline"]'/>149 </div>150 151 <div class="field">152 <h4>List Style (To display menu in ordered or unordered style - default:ul): </h4>153 <input type="text" readonly value='[shortmenu menu="menu name/slug" list="ol"]'/>154 </div>155 156 <div class="field field-last">157 <h4>Enhance (Default : true):</h4>158 <input type="text" readonly value='[shortmenu menu="menu name/slug" enhance="false"]'/>159 </div>160 292 161 </div><!-- .postbox -->162 </div><!-- .postbox-container -->163 164 165 166 167 293 168 294 </div><!-- wrap --> … … 243 369 244 370 if (jQuery('#shortcode_enhance').is(':checked')) 371 { 245 372 var shortcode_enhance = ' enhance="true" '; 246 else 373 jQuery('.hide-field').fadeIn('slow'); 374 var enhance_enable = true; 375 } 376 else 377 { 247 378 var shortcode_enhance = ' enhance="false" '; 248 379 jQuery('.hide-field').fadeOut('slow'); 380 var enhance_enable = false; 381 } 382 249 383 250 384 if(jQuery('#shortcode_list').is(':checked')) … … 253 387 var shortcode_list = ''; 254 388 255 var shortcode = shortcode_start+shortcode_menu+shortcode_id+shortcode_class+shortcode_display+shortcode_list+shortcode_enhance+shortcode_end; 389 if(!jQuery('#wpsm-color-field-check').is(':checked')) 390 { 391 var menu_color = jQuery( '#wpsm-color-field' ).wpColorPicker( 'color' ); 392 if(menu_color != '') 393 var shortcode_menu_color = ' menu_color="'+menu_color+'" '; 394 else 395 var shortcode_menu_color = ''; 396 } 397 else 398 var shortcode_menu_color = ''; 399 400 if(!jQuery('#wpsm-anchor-color-field-check').is(':checked')) 401 { 402 var menu_anchor_color = jQuery( '#wpsm-anchor-color-field' ).wpColorPicker( 'color' ); 403 if(menu_anchor_color != '') 404 var shortcode_menu_anchor_color = ' menu_anchor_color="'+menu_anchor_color+'" '; 405 else 406 var shortcode_menu_anchor_color = ''; 407 } 408 else 409 var shortcode_menu_anchor_color = ''; 410 411 if(!jQuery('#wpsm-anchor-hover-color-field-check').is(':checked')) 412 { 413 var menu_anchor_hover_color = jQuery( '#wpsm-anchor-hover-color-field' ).wpColorPicker( 'color' ); 414 if(menu_anchor_hover_color != '') 415 var shortcode_menu_anchor_hover_color = ' menu_anchor_hover_color="'+menu_anchor_hover_color+'" '; 416 else 417 var shortcode_menu_anchor_hover_color = ''; 418 } 419 else 420 var shortcode_menu_anchor_hover_color = ''; 421 422 if(!jQuery('#wpsm-submenu-color-field-check').is(':checked') && enhance_enable == true) 423 { 424 var submenu_color = jQuery( '#wpsm-submenu-color-field' ).wpColorPicker( 'color' ); 425 if(submenu_color != '') 426 var shortcode_submenu_color = ' submenu_color="'+submenu_color+'" '; 427 else 428 var shortcode_submenu_color = ''; 429 } 430 else 431 var shortcode_submenu_color = ''; 432 433 if(!jQuery('#wpsm-submenu-anchor-color-field-check').is(':checked') && enhance_enable == true) 434 { 435 var submenu_anchor_color = jQuery( '#wpsm-submenu-anchor-color-field' ).wpColorPicker( 'color' ); 436 if(submenu_anchor_color != '') 437 var shortcode_submenu_anchor_color = ' submenu_anchor_color="'+submenu_anchor_color+'" '; 438 else 439 var shortcode_submenu_anchor_color = ''; 440 } 441 else 442 var shortcode_submenu_anchor_color = ''; 443 444 if(!jQuery('#wpsm-submenu-anchor-hover-color-field-check').is(':checked') && enhance_enable == true) 445 { 446 var submenu_anchor_hover_color = jQuery( '#wpsm-submenu-anchor-hover-color-field' ).wpColorPicker( 'color' ); 447 if(submenu_anchor_hover_color != '') 448 var shortcode_submenu_anchor_hover_color = ' submenu_anchor_hover_color="'+submenu_anchor_hover_color+'" '; 449 else 450 var shortcode_submenu_anchor_hover_color = ''; 451 } 452 else 453 var shortcode_submenu_anchor_hover_color = ''; 454 455 var submenu_transparency = jQuery('#wpsm-submenu-transparency').val(); 456 if(submenu_transparency != '' && enhance_enable == true) 457 var submenu_transparency_code = ' submenu_transparency="'+submenu_transparency+'" '; 458 else 459 var submenu_transparency_code = ''; 460 461 if(enhance_enable == true) 462 { 463 if(!jQuery('#shortcode_arrow').is(':checked')) 464 var shortcode_arrow = ' arrow="false" '; 465 else 466 var shortcode_arrow = ' arrow="true" '; 467 } 468 else 469 var shortcode_arrow = ''; 470 var sm_custom_css = jQuery('#sm_custom_css').val(); 471 if(sm_custom_css != '') 472 var shortcode_sm_custom_css = ' css="'+sm_custom_css+'" '; 473 else 474 var shortcode_sm_custom_css = ''; 475 476 var shortcode = shortcode_start+shortcode_menu+shortcode_id+shortcode_class+shortcode_display+shortcode_list+shortcode_enhance+shortcode_menu_color+shortcode_menu_anchor_color+shortcode_menu_anchor_hover_color+shortcode_submenu_color+shortcode_submenu_anchor_color+shortcode_submenu_anchor_hover_color+submenu_transparency_code+shortcode_arrow+shortcode_sm_custom_css+shortcode_end; 256 477 if(menu != 'Select') 257 478 { 258 jQuery('#help-text').html('Now just copy and paste intoanywhere');479 jQuery('#help-text').html('Now just copy and paste anywhere'); 259 480 jQuery("#shortcode").fadeOut("fast", function() 260 481 { … … 285 506 generate_shortcode(); 286 507 }); 508 509 jQuery('.field-check').click(function() { 510 generate_shortcode(); 511 }); 512 513 jQuery(document).ready(function($){ 514 var myOptions = { 515 // you can declare a default color here, 516 // or in the data-default-color attribute on the input 517 defaultColor: false, 518 // a callback to fire whenever the color changes to a valid color 519 change: function(event, ui){ 520 var id = jQuery(this).attr('id'); 521 var id_check = id+'-check'; 522 jQuery('#'+id_check).attr('checked',false); 523 generate_shortcode(); 524 }, 525 // a callback to fire when the input is emptied or an invalid color 526 clear: function(event, ui) { 527 generate_shortcode(); 528 }, 529 // hide the color picker controls on load 530 hide: true, 531 // show a group of common colors beneath the square 532 // or, supply an array of colors to customize further 533 palettes: true 534 }; 535 $('.color-picker').wpColorPicker(myOptions); 536 537 jQuery('.wp-picker-clear').click(function(){ 538 var id = jQuery(this).prev().attr('id'); 539 var check_id = id+'-check'; 540 jQuery('#'+check_id).attr('checked',true); 541 generate_shortcode(); 542 }); 543 }); 544 545 function send_support() 546 { 547 var data = jQuery('#wpsm_support_form').serialize(); 548 data = 'action=wpsm_shortcode_menu_mail&'+data; 549 jQuery.post(ajaxurl, data, function(response) { 550 jQuery('#server_msg').html('<div>'+response+'</div>'); 551 }); 552 } 553 287 554 </script> 288 555 -
shortcode-menu/trunk/js/enhance.menu.js
r760504 r888392 1 if (typeof yourvar != 'undefined') 2 var show_arrow = false; 3 //var show_arrow = false; 1 4 $x = jQuery.noConflict(); 5 $x(document).ready(function() { 2 6 $x(".menu_enhance, .enhance_shortcode_menu_list").each(function() { 3 7 var id = this.id; 4 menu_superfish(id);5 8 if($x("#"+id).find(".sub-menu")) 6 { 9 { 10 var smleft, sub_smleft; 7 11 12 if(show_arrow == 'true') 13 { 14 smleft = '120%'; 15 sub_smleft = '108%'; 16 } 17 else 18 { 19 smleft = '100%'; 20 sub_smleft = '100%'; 21 } 22 8 23 $x($x("#"+id+" li .sub-menu")).each(function(index,element){ 9 var max_w = $x(this).parent().children("a").width(); 10 $x(this).css("left",max_w+10); 24 $x(this).css({"left":smleft, "top":0}); 11 25 }); 12 26 13 27 $x($x("#"+id+" li .sub-menu .sub-menu")).each(function(index,element){ 14 $x(this).css( "left","100%");28 $x(this).css({"left":sub_smleft, "top":0}); 15 29 }); 16 30 } … … 20 34 $x(".enhance_shortcode_menu_inline, .enhance_shortcode_menu_inline_list").each(function() { 21 35 var id = this.id; 22 menu_superfish(id); 36 23 37 if($x("#"+id).find(".sub-menu")) 24 38 { 39 $x(this).css("left",'0'); 25 40 26 //$x($x("#"+id+" li .sub-menu")).each(function(index,element){ 27 // var max = $x(this).parent().children("a").width(); 28 $x(this).css("left",'0'); 29 //}); 41 var smleft, smtop; 42 43 if(show_arrow == 'true') 44 { 45 smleft = '114%'; 46 smtop = '140%'; 47 } 48 else 49 { 50 smleft = '100%'; 51 smtop = '100%'; 52 } 53 54 $x($x("#"+id+" li .sub-menu")).each(function(index,element){ 55 $x(this).css({"left":0, "top":smtop}); 56 }); 30 57 31 58 $x($x("#"+id+" li .sub-menu .sub-menu")).each(function(index,element){ 32 $x(this).css( "left","100%");59 $x(this).css({"left":smleft, "top":0}); 33 60 }); 34 61 } 62 }); 35 63 }); 36 64 37 65 38 66 $x(document).ready(function() { 39 $x(".menu_enhance .sub-menu li:first-child a").append("<div class='arrow-left'></div>"); 40 $x(".menu_enhance .sub-menu .sub-menu li a .arrow-left").remove(); 67 68 $x(".menu_enhance .sub-menu").each(function(index,element){ 69 if(show_arrow == 'true') 70 { 71 $x(this).addClass('wpsm-arrow-enabled'); 72 $x(this).addClass('wpsm-left-arrow'); 73 } 74 }); 75 41 76 }); 42 77 $x(document).ready(function() { 43 $x(".enhance_shortcode_menu_list .sub-menu li:first-child a").append("<div class='arrow-left'></div>"); 44 $x(".enhance_shortcode_menu_list .sub-menu .sub-menu li a .arrow-left").remove(); 78 $x(".enhance_shortcode_menu_inline .sub-menu").each(function(index,element){ 79 if(show_arrow == 'true') 80 { 81 $x(this).addClass('wpsm-arrow-enabled'); 82 $x(this).addClass('wpsm-up-arrow'); 83 } 84 }); 85 $x(".enhance_shortcode_menu_inline .sub-menu .sub-menu").each(function(index,element){ 86 if(show_arrow == 'true') 87 { 88 $x(this).removeClass('wpsm-up-arrow'); 89 $x(this).addClass('wpsm-left-arrow'); 90 } 91 }); 92 93 $x('.wpsm-up-arrow').each(function(index,element){ 94 var pid = $x(this).parents('.shortcode_menu').attr('id'); 95 var w = $x(this).prev('a').width(); 96 $x('head').append('<style>#'+pid+' .wpsm-up-arrow:before { width : '+(w-10)+'px; }</style>'); 97 }); 45 98 }); 46 47 function menu_superfish(id)48 {49 $x('#'+id).superfish({50 animation: {height:'show'}, // slide-down effect without fade-in51 delay: 1200 // 1.2 second delay on mouseout52 });53 } -
shortcode-menu/trunk/readme.txt
r882470 r888392 5 5 Requires at least: 3.0.1 6 6 Tested up to: 3.8.1 7 Stable tag: 1.47 Stable tag: 2.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 21 21 The main feature is that, we have enhanced the sub menu to display it more effectively. You can disable this feature. 22 22 23 We will create your shortcode for you in just simp ple steps.23 We will create your shortcode for you in just simple steps. 24 24 25 25 == Installation == … … 32 32 33 33 == Frequently Asked Questions == 34 35 = My menu design collapse after updated to 2.0 = 36 37 We have added custom styling of menu. Just go to our menu create newly shortcode and replace with old one. 38 Note - If you want exactly same as previous design just select your menu and copy-paste with your previous shortcode. 34 39 35 40 = Why should I use it as we are having Custom Menu widget? = … … 44 49 No issues, use text widget. Just copy-paste your shortcode. 45 50 46 = What will have in our next version? =47 48 Widget, Yes next version will have directly widget so you need not use copy paste your shortcode in Text Widget.49 50 51 51 52 == Screenshots == … … 53 54 1. Example of the Simple Enhanced menu. 54 55 2. Example of the Inline display menu. 55 3. Example of the Ordered List menu. 56 4. Easy creating Shortcodes. 56 3. Easy creating Shortcodes. 57 57 58 58 == Changelog == 59 60 = 2.0 = 61 * Quick design menu 62 * Solved superfish conflict (Superfish removed). 63 * Custom css 64 * Quick support form 59 65 60 66 = 1.4 = … … 78 84 == Upgrade Notice == 79 85 86 = 2.0 = 87 Use custom CSS. Quick design your menu. Solved superfish conflict. 88 89 = 1.4 = 90 Remove jquery-ui css errors 91 80 92 = 1.3 = 81 93 Upgrade will remove warnings. Error free logs. -
shortcode-menu/trunk/shortcode-menu.css
r755491 r888392 8 8 { 9 9 margin:0.5em 0; 10 padding:0 0 0 1.5em; 11 } 12 10 padding:0; 11 } 12 13 /* vertical */ 14 .wpsm-menu, .wpsm-menu ul, .wpsm-menu ul ul 15 { 16 list-style:none; 17 display:inline-block; 18 padding: 0 !important; 19 margin:0 !important; 20 } 21 .wpsm-menu li 22 { 23 margin:0 5px; 24 padding:0; 25 display: inline-block; 26 position: relative; 27 list-style:none; 28 } 29 .wpsm-menu li:first-child 30 { 31 margin-left:0 32 } 33 .wpsm-menu li:last-child 34 { 35 margin-right:0; 36 } 37 .wpsm-menu ul li 38 { 39 padding:3px 5px; 40 list-style:none; 41 display:block; 42 } 43 .wpsm-menu.menu_enhance li 44 { 45 position:relative; 46 list-style:none; 47 margin:0; 48 display:block; 49 } 50 .wpsm-menu.menu_enhance ul, .wpsm-vertical.menu_enhance ul ul 51 { 52 position:absolute; 53 right:0; 54 left:auto; 55 top:-5px; 56 width:12em; 57 visibility:hidden; 58 opacity:0; 59 z-index:-999; 60 overflow:hidden; 61 transition: opacity 0.5s linear; 62 -webkit-transition: opacity 0.5s linear; 63 -moz-transition: opacity 0.5s linear; 64 -o-transition: opacity 0.5s linear; 65 } 66 .wpsm-menu.menu_enhance li:hover > ul 67 { 68 opacity:1; 69 visibility:visible; 70 z-index:999; 71 overflow:visible; 72 } 73 74 .wpsm-arrow-left { 75 width: 0; 76 height: 0; 77 border-top: 10px solid transparent; 78 border-bottom: 10px solid transparent; 79 border-right:10px solid blue; 80 } 13 81 14 82 /* simple enhance */ … … 35 103 .enhance_shortcode_menu_inline 36 104 { 37 38 } 39 .enhance_shortcode_menu_inline li 40 { 41 margin:0 5px; 42 } 43 .enhance_shortcode_menu_inline > li:first-child a.sf-with-ul 44 { 45 padding:0 !important; 46 } 47 .enhance_shortcode_menu_inline > li:first-child ul li a.sf-with-ul 48 { 49 padding-right:1.5em !important; 50 } 51 .enhance_shortcode_menu_inline .arrow-left 52 { 53 display:none; 105 106 } 107 .entry-content .enhance_shortcode_menu_inline li, .enhance_shortcode_menu_inline li 108 { 109 margin: 0 10px; 110 padding: 3px 5px; 111 } 112 .enhance_shortcode_menu_inline ul 113 { 114 position: absolute; 115 padding: 0 !important; 116 margin:0 !important; 117 min-width: 10em; 118 visibility:hidden; 119 opacity:0; 120 z-index:-999; 121 overflow:hidden; 122 transition: opacity 0.5s linear; 123 -webkit-transition: opacity 0.5s linear; 124 -moz-transition: opacity 0.5s linear; 125 -o-transition: opacity 0.5s linear; 126 } 127 .enhance_shortcode_menu_inline ul ul 128 { 129 top:0; 130 } 131 .enhance_shortcode_menu_inline ul li 132 { 133 display: block; 134 } 135 .enhance_shortcode_menu_inline li:hover > ul 136 { 137 visibility:visible; 138 opacity:1; 139 z-index:999; 140 overflow:visible; 141 } 142 143 .enhance_shortcode_menu_inline ul li span.wpsm-icon-arrow-up 144 { 145 top: -19px; 146 bottom: auto; 147 left: 0; 148 padding: 0; 149 } 150 .enhance_shortcode_menu_inline ul li span.wpsm-icon-arrow-left 151 { 152 left: -25px; 153 top: 3px; 54 154 } 55 155 … … 121 221 margin:0; 122 222 } 223 224 225 /* styles */ 226 .wpsm-menu.menu_enhance.wpsm-white ul, .wpsm-vertical.menu_enhance.wpsm-white ul ul 227 { 228 background:white; 229 box-shadow:0 0 2px #999; 230 } 231 .wpsm-vertical.menu_enhance.wpsm-white span.wpsm-icons 232 { 233 color:white; 234 text-shadow:-1px 0 2px #999; 235 } 236 237 /* Font */ 238 @font-face { 239 font-family: 'wpsmicomoon'; 240 src:url('fonts/wpsmicomoon.eot?-n2fq81'); 241 src:url('fonts/wpsmicomoon.eot?#iefix-n2fq81') format('embedded-opentype'), 242 url('fonts/wpsmicomoon.woff?-n2fq81') format('woff'), 243 url('fonts/wpsmicomoon.ttf?-n2fq81') format('truetype'), 244 url('fonts/wpsmicomoon.svg?-n2fq81#wpsmicomoon') format('svg'); 245 font-weight: normal; 246 font-style: normal; 247 } 248 249 .wpsm-arrow-enabled:before 250 { 251 font-family: 'wpsmicomoon'; 252 speak: none; 253 font-style: normal; 254 font-weight: normal; 255 font-variant: normal; 256 text-transform: none; 257 line-height: 1; 258 259 /* Better Font Rendering =========== */ 260 -webkit-font-smoothing: antialiased; 261 -moz-osx-font-smoothing: grayscale; 262 position: absolute; 263 font-size: 29px; 264 } 265 .wpsm-left-arrow:before { 266 content: "\e600"; 267 left: -20px; 268 top: -2px; 269 } 270 271 .wpsm-up-arrow:before { 272 content: "\e602"; 273 left: 0px; 274 top: -19px; 275 text-align:center; 276 } 277 278 279 [class^="wpsm-icon-"], [class*=" wpsm-icon-"] { 280 font-family: 'wpsmicomoon'; 281 speak: none; 282 font-style: normal; 283 font-weight: normal; 284 font-variant: normal; 285 text-transform: none; 286 line-height: 1; 287 288 /* Better Font Rendering =========== */ 289 -webkit-font-smoothing: antialiased; 290 -moz-osx-font-smoothing: grayscale; 291 position: absolute; 292 left: -20px; 293 font-size: 1.8em; 294 top: 0px; 295 } 296 297 .wpsm-icon-arrow-left:before { 298 content: "\e600"; 299 } 300 .wpsm-icon-arrow-down:before { 301 content: "\e601"; 302 } 303 .wpsm-icon-arrow-up:before { 304 content: "\e602"; 305 } 306 .wpsm-icon-arrow-right:before { 307 content: "\e603"; 308 } -
shortcode-menu/trunk/shortcode-menu.php
r882480 r888392 4 4 Plugin URI: http://wordpress.org/plugins/shortcode-menu/ 5 5 Description: To display menu's everywhere like sidebar, header, footer, pages, posts or theme template with effective styling and customization using shortcode. 6 Version: 1.46 Version: 2.0 7 7 Author:Amit Sukapure 8 8 Author URI: http://in.linkedin.com/in/amitsukapure/ 9 9 */ 10 /* Copyright YEAR PLUGIN_AUTHOR_NAME (email : amit.sukapure 89@gmail.com)10 /* Copyright YEAR PLUGIN_AUTHOR_NAME (email : amit.sukapure@gmail.com) 11 11 This program is free software; you can redistribute it and/or modify 12 12 it under the terms of the GNU General Public License, version 2, as … … 30 30 add_action('wp_enqueue_scripts', array($this, 'menushort_template_scripts_styles')); 31 31 add_action('admin_enqueue_scripts', array($this, 'menushort_admin_scripts_styles')); 32 add_action( 'wp_ajax_wpsm_shortcode_menu_mail', array($this, 'wpsm_mail_callback' )); 32 33 add_shortcode('shortmenu', array($this,'display_shortcode_menu')); 33 34 } … … 40 41 function menushort_template_scripts_styles() 41 42 { 42 wp_ register_script('enhance-script-menu', plugins_url('js/superfish.js', __FILE__));43 wp_register_script('enhance-script-menu-hover', plugins_url('js/hoverIntent.js', __FILE__));43 wp_enqueue_script('jquery'); 44 44 45 wp_register_script('enhance-script-enhance-menu', plugins_url('js/enhance.menu.js', __FILE__)); 45 46 wp_enqueue_script('enhance-script-menu');47 wp_enqueue_script('enhance-script-menu-hover');48 46 wp_enqueue_script('enhance-script-enhance-menu'); 49 50 wp_register_style('enhance-style', plugins_url('css/superfish.css', __FILE__));51 wp_register_style('enhance-style-vertical', plugins_url('css/superfish-vertical.css', __FILE__));52 53 wp_enqueue_style('enhance-style');54 wp_enqueue_style('enhance-style-vertical');55 47 56 48 wp_register_style('menushort-style', plugins_url('shortcode-menu.css', __FILE__)); … … 68 60 wp_register_style('menushort-admin-style', plugins_url('style.css', __FILE__)); 69 61 wp_enqueue_style( 'menushort-admin-style' ); 62 63 wp_enqueue_style( 'wp-color-picker' ); 64 wp_enqueue_script( 'wp-color-picker' ); 70 65 } 71 66 … … 76 71 'class' => '', 77 72 'menu' => '', 78 'list' => 'ul',73 //'list' => 'ul', 79 74 'display' => 'block', 80 'enhance' => 'true' 75 'enhance' => 'true', 76 'menu_color' => '', 77 'menu_anchor_color' => '', 78 'menu_anchor_hover_color' => '', 79 'submenu_color' => '', 80 'submenu_anchor_color' => '', 81 'submenu_anchor_hover_color' => '', 82 'submenu_transparency' => '', 83 'arrow' => 'true', 84 'css' => '' 81 85 ), $attr ) ); 86 87 $list = 'ul'; 88 89 if($menu_color != '') 90 { 91 $menu_style = 'background:'.$menu_color.'; '; 92 } 93 if($menu_anchor_color != '') 94 { 95 $menu_anchor_color_style = 'color:'.$menu_anchor_color.'; '; 96 } 97 if($menu_anchor_hover_color != '') 98 { 99 $menu_anchor_hover_color_style = 'color:'.$menu_anchor_hover_color.'; '; 100 } 101 if($submenu_color != '') 102 { 103 $rgba = $this->wpsm_hex2rgb($submenu_color); 104 if($submenu_transparency != '') 105 $opacity = $submenu_transparency; 106 else 107 $opacity = '1'; 108 109 $sub_menu_color = 'rgba('.$rgba[0].','.$rgba[1].','.$rgba[2].','.$opacity.');'; 110 111 $sub_menu_style = 'background: '.$sub_menu_color; 112 $icon_style = 'color:'.$sub_menu_color; 113 } 114 if($submenu_anchor_color != '') 115 { 116 $submenu_anchor_color_style = 'color:'.$submenu_anchor_color.'; '; 117 } 118 if($submenu_anchor_hover_color != '') 119 { 120 $submenu_anchor_hover_color_style = 'color:'.$submenu_anchor_hover_color.'; '; 121 } 122 82 123 83 124 $menu_class = ''; … … 95 136 if($enhance == 'true' && $list == 'ul' && $display == 'block') 96 137 { 97 $menu_class .= ' sf-menu sf-vertical menu_enhance ';138 $menu_class .= ' wpsm-menu wpsm-vertical menu_enhance '; 98 139 } 99 140 elseif($enhance == 'true' && $list == 'ol' && $display == 'block') 100 141 { 101 $menu_class .= ' sf-menu sf-vertical enhance_shortcode_menu_list ';142 $menu_class .= ' wpsm-menu wpsm-vertical enhance_shortcode_menu_list '; 102 143 } 103 144 elseif(($enhance == 'true' && $list == 'ol' && $display == 'inline') 104 145 ||($enhance == 'false' && $list == 'ol' && $display == 'inline')) 105 146 { 106 $menu_class .= ' sf-menu enhance_shortcode_menu_inline_list ';147 $menu_class .= ' wpsm-menu enhance_shortcode_menu_inline_list '; 107 148 } 108 149 elseif(($enhance == 'true' && $list == 'ul' && $display == 'inline') 109 150 ||($enhance == 'false' && $list == 'ul' && $display == 'inline')) 110 151 { 111 $menu_class .= ' sf-menu enhance_shortcode_menu_inline ';152 $menu_class .= ' wpsm-menu enhance_shortcode_menu_inline '; 112 153 } 113 154 elseif($enhance == 'false' && $list == 'ol' && $display == 'block') 114 155 { 115 $menu_class .= ' shortcode_menu_list ';156 $menu_class .= ' wpsm-menu shortcode_menu_list '; 116 157 } 117 158 else … … 134 175 'link_before' => '', 135 176 'link_after' => '', 136 'items_wrap' => '<ul id="'.$menu_id.'" class="%2$s '.$menu_class.' ">%3$s</ul>',177 'items_wrap' => '<ul id="'.$menu_id.'" class="%2$s '.$menu_class.' ">%3$s</ul>', 137 178 'depth' => 0, 138 179 'walker' => '' 139 180 ); 140 return wp_nav_menu( $defaults ).'<div class="clear"></div>'; 181 return wp_nav_menu( $defaults ).'<div class="clear"></div> 182 <style> 183 #'.$menu_id.' { '.$menu_style.' } 184 #'.$menu_id.' ul.wpsm-arrow-enabled:before { '.$icon_style.' } 185 #'.$menu_id.' ul, #'.$menu_id.' ul ul { '.$sub_menu_style.' } 186 #'.$menu_id.' a { '.$menu_anchor_color_style.' } 187 #'.$menu_id.' a:hover { '.$menu_anchor_hover_color_style.' } 188 #'.$menu_id.' ul a { '.$submenu_anchor_color_style.' } 189 #'.$menu_id.' ul a:hover { '.$submenu_anchor_hover_color_style.' } 190 '.$css.' 191 </style> 192 <script type="text/javascript">var show_arrow = "'.$arrow.'"</script>'; 193 } 194 195 function wpsm_hex2rgb($hex) 196 { 197 $hex = str_replace("#", "", $hex); 198 199 if(strlen($hex) == 3) 200 { 201 $r = hexdec(substr($hex,0,1).substr($hex,0,1)); 202 $g = hexdec(substr($hex,1,1).substr($hex,1,1)); 203 $b = hexdec(substr($hex,2,1).substr($hex,2,1)); 204 } 205 else 206 { 207 $r = hexdec(substr($hex,0,2)); 208 $g = hexdec(substr($hex,2,2)); 209 $b = hexdec(substr($hex,4,2)); 210 } 211 $rgb = array($r, $g, $b); 212 //return implode(",", $rgb); // returns the rgb values separated by commas 213 return $rgb; // returns an array with the rgb values 214 } 215 216 function wpsm_mail_callback() 217 { 218 //if(wp_mail('[email protected]','Support request', 'Testing')) 219 // echo 'Mail sent'; 220 //else 221 // echo 'Not sent'; 222 $your_name = $_POST['your_name']; 223 $your_message = $_POST['your_message']; 224 $your_email = $_POST['your_email']; 225 $errors = 0; 226 $msg = ''; 227 if($your_name == '') 228 $errors++; 229 if($your_message == '') 230 $errors++; 231 if($errors == 0) 232 { 233 $site = home_url(); 234 $to = '[email protected]'; 235 $from = $your_email; 236 $subject = 'Support request for Shortcode Menu from '.$your_name; 237 $message = $your_message.'<br/><br/>Email - '.$your_email.' <br/><br/> Site - '.$site.'<br/><br/> - <br/> '.$your_name; 238 $headers = "From: ".$your_name." ". strip_tags($from) . "\r\n"; 239 $headers .= "Reply-To: ". strip_tags($from) . "\r\n"; 240 $headers .= "MIME-Version: 1.0\r\n"; 241 $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; 242 if(wp_mail( $to, $subject, $message, $headers)) 243 { 244 $msg = 'Your query has been sent.'; 245 $cls = 'updated'; 246 } 247 else 248 { 249 $headers = "Content-Type: text/html; charset=ISO-8859-1\r\n"; 250 if(wp_mail( $to, $subject, $message, $headers)) 251 { 252 $msg = 'Your query has been sent.'; 253 $cls = 'updated'; 254 } 255 else 256 { 257 $msg = 'Something went wrong. <br/> You can write directly to <strong>'.$to.'</strong>'; 258 $cls = 'error'; 259 } 260 } 261 //print_r(error_get_last()); 262 } 263 else 264 { 265 $msg = 'All fields are required'; 266 $cls = 'error'; 267 } 268 echo $msg; 269 die(); 270 //echo '<div class="'.$cls.' wpsm-message">'.$msg.'</div>'; 141 271 } 142 272 } … … 148 278 $menu_shortcode = new menu_shortcode; 149 279 } 280 150 281 ?> -
shortcode-menu/trunk/style.css
r843188 r888392 7 7 .hide 8 8 { 9 display:none ;9 display:none !important; 10 10 } 11 11 .padding … … 34 34 { 35 35 width:100%; 36 font-size:14px; 36 37 } 37 38 #create_table td, #create_table th … … 40 41 margin-bottom:1em; 41 42 padding:1em; 43 vertical-align: top; 44 } 45 #create_table td input[type=checkbox], #create_table td input[type=radio] 46 { 47 vertical-align:top 42 48 } 43 49 #create_table th … … 78 84 text-shadow: 1px 1px 1px white; 79 85 display:none; 86 min-height:130px; 80 87 } 81 88 .help … … 134 141 } 135 142 textarea.sm-area { width:100%; max-width:100%; padding:10px} 143 .wpsm-highlighter-row 144 { 145 text-align: center; 146 background: #F1F1F1; 147 padding: 0 !important; 148 border-radius: 3px; 149 } 150 .wpsm-highlighter-row span 151 { 152 background: white; 153 padding: 2px 10px; 154 font-weight: bold; 155 line-height: normal; 156 } 157 158 #create_table label 159 { 160 vertical-align:top 161 } 162 #create_table .wp-color-result 163 { 164 float: left; 165 } 166 #create_table .wp-picker-open+.wp-picker-input-wrap 167 { 168 float: left; 169 width: 130px; 170 } 171 #create_table .color-picker 172 { 173 width:80px !important; 174 } 175 #create_table .wp-picker-holder 176 { 177 clear:both; 178 } 179 .disabled-color 180 { 181 border:1px solid red 182 } 183 .toplevel_page_shortcode-menu code {display:block} 184 .toplevel_page_shortcode-menu code strong { font-weight:bold; line-height:20px; } 185 .toplevel_page_shortcode-menu .inner { padding:1em; } 186 .field {margin-bottom:1em} 187 .field input[type="text"], .field textarea 188 { 189 max-width:100%; 190 width:100%; 191 } 192 .field label 193 { 194 margin-bottom:5px; 195 display:block; 196 } 197 .wpsm-message 198 { 199 padding:10px; 200 } 201 #server_msg > div 202 { 203 background: rgb(255, 246, 212); 204 padding: 10px; 205 border: 1px solid rgb(255, 222, 52); 206 border-radius: 3px; 207 margin-bottom: 2em; 208 }
Note: See TracChangeset
for help on using the changeset viewer.