From ab30e19afd4e351c71f6b8868e42f3d6896cf4e2 Mon Sep 17 00:00:00 2001 From: Salman Date: Mon, 11 Aug 2014 09:49:43 -0400 Subject: [PATCH 1/6] Small stuff functions: remove unnecessary variable reg-sidebars: need widgets page --- functions.php | 4 +++- inc/reg-sidebars.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 3a233eb..c8930c7 100644 --- a/functions.php +++ b/functions.php @@ -172,13 +172,15 @@ function be_hidden_meta_boxes($hidden, $screen) { } -function load_custom_wp_admin_style() { +function load_custom_wp_admin_style($page) { wp_register_style( 'custom_wp_admin_css', get_template_directory_uri() . '/css/admin-style.css', false, '1.0.0' ); wp_enqueue_style( 'custom_wp_admin_css' ); wp_register_script('uc-admin-js', get_template_directory_uri() . '/js/admin-style.js', false, '1.0.0'); wp_enqueue_script('uc-admin-js'); + + } add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' ); diff --git a/inc/reg-sidebars.php b/inc/reg-sidebars.php index 03cb911..8aad820 100644 --- a/inc/reg-sidebars.php +++ b/inc/reg-sidebars.php @@ -91,7 +91,7 @@ */ function uc_options_add_page() { add_theme_page( 'Manage Sidebars', 'Manage Sidebars', 'edit_theme_options', 'uc_sidebars', 'uc_sidebars_do_page' ); - remove_submenu_page( 'themes.php', 'widgets.php' ); + //remove_submenu_page( 'themes.php', 'widgets.php' ); } add_action( 'admin_menu', 'uc_options_add_page' ); From ba8fd576d480ae89100f9967fbe04d50f0b7df44 Mon Sep 17 00:00:00 2001 From: Salman Date: Mon, 11 Aug 2014 15:42:01 -0400 Subject: [PATCH 2/6] Hiding inactive home sidebars widgets-area.php: css to hide the sidebars in widgets page functions.php: enqueue css in widgets-area.php admin-style.js: hide containers of hidden sidebars in widgets page --- css/widgets-area.php | 22 ++++++++++++++++++++++ functions.php | 32 +++++++++++++------------------- js/admin-style.js | 10 ++++++++++ 3 files changed, 45 insertions(+), 19 deletions(-) create mode 100644 css/widgets-area.php diff --git a/css/widgets-area.php b/css/widgets-area.php new file mode 100644 index 0000000..8ca618a --- /dev/null +++ b/css/widgets-area.php @@ -0,0 +1,22 @@ + $index ){ + $index = $i; //$index is the biggest home widget area that has widgets, the next widget area doesn't have widgets + } + } + } + $start = ++$index; + for ($i=$start; $i < 31; $i++) { + echo '#home'.$i.'{ display:none; } '; + } +?> \ No newline at end of file diff --git a/functions.php b/functions.php index c8930c7..75dcc00 100644 --- a/functions.php +++ b/functions.php @@ -172,30 +172,24 @@ function be_hidden_meta_boxes($hidden, $screen) { } -function load_custom_wp_admin_style($page) { - wp_register_style( 'custom_wp_admin_css', get_template_directory_uri() . '/css/admin-style.css', false, '1.0.0' ); - wp_enqueue_style( 'custom_wp_admin_css' ); - - - wp_register_script('uc-admin-js', get_template_directory_uri() . '/js/admin-style.js', false, '1.0.0'); - wp_enqueue_script('uc-admin-js'); - +function load_custom_wp_admin_style($hook) { + wp_register_style( 'custom_wp_admin_css', get_template_directory_uri() . '/css/admin-style.css', false, '1.0.0' ); + wp_enqueue_style( 'custom_wp_admin_css' ); + + + wp_register_script('uc-admin-js', get_template_directory_uri() . '/js/admin-style.js', false, '1.0.0'); + wp_enqueue_script('uc-admin-js'); + if( 'widgets.php' != $hook ) + return; + wp_register_style( 'css-widgets-area', get_template_directory_uri().'/css/widgets-area.php' ); + wp_enqueue_style( 'css-widgets-area' ); } add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' ); -/* -function remove_widgets() { - // removed to avoid confusion with UConn Calendar widget - unregister_widget('WP_Widget_Calendar'); - // removed to de-emphasize blog use - unregister_widget('WP_Widget_Recent_Comments'); - unregister_widget('WP_Widget_Meta'); - // removed for conflict with simple social plugin on IE9 - unregister_widget('WP_Widget_Categories'); +function widgets_page_css($hook) { } -add_action( 'widgets_init', 'remove_widgets' ); -*/ +add_action( 'admin_enqueue_scripts', 'widgets_page_css' ); add_theme_support( 'post-thumbnails' ); \ No newline at end of file diff --git a/js/admin-style.js b/js/admin-style.js index ecca6bb..6687358 100644 --- a/js/admin-style.js +++ b/js/admin-style.js @@ -2,4 +2,14 @@ jQuery(document).ready(function($) { $('#accordion-section-layout_builder .ui-slider-handle').each(function(){ $(this).addClass('button button-primary'); }); + + var path = window.location.pathname; + if( path.split('/').indexOf('widgets.php') != -1 ){ + $('.widgets-holder-wrap.sidebar-sidebar').each(function(i){ + if( !($(this['children'][0]).is(":visible")) ){ + $(this).css('display', 'none'); + } + }); + } + }); \ No newline at end of file From 60004f96f0ac6b051f1308c4f59becdb2d16ba48 Mon Sep 17 00:00:00 2001 From: Salman Date: Mon, 11 Aug 2014 15:45:32 -0400 Subject: [PATCH 3/6] forgot to remove unnecessary function --- functions.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/functions.php b/functions.php index 75dcc00..571ef3b 100644 --- a/functions.php +++ b/functions.php @@ -187,9 +187,4 @@ function load_custom_wp_admin_style($hook) { } add_action( 'admin_enqueue_scripts', 'load_custom_wp_admin_style' ); -function widgets_page_css($hook) { - -} -add_action( 'admin_enqueue_scripts', 'widgets_page_css' ); - add_theme_support( 'post-thumbnails' ); \ No newline at end of file From fa18fe4111ad1b60d188b8c71d5f16e2a21d1a68 Mon Sep 17 00:00:00 2001 From: Salman Date: Wed, 20 Aug 2014 10:09:38 -0400 Subject: [PATCH 4/6] 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 @@
- +
From 1c450c2f95fc8b47d42df1ea1db2f41d4ea589bc Mon Sep 17 00:00:00 2001 From: Salman Z Kaleem Date: Wed, 20 Aug 2014 10:11:04 -0400 Subject: [PATCH 5/6] Update functions.php --- functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 96cb5fc..6c154f0 100644 --- a/functions.php +++ b/functions.php @@ -1,4 +1,3 @@ -<<<<<<< HEAD Date: Wed, 20 Aug 2014 10:45:08 -0400 Subject: [PATCH 6/6] bootstrap whitelist --- functions.php | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 96cb5fc..910c854 100644 --- a/functions.php +++ b/functions.php @@ -1,4 +1,3 @@ -<<<<<<< HEAD true, + 'data-dismiss' => true, + 'data-target' => true, + 'data-spy' => true, + 'data-loading-text' => true, + 'data-parent' => true, + 'data-slide' => true, + 'data-slide-to' => true, + 'data-provide' => true, + 'data-interval' => true, + 'data-pause' => true, + 'data-animation' => true, + 'data-html' => true, + 'data-placement' => true, + 'data-selector' => true, + 'data-title' => true, + 'data-trigger' => true, + 'data-delay' => true, + 'data-container' => true); + + foreach($newtags as $newtag){ + if( isset($tags[$newtag]) && is_array($tags[$newtag])){ + $tags[$newtag] = array_merge($tags[$newtag], $newattrs); + } + else{ + $tags[$newtag] = $newattrs; + } + } + + return $tags; +} +add_filter('wp_kses_allowed_html', 'add_allowed_tags'); \ No newline at end of file