8889841cadmin/css/mega-menu-rtl.css000064400000001025150514555650011621 0ustar00/** * @package WordPress Plugin * @subpackage CMSMasters Mega Menu * @version 1.2.0 * * Mega Menu Builder Styles in a Right To Left (RTL) direction * Created by CMSMasters * */ .is-mega-menu, .is-column, .is-mega-descr-text { margin-left: 0; margin-right: 4px; } .is-drop-side-right { margin-left: 0; margin-right: 6px; } .menu-item span[data-class=cmsmasters_new_icon_img] { margin: 0 0 0 10px; } .menu-item a.cmsmasters_remove_icon { margin-left: 0; margin-right: 5px; } admin/css/mega-menu.css000064400000010457150514555650011033 0ustar00/** * @package WordPress Plugin * @subpackage CMSMasters Mega Menu * @version 1.2.6 * * Mega Menu Builder Styles * Created by CMSMasters * */ .is-mega-menu, .is-column, .is-mega-descr-text { color: #999999; font-style: italic; font-weight: 400; display: none; margin-left: 4px; } .is-drop-side-right { color: #aaaaaa; font-size: 14px; display: none; margin-left: 6px; position: relative; vertical-align: middle; } .cmsmasters_hide_text { text-decoration: line-through; } .cmsmasters_highlight { color: #0074a2; } .item-title .menu-item-title:before { font-size: 16px; text-decoration: none; } .field-mega_cols, .field-mega_cols_full, .field-mega_descr_text, .field-mega_bg_img, .field-mega_bg_pos, .field-mega_bg_rep, .field-mega_bg_att, .field-mega_bg_size, .menu-item.menu-item-depth-1 .field-drop_side, .menu-item.menu-item-depth-2 .field-drop_side, .menu-item.menu-item-depth-3 .field-drop_side, .menu-item.menu-item-depth-4 .field-drop_side, .menu-item.menu-item-depth-5 .field-drop_side, .menu-item.menu-item-depth-6 .field-drop_side, .menu-item.menu-item-depth-7 .field-drop_side, .menu-item.menu-item-depth-8 .field-drop_side, .menu-item.menu-item-depth-9 .field-drop_side, .menu-item.menu-item-depth-10 .field-drop_side, .menu-item.menu-item-depth-11 .field-drop_side, .menu-item.menu-item-depth-1 .field-mega, .menu-item.menu-item-depth-2 .field-mega, .menu-item.menu-item-depth-3 .field-mega, .menu-item.menu-item-depth-4 .field-mega, .menu-item.menu-item-depth-5 .field-mega, .menu-item.menu-item-depth-6 .field-mega, .menu-item.menu-item-depth-7 .field-mega, .menu-item.menu-item-depth-8 .field-mega, .menu-item.menu-item-depth-9 .field-mega, .menu-item.menu-item-depth-10 .field-mega, .menu-item.menu-item-depth-11 .field-mega, .menu-item.menu-item-depth-1 .field-hide_text, .menu-item.menu-item-depth-2 .field-hide_text, .menu-item.menu-item-depth-3 .field-hide_text, .menu-item.menu-item-depth-4 .field-hide_text, .menu-item.menu-item-depth-5 .field-hide_text, .menu-item.menu-item-depth-6 .field-hide_text, .menu-item.menu-item-depth-7 .field-hide_text, .menu-item.menu-item-depth-8 .field-hide_text, .menu-item.menu-item-depth-9 .field-hide_text, .menu-item.menu-item-depth-10 .field-hide_text, .menu-item.menu-item-depth-11 .field-hide_text, .menu-item.menu-item-depth-1 .field-subtitle, .menu-item.menu-item-depth-2 .field-subtitle, .menu-item.menu-item-depth-3 .field-subtitle, .menu-item.menu-item-depth-4 .field-subtitle, .menu-item.menu-item-depth-5 .field-subtitle, .menu-item.menu-item-depth-6 .field-subtitle, .menu-item.menu-item-depth-7 .field-subtitle, .menu-item.menu-item-depth-8 .field-subtitle, .menu-item.menu-item-depth-9 .field-subtitle, .menu-item.menu-item-depth-10 .field-subtitle, .menu-item.menu-item-depth-11 .field-subtitle { display: none; } .menu-item span[data-class=cmsmasters_new_icon_img] { font-size: 14px; line-height: 22px; width: 24px; height: 24px; margin: 0 10px 0 0; } .menu-item span[data-class=cmsmasters_new_icon_img]:before { line-height: 22px; } .menu-item a.cmsmasters_remove_icon { font-size: 16px; text-align: center; margin-left: 5px; overflow: visible; } .menu-item-settings:after { content: "."; display: block; clear: both; height: 0; visibility: hidden; overflow: hidden; } .menu-item-settings input[type=checkbox], .menu-item-settings input[type=radio] { width: 25px; } .menu-item-settings input[type=button], .menu-item-settings button { width: auto; } .description-tall { height: 20px; padding-top: 20px; } .description-wafer-thin { height: 20px; } .description-narrow { width: 123px; } .menu-item .wp-picker-open + .wp-picker-input-wrap { position: relative; } .menu-item-settings .field-color .wp-picker-holder .iris-picker { z-index: 1; } @media only screen and (max-width: 782px) { .menu-item span[data-class=cmsmasters_new_icon_img] { font-size: 20px; line-height: 34px; width: 36px; height: 36px; } .menu-item span[data-class=cmsmasters_new_icon_img]:before { line-height: 34px; } .menu-item a.cmsmasters_remove_icon { font-size: 20px; } .description-tall { padding-top: 0; } } admin/js/mega-menu.js000064400000033267150514555650010507 0ustar00/** * @package WordPress Plugin * @subpackage CMSMasters Mega Menu * @version 1.2.3 * * Mega Menu Builder Scripts * Created by CMSMasters * */ (function ($) { // rewrite jquery original append & prepend functions var origAppend = $.fn.append, origPrepend = $.fn.prepend; $.fn.append = function () { return origAppend.apply(this, arguments).trigger('append'); }; $.fn.prepend = function () { return origPrepend.apply(this, arguments).trigger('prepend'); }; $(document).ready(function() { var mega_ul = $('#menu-to-edit'), mega_checkboxes = mega_ul.find('.menu-item.menu-item-depth-0 .menu-item-mega:checked'); // color picker loaded fields start if (cmsmasters_mega_menu.palettes !== '') { $('.menu-item-color').wpColorPicker( { palettes : cmsmasters_mega_menu.palettes.split(',') } ); } else { $('.menu-item-color').wpColorPicker(); } // appended menu items color picker start mega_ul.on('append prepend', function (el) { if (typeof $(el.target).attr('id') !== 'undefined' && $(el.target).attr('id') === 'menu-to-edit') { $(el.target).find('> li.menu-item.pending .menu-item-color').each(function () { if (!$(this).is('.wp-color-picker')) { if (cmsmasters_mega_menu.palettes !== '') { $(this).wpColorPicker( { palettes : cmsmasters_mega_menu.palettes.split(',') } ); } else { $(this).wpColorPicker(); } } } ); } } ); // mega checkboxes test mega_checkboxes.each(function () { $(this).megaMenuToggle(); // start mega menu toggle function } ); // mega checkbox change $(document).on('change', '.menu-item-mega', function () { $(this).megaMenuToggle(); // start mega menu toggle function } ); // move buttons click $(document).on('click', '.field-move .menus-move-up, .field-move .menus-move-down, .field-move .menus-move-left, .field-move .menus-move-right, .field-move .menus-move-top', function (e) { setTimeout(function () { var li_prev_array = $(e.currentTarget).parents('.menu-item').prevAll('.menu-item.menu-item-depth-0'), // all previous menu items with depth = 0 li_prev_count = li_prev_array.length, // count all previous menu items with depth = 0 li_prev_mega = (li_prev_count > 0) ? $(li_prev_array[0]).find('.menu-item-mega') : $(e.currentTarget).parents('.menu-item').find('.menu-item-mega'); // mega menu checkbox choose if ($(e.currentTarget).parents('.menu-item').hasClass('menu-item-depth-0')) { // if current menu item depth = 0 li_prev_mega = $(e.currentTarget).parents('.menu-item').find('.menu-item-mega'); } li_prev_mega.megaMenuToggle(); // start mega menu toggle function }, 250); e.preventDefault(); } ); // sort menu items mega_ul.on('sortstop', function(event, ui) { setTimeout(function () { var li_prev_array = $(ui.item).prevAll('.menu-item.menu-item-depth-0'), // all previous menu items with depth = 0 li_prev_count = li_prev_array.length, // count all previous menu items with depth = 0 li_prev_mega = (li_prev_count > 0) ? $(li_prev_array[0]).find('.menu-item-mega') : $(ui.item).find('.menu-item-mega'); // mega menu checkbox choose if ($(ui.item).hasClass('menu-item-depth-0')) { // if current menu item depth = 0 li_prev_mega = $(ui.item).find('.menu-item-mega'); } li_prev_mega.megaMenuToggle(); // start mega menu toggle function }, 250); } ); // menu item highlight change $(document).on('change', '.menu-item-highlight', function () { var checkbox = $(this), checkbox_container = checkbox.parents('.menu-item'); if (checkbox.is(':checked')) { checkbox_container.find('span.menu-item-title').addClass('cmsmasters_highlight'); } else { checkbox_container.find('span.menu-item-title').removeClass('cmsmasters_highlight'); } } ); // menu item icon change $(document).on('change', '.menu-item-icon', function () { var input = $(this), input_container = input.parents('.menu-item'), input_val = input.val(); if (input_val !== '') { input_container.find('span.menu-item-title').removeClass(function (index, css) { return (css.match(/(^|\s)cmsmasters-icon-\S+/g) || []).join(' '); } ).addClass(input_val); } else { input_container.find('span.menu-item-title').removeClass(function (index, css) { return (css.match(/(^|\s)cmsmasters-icon-\S+/g) || []).join(' '); } ); } } ); // drop side right change $(document).on('change', '.menu-item-drop_side', function () { var checkbox = $(this), checkbox_container = checkbox.parents('.menu-item'); if (checkbox.is(':checked')) { checkbox_container.find('span.is-drop-side-right').show(); } else { checkbox_container.find('span.is-drop-side-right').hide(); } } ); // hide column text change $(document).on('change', '.menu-item-hide_text', function () { var checkbox = $(this), checkbox_container = checkbox.parents('.menu-item'); if (checkbox.is(':checked')) { checkbox_container.find('span.menu-item-title').addClass('cmsmasters_hide_text'); } else { checkbox_container.find('span.menu-item-title').removeClass('cmsmasters_hide_text'); } } ); // mega description text change $(document).on('change', '.menu-item-mega_descr_text', function () { var checkbox = $(this), checkbox_container = checkbox.parents('.menu-item'); if (checkbox.is(':checked')) { checkbox_container.find('span.is-mega-descr-text').show(); checkbox_container.find('span.is-submenu').hide(); } else { checkbox_container.find('span.is-mega-descr-text').hide(); checkbox_container.find('span.is-submenu').show(); } } ); } ); $.fn.extend( { megaMenuToggle : function () { // mega menu toggle var mega = $(this), // mega menu checkbox container = mega.parents('.menu-item'), // mega menu checkbox container (menu item) cont_depth = container.menuItemDepth(), // mega menu checkbox container depth li_array = container.nextUntil('.menu-item-depth-0'); // mega menu items mega.megaMenuHideElems(container, cont_depth); // start mega menu show/hide custom fields function li_array.each(function () { // mega menu items forEach var li = $(this), // mega menu item depth = li.menuItemDepth(); // mega menu item depth if (depth === 1) { // depth = 1 mega.megaMenuHideElems(li, depth); // start mega menu show/hide custom fields function } if (depth > 1) { // depth > 1 mega.megaMenuHideElems(li, depth); // start mega menu show/hide custom fields function } } ); }, megaMenuHideElems : function (cont, depth) { // mega menu show/hide custom fields var checkbox = $(this), drop_side_class = cont.find('.is-drop-side-right'), drop_side_field = cont.find('p.field-drop_side'), mega_class = cont.find('.is-mega-menu'), mega_field = cont.find('p.field-mega'), mega_cols_field = cont.find('p.field-mega_cols'), mega_cols_full_field = cont.find('p.field-mega_cols_full'), mega_bg_img_field = cont.find('p.field-mega_bg_img'), mega_bg_pos_field = cont.find('p.field-mega_bg_pos'), mega_bg_rep_field = cont.find('p.field-mega_bg_rep'), mega_bg_size_field = cont.find('p.field-mega_bg_size'), column_class = cont.find('.is-column'), subtitle_field = cont.find('p.field-subtitle'), hide_text_class = cont.find('span.menu-item-title'), hide_text_field = cont.find('p.field-hide_text'), hide_text_test = hide_text_field.find('input.menu-item-hide_text').is(':checked'), submenu_class = cont.find('.is-submenu'), descr_text_class = cont.find('.is-mega-descr-text'), descr_text_field = cont.find('p.field-mega_descr_text'); // depth = 0 if (depth === 0) { var drop_side_test = drop_side_field.find('input.menu-item-drop_side').is(':checked'); if (checkbox.is(':checked')) { cont.addClass('cmsmasters_mega_menu'); // menu item class if (drop_side_test) { drop_side_class.show(); // drop side right class } else { drop_side_class.hide(); // drop side right class } drop_side_field.show(); // drop side right field mega_class.show(); // mega class mega_field.show(); // mega field mega_cols_field.show(); // mega columns field mega_cols_full_field.show(); // mega columns fullwidth field mega_bg_img_field.show(); // mega background image field mega_bg_pos_field.show(); // mega background position field mega_bg_rep_field.show(); // mega background repeat field mega_bg_size_field.show(); // mega background size field } else { cont.removeClass('cmsmasters_mega_menu'); // menu item class if (drop_side_test) { drop_side_class.show(); // drop side right class } else { drop_side_class.hide(); // drop side right class } drop_side_field.show(); // drop side right field mega_class.hide(); // mega class mega_field.show(); // mega field mega_cols_field.hide(); // mega columns field mega_cols_full_field.hide(); // mega columns fullwidth field mega_bg_img_field.hide(); // mega background image field mega_bg_pos_field.hide(); // mega background position field mega_bg_rep_field.hide(); // mega background repeat field mega_bg_size_field.hide(); // mega background size field } if (hide_text_test) { hide_text_class.addClass('cmsmasters_hide_text'); // column hide text class } else { hide_text_class.removeClass('cmsmasters_hide_text'); // column hide text class } // depth = 1 column_class.hide(); // column class // depth > 1 submenu_class.hide(); // submenu class descr_text_class.hide(); // description text class descr_text_field.hide(); // description text field } else if (depth === 1) { cont.removeClass('cmsmasters_mega_menu'); // menu item class // depth = 0 drop_side_class.hide(); // drop side right class drop_side_field.hide(); // drop side right field mega_class.hide(); // mega class mega_field.hide(); // mega field mega_cols_field.hide(); // mega columns field mega_cols_full_field.hide(); // mega columns fullwidth field mega_bg_img_field.hide(); // mega background image field mega_bg_pos_field.hide(); // mega background position field mega_bg_rep_field.hide(); // mega background repeat field mega_bg_size_field.hide(); // mega background size field // depth = 1 if (checkbox.is(':checked')) { column_class.show(); // column class subtitle_field.show(); // column subtitle field if (hide_text_test) { hide_text_class.addClass('cmsmasters_hide_text'); // column hide text class } else { hide_text_class.removeClass('cmsmasters_hide_text'); // column hide text class } hide_text_field.show(); // column hide text field } else { column_class.hide(); // column class subtitle_field.hide(); // column subtitle field hide_text_class.removeClass('cmsmasters_hide_text'); // column hide text class hide_text_field.hide(); // column hide text field } // depth > 1 if (checkbox.is(':checked')) { submenu_class.hide(); // submenu class } else { submenu_class.show(); // submenu class } descr_text_class.hide(); // description text class descr_text_field.hide(); // description text field } else { var descr_text_test = descr_text_field.find('input.menu-item-mega_descr_text').is(':checked'); cont.removeClass('cmsmasters_mega_menu'); // menu item class // depth = 0 drop_side_class.hide(); // drop side right class drop_side_field.hide(); // drop side right field mega_class.hide(); // mega class mega_field.hide(); // mega field mega_cols_field.hide(); // mega columns field mega_cols_full_field.hide(); // mega columns fullwidth field mega_bg_img_field.hide(); // mega background image field mega_bg_pos_field.hide(); // mega background position field mega_bg_rep_field.hide(); // mega background repeat field mega_bg_size_field.hide(); // mega background size field // depth = 1 column_class.hide(); // column class subtitle_field.hide(); // column subtitle field hide_text_class.removeClass('cmsmasters_hide_text'); // column hide text class hide_text_field.hide(); // column hide text field // depth > 1 if (checkbox.is(':checked')) { if (descr_text_test) { submenu_class.hide(); // submenu class descr_text_class.show(); // description text class } else { submenu_class.show(); // submenu class descr_text_class.hide(); // description text class } descr_text_field.show(); // description text field } else { submenu_class.show(); // submenu class descr_text_class.hide(); // description text class descr_text_field.hide(); // description text field } } } } ); } )(jQuery); license.txt000064400000003223150514555650006742 0ustar00CMSMasters Mega Menu License Terms & Conditions CMSMasters Mega Menu should be used in strict compliance to the terms and conditions listed in this document. 1. General Terms 1.1 CMSMasters Mega Menu (hereafter - Software) is distributed under a proprietary licence with CMSMasters Studio as exclusive legal copyright holder. Any software usage, modification, sharing and redistribution conditions are limited to the stated below and cannot be extended without legally provable consent from CMSMasters authority. 2. Software usage 2.1. Software can be used exclusively as an add-on to a Wordpress theme, created by CMSMasters Studio and legally purchased by software user. 2.2. This software can be used on a single installation only per one theme purchase. 2.3. Software can be used only with a theme, that is stated as compatible with it and its specific version. 2.4. Software should be treated as appendant to the theme it was purchased with. Wordpress theme (as a main product) can be used without software (appendant product) installed, not vice versa. 3. Software modification 3.1. While software is used according to the Software Usage terms of this license, software user may apply modifications to it at his own risk. CMSMasters Studio does not take any responsibility for the altered product malfunction. 3.2. Despite any modifications and changes applied to software code by its user, copyright cannot be altered and belongs exclusively to CMSMasters Studio. 3.3. Product renaming is prohibited. 4. Software Sharing & Redistribution 4.1. Any sharing or redistribution of this Software is prohibited. Copyright 2014 CMSMasters Studio languages/cmsmasters-mega-menu.pot000064400000012144150514555650013305 0ustar00msgid "" msgstr "" "Project-Id-Version: CMSMasters Mega Menu 1.2.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-11-14 19:14+0200\n" "PO-Revision-Date: 2016-11-14 19:14+0200\n" "Last-Translator: \n" "Language-Team: cmsmasters \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-KeywordsList: __;_e\n" "X-Poedit-Basepath: .\n" "X-Poedit-SourceCharset: utf-8\n" "X-Poedit-Language: English\n" "X-Poedit-Country: UNITED STATES\n" "X-Poedit-SearchPath-0: .\n" #: cmsmasters-mega-menu.php:362 msgid "Your theme doesn't support CMSMasters Mega Menu plugin. Please use appropriate CMSMasters theme." msgstr "" #: cmsmasters-mega-menu.php:363 msgid "Error!" msgstr "" #: cmsmasters-mega-menu.php:389 msgid "CMSMasters Mega Menu plugin was deactivated, because your theme doesn't support it. Please use appropriate CMSMasters theme." msgstr "" #: cmsmasters-mega-menu.php:437 #, php-format msgid "%s (Invalid)" msgstr "" #: cmsmasters-mega-menu.php:440 #, php-format msgid "%s (Pending)" msgstr "" #: cmsmasters-mega-menu.php:473 msgid "sub item" msgstr "" #: cmsmasters-mega-menu.php:473 msgid "mega menu" msgstr "" #: cmsmasters-mega-menu.php:473 msgid "column" msgstr "" #: cmsmasters-mega-menu.php:473 msgid "text block" msgstr "" #: cmsmasters-mega-menu.php:505 msgid "Edit Menu Item" msgstr "" #: cmsmasters-mega-menu.php:514 msgid "URL" msgstr "" #: cmsmasters-mega-menu.php:521 msgid "Navigation Label" msgstr "" #: cmsmasters-mega-menu.php:527 msgid "Title Attribute" msgstr "" #: cmsmasters-mega-menu.php:533 msgid "Navigation Label Tag" msgstr "" #: cmsmasters-mega-menu.php:539 msgid "Navigation Label Subtitle" msgstr "" #: cmsmasters-mega-menu.php:546 msgid "Open link in a new window/tab" msgstr "" #: cmsmasters-mega-menu.php:551 msgid "CSS Classes (optional)" msgstr "" #: cmsmasters-mega-menu.php:557 msgid "Link Relationship (XFN)" msgstr "" #: cmsmasters-mega-menu.php:563 msgid "Description" msgstr "" #: cmsmasters-mega-menu.php:565 msgid "The description will be displayed in the menu if the current theme supports it." msgstr "" #: cmsmasters-mega-menu.php:570 msgid "Menu Item Color" msgstr "" #: cmsmasters-mega-menu.php:576 msgid "Menu Item Icon" msgstr "" #: cmsmasters-mega-menu.php:579 msgid "Choose icon" msgstr "" #: cmsmasters-mega-menu.php:580 msgid "Remove icon" msgstr "" #: cmsmasters-mega-menu.php:586 msgid "Highlight" msgstr "" #: cmsmasters-mega-menu.php:592 msgid "Hide Text" msgstr "" #: cmsmasters-mega-menu.php:598 msgid "Align drop-down menus to the Right Side" msgstr "" #: cmsmasters-mega-menu.php:604 msgid "Use as Mega Menu" msgstr "" #: cmsmasters-mega-menu.php:609 msgid "Mega Menu Columns Count" msgstr "" #: cmsmasters-mega-menu.php:611 msgid "2 Columns" msgstr "" #: cmsmasters-mega-menu.php:612 msgid "3 Columns" msgstr "" #: cmsmasters-mega-menu.php:613 msgid "4 Columns" msgstr "" #: cmsmasters-mega-menu.php:614 msgid "5 Columns" msgstr "" #: cmsmasters-mega-menu.php:621 msgid "Stretch Mega Menu columns on full width" msgstr "" #: cmsmasters-mega-menu.php:636 msgid "Mega Menu Background Image" msgstr "" #: cmsmasters-mega-menu.php:637 msgid "Choose image" msgstr "" #: cmsmasters-mega-menu.php:637 msgid "Insert image" msgstr "" #: cmsmasters-mega-menu.php:640 #: cmsmasters-mega-menu.php:716 msgid "Remove" msgstr "" #: cmsmasters-mega-menu.php:647 msgid "Background Position" msgstr "" #: cmsmasters-mega-menu.php:649 msgid "Top Left" msgstr "" #: cmsmasters-mega-menu.php:650 msgid "Top Center" msgstr "" #: cmsmasters-mega-menu.php:651 msgid "Top Right" msgstr "" #: cmsmasters-mega-menu.php:652 msgid "Center Left" msgstr "" #: cmsmasters-mega-menu.php:653 msgid "Center Center" msgstr "" #: cmsmasters-mega-menu.php:654 msgid "Center Right" msgstr "" #: cmsmasters-mega-menu.php:655 msgid "Bottom Left" msgstr "" #: cmsmasters-mega-menu.php:656 msgid "Bottom Center" msgstr "" #: cmsmasters-mega-menu.php:657 msgid "Bottom Right" msgstr "" #: cmsmasters-mega-menu.php:663 msgid "Background Repeat" msgstr "" #: cmsmasters-mega-menu.php:665 msgid "No Repeat" msgstr "" #: cmsmasters-mega-menu.php:666 msgid "Repeat Horizontally" msgstr "" #: cmsmasters-mega-menu.php:667 msgid "Repeat Vertically" msgstr "" #: cmsmasters-mega-menu.php:668 msgid "Repeat" msgstr "" #: cmsmasters-mega-menu.php:674 msgid "Background Size" msgstr "" #: cmsmasters-mega-menu.php:676 msgid "Auto" msgstr "" #: cmsmasters-mega-menu.php:677 msgid "Cover" msgstr "" #: cmsmasters-mega-menu.php:678 msgid "Contain" msgstr "" #: cmsmasters-mega-menu.php:685 msgid "Use the description field to create a Text Block." msgstr "" #: cmsmasters-mega-menu.php:685 msgid "Note: Don't remove the navigation label text, otherwise wordpress will delete the item" msgstr "" #: cmsmasters-mega-menu.php:691 msgid "Move" msgstr "" #: cmsmasters-mega-menu.php:692 msgid "Up one" msgstr "" #: cmsmasters-mega-menu.php:693 msgid "Down one" msgstr "" #: cmsmasters-mega-menu.php:696 msgid "To the top" msgstr "" #: cmsmasters-mega-menu.php:703 #, php-format msgid "Original: %s" msgstr "" #: cmsmasters-mega-menu.php:717 msgid "Cancel" msgstr "" cmsmasters-mega-menu.php000064400000125271150514555650011332 0ustar00CMSMasters team. Mega Menu plugin create custom settings integrated to WordPress default Appearance > Menus editor for new cmsmasters WordPress themes. Version: 1.2.9 Author: cmsmasters Author URI: http://cmsmasters.net/ */ /* Copyright 2014 CMSMasters (email : cmsmstrs@gmail.com). All Rights Reserved. This software is distributed exclusively as appendant to Wordpress themes, created by CMSMasters studio and should be used in strict compliance to the terms, listed in the License Terms & Conditions included in software archive. If your archive does not include this file, you may find the license text by url http://cmsmasters.net/files/license/cmsmasters-mega-menu/license.txt or contact CMSMasters Studio at email copyright.cmsmasters@gmail.com about this. Please note, that any usage of this software, that contradicts the license terms is a subject to legal pursue and will result copyright reclaim and damage withdrawal. */ class Cmsmasters_Mega_Menu { function __construct() { define('CMSMASTERS_MEGA_MENU_VERSION', '1.2.9'); define('CMSMASTERS_MEGA_MENU_URL', plugin_dir_url(__FILE__)); define('CMSMASTERS_MEGA_MENU_NAME', plugin_basename(__FILE__)); add_action('admin_enqueue_scripts', array($this, 'cmsmasters_add_custom_admin_menu_header')); add_action('wp_enqueue_scripts', array($this, 'cmsmasters_add_custom_menu_header')); remove_filter('nav_menu_description', 'strip_tags'); add_filter('wp_setup_nav_menu_item', array($this, 'cmsmasters_add_custom_nav_fields')); add_action('wp_update_nav_menu_item', array($this, 'cmsmasters_update_custom_nav_fields'), 10, 3); add_filter('wp_edit_nav_menu_walker', array($this, 'cmsmasters_edit_walker'), 10, 2); // Load Plugin Local File load_plugin_textdomain('cmsmasters-mega-menu', false, dirname(plugin_basename(__FILE__)) . '/languages/'); register_activation_hook(__FILE__, array($this, 'cmsmasters_mega_menu_activate')); register_deactivation_hook(__FILE__, array($this, 'cmsmasters_mega_menu_deactivate')); add_action('admin_init', array($this, 'cmsmasters_mega_menu_compatibility')); } function cmsmasters_add_custom_admin_menu_header() { if (basename($_SERVER['PHP_SELF']) == 'nav-menus.php') { wp_register_style('cmsmasters-mega-menu', CMSMASTERS_MEGA_MENU_URL . 'admin/css/mega-menu.css', array(), CMSMASTERS_MEGA_MENU_VERSION, 'screen'); wp_register_style('cmsmasters-mega-menu-rtl', CMSMASTERS_MEGA_MENU_URL . 'admin/css/mega-menu-rtl.css', array(), CMSMASTERS_MEGA_MENU_VERSION, 'screen'); wp_enqueue_style('cmsmasters-mega-menu'); if (is_rtl()) { wp_enqueue_style('cmsmasters-mega-menu-rtl'); } wp_register_script('cmsmasters-mega-menu', CMSMASTERS_MEGA_MENU_URL . 'admin/js/mega-menu.js', array('jquery', 'jquery-ui-sortable'), CMSMASTERS_MEGA_MENU_VERSION, true); wp_localize_script('cmsmasters-mega-menu', 'cmsmasters_mega_menu', array( 'palettes' => ((function_exists('cmsmasters_color_picker_palettes')) ? implode(',', cmsmasters_color_picker_palettes()) : '') )); wp_enqueue_script('cmsmasters-mega-menu'); } } function cmsmasters_add_custom_menu_header() { if (!is_admin()) { wp_register_script('megamenu', CMSMASTERS_MEGA_MENU_URL . 'js/jquery.megaMenu.js', array('jquery'), CMSMASTERS_MEGA_MENU_VERSION, true); wp_enqueue_script('megamenu'); } } function cmsmasters_add_custom_nav_fields($menu_item) { // Global $menu_item->highlight = get_post_meta($menu_item->ID, '_menu_item_highlight', true); $menu_item->color = get_post_meta($menu_item->ID, '_menu_item_color', true); $menu_item->icon = get_post_meta($menu_item->ID, '_menu_item_icon', true); $menu_item->tag = get_post_meta($menu_item->ID, '_menu_item_tag', true); // 1 Level $menu_item->drop_side = get_post_meta($menu_item->ID, '_menu_item_drop_side', true); $menu_item->mega = get_post_meta($menu_item->ID, '_menu_item_mega', true); $menu_item->mega_cols = get_post_meta($menu_item->ID, '_menu_item_mega_cols', true); $menu_item->mega_cols_full = get_post_meta($menu_item->ID, '_menu_item_mega_cols_full', true); $menu_item->mega_bg_img = get_post_meta($menu_item->ID, '_menu_item_mega_bg_img', true); $menu_item->mega_bg_pos = get_post_meta($menu_item->ID, '_menu_item_mega_bg_pos', true); $menu_item->mega_bg_rep = get_post_meta($menu_item->ID, '_menu_item_mega_bg_rep', true); $menu_item->mega_bg_size = get_post_meta($menu_item->ID, '_menu_item_mega_bg_size', true); // 1-2 Level $menu_item->hide_text = get_post_meta($menu_item->ID, '_menu_item_hide_text', true); $menu_item->subtitle = get_post_meta($menu_item->ID, '_menu_item_subtitle', true); // >= 3 Level $menu_item->mega_descr_text = get_post_meta($menu_item->ID, '_menu_item_mega_descr_text', true); return $menu_item; } function cmsmasters_update_custom_nav_fields($menu_id, $menu_item_db_id, $args) { if (isset($_POST['menu-item-highlight'])) { if (is_array($_POST['menu-item-highlight'])) { $highlight_value = (isset($_POST['menu-item-highlight'][$menu_item_db_id])) ? $_POST['menu-item-highlight'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_highlight', $highlight_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_highlight', ''); } if (isset($_POST['menu-item-color'])) { if (is_array($_POST['menu-item-color'])) { $color_value = (isset($_POST['menu-item-color'][$menu_item_db_id])) ? $_POST['menu-item-color'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_color', $color_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_color', ''); } if (isset($_POST['menu-item-icon'])) { if (is_array($_POST['menu-item-icon'])) { $icon_value = (isset($_POST['menu-item-icon'][$menu_item_db_id])) ? $_POST['menu-item-icon'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_icon', $icon_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_icon', ''); } if (isset($_POST['menu-item-tag'])) { if (is_array($_POST['menu-item-tag'])) { $tag_value = (isset($_POST['menu-item-tag'][$menu_item_db_id])) ? $_POST['menu-item-tag'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_tag', $tag_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_tag', ''); } if (isset($_POST['menu-item-drop_side'])) { if (is_array($_POST['menu-item-drop_side'])) { $drop_side_value = (isset($_POST['menu-item-drop_side'][$menu_item_db_id])) ? $_POST['menu-item-drop_side'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_drop_side', $drop_side_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_drop_side', ''); } if (isset($_POST['menu-item-mega'])) { if (isset($_POST['menu-item-mega']) && is_array($_POST['menu-item-mega'])) { $mega_value = (isset($_POST['menu-item-mega'][$menu_item_db_id])) ? $_POST['menu-item-mega'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_mega', $mega_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_mega', ''); } if (isset($_POST['menu-item-mega_cols'])) { if (is_array($_POST['menu-item-mega_cols'])) { $mega_cols_value = (isset($_POST['menu-item-mega_cols'][$menu_item_db_id])) ? $_POST['menu-item-mega_cols'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_mega_cols', $mega_cols_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_mega_cols', ''); } if (isset($_POST['menu-item-mega_cols_full'])) { if (is_array($_POST['menu-item-mega_cols_full'])) { $mega_cols_full_value = (isset($_POST['menu-item-mega_cols_full'][$menu_item_db_id])) ? $_POST['menu-item-mega_cols_full'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_mega_cols_full', $mega_cols_full_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_mega_cols_full', ''); } if (isset($_POST['menu-item-mega_bg_img'])) { if (is_array($_POST['menu-item-mega_bg_img'])) { $mega_bg_img_value = (isset($_POST['menu-item-mega_bg_img'][$menu_item_db_id])) ? $_POST['menu-item-mega_bg_img'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_mega_bg_img', $mega_bg_img_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_mega_bg_img', ''); } if (isset($_POST['menu-item-mega_bg_pos'])) { if (is_array($_POST['menu-item-mega_bg_pos'])) { $mega_bg_pos_value = (isset($_POST['menu-item-mega_bg_pos'][$menu_item_db_id])) ? $_POST['menu-item-mega_bg_pos'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_mega_bg_pos', $mega_bg_pos_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_mega_bg_pos', ''); } if (isset($_POST['menu-item-mega_bg_rep'])) { if (is_array($_POST['menu-item-mega_bg_rep'])) { $mega_bg_rep_value = (isset($_POST['menu-item-mega_bg_rep'][$menu_item_db_id])) ? $_POST['menu-item-mega_bg_rep'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_mega_bg_rep', $mega_bg_rep_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_mega_bg_rep', ''); } if (isset($_POST['menu-item-mega_bg_size'])) { if (is_array($_POST['menu-item-mega_bg_size'])) { $mega_bg_size_value = (isset($_POST['menu-item-mega_bg_size'][$menu_item_db_id])) ? $_POST['menu-item-mega_bg_size'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_mega_bg_size', $mega_bg_size_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_mega_bg_size', ''); } if (isset($_POST['menu-item-hide_text'])) { if (is_array($_POST['menu-item-hide_text'])) { $hide_text_value = (isset($_POST['menu-item-hide_text'][$menu_item_db_id])) ? $_POST['menu-item-hide_text'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_hide_text', $hide_text_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_hide_text', ''); } if (isset($_POST['menu-item-subtitle'])) { if (is_array($_POST['menu-item-subtitle'])) { $subtitle_value = (isset($_POST['menu-item-subtitle'][$menu_item_db_id])) ? $_POST['menu-item-subtitle'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_subtitle', $subtitle_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_subtitle', ''); } if (isset($_POST['menu-item-mega_descr_text'])) { if (is_array($_POST['menu-item-mega_descr_text'])) { $mega_descr_text_value = (isset($_POST['menu-item-mega_descr_text'][$menu_item_db_id])) ? $_POST['menu-item-mega_descr_text'][$menu_item_db_id] : ''; update_post_meta($menu_item_db_id, '_menu_item_mega_descr_text', $mega_descr_text_value); } } else { update_post_meta($menu_item_db_id, '_menu_item_mega_descr_text', ''); } } function cmsmasters_edit_walker($walker, $menu_id) { return 'Walker_Cmsmasters_Nav_Mega_Menu_Edit'; } public function cmsmasters_mega_menu_activate() { $this->cmsmasters_mega_menu_activation_compatibility(); if (get_option('cmsmasters_active_mega_menu') != CMSMASTERS_MEGA_MENU_VERSION) { add_option('cmsmasters_active_mega_menu', CMSMASTERS_MEGA_MENU_VERSION, '', 'yes'); } flush_rewrite_rules(); } public function cmsmasters_mega_menu_deactivate() { flush_rewrite_rules(); } public function cmsmasters_mega_menu_activation_compatibility() { if ( !defined('CMSMASTERS_MEGA_MENU') || (defined('CMSMASTERS_MEGA_MENU') && !CMSMASTERS_MEGA_MENU) ) { deactivate_plugins(CMSMASTERS_MEGA_MENU_NAME); wp_die( __("Your theme doesn't support CMSMasters Mega Menu plugin. Please use appropriate CMSMasters theme.", 'cmsmasters-mega-menu'), __("Error!", 'cmsmasters-mega-menu'), array( 'back_link' => true ) ); } } public function cmsmasters_mega_menu_compatibility() { if ( !defined('CMSMASTERS_MEGA_MENU') || (defined('CMSMASTERS_MEGA_MENU') && !CMSMASTERS_MEGA_MENU) ) { if (is_plugin_active(CMSMASTERS_MEGA_MENU_NAME)) { deactivate_plugins(CMSMASTERS_MEGA_MENU_NAME); add_action('admin_notices', array($this, 'cmsmasters_mega_menu_compatibility_warning')); } } } public function cmsmasters_mega_menu_compatibility_warning() { echo "

" . __("CMSMasters Mega Menu plugin was deactivated, because your theme doesn't support it. Please use appropriate CMSMasters theme.", 'cmsmasters-mega-menu') . "

"; } } class Walker_Cmsmasters_Nav_Mega_Menu_Edit extends Walker_Nav_Menu { function start_lvl( &$output, $depth = 0, $args = array() ) {} function end_lvl( &$output, $depth = 0, $args = array() ) {} function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { global $_wp_nav_menu_max_depth; $_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth; ob_start(); $item_id = esc_attr( $item->ID ); $removed_args = array( 'action', 'customlink-tab', 'edit-menu-item', 'menu-item', 'page-tab', '_wpnonce', ); $original_title = ''; if ( 'taxonomy' == $item->type ) { $original_title = get_term_field( 'name', $item->object_id, $item->object, 'raw' ); if ( is_wp_error( $original_title ) ) $original_title = false; } elseif ( 'post_type' == $item->type ) { $original_object = get_post( $item->object_id ); $original_title = get_the_title( $original_object->ID ); } $classes = array( 'menu-item menu-item-depth-' . $depth, 'menu-item-' . esc_attr( $item->object ), 'menu-item-edit-' . ( ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? 'active' : 'inactive'), ); $title = $item->title; if ( ! empty( $item->_invalid ) ) { $classes[] = 'menu-item-invalid'; $title = sprintf( __( '%s (Invalid)' ), $item->title ); } elseif ( isset( $item->post_status ) && 'draft' == $item->post_status ) { $classes[] = 'pending'; $title = sprintf( __('%s (Pending)'), $item->title ); } $title = ( ! isset( $item->label ) || '' == $item->label ) ? $title : $item->label; $submenu_text = ''; if ( 0 == $depth ) $submenu_text = 'style="display: none;"'; $highlight_class = ''; if ( $item->highlight == 'highlight') $highlight_class = ' cmsmasters_highlight'; $icon_class = ''; if ( $item->icon != '') $icon_class = ' ' . $item->icon; $drop_side_text = ''; if ( 0 == $depth && $item->drop_side == 'right') $drop_side_text = 'style="display: inline;"'; $mega_menu_text = ''; if ( 0 == $depth && $item->mega == 'mega') $mega_menu_text = 'style="display: inline;"'; $hide_text_class = ''; if ( ( 0 == $depth && $item->hide_text == 'hide' ) || ( 1 == $depth && $item->mega == 'mega' && $item->hide_text == 'hide' ) ) $hide_text_class = ' cmsmasters_hide_text'; ?> \n"; } } new Cmsmasters_Mega_Menu(); js/jquery.megaMenu.js000064400000010721150514555650010606 0ustar00/** * @package WordPress Plugin * @subpackage CMSMasters Mega Menu * @version 1.2.9 * * Mega Menu Script * Created by CMSMasters * */ var header = jQuery('#header .header_mid_inner'), nav = jQuery('#navigation'); if(nav.length > 0) { var nav_left = nav.offset().left, mega = nav.find('> li.menu-item-mega'), header_width = header.width(), firstRun = true, rtl = jQuery('html').attr('dir'); jQuery(document).ready(function() { cmsmastersMegaMenu(); } ); jQuery(window).on('debouncedresize', function () { setTimeout(function () { cmsmastersMegaMenu(); }, 150); } ); jQuery(window).on('debouncedscroll', function () { cmsmastersMegaMenu(); } ); } function cmsmastersMegaMenu() { var win_width = jQuery(window).width(), new_header_width = header.width(), header_pad_left = Number(header.css('padding-left').replace('px', '')), header_left = header.offset().left + header_pad_left, header_right = header_left + new_header_width, new_nav_left = nav.offset().left; if ( firstRun || new_header_width !== header_width || new_nav_left !== nav_left ) { mega.each(function () { var li = jQuery(this), full = li.hasClass('menu-item-mega-fullwidth'), drop_right = li.hasClass('menu-item-dropdown-right'), li_left = li.offset().left, mega = li.find('> div'); if (mega.length === 1) { var mega_width = mega.outerWidth(), mega_left = mega.offset().left, mega_right = mega_left + mega_width; if (full) { mega.css( { width : new_header_width + 'px', right : 'auto', left : '-' + (li_left - header_left) + 'px' } ); } else { if (mega_width >= new_header_width) { li.addClass('menu-item-mega-fullwidth menu-item-mega-dynamic-fullwidth').find('> div').css( { width : new_header_width + 'px', right : 'auto', left : '-' + ((typeof(rtl) === 'undefined') ? (li_left - header_left) : (mega_right - header_right)) + 'px' } ); } else { if (drop_right) { if (typeof(rtl) === 'undefined') { if (mega_left < header_left) { mega.css( { right : 'auto', left : '-' + (li_left - header_left) + 'px' } ); } } else { if (mega_right > header_right) { mega.css( { left : '-' + (mega_right - header_right) + 'px' } ); } } } else { if (typeof(rtl) === 'undefined') { if (mega_right > header_right) { mega.css( { left : '-' + (mega_right - header_right) + 'px' } ); } else if (mega_left < header_left) { mega.css( { left : '-' + (li_left - header_left) + 'px' } ); } } else { if (mega_left < header_left) { mega.css( { right : 'auto', left : '-' + (li_left - header_left) + 'px' } ); } } } } } if (win_width < 1008) { mega.css( { width : '', right : '', left : '' } ); mega.find('a').each(function () { var a_style = jQuery(this).attr('style'), span_tag = jQuery(this).find('span'); jQuery(this).removeAttr('style').attr('data-style', a_style); span_tag.each(function () { var span_style = jQuery(this).attr('style'); jQuery(this).removeAttr('style').attr('data-style', span_style); } ); } ); } else { mega.find('a').each(function () { var a_style = jQuery(this).attr('data-style'), span_tag = jQuery(this).find('span'); jQuery(this).removeAttr('data-style').attr('style', a_style); span_tag.each(function () { var span_style = jQuery(this).attr('data-style'); jQuery(this).removeAttr('data-style').attr('style', span_style); } ); } ); } } } ); nav_left = new_nav_left; } firstRun = false; } function cmsmastersMegaMenuDestroy() { mega.each(function () { var li = jQuery(this), mega = li.find('> div'); mega.css( { width : '', right : '', left : '' } ); } ); firstRun = true; }