reworked Trestle settings to separate metabox, include new settings - layout & link icons, cleaned up php

This commit is contained in:
Mickey Kay
2013-11-19 09:52:34 -08:00
parent 38a1146d8f
commit 5fe327f54c
5 changed files with 150 additions and 156 deletions
-54
View File
@@ -1,54 +0,0 @@
// Executes when the document is ready
jQuery(document).ready(function() {
// Remove .no-jquery body class
jQuery('body').removeClass('no-jquery');
// Get our URL
var h = window.location.host.toLowerCase();
// External Links
jQuery('[href^="http://"],[href^="https://"]').not('[href*="' + h + '"], .button, .menu-primary a').addClass('externalLink').attr("target", "_blank");
// Add classes to different types of media links
jQuery('a[href^="mailto:"]:not(.button)').addClass('emailLink');
jQuery('a[href*=".pdf"]:not(.button)').attr({"target":"_blank"}).addClass('pdfLink');
jQuery('a[href*=".doc"]:not(.button)').attr({"target":"_blank"}).addClass('docLink');
jQuery('img').parent('a:not(.button)').addClass('imageLink').removeClass('externalLink');
// Add classes to parts of lists
jQuery('li:last-child').addClass('last');
jQuery('li:first-child').addClass('first');
jQuery('ul, ol').parent('li').addClass('parent');
// Mobile navigation button
jQuery('#menu-button').click(function() {
var button = jQuery(this);
button.toggleClass('open');
jQuery('.menu-primary').slideToggle();
});
// Mobile navigation icons
var closedIcon = '+';
var openIcon = '-';
jQuery('.genesis-nav-menu .parent:not(.current-menu-item, .current_page_item, .current_page_parent, .current_page_ancestor) > a').after('<a class="sub-icon" href="javascript:void()">' + closedIcon + '</a>');
jQuery('.genesis-nav-menu .parent.current-menu-item > a, .genesis-nav-menu .parent.current_page_item > a, .genesis-nav-menu .parent.current_page_parent > a, .genesis-nav-menu .parent.current_page_ancestor > a').after('<a class="sub-icon" href="javscript: void()">' + openIcon + '</a>');
// Mobile navigation expand/contract functionality
jQuery('.sub-icon').click(function() {
var icon = jQuery(this);
icon.next('ul').slideToggle();
if ( icon.text().indexOf( closedIcon ) !== -1 )
icon.text(openIcon);
else if ( icon.text().indexOf( openIcon ) !== -1 )
icon.text(closedIcon);
});
}); /* end of as page load scripts */
// Executes when complete page is fully loaded, including all frames, objects, and images
jQuery(window).load(function() {
});