Skip to content

Commit

Permalink
Make page.js work on cpanratings
Browse files Browse the repository at this point in the history
  • Loading branch information
abh committed Jun 13, 2011
1 parent 869ea6d commit a25e6a7
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 23 deletions.
2 changes: 1 addition & 1 deletion combust
9 changes: 3 additions & 6 deletions docs/cpanratings/display/short_review.html
@@ -1,10 +1,7 @@

[% UNLESS page.added_helpful_js;
page.added_helpful_js = 1;
page.morehead = page.morehead _ '
<script type="text/javascript" src="/js/helpful.js"></script>
';
END;
[%
page.js.push("helpful.js");

UNLESS (page.added_cpanratings_css);
page.css_more.push('/css/cpanratings.css');
page.added_cpanratings_css = 1;
Expand Down
10 changes: 1 addition & 9 deletions docs/cpanratings/tpl/defaults
@@ -1,18 +1,10 @@
[%- page = {
title = template.title,
style = template.style or 'default.html',
site = "CPAN Ratings"
};
[%- page.site = "CPAN Ratings";

page.morehead = page.morehead _ '
<script type="text/javascript">
var global_auth_token = \'' _ combust.user_auth_token _ "';
</script>";

page.morehead = page.morehead _ '
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
';

page.banner_prefix = page.site;

page.style = 'default.html';
Expand Down
1 change: 0 additions & 1 deletion docs/dev/perl6/tpl/defaults

This file was deleted.

6 changes: 1 addition & 5 deletions docs/shared/tpl/defaults
@@ -1,8 +1,4 @@
[%- page = {
title = template.title,
style = template.style or 'default.html'
};

[%-
PROCESS "tpl/quicknews";

# don't include any whitespace from here...
Expand Down
31 changes: 31 additions & 0 deletions docs/shared/tpl/js_includes.html
@@ -0,0 +1,31 @@
[%

MACRO show_js(list_js_files) BLOCK;
Dumper.dump(list_js_files);
IF list_js_files && list_js_files.list && list_js_files.list.size;
FOR js_elem = list_js_files.list;
FOR js = js_elem.list;
IF !unique_js.${js};
IF js.match('^https?://');
jspath = js;
ELSIF js.match('^//');
jspath = js;
ELSIF js.match('^/');
jspath = combust.static_url(js) || js;
ELSE;
jspath = combust.static_url("/js/${js}") || "/js/${js}";
END;

%]<script type="text/javascript" src="[%- jspath -%]" charset="UTF-8"></script>
[%

unique_js.${js} = 1;
END;
END;
END;
END;
END; # END BLOCK

show_js(js_files);

%]
6 changes: 5 additions & 1 deletion docs/shared/tpl/style/default.html
Expand Up @@ -140,8 +140,12 @@
</TABLE>

[% END %]

[%
page.js.unshift("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js");
PROCESS tpl/js_includes.html(js_files = page.js);
%]

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="http://ipv4.v6test.develooper.com/js/v1/v6test.js"></script>
<script type="text/javascript">
// v6.target = '';
Expand Down

0 comments on commit a25e6a7

Please sign in to comment.