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

Unified Diff: samples/dartboard/dartboard.html

Issue 10204007: Remove many things that depend on frog. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | « samples/dartboard/dartboard.dart ('k') | samples/pond/build_pond.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/dartboard/dartboard.html
===================================================================
--- samples/dartboard/dartboard.html (revision 6866)
+++ samples/dartboard/dartboard.html (working copy)
@@ -1,169 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Dartboard</title>
- <script src="codemirror/lib/codemirror.js"></script>
- <link rel="stylesheet" href="codemirror/lib/codemirror.css">
-
- <script src="codemirror/mode/css/css.js"></script>
- <script src="codemirror/mode/dart/dart.js"></script>
- <script src="codemirror/mode/htmlmixed/htmlmixed.js"></script>
- <script src="codemirror/mode/javascript/javascript.js"></script>
- <script src="codemirror/mode/xml/xml.js"></script>
-
- <script type="text/javascript" src="dartboard.dart.js"></script>
-
- <style type="text/css">
- .CodeMirror {
- border: 1px solid black; margin: 2px
- }
- body,
- html {
- margin:0;
- padding:0;
- }
-
- #wrap {
- width: 100%;
- margin:0 auto;
- }
-
- #dartEditor {
- float:left;
- width:50%;
- }
- #htmlEditor {
- float:left;
- width:50%;
- }
- #jsEditor {
- float:left;
- width:50%;
- height:300px;
- }
- #result {
- float:left;
- width:48%;
- height:300px;
- border: 3px solid blue;
- }
- #warningEditor {
- float:left;
- width:50%;
- }
- #resultFrame {
- width:100%;
- }
-
- .compile_error {
- background: red;
- }
- .compile_warning {
- background: orange;
- }
-
- </style>
- <script>
- if (document.readyState == "loaded") {
- jsReady();
- } else {
- window.addEventListener("load", function(e) { jsReady(); }, false);
- }
- function jsReady() {
- var dartEditor = CodeMirror(document.getElementById("dartEditor"), {
- mode: "dart",
- matchBrackets: true,
- tabSize: 2,
- lineNumbers: true,
- gutter: false
- });
- var htmlEditor = CodeMirror(document.getElementById("htmlEditor"), {
- mode: "htmlmixed",
- tabSize: 2,
- lineNumbers: true,
- gutter: true
- });
- var jsEditor = CodeMirror(document.getElementById("jsEditor"), {
- mode: "javascript",
- tabSize: 2,
- lineNumbers: true,
- gutter: true
- });
- var warningEditor = CodeMirror(document.getElementById("warningEditor"), {
- tabSize: 2,
- lineNumbers: true,
- gutter: true
- });
-
- document.getElementById("testButton").addEventListener("click", function() {
- }, false);
-
- function toDataURL(text) {
- var preamble = "data:text/html;charset=utf-8,";
- var escaped = encodeURIComponent(text);
- return preamble + escaped;
- }
-
- function getSourceText(id) {
- var s = document.getElementById(id).text;
- s = s.replace(/^\s+|\s+$/g,"");
- return s + "\n";
- }
- window.getEditorText = function(id) {
- if (id == "dartEditor") {
- return dartEditor.getValue();
- }
- }
- window.markText = function(startLine, startCol, endLine, endCol, className) {
- return dartEditor.markText({line:startLine, ch:startCol}, {line:endLine, ch:endCol}, className);
- }
-
- window.setEditorText = function(id, text) {
- var editor
- if (id == "jsEditor") {
- editor = jsEditor;
- } else if (id == "dartEditor") {
- editor = dartEditor;
- } else if (id == "htmlEditor") {
- editor = htmlEditor;
- } else if (id == "warningEditor") {
- editor = warningEditor;
- } else {
- throw "can't find editor for id " + id;
- }
- editor.setValue(text);
- if (editor === jsEditor) {
- var html = htmlEditor.getValue();
- var start = html.indexOf("{{DART}}");
- html = html.substr(0, start) + text + html.substr(start + "{{DART}}".length);
- html = html.replace("application/dart", "text/javascript");
- document.getElementById("resultFrame").setAttribute("src", toDataURL(html));
- } else if (id == "htmlEditor") {
- htmlEditor.setValue(text);
- }
- }
- dartboardMain();
- dartEditor.focus();
- }
- </script>
-
- </head>
- <body>
- <div id="wrap">
- <div>
- <span>Dartboard</span>
- <input type="button" value="run" id="runButton">
- <input type="button" value="clear output" id="clearButton">
- <input type="button" value="test" id="testButton" style="display:none;">
- <input type="checkbox" id="warningCheckbox">
- <label>treat warnings as errors</label>
- </div>
- <div id="dartEditor"></div>
- <div id="htmlEditor"></div>
- <div id="jsEditor"></div>
- <div id="result"><iframe id="resultFrame" ></iframe></div>
- <div id="warningEditor"></div>
- </div>
- <iframe src="dartlib.html" id="dartlibFrame" style="display:none;"></iframe>
- </body>
-</html>
« no previous file with comments | « samples/dartboard/dartboard.dart ('k') | samples/pond/build_pond.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698