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

Unified Diff: third_party/pkg/js/example/twitter/twitter.dart

Issue 56153005: Remove SendPortSync and ReceivePortSync. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove third_party/pkg/js and dom/Serialization.dart Created 7 years, 1 month 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
Index: third_party/pkg/js/example/twitter/twitter.dart
diff --git a/third_party/pkg/js/example/twitter/twitter.dart b/third_party/pkg/js/example/twitter/twitter.dart
deleted file mode 100644
index 75313534cf8ffd7f4cb07f23d998eed17ceb3f4e..0000000000000000000000000000000000000000
--- a/third_party/pkg/js/example/twitter/twitter.dart
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2012, 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.
-
-// A JS interop sample showing JSONP access to Twitter from Dart.
-
-import 'dart:html';
-import 'package:js/js.dart' as js;
-
-void main() {
- // Create a JavaScript function called display that forwards to the Dart
- // function.
- js.context.display = new js.Callback.once(display);
-
- // Inject a JSONP request to Twitter invoking the JavaScript display
- // function.
- document.body.nodes.add(new ScriptElement()..src =
- "https://search.twitter.com/search.json?q=dartlang&rpp=20&callback=display");
-}
-
-// Convert URLs in the text to links.
-String linkify(String text) {
- List words = text.split(' ');
- var buffer = new StringBuffer();
- for (var word in words) {
- if (!buffer.isEmpty) buffer.write(' ');
- if (word.startsWith('http://') || word.startsWith('https://')) {
- buffer.write('<a href="$word">$word</a>');
- } else {
- buffer.write(word);
- }
- }
- return buffer.toString();
-}
-
-// Display the JSON data on the web page.
-// Note callbacks are automatically executed within a scope.
-void display(var data) {
- // The data and results objects are proxies to JavaScript object.
- var results = data.results;
- int length = results.length;
-
- for (int i = 0; i < length; ++i) {
- var result = results[i];
- String user = result.from_user_name;
- String text = linkify(result.text);
-
- var div = new DivElement()
- ..innerHtml = '<div>From: $user</div><div>$text</div><p>';
- document.body.nodes.add(div);
- }
-}
« no previous file with comments | « third_party/pkg/js/example/google-maps/marker_simple.html ('k') | third_party/pkg/js/example/twitter/twitter.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698