Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Side by Side Diff: src/site/js/scripts.js

Issue 23619013: start talking about polymer.dart (Closed) Base URL: git@github.com:dart-lang/dartlang.org.git@master
Patch Set: remove the colors, reword the intro Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/site/index.html ('k') | src/site/polymer-dart/index.markdown » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 $(document).ready(function() { 1 $(document).ready(function() {
2 var addPermalink = function() { 2 var addPermalink = function() {
3 if ($(this).hasClass('no-permalink')) {
4 return;
5 }
3 $(this).addClass('has-permalink'); 6 $(this).addClass('has-permalink');
4 $(this).append($('<a class="permalink" title="Permalink" href="#' + $(th is).attr('id') + '">#</a>')); 7 $(this).append($('<a class="permalink" title="Permalink" href="#' + $(th is).attr('id') + '">#</a>'));
5 }; 8 };
6 9
7 $.each(['h2','h3','h4'], function(n, h) { $('.has-permalinks ' + h).each(addPe rmalink); }); 10 $.each(['h2','h3','h4'], function(n, h) { $('.has-permalinks ' + h).each(addPe rmalink); });
8 11
9 // Add the `prettyprint` class to the blocks of code specified in the way that 12 // Add the `prettyprint` class to the blocks of code specified in the way that
10 // the book pages use. 13 // the book pages use.
11 $('pre.programlisting > em > span.remark, pre.screen > em > span.remark') 14 $('pre.programlisting > em > span.remark, pre.screen > em > span.remark')
12 .each(function(i, element) { 15 .each(function(i, element) {
13 var $element = $(element); 16 var $element = $(element);
14 var $programListing = $element.parent().parent(); 17 var $programListing = $element.parent().parent();
15 $programListing.addClass('prettyprint'); 18 $programListing.addClass('prettyprint');
16 // This regular expression is to test if this remark is of the right form to 19 // This regular expression is to test if this remark is of the right form to
17 // specify the language of the code block. 20 // specify the language of the code block.
18 var re = /^lang\-[a-z]+$/i; 21 var re = /^lang\-[a-z]+$/i;
19 if (re.test($element.text().trim())) { 22 if (re.test($element.text().trim())) {
20 $programListing.addClass($element.text().trim()); 23 $programListing.addClass($element.text().trim());
21 } 24 }
22 }); 25 });
23 26
24 // Add syntax highlighting. 27 // Add syntax highlighting.
25 prettyPrint(); 28 prettyPrint();
26 }); 29 });
OLDNEW
« no previous file with comments | « src/site/index.html ('k') | src/site/polymer-dart/index.markdown » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698