Ticket #84: 84-jquery.patch
File 84-jquery.patch, 6.5 KB (added by , 11 years ago) |
---|
-
functions.php
103 103 * Enqueue scripts and styles 104 104 */ 105 105 function jobswp_scripts() { 106 wp_enqueue_style( '996-normalize', get_template_directory_uri() . '/css/996/normalize.css' ); 107 wp_enqueue_style( '996-base', get_template_directory_uri() . '/css/996/base.css' ); 108 wp_enqueue_style( '996-grid', get_template_directory_uri() . '/css/996/grid.css' ); 109 wp_enqueue_style( '996-style', get_template_directory_uri() . '/css/996/style.css' ); 110 wp_enqueue_style( 'dashicons' ); 111 wp_enqueue_style( 'open-sans' ); 106 112 wp_enqueue_style( 'jobswp-style', get_stylesheet_uri() ); 107 108 wp_enqueue_script( 'jobswp-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); 109 113 114 wp_enqueue_script( 'jobswp-navigation', get_template_directory_uri() . '/js/navigation.js', array( 'jquery'), '20131107', true ); 110 115 wp_enqueue_script( 'jobswp-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); 111 116 112 117 if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { … … 117 122 wp_enqueue_script( 'jobswp-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); 118 123 } 119 124 120 wp_enqueue_style( '996-normalize', get_template_directory_uri() . '/css/996/normalize.css' );121 wp_enqueue_style( '996-base', get_template_directory_uri() . '/css/996/base.css' );122 wp_enqueue_style( '996-grid', get_template_directory_uri() . '/css/996/grid.css' );123 wp_enqueue_style( '996-style', get_template_directory_uri() . '/css/996/style.css' );124 wp_enqueue_style( 'dashicons' );125 wp_enqueue_style( 'open-sans' );126 127 125 /* Modernizr disbabled because it causes Safari to whitescreen */ 128 126 // wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/996/modernizr-2.6.2.min.js' ); 129 127 // wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/996/modernizr-2.6.2.js' ); -
js/navigation.js
1 1 /** 2 2 * navigation.js 3 * 4 * Handles toggling the navigation menu for small screens. 3 * 4 * Handles toggling the two navigation menus for small screens. 5 * 5 6 */ 6 ( function() { 7 var container, button, menu; 7 jQuery(document).ready(function(){ 8 8 9 container = document.getElementById( 'site-navigation' ); 10 if ( ! container ) 11 return; 12 13 button = container.getElementsByTagName( 'h1' )[0]; 14 if ( 'undefined' === typeof button ) 15 return; 16 17 menu = container.getElementsByTagName( 'ul' )[0]; 18 19 // Hide menu toggle button if menu is empty and return early. 20 if ( 'undefined' === typeof menu ) { 21 button.style.display = 'none'; 22 return; 23 } 24 25 if ( -1 === menu.className.indexOf( 'nav-menu' ) ) 26 menu.className += ' nav-menu'; 27 28 button.onclick = function() { 29 if ( -1 !== container.className.indexOf( 'toggled' ) ) 30 container.className = container.className.replace( ' toggled', '' ); 31 else 32 container.className += ' toggled'; 33 }; 34 } )(); 9 jQuery('.menu-toggle').click(function () { 10 jQuery('.menu').slideToggle(400, function () { 11 jQuery('.menu').toggleClass('mobile-pop').css('display', ''); 12 }); 13 }); 14 15 jQuery('.menu-jobs-toggle').click(function () { 16 jQuery('.menu-jobs').slideToggle(400, function () { 17 jQuery('.menu-jobs').toggleClass('mobile-pop').css('display', ''); 18 }); 19 }); 20 21 }); -
sidebar.php
10 10 11 11 <aside id="cats" class="widget"> 12 12 <h3 class="widget-title"><?php _e( 'Position Types', 'jobswp' ); ?></h3> 13 <ul> 13 <a href="#" class="menu-jobs-toggle"></a> 14 <ul class="menu-jobs"> 14 15 <li class="job-cat-item job-cat-item-all"><a href="/" title="<?php esc_attr_e( 'View all job openings', 'jobswp' ); ?>"><?php _e( 'All Openings', 'jobswp' ) ?></a></li> 15 16 <?php Jobs_Dot_WP::list_job_categories(); ?> 16 17 </ul> … … 18 19 19 20 <?php dynamic_sidebar( 'sidebar-1' ); ?> 20 21 21 </div><!-- #secondary --> 22 </div><!-- #secondary --> 23 No newline at end of file -
style.css
455 455 cursor: pointer; 456 456 display: none; 457 457 } 458 .menu { 459 display: block; 460 } 458 461 459 462 @media screen and (max-width: 600px) { 460 463 .menu-toggle, … … 758 761 text-decoration: none; 759 762 color: #21759b; 760 763 } 764 765 /* Small menu */ 766 .menu-jobs-toggle { 767 display: none; 768 } 769 .menu-jobs { 770 display: block; 771 } 772 761 773 .all-job-categories a:hover, .jobs-group a:hover, #secondary #cats li a:hover { 762 774 color: #2EA2CC; 763 775 } … … 1245 1257 .container .jobs-group .grid_2, 1246 1258 .container .jobs-group .grid_4, 1247 1259 .container .jobs-group .grid_7, 1248 .post-job-job-info { 1260 .post-job-job-info, 1261 .container .no-job.grid_9 { 1249 1262 width: 100%; 1250 1263 } 1251 1264 .container .jobs-group .grid_1, 1252 1265 .container .jobs-group .grid_2, 1253 1266 .container .jobs-group .grid_4, 1254 .container .hentry .grid_3 { 1267 .container .hentry .grid_3, 1268 .container .no-job.grid_9 { 1255 1269 padding-left: 20px; 1256 1270 padding-right: 20px; 1257 1271 } … … 1299 1313 margin-top: 0; 1300 1314 margin-bottom: 0.5em; 1301 1315 } 1302 1316 1317 #cats { 1318 position: relative; 1319 } 1320 #cats h3 { 1321 color: #2ea2cc; 1322 margin: 0; 1323 padding-bottom: 10px; 1324 } 1325 #cats h3:after { 1326 content: '\f228'; 1327 font: 16px 'dashicons'; 1328 float: right; 1329 vertical-align: top; 1330 } 1331 .menu-jobs { 1332 display: none; 1333 margin-top: 10px; 1334 } 1335 .menu-jobs.mobile-pop { 1336 display: block; 1337 } 1338 .menu-jobs-toggle { 1339 background: transparent; 1340 display: block; 1341 position: absolute; 1342 top: 0; 1343 left: 0; 1344 width: 100%; 1345 height: 50px; 1346 } 1303 1347 #wporg-footer { 1304 1348 min-width: inherit; 1305 1349 } 1306 1350 } 1351 @media only screen and (max-width: 600px) { 1352 .menu { 1353 display: none; 1354 } 1355 .menu.mobile-pop { 1356 display: block; 1357 } 1358 .menu-toggle { 1359 color: #ddd; 1360 display: block; 1361 font-size: 18px; 1362 padding-bottom: 20px; 1363 text-align: center; 1364 } 1365 .menu-toggle:after { 1366 content: '\f228'; 1367 font: 16px 'dashicons'; 1368 margin-left: 15px; 1369 vertical-align: middle; 1370 } 1371 } -
wporg-footer.php
47 47 <h6 class="aligncenter">Code is Poetry</h6> 48 48 </div> 49 49 50 </body>51 </html>