Skip to content

Commit 7fe06fc

Browse files
committed
Updating Demos
1 parent ac2bb7e commit 7fe06fc

Some content is hidden

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

79 files changed

+18842
-16955
lines changed

demos/common.dart

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import "dart:html";
22

3+
import "package:github/browser.dart";
4+
35
void init(String script, {void onReady()}) {
46
var stopwatch = new Stopwatch();
57

@@ -45,5 +47,16 @@ void init(String script, {void onReady()}) {
4547
});
4648
}
4749

48-
Map<String, String> get queryString =>
49-
Uri.parse(window.location.href).queryParameters;
50+
Map<String, String> queryString = Uri.parse(window.location.href).queryParameters;
51+
52+
GitHub _createGitHub() {
53+
initGitHub();
54+
return new GitHub(
55+
auth:
56+
queryString["token"] != null ?
57+
new Authentication.withToken(queryString["token"]) :
58+
new Authentication.anonymous()
59+
);
60+
}
61+
62+
GitHub github = _createGitHub();

demos/emoji.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import "dart:html";
33
import "package:github/browser.dart";
44
import "common.dart";
55

6-
GitHub github;
76
DivElement $emoji;
87
Map<String, String> emojis;
98

109
void main() {
11-
initGitHub();
1210
init("emoji.dart", onReady: () {
1311
$emoji = querySelector("#emojis");
1412
loadEmojis();
@@ -20,16 +18,6 @@ void main() {
2018
}
2119

2220
void loadEmojis() {
23-
var token = "5fdec2b77527eae85f188b7b2bfeeda170f26883";
24-
25-
var params = queryString;
26-
27-
if (params.containsKey("token")) {
28-
token = params["token"];
29-
}
30-
31-
github = new GitHub(auth: new Authentication.withToken(token));
32-
3321
github.misc.listEmojis().then((info) {
3422
emojis = info;
3523
info.forEach((name, url) {

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