@zzish/sdk-js 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/3rdparty.html ADDED
@@ -0,0 +1,87 @@
1
+ <!doctype html>
2
+
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>Zzish Quick Javascript Client SDK</title>
8
+
9
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
10
+ <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
11
+
12
+ <script src="zzish.js"></script>
13
+ <script>
14
+ var init = false;
15
+ var loggedIn = false;
16
+ var token;
17
+ var href;
18
+
19
+ function initApp() {
20
+ if (init) return true;
21
+ if ($("#appId").val()!="") {
22
+ var initParams = $("#appId").val();
23
+ Zzish.init(initParams);
24
+ init = true;
25
+ console.log("App Initalized with id",$("#appId").val());
26
+ return true;
27
+ }
28
+ else {
29
+ alert ("Please enter your API KEY from http://www.zzish.co.uk/developer/")
30
+ return false;
31
+ }
32
+ }
33
+
34
+ function registerWithZzish() {
35
+ var uuid = $("#uuid").val();
36
+ var email = $("#email").val();
37
+ var name = $("#name").val();
38
+
39
+ if (initApp()) {
40
+ Zzish.registerUserWithZzish(uuid, email, name, function(err, message) {
41
+ console.log("Result from register", err, message);
42
+ });
43
+ }
44
+ }
45
+
46
+ function loadUser() {
47
+ if (initApp()) {
48
+ var uuid = $("#uuid").val();
49
+ var redirect = $("#redirect").val();
50
+ Zzish.getTokenForUser(uuid, function(err, url) {
51
+ if (err == 400) {
52
+ alert("Either the user doesn't exist or the user has not authorized this email")
53
+ }
54
+ else {
55
+ href = url;
56
+ console.log("Result from register", err, url);
57
+ $("#dashboard").attr("href",url + "/" + redirect);
58
+ }
59
+ });
60
+ }
61
+ }
62
+
63
+ function updateTarget() {
64
+ $("#dashboard").attr("href",href + "/" + $("#redirect").val());
65
+ }
66
+ </script>
67
+ </head>
68
+
69
+ <body>
70
+ <input type="text" id="appId" name="appId" placeholder="Your API Key" value="" size="40"/><br/>
71
+ <h1>Login</h1>
72
+ <div id="loginButtons">
73
+ <input type="text" id="uuid" name="uuid" placeholder="UUID (Required)"/><br/>
74
+ <input type="text" id="email" name="email" placeholder="Email (Required)"/><br/>
75
+ <input type="text" id="name" name="name" placeholder="Name (Optional)"/><br/><br/>
76
+ <input type="button" onclick="registerWithZzish()" value="RegisterWithZzish"/><br/><br/>
77
+ <input type="button" onclick="loadUser()" value="LoadUser"/><br/><br/>
78
+ <select id="redirect" onchange="updateTarget()">
79
+ <option value="">Nothing defaults to home</option>
80
+ <option value="home">Home</option>
81
+ <option value="dashboard">Teacher Dashboard</option>
82
+ </select>
83
+ <a id="dashboard" target=_blank>Open Dashboard</a>
84
+ <br/><br/>
85
+ </div>
86
+ </body>
87
+ </html>
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ Zzish JS Sample
2
+ ======================
3
+
4
+ A simple Example app to allow you to test out the different calls that the Zzish SDK provides.
5
+
6
+ Try it out via GitHub pages: [Zzish Demo Javascript App](http://zzish.github.io/zzishsdk-js)
7
+
8
+ You will need to generate an applicaiton id by siging up at the [Zzish Developer](http://developer.zzish.com) website.
9
+
10
+ You will also need to create a class on the [Zzish Learning Hub](http://live.zzish.com) website. After entering the class code (when creating an activity), you will be able to view realtime data on the live dashboard.
11
+
12
+ Feedback of all shapes and sizes welcome via issues or (email)[mailto:developers@zzish.com].
13
+
14
+ Thanks for your interest
15
+
16
+ -*Zzish*
package/content.html ADDED
@@ -0,0 +1,162 @@
1
+ <!doctype html>
2
+
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>Zzish Quick Javascript Client SDK</title>
8
+
9
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
10
+ <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
11
+
12
+ <script src="zzish.js"></script>
13
+ <script>
14
+ var userId;
15
+ var init = false;
16
+
17
+ function initApp() {
18
+ if (!init) {
19
+ if ($("#appId").val()!="") {
20
+ Zzish.init({
21
+ api: $("#appId").val(),
22
+ protocol: "http://",
23
+ baseUrl: "localhost:8080/zzishapi/api/",
24
+ webUrl: "http://localhost:3000/",
25
+ header: "X-ApplicationId",
26
+ headerprefix: "",
27
+ logEnabled: true
28
+ });
29
+ //Zzish.init($("#appId").val());
30
+ init = true;
31
+ console.log("App Initalized with id",$("#appId").val());
32
+ }
33
+ else {
34
+ alert ("Please enter your API KEY from http://www.zzish.co.uk/developer/")
35
+ }
36
+ }
37
+ return init;
38
+ }
39
+
40
+ function createUser() {
41
+ if (initApp()) {
42
+ Zzish.getUser($("#userId").val(),$("#name").val(),function(err,message) {
43
+ userId = message.uuid;
44
+ console.log("User created with status" + message.uuid);
45
+ });
46
+
47
+ }
48
+ }
49
+
50
+ function postContent() {
51
+ if (initApp()) {
52
+ //postContent = function(profileId,id,name,content,callback)
53
+ var JSON_val = JSON.parse($("#cjson").val());
54
+ var content = {
55
+ uuid: $("#cid").val(),
56
+ name: $("#cname").val(),
57
+ payload: JSON_val
58
+ };
59
+ Zzish.postContent(userId,content,function(err,message) {
60
+ console.log("Content created with status" + err);
61
+ });
62
+ }
63
+ }
64
+
65
+ function getContent() {
66
+ if (initApp()) {
67
+ Zzish.getContent(userId,$("#gcid").val(),function(err,message) {
68
+ $("#getContentOutput").html(JSON.stringify(message));
69
+ });
70
+ }
71
+ }
72
+
73
+ function listContent() {
74
+ if (initApp()) {
75
+ Zzish.listContent(userId,function(err,message) {
76
+ $("#listContentOutput").html(JSON.stringify(message));
77
+ });
78
+ }
79
+ }
80
+
81
+ function deleteContent() {
82
+ if (initApp()) {
83
+ Zzish.deleteContent(userId,$("#dcid").val(),function(err,message) {
84
+ console.log("")
85
+ });
86
+ }
87
+ }
88
+
89
+ function publishContent() {
90
+ if (initApp()) {
91
+ Zzish.publishContentToGroup(userId,$("#pemail").val(),$("#pid").val(),$("#pcode").val(),function(err,message) {
92
+ $("#publishContentOutput").html(JSON.stringify(message));
93
+ });
94
+ }
95
+ else {
96
+ alert ("Please init with your APP_ID from http://www.zzish.co.uk/developer/")
97
+ }
98
+ }
99
+
100
+ function unpublishContent() {
101
+ if (initApp()) {
102
+ Zzish.unpublishContent(userId,$("#pid").val(),$("#pcode").val(),function(err,message) {
103
+ $("#publishContentOutput").html(JSON.stringify(message));
104
+ });
105
+ }
106
+ else {
107
+ alert ("Please init with your APP_ID from http://www.zzish.co.uk/developer/")
108
+ }
109
+ }
110
+
111
+ function republishContent() {
112
+ if (initApp()) {
113
+ Zzish.republishContent(userId,$("#pid").val(),$("#pcode").val(),function(err,message) {
114
+ $("#publishContentOutput").html(JSON.stringify(message));
115
+ });
116
+ }
117
+ else {
118
+ alert ("Please init with your APP_ID from http://www.zzish.co.uk/developer/")
119
+ }
120
+ }
121
+ </script>
122
+ </head>
123
+
124
+ <body>
125
+ <input type="text" id="appId" name="appId" placeholder="Your API Key" value="" size="40"/><br/>
126
+ <h1>Create user</h1>
127
+ <input type="text" id="userId" name="userId" placeholder="userId" value=""/><br/>
128
+ <input type="text" id="name" name="name" placeholder="Name" value=""/><br/>
129
+ <input type="button" onclick="createUser()" value="Create User"/><br/>
130
+ <br/>
131
+ <h1>Create Content</h1>
132
+ <input type="text" id="cid" name="cid" placeholder="Content Id" value=""/><br/>
133
+ <input type="text" id="cname" name="cname" placeholder="Content Name" value=""/><br/>
134
+ <textarea id="cjson" name="cjson" placeholder="Content JSON" rows="10" cols="40"></textarea><br/>
135
+ <input type="button" onclick="postContent()" value="Create Content"/><br/>
136
+ <h1>Get Content</h1>
137
+ <input type="text" id="gcid" name="gcid" placeholder="Content Id" value=""/><br/>
138
+ <input type="button" onclick="getContent()" value="Get Content"/><br/>
139
+ <h2>Output</h2>
140
+ <div id="getContentOutput"></div>
141
+ <br/>
142
+ <h1>List Content</h1>
143
+ <input type="button" onclick="listContent()" value="Get Content"/><br/>
144
+ <h2>Output</h2>
145
+ <div id="listContentOutput"></div>
146
+ <br/>
147
+ <h1>Publish Content</h1>
148
+ <input type="text" id="pid" name="pid" placeholder="Content Id" value=""/><br/>
149
+ <input type="text" id="pemail" name="pemail" placeholder="Email Address of Creator" value=""/><br/>
150
+ <input type="text" id="pcode" name="pcode" placeholder="Group Code" value=""/><br/>
151
+ <input type="button" onclick="publishContent()" value="Publish Content"/><br/>
152
+ <input type="button" onclick="unpublishContent()" value="Unpublish Content"/><br/>
153
+ <input type="button" onclick="republishContent()" value="Republish Content"/><br/>
154
+ <h2>Output</h2>
155
+ <div id="publishContentOutput"></div>
156
+ <h1>Delete Content</h1>
157
+ <input type="text" id="dcid" name="dcid" placeholder="Content Id" value=""/><br/>
158
+ <input type="button" onclick="deleteContent()" value="Delete Content"/><br/>
159
+ <input type="button" onclick="publishContent()" value="Publish Content"/><br/>
160
+
161
+ </body>
162
+ </html>
Binary file
Binary file
Binary file
Binary file
package/index.html ADDED
@@ -0,0 +1,265 @@
1
+ <!doctype html>
2
+
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>Zzish Quick Javascript Client SDK</title>
8
+
9
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
10
+ <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
11
+
12
+ <style>
13
+ .help {
14
+ display: none;
15
+ }
16
+ </style>
17
+
18
+ <script src="zzish.js"></script>
19
+ <script>
20
+ var activityId;
21
+ var init = false;
22
+ //set to true to use a stateless version of the SDK
23
+ var stateless = false;
24
+ var deviceId = "DEVICE_ID";
25
+ var sessionId = "SESSION_ID";
26
+ var showHelp = false;
27
+
28
+ function toggleHelp() {
29
+ showHelp = !showHelp;
30
+ if (showHelp) {
31
+ $(".help").show();
32
+ $("#helpButton").val("Hide Help");
33
+ }
34
+ else {
35
+ $("#helpButton").val("Show Help");
36
+ $(".help").hide();
37
+ }
38
+ }
39
+
40
+ function initApp() {
41
+ if (!init) {
42
+ if ($("#appId").val()!="") {
43
+ var initParams = $("#appId").val();
44
+ Zzish.init(initParams);
45
+ init = true;
46
+ console.log("App Initalized with id",$("#appId").val());
47
+ }
48
+ else {
49
+ alert ("Please enter your API KEY from https://developer.zzish.com")
50
+ }
51
+ }
52
+ return init;
53
+ }
54
+
55
+
56
+ function getUser() {
57
+ if (initApp()) {
58
+ var command = Zzish;
59
+ if (stateless) {
60
+ command = Zzish.initState(deviceId,sessionId);
61
+ }
62
+ command.getUser($("#userId").val(),$("#name").val(),function(err,message) {
63
+ if (!err) {
64
+ console.log("User " + message.uuid + "created");
65
+ }
66
+ else {
67
+ console.log("Error starting" + err)
68
+ }
69
+ });
70
+ }
71
+ }
72
+
73
+ function startActivity() {
74
+ if (initApp()) {
75
+ var validRequest = true;
76
+ if ($("#groupCode").val()!="") {
77
+ if (Zzish.validateClassCode($("#groupCode").val())) {
78
+ validRequest = true;
79
+ }
80
+ else {
81
+ validRequest = false;
82
+ }
83
+ }
84
+ else {
85
+ validRequest = true;
86
+ }
87
+ if (validRequest) {
88
+ var parameters = {
89
+ activityDefinition: {
90
+ type: $("#aname").val()
91
+ },
92
+ extensions: {
93
+ groupCode: $("#groupCode").val()
94
+ }
95
+ };
96
+ if ($("#stored").val().length > 0) {
97
+ parameters.stored = $("#stored").val();
98
+ }
99
+ Zzish.startActivityWithObjects($("#userId").val(),parameters,function(err,message) {
100
+ if (!err) {
101
+ activityId = message.id;
102
+ console.log("Activity " + message.id + "started");
103
+ }
104
+ else {
105
+ console.log("Error starting" + err)
106
+ }
107
+ });
108
+ }
109
+ else {
110
+ console.log("Invalid Request");
111
+ }
112
+ }
113
+
114
+ }
115
+
116
+ function logAction() {
117
+ if (initApp()) {
118
+ var definition = {
119
+ type: $("#actname").val()
120
+ };
121
+ var result = {};
122
+ result["uuid"] = $("#actuuid").val();
123
+ result["response"] = $("#response").val();
124
+ result["score"] = parseFloat($("#Score").val());
125
+ result["correct"] = $("#correct").val();
126
+ result["duration"] = parseInt($("#Duration").val());
127
+ result["attempts"] = parseInt($("#Attempts").val());
128
+ Zzish.logActionWithObjects(activityId,{definition:definition, result: result},function(err,message) {
129
+ if (!err) {
130
+ console.log("logAction " + message.uuid + "started");
131
+ }
132
+ else {
133
+ console.log("Error starting" + err)
134
+ }
135
+ });
136
+ }
137
+ }
138
+
139
+ function logActions() {
140
+ if (initApp()) {
141
+ var definition = {
142
+ type: $("#actname").val()
143
+ };
144
+ var actions = [];
145
+ var result = {};
146
+ result["uuid"] = $("#actuuid").val();
147
+ result["response"] = $("#response").val();
148
+ result["score"] = parseFloat($("#Score").val());
149
+ result["correct"] = $("#correct").val();
150
+ result["duration"] = parseInt($("#Duration").val());
151
+ result["attempts"] = parseInt($("#Attempts").val());
152
+ actions.push({definition:definition, result: result});
153
+
154
+ var result2 = {};
155
+ result2["uuid"] = $("#actuuid").val();
156
+ result2["response"] = $("#response").val();
157
+ result2["score"] = parseFloat($("#Score").val() * 2);
158
+ result2["correct"] = $("#correct").val();
159
+ result2["duration"] = parseInt($("#Duration").val() / 2);
160
+ result2["attempts"] = parseInt($("#Attempts").val());
161
+ actions.push({definition:definition, result: result2});
162
+
163
+ Zzish.logActions(activityId, actions[0], actions,function(err,message) {
164
+ if (!err) {
165
+ console.log("logAction " + message.uuid + "started");
166
+ }
167
+ else {
168
+ console.log("Error starting" + err)
169
+ }
170
+ });
171
+ }
172
+ }
173
+
174
+ function stopActivity() {
175
+ if (initApp()) {
176
+ Zzish.stopActivity(activityId,$("#aattributes").val(),function(err,message) {
177
+ if (!err) {
178
+ console.log("Activity " + message.uuid + "started");
179
+ }
180
+ else {
181
+ console.log("Error starting" + err)
182
+ }
183
+ });
184
+ }
185
+ }
186
+
187
+ function cancelActivity() {
188
+ if (initApp()) {
189
+ Zzish.cancelActivity(activityId,function(err,message) {
190
+ if (!err) {
191
+ console.log("Activity " + message.uuid + "cancelled");
192
+ }
193
+ else {
194
+ console.log("Error starting" + err)
195
+ }
196
+ });
197
+ }
198
+ }
199
+
200
+ function stopZzish() {
201
+ if (initApp()) {
202
+ Zzish.stop(function(err,message) {
203
+ if (!err) {
204
+ console.log("Zzish stopped");
205
+ }
206
+ else {
207
+ console.log("Error starting" + err)
208
+ }
209
+ });
210
+ }
211
+ }
212
+ </script>
213
+ </head>
214
+
215
+ <body>
216
+ <input type="button" onclick="toggleHelp()" value="Need Help? Click Here" id="helpButton"/><br/>
217
+ <input type="text" id="appId" name="appId" placeholder="Your API Key" value="" size="40"/><br/>
218
+ <span class="help">This is the API Key you get when you create an app on the Zzish Developer Console (http://www.zzish.com/developer)</span>
219
+ <h1>Create user</h1>
220
+ <input type="text" id="userId" name="userId" placeholder="userId" value=""/><br/>
221
+ <span class="help">This is your User ID that must be unique. It's scoped to your app and helps uniquely identify a user within your app.<br/></span>
222
+ <input type="text" id="name" name="name" placeholder="Name" value=""/><br/>
223
+ <input type="button" onclick="getUser()" value="Create User" id="createUserButton"/><br/>
224
+ <span class="help">This is a simple name that will be shown on the teacher dashboard.</span>
225
+ <br/>
226
+ <h1>Start Activity</h1>
227
+ <input type="text" id="groupCode" name="groupCode" placeholder="Class code" value=""/><br/>
228
+ <span class="help">This is the class code you get when you create a class in the learning hub (http://www.zzish.com/learning-hub) It uniquely identifies the class. <br/></span>
229
+ <input type="text" id="stored" name="stored" placeholder="Activity Start Time" value=""/><br/>
230
+ <span class="help">This is a long format of when the activity was started<br/></span>
231
+ <input type="text" id="aname" name="aname" placeholder="Activity Name" value=""/><br/>
232
+ <span class="help">This is the name of the activity. (e.g. "Level 1", "Multiple Choice Quiz", "French")<br/></span>
233
+ <input type="button" onclick="startActivity()" value="Start Activity" id="startActivityButton"/><br/>
234
+ <h1>Create Action</h1>
235
+ <input type="text" id="actuuid" name="actuuid" placeholder="Action UUID" value=""/><br/>
236
+ <span class="help">This is the unique code to identify a question. (e.g. "Q1" or "What is 3*3)". This must be unique across your app.<br/></span>
237
+ <input type="text" id="actname" name="actname" placeholder="Action Name" value=""/><br/>
238
+ <span class="help">This is the unique code to identify a question. (e.g. "Q1" or "What is 3*3)". This must be unique across your app.<br/></span>
239
+ <input type="text" id="response" name="response" placeholder="Response" value=""/><br/>
240
+ <span class="help">This is the response given by the user (e.g. "8")<br/></span>
241
+ <input type="text" id="Score" name="actname" placeholder="Score" value=""/><br/>
242
+ <span class="help">This is the score you have given to the user for answering the question (optional)<br/></span>
243
+ <input type="text" id="Duration" name="actname" placeholder="Duration" value=""/><br/>
244
+ <span class="help">This is the time it took the user to answer the question in milliseconds (optional)<br/></span>
245
+ <input type="text" id="Attempts" name="actname" placeholder="Attempts" value=""/><br/>
246
+ <span class="help">This is the time the number of attempts it took for the user to get the correct answer (optional)<br/></span>
247
+ <input type="text" id="correct" name="actname" placeholder="correct" value=""/><br/>
248
+ <span class="help">This is the whether they got it right "true" or wrong "false" (optional)<br/></span>
249
+ <input type="text" id="attributes" name="attributes" placeholder="Action State (JSON)" value=""/><br/>
250
+ <span class="help">You can store state against this user and action which persists (and overrides previous values). For example, you may want to store the proficiency of the user understanding this action or how many times they have seen this action. (e.g. {proficiency: 5, tries: 4}) (optional)<br/></span>
251
+ <input type="button" onclick="logAction()" value="Log Action" id="logActionButton"/><br/>
252
+ <br/>
253
+ <h1>Complete Activity</h1>
254
+ <input type="text" id="aattributes" name="aattributes" placeholder="Activity State (JSON)" value=""/><br/>
255
+ <span class="help">You can store state against this user and activity which persists (and overrides previous values). For example, you may want to store the proficiency of the user understanding this activity or how many times they have seen this activity. (e.g. {proficiency: 5, tries: 4}) (optional)<br/></span>
256
+ <input type="button" onclick="stopActivity()" value="Complete Activity" id="completeActivityButton"/><br/>
257
+ <h1>Cancel Activity</h1>
258
+ <input type="button" onclick="cancelActivity()" value="Cancel Activity" id="cancelActivityButton"/><br/>
259
+
260
+ <h1>Stop Zzish</h1>
261
+ <input type="button" onclick="stopZzish()" value="Stop" id="stopZzishButton"/><br/>
262
+
263
+
264
+ </body>
265
+ </html>
@@ -0,0 +1 @@
1
+ console.log('This would be the main JS file.');
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@zzish/sdk-js",
3
+ "version": "0.5.3",
4
+ "description": "SDK for Zzish API",
5
+ "main": "zzish.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/zzishdev/zzishsdk-js.git"
12
+ },
13
+ "keywords": [
14
+ "zzish",
15
+ "api",
16
+ "sdk"
17
+ ],
18
+ "author": "Zzish Developers <developers@zzish.com> (http://www.zzish.com)",
19
+ "license": "MIT",
20
+ "bugs": {
21
+ "url": "https://github.com/zzish/zzishsdk-js/issues"
22
+ },
23
+ "homepage": "https://github.com/zzish/zzishsdk-js"
24
+ }
package/params.json ADDED
@@ -0,0 +1 @@
1
+ {"name":"Zzishsdk-js","tagline":"Zzish SDK for Zzish REST API","body":"### Welcome to GitHub Pages.\r\nThis automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new branch:\r\n\r\n```\r\n$ cd your_repo_root/repo_name\r\n$ git fetch origin\r\n$ git checkout gh-pages\r\n```\r\n\r\nIf you're using the GitHub for Mac, simply sync your repository and you'll see the new branch.\r\n\r\n### Designer Templates\r\nWe've crafted some handsome templates for you to use. Go ahead and continue to layouts to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved if it remained markdown format.\r\n\r\n### Rather Drive Stick?\r\nIf you prefer to not use the automatic generator, push a branch named `gh-pages` to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.\r\n\r\n### Authors and Contributors\r\nYou can @mention a GitHub username to generate a link to their profile. The resulting `<a>` element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.\r\n\r\n### Support or Contact\r\nHaving trouble with Pages? Check out the documentation at https://help.github.com/pages or contact support@github.com and we’ll help you sort it out.\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
package/redirect.html ADDED
@@ -0,0 +1,48 @@
1
+ <!doctype html>
2
+
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>Zzish Login Success</title>
7
+ <script src="zzish.js"></script>
8
+ <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
9
+
10
+ <script>
11
+ var token = null;
12
+
13
+ function loadDetails() {
14
+ console.log("Loading zzish");
15
+ Zzish.getCurrentUser(null,function (err,data) {
16
+ if (!err) {
17
+ token = data.token;
18
+ $("#profileIdSpan").html(data.id);
19
+ $("#profileNameSpan").html(data.name);
20
+ }
21
+ else {
22
+ alert("Error",err);
23
+ }
24
+ })
25
+ }
26
+
27
+ function logout() {
28
+ Zzish.logout(token,function(err,message) {
29
+ console.log("Logged out with status and message",err,message);
30
+ if (!err) {
31
+ window.location.href = "user.html";
32
+ }
33
+ });
34
+ }
35
+ </script>
36
+ <script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
37
+ </head>
38
+ <h1>User has been successfully logged in. Click button below to load id and name</h1>
39
+ Profile Id: <span id="profileIdSpan">...</span><br/>
40
+ Profile Name: <span id="profileNameSpan">...</span><br/>
41
+
42
+ <input type="button" onclick="loadDetails()" value="Load Details from Login"/><br/>
43
+
44
+ <input type="button" onclick="logout()" value="Logout"/><br/>
45
+
46
+ <body>
47
+ </body>
48
+ </html>