Skip to content

Commit 28dca35

Browse files
committed
Updating Demos
1 parent 95c9879 commit 28dca35

File tree

144 files changed

+44333
-26035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+44333
-26035
lines changed

demos/common.dart

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,23 @@ void init(String script, {void onReady()}) {
1515

1616
document.querySelector("#view-source").onClick.listen((_) {
1717
var popup = window.open("view_source.html", "View Source");
18+
String code;
1819

1920
var fetched = false;
2021
var ready = false;
2122

22-
String code;
23+
void sendCode() {
24+
popup.postMessage({
25+
"command": "code",
26+
"code": code
27+
}, window.location.href);
28+
}
2329

2430
window.addEventListener("message", (event) {
2531
if (event.data['command'] == "ready") {
2632
ready = true;
2733
if (fetched) {
28-
popup.postMessage({
29-
"command": "code",
30-
"code": code
31-
}, window.location.href);
34+
sendCode();
3235
}
3336
}
3437
});
@@ -37,20 +40,10 @@ void init(String script, {void onReady()}) {
3740
code = c;
3841
fetched = true;
3942
if (ready) {
40-
popup.postMessage({
41-
"command": "code",
42-
"code": code
43-
}, window.location.href);
43+
sendCode();
4444
}
4545
});
4646
});
4747
}
4848

49-
Map<String, String> get queryString {
50-
var url = window.location.href;
51-
if (url.contains("?")) {
52-
return Uri.splitQueryString(url.substring(url.indexOf('?') + 1));
53-
} else {
54-
return {};
55-
}
56-
}
49+
Map<String, String> get queryString => Uri.parse(window.location.href).queryParameters;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy