{"action":"created","issue":{"url":"https://api.github.com/repos/m-lab/ndt/issues/46","repository_url":"https://api.github.com/repos/m-lab/ndt","labels_url":"https://api.github.com/repos/m-lab/ndt/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/m-lab/ndt/issues/46/comments","events_url":"https://api.github.com/repos/m-lab/ndt/issues/46/events","html_url":"https://github.com/m-lab/ndt/pull/46","id":140200053,"number":46,"title":"Decouples Websocket code from HTML","user":{"login":"nkinkade","id":1392825,"avatar_url":"https://avatars.githubusercontent.com/u/1392825?v=3","gravatar_id":"","url":"https://api.github.com/users/nkinkade","html_url":"https://github.com/nkinkade","followers_url":"https://api.github.com/users/nkinkade/followers","following_url":"https://api.github.com/users/nkinkade/following{/other_user}","gists_url":"https://api.github.com/users/nkinkade/gists{/gist_id}","starred_url":"https://api.github.com/users/nkinkade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkinkade/subscriptions","organizations_url":"https://api.github.com/users/nkinkade/orgs","repos_url":"https://api.github.com/users/nkinkade/repos","events_url":"https://api.github.com/users/nkinkade/events{/privacy}","received_events_url":"https://api.github.com/users/nkinkade/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-03-11T14:41:10Z","updated_at":"2016-03-11T23:46:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/m-lab/ndt/pulls/46","html_url":"https://github.com/m-lab/ndt/pull/46","diff_url":"https://github.com/m-lab/ndt/pull/46.diff","patch_url":"https://github.com/m-lab/ndt/pull/46.patch"},"body":"Decouples Websocket code from HTML so external sites can use Websocket code with their own HTML frontend (to some extent). The basic idea behind these changes, notwithstanding some style changes like consistently using single quotes, is that the core Websocket scripts can be used by other front-end implementations other than fakewww. The principal motivation for doing this is so that the M-Lab website can use the official NDT Websocket code located in the NDT project repository, while still maintaining control over the user interface so that it fits better stylistically, and also so that it can be embedded using HTTPS.\r\n\r\nI have compiled this and tested that it works as expected. There should be no changes at all to how the Websocket test currently functions or looks when this is running via fakewww.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/m-lab/ndt/46)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/m-lab/ndt/issues/comments/195605333","html_url":"https://github.com/m-lab/ndt/pull/46#issuecomment-195605333","issue_url":"https://api.github.com/repos/m-lab/ndt/issues/46","id":195605333,"user":{"login":"nkinkade","id":1392825,"avatar_url":"https://avatars.githubusercontent.com/u/1392825?v=3","gravatar_id":"","url":"https://api.github.com/users/nkinkade","html_url":"https://github.com/nkinkade","followers_url":"https://api.github.com/users/nkinkade/followers","following_url":"https://api.github.com/users/nkinkade/following{/other_user}","gists_url":"https://api.github.com/users/nkinkade/gists{/gist_id}","starred_url":"https://api.github.com/users/nkinkade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkinkade/subscriptions","organizations_url":"https://api.github.com/users/nkinkade/orgs","repos_url":"https://api.github.com/users/nkinkade/repos","events_url":"https://api.github.com/users/nkinkade/events{/privacy}","received_events_url":"https://api.github.com/users/nkinkade/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T23:46:30Z","updated_at":"2016-03-11T23:46:30Z","body":"\n\n\n\nReview status: 5 of 9 files reviewed at latest revision, 4 unresolved discussions.\n\n---\n\n*[HTML5-frontend/script.js, line 35 \\[r4\\]](https://reviewable.io:443/reviews/m-lab/ndt/46#-KCbi_o_mR_hwbufeERA:-KCbv9dILzVMFlDTcdrB:-941888294) ([raw file](https://github.com/m-lab/ndt/blob/ce331f96b333d23374c96ddfa270d4de4627cabc/HTML5-frontend/script.js#L35)):*\nI've removed the global variable and now the protocol variable gets passed explicitly to everything as a parameter.\n\n---\n\n*[HTML5-frontend/script.js, line 669 \\[r4\\]](https://reviewable.io:443/reviews/m-lab/ndt/46#-KCbhI6LIqATqrIHqySm:-KCbsnvcyawohDhK4mKJ:-1946923628) ([raw file](https://github.com/m-lab/ndt/blob/ce331f96b333d23374c96ddfa270d4de4627cabc/HTML5-frontend/script.js#L669)):*\nWhat is an example of any (valid) string that could be passed which would fail? The only valid strings to be passed in _scriptName_ are bare file names, as the comment describes.  If someone passes an invalid string or non-existent file, then the check is going to fail anyway. It seems to me that this is one of those cases where we'd just be adding additional lines of code and processing for what amounts to a non-issue.  That a dot matches itself is not invalid, whether the user expects that or not.\n\n---\n\n\n*Comments from the [review on Reviewable.io](https://reviewable.io:443/reviews/m-lab/ndt/46)*\n<!-- Sent from Reviewable.io -->\n"}}