{"action":"created","comment":{"url":"https://api.github.com/repos/publiclab/image-sequencer/pulls/comments/198933705","pull_request_review_id":132956731,"id":198933705,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODkzMzcwNQ==","diff_hunk":"@@ -46,6 +46,13 @@ ImageSequencer = function ImageSequencer(options) {\n   events = require('./ui/UserInterface')(),\n   fs = require('fs');\n \n+\n+  if(options.inBrowser){\n+    for(o in sequencer){\n+        modules[o] = sequencer[o];","path":"src/ImageSequencer.js","position":7,"original_position":7,"commit_id":"8c846ab055c8fc751d60e3c886f0b4f33e479575","original_commit_id":"8c846ab055c8fc751d60e3c886f0b4f33e479575","user":{"login":"tech4GT","id":25617855,"node_id":"MDQ6VXNlcjI1NjE3ODU1","avatar_url":"https://avatars0.githubusercontent.com/u/25617855?v=4","gravatar_id":"","url":"https://api.github.com/users/tech4GT","html_url":"https://github.com/tech4GT","followers_url":"https://api.github.com/users/tech4GT/followers","following_url":"https://api.github.com/users/tech4GT/following{/other_user}","gists_url":"https://api.github.com/users/tech4GT/gists{/gist_id}","starred_url":"https://api.github.com/users/tech4GT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tech4GT/subscriptions","organizations_url":"https://api.github.com/users/tech4GT/orgs","repos_url":"https://api.github.com/users/tech4GT/repos","events_url":"https://api.github.com/users/tech4GT/events{/privacy}","received_events_url":"https://api.github.com/users/tech4GT/received_events","type":"User","site_admin":false},"body":"@jywarren Actually sequencer object is not yet built at this stage hence even if there is a collision that not be a issue. we will consume the property here and later the value of sequencer will be reassigned ","created_at":"2018-06-28T18:03:43Z","updated_at":"2018-06-28T18:03:43Z","html_url":"https://github.com/publiclab/image-sequencer/pull/294#discussion_r198933705","pull_request_url":"https://api.github.com/repos/publiclab/image-sequencer/pulls/294","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/publiclab/image-sequencer/pulls/comments/198933705"},"html":{"href":"https://github.com/publiclab/image-sequencer/pull/294#discussion_r198933705"},"pull_request":{"href":"https://api.github.com/repos/publiclab/image-sequencer/pulls/294"}},"in_reply_to_id":198913857},"pull_request":{"url":"https://api.github.com/repos/publiclab/image-sequencer/pulls/294","id":195928044,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1OTI4MDQ0","html_url":"https://github.com/publiclab/image-sequencer/pull/294","diff_url":"https://github.com/publiclab/image-sequencer/pull/294.diff","patch_url":"https://github.com/publiclab/image-sequencer/pull/294.patch","issue_url":"https://api.github.com/repos/publiclab/image-sequencer/issues/294","number":294,"state":"open","locked":false,"title":"implement importNewModule","user":{"login":"tech4GT","id":25617855,"node_id":"MDQ6VXNlcjI1NjE3ODU1","avatar_url":"https://avatars0.githubusercontent.com/u/25617855?v=4","gravatar_id":"","url":"https://api.github.com/users/tech4GT","html_url":"https://github.com/tech4GT","followers_url":"https://api.github.com/users/tech4GT/followers","following_url":"https://api.github.com/users/tech4GT/following{/other_user}","gists_url":"https://api.github.com/users/tech4GT/gists{/gist_id}","starred_url":"https://api.github.com/users/tech4GT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tech4GT/subscriptions","organizations_url":"https://api.github.com/users/tech4GT/orgs","repos_url":"https://api.github.com/users/tech4GT/repos","events_url":"https://api.github.com/users/tech4GT/events{/privacy}","received_events_url":"https://api.github.com/users/tech4GT/received_events","type":"User","site_admin":false},"body":"@jywarren this implements importNewModule functionality for both node and browser environments, in node it is as simple as `sequencer.importNewModule(name,options)` In browser the module maker must browserify the code before publishing it for frontend use. For example to use invert as a dynamically imported module it will look something like this\r\n```\r\n/*\r\n* Invert the image\r\n*/\r\nfunction Invert(options, UI) {\r\n\r\n  var output;\r\n\r\n  // The function which is called on every draw.\r\n  function draw(input, callback, progressObj) {\r\n\r\n    progressObj.stop(true);\r\n    progressObj.overrideFlag = true;\r\n\r\n    var step = this;\r\n\r\n    function changePixel(r, g, b, a) {\r\n      return [255 - r, 255 - g, 255 - b, a];\r\n    }\r\n\r\n    function output(image, datauri, mimetype) {\r\n\r\n      // This output is accessible by Image Sequencer\r\n      step.output = { src: datauri, format: mimetype };\r\n\r\n    }\r\n\r\n    return require('../_nomodule/PixelManipulation.js')(input, {\r\n      output: output,\r\n      changePixel: changePixel,\r\n      format: input.format,\r\n      image: options.image,\r\n      inBrowser: options.inBrowser,\r\n      callback: callback\r\n    });\r\n\r\n  }\r\n\r\n  return {\r\n    options: options,\r\n    draw: draw,\r\n    output: output,\r\n    UI: UI\r\n  }\r\n}\r\n\r\nif(this.module) {\r\n  module.exports = Invert;\r\n} else {\r\n  sequencer['invert'] = {\r\n    func: Invert,\r\n    info: {\r\n      \"name\": \"Invert\",\r\n      \"description\": \"Inverts the image.\",\r\n      \"inputs\": {\r\n      }\r\n    }\r\n  };\r\n```\r\nSigned-off-by: tech4GT <varun.gupta1798@gmail.com>","created_at":"2018-06-19T19:07:02Z","updated_at":"2018-06-28T18:03:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6838edeb14965325ebcaa06f8ef328aaeb117ec0","assignee":{"login":"tech4GT","id":25617855,"node_id":"MDQ6VXNlcjI1NjE3ODU1","avatar_url":"https://avatars0.githubusercontent.com/u/25617855?v=4","gravatar_id":"","url":"https://api.github.com/users/tech4GT","html_url":"https://github.com/tech4GT","followers_url":"https://api.github.com/users/tech4GT/followers","following_url":"https://api.github.com/users/tech4GT/following{/other_user}","gists_url":"https://api.github.com/users/tech4GT/gists{/gist_id}","starred_url":"https://api.github.com/users/tech4GT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tech4GT/subscriptions","organizations_url":"https://api.github.com/users/tech4GT/orgs","repos_url":"https://api.github.com/users/tech4GT/repos","events_url":"https://api.github.com/users/tech4GT/events{/privacy}","received_events_url":"https://api.github.com/users/tech4GT/received_events","type":"User","site_admin":false},"assignees":[{"login":"tech4GT","id":25617855,"node_id":"MDQ6VXNlcjI1NjE3ODU1","avatar_url":"https://avatars0.githubusercontent.com/u/25617855?v=4","gravatar_id":"","url":"https://api.github.com/users/tech4GT","html_url":"https://github.com/tech4GT","followers_url":"https://api.github.com/users/tech4GT/followers","following_url":"https://api.github.com/users/tech4GT/following{/other_user}","gists_url":"https://api.github.com/users/tech4GT/gists{/gist_id}","starred_url":"https://api.github.com/users/tech4GT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tech4GT/subscriptions","organizations_url":"https://api.github.com/users/tech4GT/orgs","repos_url":"https://api.github.com/users/tech4GT/repos","events_url":"https://api.github.com/users/tech4GT/events{/privacy}","received_events_url":"https://api.github.com/users/tech4GT/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":951520339,"node_id":"MDU6TGFiZWw5NTE1MjAzMzk=","url":"https://api.github.com/repos/publiclab/image-sequencer/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/publiclab/image-sequencer/pulls/294/commits","review_comments_url":"https://api.github.com/repos/publiclab/image-sequencer/pulls/294/comments","review_comment_url":"https://api.github.com/repos/publiclab/image-sequencer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/publiclab/image-sequencer/issues/294/comments","statuses_url":"https://api.github.com/repos/publiclab/image-sequencer/statuses/8c846ab055c8fc751d60e3c886f0b4f33e479575","head":{"label":"tech4GT:importModule","ref":"importModule","sha":"8c846ab055c8fc751d60e3c886f0b4f33e479575","user":{"login":"tech4GT","id":25617855,"node_id":"MDQ6VXNlcjI1NjE3ODU1","avatar_url":"https://avatars0.githubusercontent.com/u/25617855?v=4","gravatar_id":"","url":"https://api.github.com/users/tech4GT","html_url":"https://github.com/tech4GT","followers_url":"https://api.github.com/users/tech4GT/followers","following_url":"https://api.github.com/users/tech4GT/following{/other_user}","gists_url":"https://api.github.com/users/tech4GT/gists{/gist_id}","starred_url":"https://api.github.com/users/tech4GT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tech4GT/subscriptions","organizations_url":"https://api.github.com/users/tech4GT/orgs","repos_url":"https://api.github.com/users/tech4GT/repos","events_url":"https://api.github.com/users/tech4GT/events{/privacy}","received_events_url":"https://api.github.com/users/tech4GT/received_events","type":"User","site_admin":false},"repo":{"id":117934891,"node_id":"MDEwOlJlcG9zaXRvcnkxMTc5MzQ4OTE=","name":"image-sequencer","full_name":"tech4GT/image-sequencer","owner":{"login":"tech4GT","id":25617855,"node_id":"MDQ6VXNlcjI1NjE3ODU1","avatar_url":"https://avatars0.githubusercontent.com/u/25617855?v=4","gravatar_id":"","url":"https://api.github.com/users/tech4GT","html_url":"https://github.com/tech4GT","followers_url":"https://api.github.com/users/tech4GT/followers","following_url":"https://api.github.com/users/tech4GT/following{/other_user}","gists_url":"https://api.github.com/users/tech4GT/gists{/gist_id}","starred_url":"https://api.github.com/users/tech4GT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tech4GT/subscriptions","organizations_url":"https://api.github.com/users/tech4GT/orgs","repos_url":"https://api.github.com/users/tech4GT/repos","events_url":"https://api.github.com/users/tech4GT/events{/privacy}","received_events_url":"https://api.github.com/users/tech4GT/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tech4GT/image-sequencer","description":"A pure JavaScript sequential image processing system, inspired by storyboards","fork":true,"url":"https://api.github.com/repos/tech4GT/image-sequencer","forks_url":"https://api.github.com/repos/tech4GT/image-sequencer/forks","keys_url":"https://api.github.com/repos/tech4GT/image-sequencer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tech4GT/image-sequencer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tech4GT/image-sequencer/teams","hooks_url":"https://api.github.com/repos/tech4GT/image-sequencer/hooks","issue_events_url":"https://api.github.com/repos/tech4GT/image-sequencer/issues/events{/number}","events_url":"https://api.github.com/repos/tech4GT/image-sequencer/events","assignees_url":"https://api.github.com/repos/tech4GT/image-sequencer/assignees{/user}","branches_url":"https://api.github.com/repos/tech4GT/image-sequencer/branches{/branch}","tags_url":"https://api.github.com/repos/tech4GT/image-sequencer/tags","blobs_url":"https://api.github.com/repos/tech4GT/image-sequencer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tech4GT/image-sequencer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tech4GT/image-sequencer/git/refs{/sha}","trees_url":"https://api.github.com/repos/tech4GT/image-sequencer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tech4GT/image-sequencer/statuses/{sha}","languages_url":"https://api.github.com/repos/tech4GT/image-sequencer/languages","stargazers_url":"https://api.github.com/repos/tech4GT/image-sequencer/stargazers","contributors_url":"https://api.github.com/repos/tech4GT/image-sequencer/contributors","subscribers_url":"https://api.github.com/repos/tech4GT/image-sequencer/subscribers","subscription_url":"https://api.github.com/repos/tech4GT/image-sequencer/subscription","commits_url":"https://api.github.com/repos/tech4GT/image-sequencer/commits{/sha}","git_commits_url":"https://api.github.com/repos/tech4GT/image-sequencer/git/commits{/sha}","comments_url":"https://api.github.com/repos/tech4GT/image-sequencer/comments{/number}","issue_comment_url":"https://api.github.com/repos/tech4GT/image-sequencer/issues/comments{/number}","contents_url":"https://api.github.com/repos/tech4GT/image-sequencer/contents/{+path}","compare_url":"https://api.github.com/repos/tech4GT/image-sequencer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tech4GT/image-sequencer/merges","archive_url":"https://api.github.com/repos/tech4GT/image-sequencer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tech4GT/image-sequencer/downloads","issues_url":"https://api.github.com/repos/tech4GT/image-sequencer/issues{/number}","pulls_url":"https://api.github.com/repos/tech4GT/image-sequencer/pulls{/number}","milestones_url":"https://api.github.com/repos/tech4GT/image-sequencer/milestones{/number}","notifications_url":"https://api.github.com/repos/tech4GT/image-sequencer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tech4GT/image-sequencer/labels{/name}","releases_url":"https://api.github.com/repos/tech4GT/image-sequencer/releases{/id}","deployments_url":"https://api.github.com/repos/tech4GT/image-sequencer/deployments","created_at":"2018-01-18T05:02:41Z","updated_at":"2018-06-21T20:02:22Z","pushed_at":"2018-06-22T07:27:22Z","git_url":"git://github.com/tech4GT/image-sequencer.git","ssh_url":"git@github.com:tech4GT/image-sequencer.git","clone_url":"https://github.com/tech4GT/image-sequencer.git","svn_url":"https://github.com/tech4GT/image-sequencer","homepage":"https://publiclab.github.io/image-sequencer/","size":19550,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"publiclab:master","ref":"master","sha":"510cf3421a9c921dbcdc607a23a1b9bc86c34c9c","user":{"login":"publiclab","id":4621650,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MjE2NTA=","avatar_url":"https://avatars3.githubusercontent.com/u/4621650?v=4","gravatar_id":"","url":"https://api.github.com/users/publiclab","html_url":"https://github.com/publiclab","followers_url":"https://api.github.com/users/publiclab/followers","following_url":"https://api.github.com/users/publiclab/following{/other_user}","gists_url":"https://api.github.com/users/publiclab/gists{/gist_id}","starred_url":"https://api.github.com/users/publiclab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/publiclab/subscriptions","organizations_url":"https://api.github.com/users/publiclab/orgs","repos_url":"https://api.github.com/users/publiclab/repos","events_url":"https://api.github.com/users/publiclab/events{/privacy}","received_events_url":"https://api.github.com/users/publiclab/received_events","type":"Organization","site_admin":false},"repo":{"id":83907262,"node_id":"MDEwOlJlcG9zaXRvcnk4MzkwNzI2Mg==","name":"image-sequencer","full_name":"publiclab/image-sequencer","owner":{"login":"publiclab","id":4621650,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MjE2NTA=","avatar_url":"https://avatars3.githubusercontent.com/u/4621650?v=4","gravatar_id":"","url":"https://api.github.com/users/publiclab","html_url":"https://github.com/publiclab","followers_url":"https://api.github.com/users/publiclab/followers","following_url":"https://api.github.com/users/publiclab/following{/other_user}","gists_url":"https://api.github.com/users/publiclab/gists{/gist_id}","starred_url":"https://api.github.com/users/publiclab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/publiclab/subscriptions","organizations_url":"https://api.github.com/users/publiclab/orgs","repos_url":"https://api.github.com/users/publiclab/repos","events_url":"https://api.github.com/users/publiclab/events{/privacy}","received_events_url":"https://api.github.com/users/publiclab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/publiclab/image-sequencer","description":"A pure JavaScript sequential image processing system, inspired by storyboards","fork":true,"url":"https://api.github.com/repos/publiclab/image-sequencer","forks_url":"https://api.github.com/repos/publiclab/image-sequencer/forks","keys_url":"https://api.github.com/repos/publiclab/image-sequencer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/publiclab/image-sequencer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/publiclab/image-sequencer/teams","hooks_url":"https://api.github.com/repos/publiclab/image-sequencer/hooks","issue_events_url":"https://api.github.com/repos/publiclab/image-sequencer/issues/events{/number}","events_url":"https://api.github.com/repos/publiclab/image-sequencer/events","assignees_url":"https://api.github.com/repos/publiclab/image-sequencer/assignees{/user}","branches_url":"https://api.github.com/repos/publiclab/image-sequencer/branches{/branch}","tags_url":"https://api.github.com/repos/publiclab/image-sequencer/tags","blobs_url":"https://api.github.com/repos/publiclab/image-sequencer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/publiclab/image-sequencer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/publiclab/image-sequencer/git/refs{/sha}","trees_url":"https://api.github.com/repos/publiclab/image-sequencer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/publiclab/image-sequencer/statuses/{sha}","languages_url":"https://api.github.com/repos/publiclab/image-sequencer/languages","stargazers_url":"https://api.github.com/repos/publiclab/image-sequencer/stargazers","contributors_url":"https://api.github.com/repos/publiclab/image-sequencer/contributors","subscribers_url":"https://api.github.com/repos/publiclab/image-sequencer/subscribers","subscription_url":"https://api.github.com/repos/publiclab/image-sequencer/subscription","commits_url":"https://api.github.com/repos/publiclab/image-sequencer/commits{/sha}","git_commits_url":"https://api.github.com/repos/publiclab/image-sequencer/git/commits{/sha}","comments_url":"https://api.github.com/repos/publiclab/image-sequencer/comments{/number}","issue_comment_url":"https://api.github.com/repos/publiclab/image-sequencer/issues/comments{/number}","contents_url":"https://api.github.com/repos/publiclab/image-sequencer/contents/{+path}","compare_url":"https://api.github.com/repos/publiclab/image-sequencer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/publiclab/image-sequencer/merges","archive_url":"https://api.github.com/repos/publiclab/image-sequencer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/publiclab/image-sequencer/downloads","issues_url":"https://api.github.com/repos/publiclab/image-sequencer/issues{/number}","pulls_url":"https://api.github.com/repos/publiclab/image-sequencer/pulls{/number}","milestones_url":"https://api.github.com/repos/publiclab/image-sequencer/milestones{/number}","notifications_url":"https://api.github.com/repos/publiclab/image-sequencer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/publiclab/image-sequencer/labels{/name}","releases_url":"https://api.github.com/repos/publiclab/image-sequencer/releases{/id}","deployments_url":"https://api.github.com/repos/publiclab/image-sequencer/deployments","created_at":"2017-03-04T16:25:32Z","updated_at":"2018-06-21T19:15:12Z","pushed_at":"2018-06-22T07:27:52Z","git_url":"git://github.com/publiclab/image-sequencer.git","ssh_url":"git@github.com:publiclab/image-sequencer.git","clone_url":"https://github.com/publiclab/image-sequencer.git","svn_url":"https://github.com/publiclab/image-sequencer","homepage":"https://publiclab.github.io/image-sequencer/","size":72625,"stargazers_count":18,"watchers_count":18,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":20,"mirror_url":null,"archived":false,"open_issues_count":67,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":20,"open_issues":67,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/publiclab/image-sequencer/pulls/294"},"html":{"href":"https://github.com/publiclab/image-sequencer/pull/294"},"issue":{"href":"https://api.github.com/repos/publiclab/image-sequencer/issues/294"},"comments":{"href":"https://api.github.com/repos/publiclab/image-sequencer/issues/294/comments"},"review_comments":{"href":"https://api.github.com/repos/publiclab/image-sequencer/pulls/294/comments"},"review_comment":{"href":"https://api.github.com/repos/publiclab/image-sequencer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/publiclab/image-sequencer/pulls/294/commits"},"statuses":{"href":"https://api.github.com/repos/publiclab/image-sequencer/statuses/8c846ab055c8fc751d60e3c886f0b4f33e479575"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tech4GT"}}