Index: dart/site/try/src/compilation.dart |
diff --git a/dart/site/try/src/compilation.dart b/dart/site/try/src/compilation.dart |
index d2cdbc6becb4e5382b7dfd6e2248d59d347f17af..b21ca6119adf3d7c40099f4ad12d509c17679aa6 100644 |
--- a/dart/site/try/src/compilation.dart |
+++ b/dart/site/try/src/compilation.dart |
@@ -5,6 +5,7 @@ |
library trydart.compilation; |
import 'dart:html' show |
+ AnchorElement, |
Blob, |
Element, |
ErrorEvent, |
@@ -12,6 +13,7 @@ import 'dart:html' show |
MessageEvent, |
Url, |
Worker, |
+ document, |
window; |
import 'dart:async' show |
@@ -66,6 +68,11 @@ String get currentSource => window.localStorage['currentSource']; |
void set currentSource(String text) { |
window.localStorage['currentSource'] = text; |
+ AnchorElement a = document.querySelector('#share-link'); |
+ if (a != null) { |
+ String sourceQuery = '?source=${Uri.encodeQueryComponent(text)}'; |
+ a.href = '${Uri.base.resolve(sourceQuery)}'; |
+ } |
} |
bool startCompilation() { |