From fa18fe4111ad1b60d188b8c71d5f16e2a21d1a68 Mon Sep 17 00:00:00 2001 From: Salman Date: Wed, 20 Aug 2014 10:09:38 -0400 Subject: [PATCH] update --- footer.php | 4 ++-- functions.php | 1 + inc/reg-sidebars.php | 2 +- inc/submenu-check.php | 2 +- js/admin-style.js | 4 +--- js/cs.js | 21 ++++++++++-------- js/min/admin-style.min.js | 1 + js/min/cs.min.js | 2 +- js/min/navigation.min.js | 2 +- js/navigation.js | 35 +++++++++++++++++++++++++++++- page-home.php | 45 ++++++++++++++++++--------------------- page.php | 2 +- 12 files changed, 77 insertions(+), 44 deletions(-) create mode 100644 js/min/admin-style.min.js diff --git a/footer.php b/footer.php index 89dda13..dd2c600 100644 --- a/footer.php +++ b/footer.php @@ -7,7 +7,7 @@ * @package cornerstone */ ?> - +
@@ -71,7 +71,7 @@
- + diff --git a/functions.php b/functions.php index 571ef3b..96cb5fc 100644 --- a/functions.php +++ b/functions.php @@ -1,3 +1,4 @@ +<<<<<<< HEAD
'; + $form = '
Search this Site'; $form .= ''; $form .= ''; $form .= ''; diff --git a/inc/submenu-check.php b/inc/submenu-check.php index 63c40b3..e212c92 100644 --- a/inc/submenu-check.php +++ b/inc/submenu-check.php @@ -33,5 +33,5 @@
-
+
\ No newline at end of file diff --git a/js/admin-style.js b/js/admin-style.js index 6687358..62b279a 100644 --- a/js/admin-style.js +++ b/js/admin-style.js @@ -10,6 +10,4 @@ jQuery(document).ready(function($) { $(this).css('display', 'none'); } }); - } - -}); \ No newline at end of file + } \ No newline at end of file diff --git a/js/cs.js b/js/cs.js index e510ebd..c46a558 100644 --- a/js/cs.js +++ b/js/cs.js @@ -215,16 +215,19 @@ jQuery(document).ready(function($) { function stickyFoot(){ /* Andrew's Sticky Footer JS. */ - var wrapperH = document.getElementById('page').clientHeight; - var footerH = document.getElementById('footers').clientHeight - - var comboH = wrapperH + footerH; - var windowH = window.innerHeight; - if(windowH>=comboH){ - $('body').addClass('sticky') - } else { - $('body').removeClass('sticky') + + if (document.getElementById('page')!=null && document.getElementById('footers') !=null){ + var wrapperH = document.getElementById('page').clientHeight; + var footerH = document.getElementById('footers').clientHeight + var windowH = window.innerHeight; + if(windowH>=wrapperH){ + $('body').addClass('sticky') + } else { + $('body').removeClass('sticky') + } } + + } window.onload = function (){ placeholderSupport = ("placeholder" in document.createElement("input")); diff --git a/js/min/admin-style.min.js b/js/min/admin-style.min.js new file mode 100644 index 0000000..f3dd803 --- /dev/null +++ b/js/min/admin-style.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(i){i("#accordion-section-layout_builder .ui-slider-handle").each(function(){i(this).addClass("button button-primary")});var e=window.location.pathname;-1!=e.split("/").indexOf("widgets.php")&&i(".widgets-holder-wrap.sidebar-sidebar").each(function(){i(this.children[0]).is(":visible")||i(this).css("display","none")})}); \ No newline at end of file diff --git a/js/min/cs.min.js b/js/min/cs.min.js index 518f4b1..b06fd2a 100644 --- a/js/min/cs.min.js +++ b/js/min/cs.min.js @@ -1 +1 @@ -jQuery(document).ready(function(a){function t(){var t=a(this).attr("href").toLowerCase(),i=a(this).children("img").length,e=null,n=null,l=null,p=null;if("#"!=t.charAt(0)&&0==i&&"/"!=t.charAt(0)){var o=t.split("/");e=o[2],n=o[o.length-1]||"";var c=n.split(".");if(c[1]&&a.each(d,function(t,i){i==c[1]&&(p=a(''),l=c[1],p.append("."+l))}),null!=p&&a(this).append(p),e!=s&&null!=e){var h='';a(this).addClass("external").append(h)}}}function i(t){var i=a("
");i.addClass("alert alert-danger accessibility-fail-msg"),i.width(t.width+"px");var e=a("");e.addClass("glyphicon glyphicon-ban-circle");var n=a("");n.append(' This image needs a valid Alt tag. '),i.append(e).append(n),a(t).after(i)}function e(){var t=document.getElementById("page").clientHeight,i=document.getElementById("footers").clientHeight,e=t+i,n=window.innerHeight;n>=e?a("body").addClass("sticky"):a("body").removeClass("sticky")}var n=location.href,l=n.split("/"),s=l[2],d=["3g2","3gp","avi","doc","docx","dotx","gif","jpg","jpeg","m4a","mid","midi","mov","mp3","mp4","mpg","odt","ogg","ogv","pdf","png","ppt","pptx","xls","xlsx","wav","wmv","zip","vsd"],p=["#comments","#site-navigation","article.page"];a.each(p,function(i,e){a(e+" a").each(t)}),a(".uup-list .has-image").each(function(){var t=a(this).find(".uup-text"),i=a(this).find("img:first"),e=t.height(),n=i.outerHeight();if(n>e){var l=n-e;t.css("padding-top",l/2)}}),a(".uup-index-table .table-has-image").each(function(){var t=a(this).find(".uup-name"),i=a(this).find(".uup-table-thumbnail"),e=t.height(),n=i.outerHeight();if(n>e){var l=n-e;t.css("cssText","padding-bottom:"+l+"px!important")}}),a("#page img").each(function(){alt=a(this).attr("alt"),alt?(alt=alt.toLowerCase(),(alt.indexOf(".jpg")>=0||alt.indexOf(".png")>=0||alt.indexOf(".gif")>=0)&&(a(this).addClass("accessibility-fail"),i(this))):(a(this).addClass("accessibility-fail"),i(this))}),a("#page table").each(function(){a(this).addClass("table")}),window.onload=function(){if(placeholderSupport="placeholder"in document.createElement("input"),0!=placeholderSupport){var t=a("main");t.addClass("supports-placeholder")}e()},window.onresize=function(){e()}}); \ No newline at end of file +jQuery(document).ready(function(a){function t(){var t=a(this).attr("href").toLowerCase(),i=a(this).children("img").length,e=null,n=null,l=null,p=null;if("#"!=t.charAt(0)&&0==i&&"/"!=t.charAt(0)){var o=t.split("/");e=o[2],n=o[o.length-1]||"";var c=n.split(".");if(c[1]&&a.each(d,function(t,i){i==c[1]&&(p=a(''),l=c[1],p.append("."+l))}),null!=p&&a(this).append(p),e!=s&&null!=e){var h='';a(this).addClass("external").append(h)}}}function i(t){var i=a("
");i.addClass("alert alert-danger accessibility-fail-msg"),i.width(t.width+"px");var e=a("");e.addClass("glyphicon glyphicon-ban-circle");var n=a("");n.append(' This image needs a valid Alt tag. '),i.append(e).append(n),a(t).after(i)}function e(){if(null!=document.getElementById("page")&&null!=document.getElementById("footers")){var t=document.getElementById("page").clientHeight,i=(document.getElementById("footers").clientHeight,window.innerHeight);i>=t?a("body").addClass("sticky"):a("body").removeClass("sticky")}}var n=location.href,l=n.split("/"),s=l[2],d=["3g2","3gp","avi","doc","docx","dotx","gif","jpg","jpeg","m4a","mid","midi","mov","mp3","mp4","mpg","odt","ogg","ogv","pdf","png","ppt","pptx","xls","xlsx","wav","wmv","zip","vsd"],p=["#comments","#site-navigation","article.page"];a.each(p,function(i,e){a(e+" a").each(t)}),a(".uup-list .has-image").each(function(){var t=a(this).find(".uup-text"),i=a(this).find("img:first"),e=t.height(),n=i.outerHeight();if(n>e){var l=n-e;t.css("padding-top",l/2)}}),a(".uup-index-table .table-has-image").each(function(){var t=a(this).find(".uup-name"),i=a(this).find(".uup-table-thumbnail"),e=t.height(),n=i.outerHeight();if(n>e){var l=n-e;t.css("cssText","padding-bottom:"+l+"px!important")}}),a("#page img").each(function(){alt=a(this).attr("alt"),alt?(alt=alt.toLowerCase(),(alt.indexOf(".jpg")>=0||alt.indexOf(".png")>=0||alt.indexOf(".gif")>=0)&&(a(this).addClass("accessibility-fail"),i(this))):(a(this).addClass("accessibility-fail"),i(this))}),a("#page table").each(function(){a(this).addClass("table")}),window.onload=function(){if(placeholderSupport="placeholder"in document.createElement("input"),0!=placeholderSupport){var t=a("main");t.addClass("supports-placeholder")}e()},window.onresize=function(){e()}}); \ No newline at end of file diff --git a/js/min/navigation.min.js b/js/min/navigation.min.js index e4ec0e3..aad16bc 100644 --- a/js/min/navigation.min.js +++ b/js/min/navigation.min.js @@ -1 +1 @@ -!function(){var e,n,a;if(e=document.getElementById("site-navigation"),e&&(n=e.getElementsByTagName("button")[0],"undefined"!=typeof n)){if(a=e.getElementsByTagName("ul")[0],"undefined"==typeof a)return n.style.display="none",void 0;-1===a.className.indexOf("nav-menu")&&(a.className+=" nav-menu"),n.onclick=function(){-1!==e.className.indexOf("toggled")?e.className=e.className.replace(" toggled",""):e.className+=" toggled"}}}(); \ No newline at end of file +jQuery(document).ready(function(r){function n(n){r(n).each(function(){var n=r(this).children("a"),t=e(this);n.attr("href",t)})}function e(n){var t=r(n).children("a").attr("href");if("#"==t){var i=r(n).children("ul").children("li").first();return 0==i.length?t:e(i)}return t}n(".menu-item-has-children")}); \ No newline at end of file diff --git a/js/navigation.js b/js/navigation.js index 706e4d8..1f759a2 100755 --- a/js/navigation.js +++ b/js/navigation.js @@ -1,8 +1,40 @@ /** * navigation.js * + */ + +jQuery(document).ready(function($) { + + function replaceAnchors(selector) { + $(selector).each(function(){ + var atag = $(this).children('a'); + var newhref = getFirstLink(this); + atag.attr('href',newhref); + }); + } + function getFirstLink(element){ + var href = $(element).children('a').attr('href'); + if(href == '#'){ + var firstChild = $(element).children('ul').children('li').first(); + if(firstChild.length == 0){ + return href; + } + else { + return getFirstLink(firstChild); + } + } + else { + return href; + } + } + + replaceAnchors('.menu-item-has-children'); + +}); + +/* * Handles toggling the navigation menu for small screens. - */ + * ( function() { var container, button, menu; @@ -32,3 +64,4 @@ container.className += ' toggled'; }; } )(); +*/ \ No newline at end of file diff --git a/page-home.php b/page-home.php index 2b1d0b2..5fa91a7 100644 --- a/page-home.php +++ b/page-home.php @@ -9,32 +9,29 @@ $rows = get_theme_mod('homepagerows'); $count = 1; get_header(); ?> +
- - -
- - -
-
- - - - - -
-
- - -
- - + +
+ +
+
+ + + + +
+
+ +
+ +
diff --git a/page.php b/page.php index 44e17cc..df71bf3 100644 --- a/page.php +++ b/page.php @@ -14,7 +14,7 @@
- +