Skip to content

Commit

Permalink
fixes learn jquery#43, add feedback link to github page for content
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkpaul committed Oct 15, 2012
1 parent 449a2b7 commit d1c2ce4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
18 changes: 18 additions & 0 deletions themes/jquery/functions.jquery.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,22 @@ function jq_page_links_for_category( $category ) {
return $ret;
}

function jq_get_github_url() {
$url = $_SERVER['REQUEST_URI'];
$path = parse_url($url)['path'];
$github_prefix = 'https://github.com/jquery/'.get_stylesheet().'/tree/master/page';

return $github_prefix . str_lreplace('/','.md', $path);
}

function str_lreplace($search, $replace, $subject) {
$pos = strrpos($subject, $search);

if($pos !== false) {
$subject = substr_replace($subject, $replace, $pos, strlen($search));
}

return $subject;
}

?>
4 changes: 3 additions & 1 deletion themes/learn.jquery.com/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
<?php get_template_part( 'content', 'page' ); ?>

<?php comments_template( '', true ); ?>

<h2>Suggestions, Problems, Feedback</h2>
<a class="btn" href="<?php echo jq_get_github_url(); ?>"><i class="icon-github"></i> Open an Issue or Submit a Pull Request on GitHub</a>

</div>
<!-- /inner -->

Expand Down
4 changes: 4 additions & 0 deletions themes/learn.jquery.com/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ Template: jquery
letter-spacing: 0;
margin: 4px 0 0 0;
}

#body .inner .icon-github {
color:#30b9f8;
}

0 comments on commit d1c2ce4

Please sign in to comment.