Changeset 1158422
- Timestamp:
- 05/12/2015 04:28:00 AM (11 years ago)
- Location:
- wr-megamenu/trunk
- Files:
-
- 14 edited
-
README.txt (modified) (1 diff)
-
assets/3rd-party/joomlashine/js/jsn-iconselector.js (modified) (1 diff)
-
assets/css/frontend.css (modified) (21 diffs)
-
assets/js/icon-options.js (modified) (1 diff)
-
includes/core/backend.php (modified) (5 diffs)
-
includes/helpers/html/icons.php (modified) (1 diff)
-
includes/helpers/html/tiny-mce.php (modified) (1 diff)
-
includes/helpers/shortcode.php (modified) (2 diffs)
-
includes/shortcode/element.php (modified) (1 diff)
-
includes/walker.php (modified) (1 diff)
-
main.php (modified) (1 diff)
-
shortcodes/submenu/submenu.php (modified) (2 diffs)
-
shortcodes/text/megamenu-text.php (modified) (1 diff)
-
themes/default/default.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wr-megamenu/trunk/README.txt
r1134429 r1158422 97 97 * Fixed Bugs with some popular themes 98 98 * Fixed Display in submenu level 3 99 99 100 = 1.1.1 = 101 * Improved interaction with icon selector 102 * Fixed Active menu cannot be saved after elements added -
wr-megamenu/trunk/assets/3rd-party/joomlashine/js/jsn-iconselector.js
r1134429 r1158422 890 890 891 891 var actionSelector = $.proxy(function (_this) { 892 var value_icon = $(_this).attr("data-value"); 892 893 $(_this).parents(".jsn-items-list").find(".active").removeClass("active"); 893 894 $(_this).parent().addClass("active"); 894 inputIcon.val( $(_this).attr("data-value"));895 inputIcon.val( value_icon ); 895 896 $(_this).parents(".wr-icon").find(".panel-heading .panel-title i").removeClass(); 896 897 $(_this).parents(".wr-icon").find(".panel-heading .panel-title i").addClass($(_this).attr("data-value")); 898 899 //Inser icon 900 var post_id = $(_this).parents('.icon_selector').attr('data-item_id'); 901 $.ajax( { 902 type : "POST", 903 url : Wr_Megamenu_Ajax.ajaxurl, 904 data : { 905 action : 'wr_megamenu_insert_icons_database', 906 post_id : post_id, 907 value_icon : value_icon, 908 wr_nonce_check : Wr_Megamenu_Ajax._nonce 909 }, 910 success: function (data) { } 911 } ); 897 912 }, this); 898 913 -
wr-megamenu/trunk/assets/css/frontend.css
r1134429 r1158422 15 15 .wr-megamenu-container { 16 16 width: 100%; 17 font-size: 12px; 17 18 -webkit-box-sizing: border-box; 18 19 -moz-box-sizing: border-box; 20 -ms-box-sizing: border-box; 21 -o-box-sizing: border-box; 19 22 box-sizing: border-box; 20 background: #000;21 23 } 22 24 .wr-megamenu-container a:hover, … … 33 35 } 34 36 .wr-megamenu-container ul.wr-mega-menu { 35 list-style: none;36 37 z-index: 9999; 37 38 float: left; … … 39 40 padding: 0; 40 41 width: 100%; 41 display: inline-flex;42 42 } 43 43 .wr-megamenu-container .block-sub-menu:after { … … 48 48 .wr-megamenu-container ul.wr-mega-menu li { 49 49 list-style: none; 50 } 51 .wr-megamenu-container .jsn-bootstrap3 .row { 52 margin-left: 0; 53 margin-right: 0; 54 } 55 .wr-megamenu-container .jsn-bootstrap3 .row > div { 56 padding-left: 10px; 57 padding-right: 10px; 58 } 59 .wr-megamenu-container .wr-element-container.wr-element-megamenu_image img{ 60 max-width: 100%; 61 height: auto; 62 } 63 64 /* Item default */ 65 .wr-megamenu-container ul.wr-mega-menu li.menu-default {} 66 .wr-megamenu-container ul.wr-mega-menu li.menu-default ul {} 67 .wr-megamenu-container ul.wr-mega-menu li.menu-default li {} 68 .wr-megamenu-container ul.wr-mega-menu li.menu-default li a { 69 padding: 13px; 50 70 } 51 71 … … 80 100 border-width: 0 1px 1px 1px; 81 101 display: inherit; 82 list-style: none;83 102 visibility: hidden; 84 103 z-index: 9999; … … 103 122 -o-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1); 104 123 box-shadow: 0 0 2px rgba(0, 0, 0, 0.1); 105 -webkit-transition: - webkit-transform 0.5s ease 0s;106 -moz-transition: -moz-transform 0. 5s ease 0s;107 -ms-transition: -ms-transform 0. 5s ease 0s;108 -o-transition: -o-transform 0. 5s ease 0s;109 transition: transform 0. 5s ease0s;124 -webkit-transition: -moz-transform 0.3s; 125 -moz-transition: -moz-transform 0.3s; 126 -ms-transition: -ms-transform 0.3s; 127 -o-transition: -o-transform 0.3s; 128 transition: transform 0.3s 0s; 110 129 } 111 130 } … … 116 135 float: left; 117 136 } 118 .wr-mega menu-container ul.wr-mega-menu > li.wr-megamenu-item > a.menu-item-link{119 display: block;137 .wr-mega-menu > li > a { 138 padding: 15px; 120 139 -webkit-transition: background 0.2s ease-in-out; 121 140 -moz-transition: background 0.2s ease-in-out; … … 153 172 } 154 173 .wr-megamenu-container ul.wr-mega-menu ul.sub-menu li.wr-megamenu-item { 155 line-height: 1;156 174 text-align: left; 157 175 margin: 0; … … 160 178 .wr-megamenu-container ul.wr-mega-menu ul li a.menu-item-link { 161 179 display: block; 162 padding: 15px 10px;163 180 width: 100%; 164 181 } … … 171 188 } 172 189 .wr-megamenu-container ul { 173 list-style: none;174 190 margin: 0; 175 }176 .wr-megamenu-container li {177 border-top: 1px solid rgba(255, 255, 255, 0.2);178 191 } 179 192 .wr-megamenu-container a { … … 181 194 display: block; 182 195 } 183 .wr-megamenu-container { 184 -webkit-box-sizing: border-box; 185 -moz-box-sizing: border-box; 186 -ms-box-sizing: border-box; 187 -o-box-sizing: border-box; 188 box-sizing: border-box; 189 font-size: 14px; 190 } 191 .wr-megamenu-container .nav-menu { 192 border-bottom: 1px solid rgba(255, 255, 255, 0.2); 193 } 194 .wr-megamenu-container.toggled-on .nav-menu { 195 display: block; 196 } 197 .wr-megamenu-container a { 198 padding: 7px 0; 196 .wr-megamenu-container.toggled-on .wr-mega-menu { 197 display: block; 199 198 } 200 199 .wr-mega-menu li a i { 201 margin-right: 7px;200 margin-right: 10px; 202 201 text-transform: none !important; 203 202 } … … 216 215 217 216 /*Submenu*/ 217 .wr-element-submenu .caption { 218 width: 100%; 219 padding: 15px 10px; 220 } 218 221 ul.sub-menu li a > i, ul.submenu-items li a > i { 219 222 margin-right: 4px; 220 font-size: 9px;221 223 } 222 224 .wr-element-submenu ul { 223 list-style: none !important;224 225 margin: 0; 225 226 padding: 0; … … 230 231 } 231 232 .wr-element-submenu .submenu-items { 232 padding: 10px;233 padding: 0 10px; 233 234 background-color: #F9F9F9; 234 235 } … … 248 249 margin-left: 10px; 249 250 } 250 .wr-element-submenu . caption{251 width: 100%;251 .wr-element-submenu .submenu-items a { 252 padding: 10px; 252 253 } 253 254 .wr-megamenu-container.vertical { … … 299 300 } 300 301 301 @media only screen and (max-width: 960px), (max-device-width: 960px) {302 303 }304 305 302 @media only screen and (max-width: 783px) { 306 .wr-megamenu-container {307 background: #000000;308 font-size: 12px;309 }310 303 .wr-megamenu-container ul li { 311 304 border-top: 1px solid rgba(255, 255, 255, 0.15); … … 420 413 .itmm-widget-container .widget .widgettitle { 421 414 color: #ffffff; 422 }423 .wr-megamenu-container ul.wr-mega-menu {424 display: none ;425 415 } 426 416 .wr-megamenu-container.active ul.wr-mega-menu { … … 484 474 visibility: initial !important; 485 475 } 486 . nav-menu .sub-menu,487 . nav-menu .children{476 .wr-mega-menu .sub-menu, 477 .wr-mega-menu .children{ 488 478 position: static; 489 479 } … … 520 510 } 521 511 .wr-megamenu-container { 522 font-size: 11px;523 512 padding: 0; 524 }525 .wr-megamenu-container .nav-menu {526 border-bottom: 0;527 513 } 528 514 .wr-megamenu-container li { 529 515 border: 0; 530 516 display: inline-block; 531 height: 48px;532 line-height: 48px;533 517 position: relative; 534 518 } 535 519 .wr-megamenu-container a { 536 display: inline-block;537 padding: 0 12px;538 520 white-space: nowrap; 539 521 } … … 548 530 } 549 531 .wr-megamenu-container li li { 550 border: 0;551 532 display: block; 552 533 height: auto; … … 559 540 } 560 541 .wr-megamenu-container ul ul a { 561 padding: 18px 12px;562 542 white-space: normal; 563 width: 176px;564 543 } 565 544 .wr-megamenu-container li:hover > a, 566 545 .wr-megamenu-container li.focus > a { 567 background-color: #24890d; 568 color: #fff; 546 color: #41a62a; 569 547 } 570 548 .wr-megamenu-container ul ul a:hover, 571 549 .wr-megamenu-container ul ul li.focus > a { 572 background-color: #41a62a;550 color: #41a62a; 573 551 } 574 552 .wr-megamenu-container ul li:hover > ul, … … 580 558 left: 100%; 581 559 } 582 .wr-megamenu-container .menu-item-has-children > a, 583 .wr-megamenu-container .page_item_has_children > a { 584 padding-right: 26px; 585 } 586 .wr-megamenu-container .menu-item-has-children > a:after, 587 .wr-megamenu-container .page_item_has_children > a:after { 588 -webkit-font-smoothing: antialiased; 589 content: "\f502"; 590 display: inline-block; 591 font: normal 8px/1 Genericons; 592 position: absolute; 593 right: 12px; 594 top: 22px; 595 vertical-align: text-bottom; 596 } 597 .wr-megamenu-container li .menu-item-has-children > a, 598 .wr-megamenu-container li .page_item_has_children > a { 599 padding-right: 20px; 600 width: 168px; 601 } 602 .wr-megamenu-container .menu-item-has-children li.menu-item-has-children > a:after, 603 .wr-megamenu-container .menu-item-has-children li.page_item_has_children > a:after, 604 .wr-megamenu-container .page_item_has_children li.menu-item-has-children > a:after, 605 .wr-megamenu-container .page_item_has_children li.page_item_has_children > a:after { 606 content: "\f501"; 607 right: 8px; 608 top: 20px; 609 } 610 } 560 } -
wr-megamenu/trunk/assets/js/icon-options.js
r1001124 r1158422 37 37 38 38 window.wr_ajax_insert_icon = function ( item_id ) { 39 if ( ! item_id ) { 40 // Get all item ids 41 var arr_ids = []; 42 $('li.menu-item').each(function () { 43 var id = $(this).attr('id'); 44 id = id.replace('menu-item-', ''); 45 id = parseInt( id ); 46 if ( typeof( id ) != 'NaN') { 47 arr_ids.push( id ); 48 } 49 }); 50 } 51 52 if ( arr_ids ) { 53 var item_ids = arr_ids.join(','); 54 // Send request ajax for get icons collapse accordion html 55 $.ajax({ 56 type : "POST", 57 url : Wr_Megamenu_Ajax.ajaxurl, 58 data : { 59 action : 'wr_megamenu_get_menu_icons', 60 item_ids : item_ids, 61 wr_nonce_check : Wr_Megamenu_Ajax._nonce 62 }, 63 success: function (data) { 64 data = ( data ) ? JSON.parse( data ) : ''; 65 if ( data ) { 66 for( var i = 0; i < data.length; i++ ) { 67 if ( data[i].id ) { 68 var element = $( '#menu-item-' + data[i].id + ' .jsn-bootstrap3' ); 69 element.removeClass('wr-icon-wrapper'); 70 element.removeClass('wr-text-center'); 71 element.html( data[i].html ); 39 40 var arr_locations = []; 41 $('.menu-theme-locations input[type="checkbox"]:checked').each(function(){ 42 var location = $(this).attr('id').replace( 'locations-', '' ); 43 arr_locations.push( location ); 44 }); 45 46 if( arr_locations ) { 47 48 var location_string = arr_locations.join(','); 49 50 if ( ! item_id ) { 51 // Get all item ids 52 var arr_ids = []; 53 $('li.menu-item').each(function () { 54 var id = $(this).attr('id'); 55 id = id.replace('menu-item-', ''); 56 id = parseInt( id ); 57 if ( typeof( id ) != 'NaN') { 58 arr_ids.push( id ); 59 } 60 }); 61 } 62 63 if ( arr_ids ) { 64 var item_ids = arr_ids.join(','); 65 // Send request ajax for get icons collapse accordion html 66 $.ajax({ 67 type : "POST", 68 url : Wr_Megamenu_Ajax.ajaxurl, 69 data : { 70 action : 'wr_megamenu_get_menu_icons', 71 item_ids : item_ids, 72 wr_nonce_check : Wr_Megamenu_Ajax._nonce, 73 locations : location_string 74 }, 75 success: function (data) { 76 if( data == 'not_show' ){ 77 $( ".wr-icon-wrapper" ).remove(); 78 } else { 79 data = ( data ) ? JSON.parse( data ) : ''; 80 if ( data ) { 81 for( var i = 0; i < data.length; i++ ) { 82 if ( data[i].id ) { 83 var element = $( '#menu-item-' + data[i].id + ' .jsn-bootstrap3' ); 84 element.removeClass('wr-icon-wrapper'); 85 element.removeClass('wr-text-center'); 86 element.html( data[i].html ); 87 } 88 } 72 89 } 90 91 $('body').trigger('init_jsn_icon_selector'); 73 92 } 74 }75 76 $('body').trigger('init_jsn_icon_selector');77 } 78 });93 } 94 }); 95 } 96 } else { 97 $( ".wr-icon-wrapper" ).remove(); 79 98 } 80 99 }; -
wr-megamenu/trunk/includes/core/backend.php
r1135372 r1158422 22 22 add_action( 'edit_form_after_title', array( &$this, 'edit_form_megamenu_editor' ) ); 23 23 add_action( 'admin_head', array( &$this, 'enqueue_script_nav_menu' ) ); 24 add_action( 'wp_update_nav_menu_item', array( &$this, 'save_nav_menu_item' ), 100, 3 );25 24 add_filter( 'wp_setup_nav_menu_item', array( &$this, 'setup_nav_item' ) ); 26 25 // hook saving post … … 36 35 add_action( 'wp_ajax_wr_megamenu_get_json_custom', array( &$this, 'ajax_json_custom' ) ); 37 36 add_action( 'wp_ajax_wr_megamenu_get_menu_icons', array( &$this, 'ajax_get_menu_icon' ) ); 37 add_action( 'wp_ajax_wr_megamenu_insert_icons_database', array( &$this, 'ajax_insert_icons_database' ) ); 38 38 39 39 // get image size … … 162 162 exit; 163 163 } 164 165 /** 166 * Insert-icon-database 167 * 168 * 169 */ 170 function ajax_insert_icons_database() { 171 $post_id = isset($_POST['post_id']) ? (int) $_POST['post_id'] : 0; 172 $value_icon = isset($_POST['value_icon']) ? $_POST['value_icon'] : 0; 173 if( $post_id && $value_icon ) { 174 update_post_meta($post_id, '_icon_mega_', addslashes( $value_icon ) ); 175 } 176 exit; 177 } 164 178 165 179 /** … … 202 216 203 217 return $menu_item; 204 }205 206 public function save_nav_menu_item( $menu_id, $menu_item_db_id, $args ) {207 if ( isset( $_POST['icon_mega'][ $menu_item_db_id ] ) ) {208 update_post_meta( $menu_item_db_id, '_icon_mega_', addslashes( $_POST['icon_mega'][ $menu_item_db_id ] ) );209 }210 218 } 211 219 … … 470 478 $settings = array(); 471 479 parse_str( $setting_menu, $output ); 472 $settings['is_mega']= $is_mega;480 if( isset($is_mega ) ) $settings['is_mega'] = $is_mega; 473 481 $settings['setting_menu'] = $output; 474 482 $settings['shortcode_content'] = $shortcode_content; -
wr-megamenu/trunk/includes/helpers/html/icons.php
r1001124 r1158422 23 23 $icon_id = ($item_id != '' ) ? '-' . $item_id : ''; 24 24 $output = "<div id='icon_selector".$icon_id."' class='icon_selector' data-item_id='".$item_id."'> 25 <input type='hidden' value='{$element['std']}' id='{$element['id']}' name='{$element['id']}'DATA_INFO />25 <input type='hidden' value='{$element['std']}' id='{$element['id']}' DATA_INFO /> 26 26 </div>"; 27 27 if ( WR_Megamenu_Helpers_Functions::is_modal() ) { -
wr-megamenu/trunk/includes/helpers/html/tiny-mce.php
r1001124 r1158422 24 24 $element['std'] = str_replace( '<wr_quote>', '"', $element['std'] ); 25 25 } 26 $element['std'] = str_replace( "\n", '<br>', $element['std'] );27 26 28 27 $settings = array( -
wr-megamenu/trunk/includes/helpers/shortcode.php
r1001124 r1158422 498 498 * @return string $content 499 499 */ 500 static function remove_autop( $content )500 static function remove_autop( $content, $element_text = false ) 501 501 { 502 502 $shortcode_tags = array(); … … 509 509 $content = preg_replace( "/(<p>)?\[\/($tagregexp)](<\/p>|<br\s\/>)?/", '[/$2]', $content ); 510 510 511 $content = do_shortcode( shortcode_unautop( $content ) );511 $content = $element_text ? do_shortcode( wpautop( $content ) ) : do_shortcode( shortcode_unautop( $content ) ); 512 512 $content = preg_replace( '#^<\/p>|^<br\s?\/?>|<p>$|<p>\s*( )?\s*<\/p>#', '', $content ); 513 513 -
wr-megamenu/trunk/includes/shortcode/element.php
r1001124 r1158422 383 383 // add Margin parameter for Not child shortcode 384 384 if ( strpos( $this->config['shortcode'], '_item' ) === false ) { 385 $this->config['params'] = array_merge( array( 'div_margin_top' => '10', 'div_margin_bottom' => '10', 'disabled_el' => 'no', 'css_suffix' => '', 'id_wrapper' => '' ), $params ); 385 if( $this->config['shortcode'] == 'wr_submenu' ){ 386 $this->config['params'] = array_merge( array( 'disabled_el' => 'no', 'css_suffix' => '', 'id_wrapper' => '' ), $params ); 387 } else { 388 $this->config['params'] = array_merge( array( 'div_margin_top' => '10', 'div_margin_bottom' => '10', 'disabled_el' => 'no', 'css_suffix' => '', 'id_wrapper' => '' ), $params ); 389 } 386 390 } 387 391 else { -
wr-megamenu/trunk/includes/walker.php
r1134429 r1158422 37 37 $output .= ''; 38 38 } else { 39 $output .= '<ul class="sub-menu abcddafasdfsub-menu-' . ( $depth ) . '">';39 $output .= '<ul class="sub-menu sub-menu-' . ( $depth ) . '">'; 40 40 } 41 41 } -
wr-megamenu/trunk/main.php
r1134429 r1158422 4 4 Plugin URI: http://woorockets.com 5 5 Description: WR MegaMenu 6 Version: 1.1. 06 Version: 1.1.1 7 7 Author: WooRockets 8 8 Author URI: http://woorockets.com -
wr-megamenu/trunk/shortcodes/submenu/submenu.php
r1114531 r1158422 232 232 $html[] = '<div class="clearfix"></div>'; 233 233 $html[] = '<span class="divider"></span>'; 234 $html[] = '<ul class="'.$class.' ">';235 234 236 235 $args = array(); … … 244 243 $args['no_of_column'] = $no_of_column; 245 244 $args['items_per_column'] = $items_per_column; 246 247 $html[] = $this->wr_walk_submenu_child( $items, 0, (object) $args ); 248 $html[] = '</ul>'; 245 246 $submenu_items_elment = $this->wr_walk_submenu_child( $items, 0, (object) $args ); 247 248 if( $submenu_items_elment ) { 249 $html[] = '<ul class="'.$class.' ">'; 250 $html[] = $submenu_items_elment; 251 $html[] = '</ul>'; 252 } 253 249 254 $html[] = '</div>'; 250 255 } -
wr-megamenu/trunk/shortcodes/text/megamenu-text.php
r1001124 r1158422 202 202 203 203 if ( ! empty( $content ) ) { 204 $content = WR_Megamenu_Helpers_Shortcode::remove_autop( $content );204 $content = WR_Megamenu_Helpers_Shortcode::remove_autop( $content, true ); 205 205 } 206 206 -
wr-megamenu/trunk/themes/default/default.css
r1134429 r1158422 11 11 12 12 .wr-megamenu-container { 13 background: #000;14 13 text-align: left; 15 14 } … … 28 27 29 28 @media screen and (min-width: 783px) { 30 .wr-megamenu-container ul.wr-mega-menu ul.sub-menu li:hover {31 background: #41a62a;29 .wr-megamenu-container ul.wr-mega-menu ul.sub-menu li:hover a { 30 color: #41a62a; 32 31 } 33 32 }
Note: See TracChangeset
for help on using the changeset viewer.