| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 var warning = [ |
| 6 'WARNING: This page is using a deprecated dart.js file. ', |
| 7 'Please update this page as described here: ', |
| 8 'http://news.dartlang.org/2013/01/big-breaking-change-dartjs-bootstrap-file-mo
ving-to-pub.html' |
| 9 ].join(''); |
| 10 console.error(warning); |
| 11 |
| 5 // Bootstrap support for Dart scripts on the page as this script. | 12 // Bootstrap support for Dart scripts on the page as this script. |
| 6 if (navigator.webkitStartDart) { | 13 if (navigator.webkitStartDart) { |
| 7 if (!navigator.webkitStartDart()) { | 14 if (!navigator.webkitStartDart()) { |
| 8 document.body.innerHTML = 'This build has expired. Please download a new Da
rtium at http://www.dartlang.org/dartium/index.html'; | 15 document.body.innerHTML = 'This build has expired. Please download a new Da
rtium at http://www.dartlang.org/dartium/index.html'; |
| 9 } | 16 } |
| 10 } else { | 17 } else { |
| 11 // TODO: | 18 // TODO: |
| 12 // - Support in-browser compilation. | 19 // - Support in-browser compilation. |
| 13 // - Handle inline Dart scripts. | 20 // - Handle inline Dart scripts. |
| 14 window.addEventListener("DOMContentLoaded", function (e) { | 21 window.addEventListener("DOMContentLoaded", function (e) { |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 var result = null; | 260 var result = null; |
| 254 var listener = function (e) { | 261 var listener = function (e) { |
| 255 result = JSON.parse(getPortSyncEventData(e)); | 262 result = JSON.parse(getPortSyncEventData(e)); |
| 256 }; | 263 }; |
| 257 window.addEventListener(source, listener, false); | 264 window.addEventListener(source, listener, false); |
| 258 dispatchEvent(target, [source, serialized]); | 265 dispatchEvent(target, [source, serialized]); |
| 259 window.removeEventListener(source, listener, false); | 266 window.removeEventListener(source, listener, false); |
| 260 return deserialize(result); | 267 return deserialize(result); |
| 261 } | 268 } |
| 262 })(); | 269 })(); |
| OLD | NEW |