Skip to content

Commit 7e79c15

Browse files
nacinrdworth
authored andcommitted
Ghetto menu handling.
(cherry picked from commit d78c2e3)
1 parent 6c2259e commit 7e79c15

File tree

15 files changed

+83
-66
lines changed

15 files changed

+83
-66
lines changed

themes/api.jquery.com/menu-header.php

Lines changed: 0 additions & 1 deletion
This file was deleted.

themes/api.jquerymobile.com/menu-header.php

Lines changed: 0 additions & 1 deletion
This file was deleted.

themes/api.jqueryui.com/menu-header.php

Lines changed: 0 additions & 1 deletion
This file was deleted.

themes/api.qunitjs.com/menu-header.php

Lines changed: 0 additions & 1 deletion
This file was deleted.

themes/jquery.com/menu-header.php

Lines changed: 0 additions & 8 deletions
This file was deleted.

themes/jquery/menu-header-jquery.php

Lines changed: 0 additions & 8 deletions
This file was deleted.

themes/jquery/menu-header-mobile.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

themes/jquery/menu-header-qunit.php

Lines changed: 0 additions & 9 deletions
This file was deleted.

themes/jquery/menu-header-ui.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

themes/jquery/menu-header.php

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,83 @@
1-
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
1+
<?php
2+
3+
$tld = explode( '.', JQUERY_LIVE_SITE );
4+
$func = 'menu_header_' . implode( '_', $tld );
5+
if ( ! function_exists( $func ) ) {
6+
array_shift( $tld );
7+
$func = 'menu_header_' . implode( '_', $tld );
8+
}
9+
if ( function_exists( $func ) )
10+
jquery_render_menu( call_user_func( $func ) );
11+
unset( $tld, $func );
12+
13+
function jquery_render_menu( $items ) {
14+
$current = trailingslashit( set_url_scheme( 'http://' . JQUERY_LIVE_SITE . $_SERVER['REQUEST_URI'] ) );
15+
error_log( $current );
16+
?>
17+
<div class="menu-top-container">
18+
<ul id="menu-top" class="menu">
19+
<?php
20+
foreach ( $items as $url => $anchor ) {
21+
$class = 'menu-item';
22+
$url = set_url_scheme( $url );
23+
error_log( $url );
24+
if ( 0 === strpos( $current, $url ) )
25+
$class .= ' current';
26+
echo ' <li class="' . $class . '"><a href="' . $url . '">' . $anchor . "</a></li>\n";
27+
}
28+
?>
29+
</ul>
30+
</div>
31+
<?php
32+
}
33+
34+
function menu_header_jquery_com() {
35+
return array(
36+
'http://plugins.jquery.com/' => 'Plugins',
37+
'http://jquery.com/download/' => 'Download',
38+
'http://api.jquery.com/' => 'API Documentation',
39+
'http://jquery.com/browser-support/' => 'Browser Support',
40+
);
41+
}
42+
43+
function menu_header_plugins_jquery_com() {
44+
return array(
45+
'http://plugins.jquery.com/docs/names/' => 'Naming Your Plugin',
46+
'http://plugins.jquery.com/docs/publish/' => 'Publishing Your Plugin',
47+
);
48+
}
49+
50+
function menu_header_qunitjs_com() {
51+
return array(
52+
'http://qunitjs.com/' => 'Home',
53+
'http://qunitjs.com/cookbook/' => 'Cookbook',
54+
'http://api.qunitjs.com/' => 'API Documentation',
55+
'http://qunitjs.com/intro/' => 'Intro to Unit Testing',
56+
'http://qunitjs.com/extensions/' => 'Extensions',
57+
);
58+
}
59+
60+
function menu_header_jquerymobile_com() {
61+
return array(
62+
'http://mobile.jquery.com/docs' => 'Docs',
63+
'http://mobile.jquery.com/download' => 'Download',
64+
'http://mobile.jquery.com/gbs' => 'Platforms',
65+
'http://mobile.jquery.com/themeroller' => 'Themes',
66+
'http://mobile.jquery.com/resources' => 'Resources',
67+
'http://forum.jquery.com/jquery-mobile' => 'Forum',
68+
'http://mobile.jquery.com/blog' => 'Blog',
69+
);
70+
}
71+
72+
function menu_header_jqueryui_com() {
73+
return array(
74+
'http://jqueryui.com/demos/' => 'Demos',
75+
'http://jqueryui.com/download' => 'Download',
76+
'http://api.jqueryui.com/' => 'API Documentation',
77+
'http://jqueryui.com/themeroller' => 'Themes',
78+
'http://jqueryui.com/development' => 'Development',
79+
'http://jqueryui.com/support' => 'Support',
80+
'http://blog.jqueryui.com/' => 'Blog',
81+
'http://jqueryui.com/about' => 'About',
82+
);
83+
}

themes/jquerymobile.com/menu-header.php

Lines changed: 0 additions & 1 deletion
This file was deleted.

themes/jqueryui.com/menu-header.php

Lines changed: 0 additions & 1 deletion
This file was deleted.

themes/learn.jquery.com/menu-header.php

Lines changed: 0 additions & 2 deletions
This file was deleted.

themes/plugins.jquery.com/menu-header.php

Lines changed: 0 additions & 8 deletions
This file was deleted.

themes/qunitjs.com/menu-header.php

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)