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

Unified Diff: samples/total/client/HtmlUtils.dart

Issue 10635015: Delete proxy and total samples, which have bit-rotted. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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/total/client/HtmlTable.dart ('k') | samples/total/client/IdGenerator.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/total/client/HtmlUtils.dart
===================================================================
--- samples/total/client/HtmlUtils.dart (revision 9011)
+++ samples/total/client/HtmlUtils.dart (working copy)
@@ -1,49 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-class HtmlUtils {
-
- // Strips the 'px' (pixels) suffix from a string CSS value and parses the
- // result as an integer.
- static int fromPx(String px) => Math.parseInt(px.substring(0, px.length - 2));
-
- // Workaround until String.replaceAll is functional
- static String quoteHtml(String s) {
- StringBuffer sb = new StringBuffer();
- int last = 0;
- for (int i = 0; i < s.length; i++) {
- switch (s[i]) {
- case "<":
- sb.add(s.substring(last, i));
- sb.add("&lt;");
- last = i + 1;
- break;
- case ">":
- sb.add(s.substring(last, i));
- sb.add("&gt;");
- last = i + 1;
- break;
- case "&":
- sb.add(s.substring(last, i));
- sb.add("&amp;");
- last = i + 1;
- break;
- case "\"":
- sb.add(s.substring(last, i));
- sb.add("&quot;");
- last = i + 1;
- break;
- }
- }
- sb.add(s.substring(last, s.length));
- return sb.toString();
- }
-
- static void setIntegerProperty(Element element, String property, int value, String units) {
- element.style.setProperty(property, "${value}${units}", "");
- }
-
- // Appends 'px' (pixels) to an integer for use in CSS values.
- static String toPx(int length) => "${length}px";
-}
« no previous file with comments | « samples/total/client/HtmlTable.dart ('k') | samples/total/client/IdGenerator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698