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

Unified Diff: src/site/_includes/samples.html

Issue 10700168: massive CL is massive (Closed) Base URL: https://code.google.com/p/dartlang-site/@master
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/site/_includes/nav.html ('k') | src/site/_layouts/default.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/site/_includes/samples.html
diff --git a/src/site/_includes/samples.html b/src/site/_includes/samples.html
deleted file mode 100644
index 9b23ef5e2ead930f3bbd2e43d2b9df8f0e85bea8..0000000000000000000000000000000000000000
--- a/src/site/_includes/samples.html
+++ /dev/null
@@ -1,68 +0,0 @@
-{% comment %}
-So you want to add more samples:
-1 - Create a new pre element below containing the code you want to show.
-2 - Give it a unique id of the form "sample-name"
-3 - In the main page, add a new option to the select element and make sure value matches
- the name from step #2.
-
-TODO: These samples are just place holders and should be replaced with something real.
-{% endcomment %}
- <div style="display:none">
-
- {% comment %} hello dart {% endcomment %}
- <pre id="sample-hello">main() {
- print('Hello, Dart!');
-}</pre>
-
-
- {% comment %} fibonacci {% endcomment %}
- <pre id="sample-fib">int fib(int n) {
- if (n &lt;= 1) return n;
- return fib(n - 1) + fib(n - 2);
-}
-
-main() {
- print('fib(20) = ${fib(20)}');
-}</pre>
-
-
- {% comment %} point{% endcomment %}
- <pre id="sample-point">class Point {
- Point(this.x, this.y);
- distanceTo(Point other) {
- var dx = x - other.x;
- var dy = y - other.y;
- return Math.sqrt(dx * dx + dy * dy);
- }
- var x, y;
-}
-
-main() {
- Point p = new Point(2, 3);
- Point q = new Point(3, 4);
- print('distance from p to q = ${p.distanceTo(q)}');
-}
-</pre>
-
- </div>
-
- <script type="text/javascript">
- function show(name) {
- var editor = document.getElementById('samples-editor');
- var code = document.getElementById('sample-' + name);
- if (editor.setCode)
- editor.setCode(code.textContent);
- else if (editor.textContent)
- editor.textContent = code.textContent;
- else
- editor.innerText = code.innerText;
- }
-
- window.addEventListener('load', function(e) {
- var list = document.getElementById('samples-list');
- document.getElementById('samples-list').addEventListener('change', function(e) {
- show(list.value);
- }, false);
- }, false);
- </script>
-
« no previous file with comments | « src/site/_includes/nav.html ('k') | src/site/_layouts/default.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698