Skip to content

Commit

Permalink
Merge pull request #860 from CA-CODE-Works/1.10.2
Browse files Browse the repository at this point in the history
1.10.2
  • Loading branch information
Danny-Guzman committed Aug 9, 2023
2 parents 9edfda3 + c3e2442 commit 50425c1
Show file tree
Hide file tree
Showing 69 changed files with 1,361 additions and 2,378 deletions.
204 changes: 88 additions & 116 deletions dist/caweb-admin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({

/***/ 43:
/***/ 44:
/***/ (function(module) {

/*!
Expand Down Expand Up @@ -7082,7 +7082,7 @@

/***/ }),

/***/ 37:
/***/ 38:
/***/ (() => {

/* CAWeb Alert Option Javascript */
Expand Down Expand Up @@ -7501,7 +7501,7 @@ jQuery(document).ready(function($) {

/***/ }),

/***/ 38:
/***/ 39:
/***/ (() => {

/* CAWeb Icon Menu Javascript */
Expand Down Expand Up @@ -7540,7 +7540,7 @@ jQuery(document).ready(function($) {

/***/ }),

/***/ 39:
/***/ 40:
/***/ (() => {

/* nav-menus.php Javascript */
Expand Down Expand Up @@ -7711,7 +7711,7 @@ jQuery(document).ready(function($) {

/***/ }),

/***/ 40:
/***/ 41:
/***/ (() => {

/* CAWeb Options Javascript */
Expand Down Expand Up @@ -7813,23 +7813,6 @@ jQuery(document).ready(function($) {
}
});

// If Google Tag Manager Preview approved, disable Analytics iD
$('#ca_google_tag_manager_approved').on('change', function(e){
if( this.checked ){
$('#ca_google_analytic_id').attr('readonly', true);
$('#ca_google_analytic_id').parent().addClass('hidden');
}else{
$('#ca_google_analytic_id').attr('readonly', false);
$('#ca_google_analytic_id').parent().removeClass('hidden');
}
});
// If no Tag Manager ID unapprove Preview
$('#ca_google_tag_manager_id').on('input',function(e){
// if theres no Tage Manager ID
if( !this.value.trim() ){
$('#ca_google_tag_manager_approved').bootstrapToggle('off');
}
});
// If Google Translate is set to Custom, show extra options
$('input[name^="ca_google_trans_enabled"]').on( 'click', function(){
if( 'ca_google_trans_enabled_custom' !== $(this).attr('id') ){
Expand All @@ -7856,117 +7839,106 @@ jQuery(document).ready(function($) {

/***/ }),

/***/ 41:
/***/ 42:
/***/ (() => {

// Toggle CSS Colorscheme Options
// Toggle CAWeb Template Options
jQuery( document ).ready( function($) {
let current_version = $('#ca_site_version option:selected').val();

// Correct Options.
correct_options();

$('select[id$="ca_site_version"]').on("change", function(){
correct_social_media_links($(this).val());
correct_utility_header_options($(this).val());
correct_sticky_nav_option($(this).val());
correct_frontpage_search_option($(this).val());
correct_menu_types_option($(this).val());
correct_menu_home_link_option($(this).val());
current_version = $(this).val();
correct_options();
} );
});

function correct_options(){
correct_template_options();
correct_social_media_links();
}

// Toggle Template Options
function correct_template_options(){
var current_menu = $('#ca_default_navigation_menu option:selected').val();

// Toggle Social Media Links
function correct_social_media_links(version){
var exlusions = '5.5' !== version ? [
'ca_social_snapchat-settings',
'ca_social_pinterest-settings',
'ca_social_rss-settings',
'ca_social_google_plus-settings',
'ca_social_flickr-settings'
] : ['ca_social_github-settings'];

jQuery('div[id^="ca_social_"]').each(function(index) {
// hide the entire option if not allowed for specified template version
if( exlusions.includes(this.id) ){
jQuery(this).addClass('d-none');
jQuery(this).prev().addClass('d-none');
// Version 6.
if( '6.0' === current_version ){
// Drop support for mega menus.
$('#ca_default_navigation_menu option[value="flexmega"]').addClass('d-none');
$('#ca_default_navigation_menu option[value="megadropdown"]').addClass('d-none');

// if current menu is no longer supported, set to singlelevel.
if( ['flexmega','megadropdown'].includes( current_menu ) ){
$(`#ca_default_navigation_menu option[value="${current_menu}"]`).attr('selected', false);
$('#ca_default_navigation_menu option[value="singlelevel"]').attr('selected', true);
}

// Drop support for Menu Home Link.
$('#ca_home_nav_link').parent().parent().addClass('d-none');

// Drop support for Search on Frontpage
$('#ca_frontpage_search_enabled').parent().parent().addClass('d-none');

// Drop support for Utility Header.
$('#utility-header-settings').prev().addClass('d-none');
$('#utility-header-settings').addClass('d-none');
// Version 5.
}else{
jQuery(this).removeClass('d-none');
jQuery(this).prev().removeClass('d-none');
// Add support for mega menus.
$('#ca_default_navigation_menu option[value="flexmega"]').removeClass('d-none');
$('#ca_default_navigation_menu option[value="megadropdown"]').removeClass('d-none');

// Share via Email only has 2 options
// all other options have 5 options
var headerOption = 2 === this.children.length ? this.children[0] : this.children[1];
// Add support for Menu Home Link.
$('#ca_home_nav_link').parent().parent().removeClass('d-none');

// hide header option for all social link options
if( '5.5' !== version ){
jQuery(headerOption).addClass('d-none');
// Add support for Search on Frontpage
$('#ca_frontpage_search_enabled').parent().parent().removeClass('d-none');

}else{
jQuery(headerOption).removeClass('d-none');
}
// Drop support for Utility Header.
$('#utility-header-settings').prev().removeClass('d-none');
$('#utility-header-settings').removeClass('d-none');
}
});
}

// Toggle Utility Header Options
function correct_utility_header_options(version){
var homeIcon = jQuery('#utility-header-settings');

if( '5.5' !== version ){
jQuery(homeIcon).addClass('d-none');
jQuery(homeIcon).prev().addClass('d-none');
}else{
jQuery(homeIcon).removeClass('d-none');
jQuery(homeIcon).prev().removeClass('d-none');
}
}

// Toggle Search on Frontpage
function correct_frontpage_search_option(version){
if( '5.5' === version ){
jQuery('#ca_frontpage_search_enabled').parent().parent().removeClass('d-none');
}else{
jQuery('#ca_frontpage_search_enabled').parent().parent().addClass('d-none');
}
}

// Toggle Menu Types
function correct_menu_types_option(version){
var menu_type_picker = document.getElementById('ca_default_navigation_menu');
var current_menu = menu_type_picker.value;

for(i = menu_type_picker.length; i >= 0; i--) {
menu_type_picker.remove(i);
}

// Toggle Social Media Links
function correct_social_media_links(){
var exclusions = '6.0' === current_version ? [
'ca_social_snapchat-settings',
'ca_social_pinterest-settings',
'ca_social_rss-settings',
'ca_social_google_plus-settings',
'ca_social_flickr-settings'
] : ['ca_social_github-settings'];

$('div[id^="ca_social_"]').each(function(index) {
// hide the entire option if not allowed for specified template version
if( exclusions.includes(this.id) ){
$(this).addClass('d-none');
$(this).prev().addClass('d-none');
}else{
$(this).removeClass('d-none');
$(this).prev().removeClass('d-none');
}

for (const [i, ele] of Object.entries(caweb_admin_args.caweb_menus)) {
if( '6.0' === version && ['flexmega', 'megadropdown'].includes(i)){
continue;
}
var o = document.createElement( 'OPTION' );
var optionName = this.id.substring(0, this.id.indexOf('-'));

o.value = i;
o.text = ele;
// hide header option for all social link options when using version 6.
if( '6.0' === current_version ){
$(`#${optionName}_header`).parent().parent().addClass('d-none');
}else{
$(`#${optionName}_header`).parent().parent().removeClass('d-none');
}
});
}

if( i === current_menu ){
o.selected = true;
}

menu_type_picker.append( o );
}
}

// Toggle Menu Home Link
function correct_menu_home_link_option(version){
if( '5.5' === version ){
jQuery('#ca_home_nav_link').parent().parent().removeClass('d-none');
}else{
jQuery('#ca_home_nav_link').parent().parent().addClass('d-none');
}
}
});

/***/ }),

/***/ 42:
/***/ 43:
/***/ (() => {

/* CAWeb Uploads Option */
Expand Down Expand Up @@ -8054,7 +8026,7 @@ function addExternal(ext_list, ext){

/***/ }),

/***/ 36:
/***/ 37:
/***/ (() => {

/* Browse Library */
Expand Down Expand Up @@ -8235,16 +8207,16 @@ __webpack_require__.r(__webpack_exports__);

// This entry need to be wrapped in an IIFE because it need to be isolated against other entry modules.
(() => {
__webpack_require__(36);

__webpack_require__(37);

__webpack_require__(38);
__webpack_require__(39);
__webpack_require__(40);
__webpack_require__(41);
__webpack_require__(42);
__webpack_require__(43);

__webpack_require__(43)
__webpack_require__(44)
})();

/******/ })()
Expand Down
22 changes: 19 additions & 3 deletions dist/caweb-core.css
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ body[class*="5.5"].divi-built .et_pb_text ol, body[class*="5.5"].divi-built .et_
body[class*="5.5"].divi-built .et_pb_toggle.et_pb_toggle_item:focus {
outline: #2ea3f2 solid 2px !important;
}
body[class*="5.5"] #navigation .top-level-nav {
width: 100%;
}
body[class*="5.5"] .second-level-nav:not(.flex) {
display: block;
position: relative !important;
Expand All @@ -264,9 +267,6 @@ body[class*="5.5"] .second-level-nav:not(.flex) {
padding: 0 !important;
background: inherit;
}
body[class*="5.5"] .second-level-nav:not(.flex) li {
display: inline-block;
}
body[class*="5.5"] .second-level-nav:not(.flex) .second-level-link {
font-size: 17.6px;
font-size: 1.1rem;
Expand All @@ -276,6 +276,12 @@ body[class*="5.5"] .second-level-nav:not(.flex) .second-level-link:hover {
opacity: 1;
transition: all 0.3s;
}
body[class*="5.5"] .second-level-nav:not(.flex) li {
display: inline-block;
}
body[class*="5.5"] .second-level-nav:not(.flex) li.w-25 {
width: 24.6% !important;
}
body[class*="5.5"] nav.megadropdown .media-left .media-object {
max-width: inherit;
}
Expand Down Expand Up @@ -544,6 +550,16 @@ body[class*="6.0"].divi-built .et_pb_text ol, body[class*="6.0"].divi-built .et_
body[class*="6.0"].divi-built .et_pb_toggle.et_pb_toggle_item:focus {
outline: #2ea3f2 solid 2px !important;
}
@media (max-width: 768px) {
body[class*="6.0"].admin-bar header .navigation-search {
top: 46px;
}
}
@media (max-width: 991px) {
body[class*="6.0"].admin-bar header .navigation-search {
top: 32px;
}
}
body.page-template-searchpage #main-content .container:before {
background: transparent;
}
Expand Down
Loading

0 comments on commit 50425c1

Please sign in to comment.