{"action":"created","comment":{"url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/comments/79406794","id":79406794,"diff_hunk":"@@ -0,0 +1,130 @@\n+/**\n+ * This Source Code Form is subject to the terms of the Mozilla Public\n+ * License, v. 2.0. If a copy of the MPL was not distributed with this\n+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n+ */\n+\n+import {client, events, faction, restAPI} from 'camelot-unchained';\n+import * as React from 'react';\n+\n+export interface WelcomeProps {\n+};\n+\n+export interface WelcomeState {\n+  visible: boolean;\n+  message: JSX.Element[];\n+};\n+\n+export interface WelcomeData {\n+  id: string;\n+  message: string;\n+  duration: number;\n+}\n+\n+declare const cuAPI: any;\n+\n+class Welcome extends React.Component<WelcomeProps, WelcomeState> {\n+  public name: string = 'Welcome';\n+\n+  constructor(props: WelcomeProps) {\n+    super(props);\n+\n+    let visibilityDefault: boolean = true;\n+\n+    try {\n+      const delayInMin: number = 24 * 60;\n+      // const delayInMin: number = 1; // 1 min for testing\n+      const savedDelay = localStorage.getItem('cse-welcome-hide-start');\n+      const currentDate: Date = new Date();\n+      const savedDelayDate: Date = new Date(JSON.parse(savedDelay));\n+      savedDelayDate.setTime(savedDelayDate.getTime() + (delayInMin*60*1000));\n+      if (currentDate < savedDelayDate) visibilityDefault = false;\n+    } catch (error) {\n+      console.log(error);\n+    }\n+\n+    //**TODO: set a decent default message. API is sometimes slow to return.\n+    this.state = {\n+      visible: visibilityDefault,\n+      message: null\n+    };\n+  }\n+\n+  onMessage = (data: WelcomeData) => {\n+    if (data.message == '') return;\n+    const welcomeMessage: JSX.Element[] = [];\n+\n+    //**TODO: Remove the following test message workaround (API needs to return full HTML)\n+    // data.message = '<style>' +\n+    //   ' .welcome-box { height: 430px; width: 780px; background-image: url(\"http://i.imgur.com/XLsZQjI.jpg\"); background-repeat: no-repeat; background-origin: content-box; }' +\n+    //   ' .welcome-msg-bg { position: absolute; top: 0px; left: 10px; height: 406px; width: 780px; background: linear-gradient(rgba(60,50,50,0.5), rgba(60,50,50,0.7)); padding: 0.7em; color: white; }' +\n+    //   ' .welcome-msg { position: absolute; top: 2em; left: 2em; height: 77%; width: 94%; background: rgba(255,250,205,0.5); padding: 1em; color: rgba(51,51,0,1); border-radius: 5px; }' +\n+    //   '</style>' +\n+    //   '<div class=\"welcome-box\"><div class=\"welcome-msg-bg\"><div class=\"welcome-msg\">' +\n+    //   '<p>Welcome to the Camelot Unchained Alpha server! Please read this message carefully, as the content is regularly updated.</p>' +\n+    //   '<p><b>NOTE:</b> This is an \"old-school\" Alpha build of the Camelot Unchained client and server. This build is used for testing and demonstration purposes only. This should not be considered a reflection of the final game. Expect stability issues and drastic daily changes/improvements.</p>' +\n+    //   '<p><u>Known Issues:</u><br /> - Animations are not final. They will be improved!<br /> - Movement speeds are not final.<br /> - Abilities are disabled.</p>' +\n+    //   '<p>To view the Alpha Manual: <a href=\"https://forums.camelotunchained.com/topic/10538-alpha-manual-v042-updated-27-july-2015/\" target=\"_new\">CLICK HERE</a><br />' +\n+    //   'To report bugs: <a href=\"https://forums.camelotunchained.com/forum/212-current-bugs-extended-alpha/\" target=\"_new\">CLICK HERE</a><br />' +\n+    //   'To provide feedback/suggestions: <a href=\"https://forums.camelotunchained.com/forum/194-alpha-feedback-suggestions/\" target=\"_new\">CLICK HERE</a></p>' +\n+    //   '<p>Try pressing <b style=\"color: rgba(110,45,23,1); font-size: 125%;\">V</b> to create new abilities and <b style=\"color: rgba(110,45,23,1); font-size: 125%;\">B</b> to open your ability book. Clicking the lock icon (lower-right corner) allows resizing and moving UI widgets. ' +\n+    //   'For some helpful backer-supplied tips, type <b style=\"color: rgba(110,45,23,1); font-size: 125%;\"><u>!tips</u></b> in the chat window.</p>' +\n+    //   '</div></div></div>';\n+\n+    welcomeMessage.push(\n+      <div key='100' dangerouslySetInnerHTML={{__html: data.message}} />","path":"game/hud/src/widgets/Welcome/index.tsx","position":75,"original_position":75,"commit_id":"d659f206b314648e262b272663ae4ba999070d4d","original_commit_id":"454243138a3e8034b036ef9b26daab3f5ab02621","user":{"login":"sysrage","id":166781,"avatar_url":"https://avatars.githubusercontent.com/u/166781?v=3","gravatar_id":"","url":"https://api.github.com/users/sysrage","html_url":"https://github.com/sysrage","followers_url":"https://api.github.com/users/sysrage/followers","following_url":"https://api.github.com/users/sysrage/following{/other_user}","gists_url":"https://api.github.com/users/sysrage/gists{/gist_id}","starred_url":"https://api.github.com/users/sysrage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sysrage/subscriptions","organizations_url":"https://api.github.com/users/sysrage/orgs","repos_url":"https://api.github.com/users/sysrage/repos","events_url":"https://api.github.com/users/sysrage/events{/privacy}","received_events_url":"https://api.github.com/users/sysrage/received_events","type":"User","site_admin":false},"body":"I agree that the data should probably be sanitized before use. However, since CSE will be setting the data which is returned by the API and the widget will mostly be temporary, I don't think we need to worry about it.","created_at":"2016-09-19T14:42:54Z","updated_at":"2016-09-19T14:42:54Z","html_url":"https://github.com/CUModSquad/Camelot-Unchained/pull/58#discussion_r79406794","pull_request_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/comments/79406794"},"html":{"href":"https://github.com/CUModSquad/Camelot-Unchained/pull/58#discussion_r79406794"},"pull_request":{"href":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/58","id":85525559,"html_url":"https://github.com/CUModSquad/Camelot-Unchained/pull/58","diff_url":"https://github.com/CUModSquad/Camelot-Unchained/pull/58.diff","patch_url":"https://github.com/CUModSquad/Camelot-Unchained/pull/58.patch","issue_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/issues/58","number":58,"state":"open","locked":false,"title":"Welcome widget to replace old MOTD.","user":{"login":"sysrage","id":166781,"avatar_url":"https://avatars.githubusercontent.com/u/166781?v=3","gravatar_id":"","url":"https://api.github.com/users/sysrage","html_url":"https://github.com/sysrage","followers_url":"https://api.github.com/users/sysrage/followers","following_url":"https://api.github.com/users/sysrage/following{/other_user}","gists_url":"https://api.github.com/users/sysrage/gists{/gist_id}","starred_url":"https://api.github.com/users/sysrage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sysrage/subscriptions","organizations_url":"https://api.github.com/users/sysrage/orgs","repos_url":"https://api.github.com/users/sysrage/repos","events_url":"https://api.github.com/users/sysrage/events{/privacy}","received_events_url":"https://api.github.com/users/sysrage/received_events","type":"User","site_admin":false},"body":"I don't actually expect this to be accepted yet. However, this is a good way to get additional eyes on my code. Please take a look and let me know of any fixes I need to make.\r\n\r\nIf the HTML in the dummy/demo code is sent by `restAPI.getMessageOfTheDay()`, it'll look like this:\r\n![client_2016-09-16_02-05-04](https://cloud.githubusercontent.com/assets/166781/18577331/e5df98a0-7bb6-11e6-8e39-f62875906be4.jpg)\r\n\r\n\r\nIf the current data from `restAPI.getMessageOfTheDay()` is used, it'll look like this:\r\n![client_2016-09-15_14-58-26](https://cloud.githubusercontent.com/assets/166781/18577373/4035b316-7bb7-11e6-9aaa-f91a66092ee0.jpg)\r\n\r\nNOTE: The older MOTD mod should be removed when this is merged.","created_at":"2016-09-16T06:43:22Z","updated_at":"2016-09-19T14:42:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d153e86459b63102d8b1d26d72a5ec4781e2e9f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/58/commits","review_comments_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/58/comments","review_comment_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/issues/58/comments","statuses_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/statuses/d659f206b314648e262b272663ae4ba999070d4d","head":{"label":"sysrage:welcome-rebase","ref":"welcome-rebase","sha":"d659f206b314648e262b272663ae4ba999070d4d","user":{"login":"sysrage","id":166781,"avatar_url":"https://avatars.githubusercontent.com/u/166781?v=3","gravatar_id":"","url":"https://api.github.com/users/sysrage","html_url":"https://github.com/sysrage","followers_url":"https://api.github.com/users/sysrage/followers","following_url":"https://api.github.com/users/sysrage/following{/other_user}","gists_url":"https://api.github.com/users/sysrage/gists{/gist_id}","starred_url":"https://api.github.com/users/sysrage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sysrage/subscriptions","organizations_url":"https://api.github.com/users/sysrage/orgs","repos_url":"https://api.github.com/users/sysrage/repos","events_url":"https://api.github.com/users/sysrage/events{/privacy}","received_events_url":"https://api.github.com/users/sysrage/received_events","type":"User","site_admin":false},"repo":{"id":62099730,"name":"Camelot-Unchained","full_name":"sysrage/Camelot-Unchained","owner":{"login":"sysrage","id":166781,"avatar_url":"https://avatars.githubusercontent.com/u/166781?v=3","gravatar_id":"","url":"https://api.github.com/users/sysrage","html_url":"https://github.com/sysrage","followers_url":"https://api.github.com/users/sysrage/followers","following_url":"https://api.github.com/users/sysrage/following{/other_user}","gists_url":"https://api.github.com/users/sysrage/gists{/gist_id}","starred_url":"https://api.github.com/users/sysrage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sysrage/subscriptions","organizations_url":"https://api.github.com/users/sysrage/orgs","repos_url":"https://api.github.com/users/sysrage/repos","events_url":"https://api.github.com/users/sysrage/events{/privacy}","received_events_url":"https://api.github.com/users/sysrage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sysrage/Camelot-Unchained","description":"UI repository for Camelot Unchained, a tri-realm RvR MMORPG.","fork":true,"url":"https://api.github.com/repos/sysrage/Camelot-Unchained","forks_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/forks","keys_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/teams","hooks_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/hooks","issue_events_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/issues/events{/number}","events_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/events","assignees_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/assignees{/user}","branches_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/branches{/branch}","tags_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/tags","blobs_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/git/refs{/sha}","trees_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/statuses/{sha}","languages_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/languages","stargazers_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/stargazers","contributors_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/contributors","subscribers_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/subscribers","subscription_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/subscription","commits_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/commits{/sha}","git_commits_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/git/commits{/sha}","comments_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/comments{/number}","issue_comment_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/issues/comments{/number}","contents_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/contents/{+path}","compare_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/merges","archive_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/downloads","issues_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/issues{/number}","pulls_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/pulls{/number}","milestones_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/milestones{/number}","notifications_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/labels{/name}","releases_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/releases{/id}","deployments_url":"https://api.github.com/repos/sysrage/Camelot-Unchained/deployments","created_at":"2016-06-28T01:22:47Z","updated_at":"2016-06-28T01:22:49Z","pushed_at":"2016-09-18T06:09:07Z","git_url":"git://github.com/sysrage/Camelot-Unchained.git","ssh_url":"git@github.com:sysrage/Camelot-Unchained.git","clone_url":"https://github.com/sysrage/Camelot-Unchained.git","svn_url":"https://github.com/sysrage/Camelot-Unchained","homepage":null,"size":117902,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CUModSquad:master","ref":"master","sha":"bf5a511a738c69f3c59b85076fadeff1d95ec134","user":{"login":"CUModSquad","id":13527172,"avatar_url":"https://avatars.githubusercontent.com/u/13527172?v=3","gravatar_id":"","url":"https://api.github.com/users/CUModSquad","html_url":"https://github.com/CUModSquad","followers_url":"https://api.github.com/users/CUModSquad/followers","following_url":"https://api.github.com/users/CUModSquad/following{/other_user}","gists_url":"https://api.github.com/users/CUModSquad/gists{/gist_id}","starred_url":"https://api.github.com/users/CUModSquad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CUModSquad/subscriptions","organizations_url":"https://api.github.com/users/CUModSquad/orgs","repos_url":"https://api.github.com/users/CUModSquad/repos","events_url":"https://api.github.com/users/CUModSquad/events{/privacy}","received_events_url":"https://api.github.com/users/CUModSquad/received_events","type":"Organization","site_admin":false},"repo":{"id":62087037,"name":"Camelot-Unchained","full_name":"CUModSquad/Camelot-Unchained","owner":{"login":"CUModSquad","id":13527172,"avatar_url":"https://avatars.githubusercontent.com/u/13527172?v=3","gravatar_id":"","url":"https://api.github.com/users/CUModSquad","html_url":"https://github.com/CUModSquad","followers_url":"https://api.github.com/users/CUModSquad/followers","following_url":"https://api.github.com/users/CUModSquad/following{/other_user}","gists_url":"https://api.github.com/users/CUModSquad/gists{/gist_id}","starred_url":"https://api.github.com/users/CUModSquad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CUModSquad/subscriptions","organizations_url":"https://api.github.com/users/CUModSquad/orgs","repos_url":"https://api.github.com/users/CUModSquad/repos","events_url":"https://api.github.com/users/CUModSquad/events{/privacy}","received_events_url":"https://api.github.com/users/CUModSquad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CUModSquad/Camelot-Unchained","description":"UI repository for Camelot Unchained, a tri-realm RvR MMORPG.","fork":true,"url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained","forks_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/forks","keys_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/teams","hooks_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/hooks","issue_events_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/issues/events{/number}","events_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/events","assignees_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/assignees{/user}","branches_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/branches{/branch}","tags_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/tags","blobs_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/git/refs{/sha}","trees_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/statuses/{sha}","languages_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/languages","stargazers_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/stargazers","contributors_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/contributors","subscribers_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/subscribers","subscription_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/subscription","commits_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/commits{/sha}","git_commits_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/git/commits{/sha}","comments_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/comments{/number}","issue_comment_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/issues/comments{/number}","contents_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/contents/{+path}","compare_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/merges","archive_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/downloads","issues_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/issues{/number}","pulls_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls{/number}","milestones_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/milestones{/number}","notifications_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/labels{/name}","releases_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/releases{/id}","deployments_url":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/deployments","created_at":"2016-06-27T20:45:58Z","updated_at":"2016-09-07T22:55:51Z","pushed_at":"2016-09-18T06:09:07Z","git_url":"git://github.com/CUModSquad/Camelot-Unchained.git","ssh_url":"git@github.com:CUModSquad/Camelot-Unchained.git","clone_url":"https://github.com/CUModSquad/Camelot-Unchained.git","svn_url":"https://github.com/CUModSquad/Camelot-Unchained","homepage":null,"size":117874,"stargazers_count":3,"watchers_count":3,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":7,"forks":12,"open_issues":7,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/58"},"html":{"href":"https://github.com/CUModSquad/Camelot-Unchained/pull/58"},"issue":{"href":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/issues/58"},"comments":{"href":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/CUModSquad/Camelot-Unchained/statuses/d659f206b314648e262b272663ae4ba999070d4d"}}}}
{"actor":{"display_login":"sysrage"}}