{"action":"created","comment":{"url":"https://api.github.com/repos/georchestra/georchestra/pulls/comments/57962463","id":57962463,"diff_hunk":"@@ -0,0 +1,149 @@\n+Ext.namespace(\"GEOR.Addons\");\n+\n+GEOR.Addons.Notes = Ext.extend(GEOR.Addons.Base, {\n+\n+    toggleGroup: \"notes\",\n+\n+    /**\n+     * Method: init\n+     */\n+    init: function(record) {\n+        if (this.target) {\n+            // addon placed in toolbar\n+            this.components = this.target.insertButton(this.position, {\n+                xtype: \"button\",\n+                enableToggle: true,\n+                toggleGroup: this.toggleGroup,\n+                tooltip: this.getTooltip(record),\n+                icon: GEOR.config.PATHNAME + \"/ws/addons/\" +\n+                    record.get(\"name\").toLowerCase() + \"/\" +\n+                    this.options.icon,\n+                listeners: {\n+                    \"toggle\": this.onToggle,\n+                    scope: this\n+                },\n+                scope: this\n+            });\n+            this.target.doLayout();\n+        } else {\n+            // addon places in \"tools menus\"\n+            this.item = new Ext.menu.CheckItem({\n+                xtype: \"button\",\n+                text: this.getText(record),\n+                qtip: this.getQtip(record),\n+                icon: GEOR.config.PATHNAME + \"/ws/addons/\" +\n+                    record.get(\"name\").toLowerCase() + \"/\" +\n+                    this.options.icon,\n+                checked: false,\n+                toggleGroup: this.toggleGroup,\n+                listeners: {\n+                    \"checkchange\": this.onToggle,\n+                    scope: this\n+                }\n+            });\n+        }\n+    },\n+    /**\n+     * Method: onToggle\n+     *\n+     */\n+    onToggle: function(btn, pressed) {\n+        if (pressed) {\n+            this.map.events.register(\"click\", this, this.addNote);\n+        } else {\n+            this.map.events.unregister(\"click\", this, this.addNote);\n+        }\n+    },\n+    /**\n+     * Method: addNote\n+     *\n+     */\n+    addNote: function(evt) {\n+        var lonlat = this.map.getLonLatFromViewPortPx(evt.xy);\n+        lonlat.transform(this.map.projection,\n+            new OpenLayers.Projection(\"EPSG:4326\"));\n+        this.window = new Ext.Window({\n+            title: this.tr(\"notes_title\"),\n+            width: 420,\n+            closable: true,\n+            closeAction: \"hide\",\n+            resizable: false,\n+            border: false,\n+            items: [{\n+                xtype: \"form\",\n+                width: 410,\n+                items: [\n+                    {\n+                        xtype: \"textfield\",\n+                        fieldLabel: this.tr(\"notes_email\"),\n+                        width: 240,\n+                        name: \"email\",\n+                        allowBlank: false,\n+                        value: GEOR.config.USEREMAIL || \"\"\n+                    }, {\n+                        xtype: \"textarea\",\n+                        width: 240,\n+                        height: 120,\n+                        fieldLabel: this.tr(\"notes_comment\"),\n+                        name: \"comment\",\n+                        allowBlank: false\n+                    }, {\n+                        xtype: \"hidden\",\n+                        name: \"latitude\",\n+                        value: lonlat.lat\n+                    }, {\n+                        xtype: \"hidden\",\n+                        name: \"longitude\",\n+                        value: lonlat.lon\n+                    }, {\n+                        xtype: \"hidden\",\n+                        name: \"map_context\",\n+                        value: GEOR.wmc.write()\n+                    }\n+                ],\n+                buttons: [{\n+                    text: this.tr(\"notes_submit\"),\n+                    handler: function(b) {\n+                        if (b.findParentByType(\"form\").getForm().isValid()) {\n+                            b.findParentByType(\"form\").getForm().submit({\n+                                url: GEOR.config.PATHNAME +\n+                                    \"/ws/note/backend/\" + this.options.backend,\n+                                method: \"POST\",\n+                                success: function() {\n+                                    b.findParentByType(\"window\").close();\n+                                },\n+                                failure: function(form, action) {","path":"mapfishapp/src/main/webapp/app/addons/notes/js/main.js","position":115,"original_position":115,"commit_id":"b40927003109f2509fe6f4106f708a2dd4eef0b7","original_commit_id":"b40927003109f2509fe6f4106f708a2dd4eef0b7","user":{"login":"fvanderbiest","id":265319,"avatar_url":"https://avatars.githubusercontent.com/u/265319?v=3","gravatar_id":"","url":"https://api.github.com/users/fvanderbiest","html_url":"https://github.com/fvanderbiest","followers_url":"https://api.github.com/users/fvanderbiest/followers","following_url":"https://api.github.com/users/fvanderbiest/following{/other_user}","gists_url":"https://api.github.com/users/fvanderbiest/gists{/gist_id}","starred_url":"https://api.github.com/users/fvanderbiest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fvanderbiest/subscriptions","organizations_url":"https://api.github.com/users/fvanderbiest/orgs","repos_url":"https://api.github.com/users/fvanderbiest/repos","events_url":"https://api.github.com/users/fvanderbiest/events{/privacy}","received_events_url":"https://api.github.com/users/fvanderbiest/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Expected method shorthand.](https://www.codacy.com/app/georchestra/georchestra/file/2328557335/issues/source?bid=3200181&fileBranchId=3206983#l115)","created_at":"2016-03-30T20:58:24Z","updated_at":"2016-03-30T20:58:24Z","html_url":"https://github.com/georchestra/georchestra/pull/1341#discussion_r57962463","pull_request_url":"https://api.github.com/repos/georchestra/georchestra/pulls/1341","_links":{"self":{"href":"https://api.github.com/repos/georchestra/georchestra/pulls/comments/57962463"},"html":{"href":"https://github.com/georchestra/georchestra/pull/1341#discussion_r57962463"},"pull_request":{"href":"https://api.github.com/repos/georchestra/georchestra/pulls/1341"}}},"pull_request":{"url":"https://api.github.com/repos/georchestra/georchestra/pulls/1341","id":64679858,"html_url":"https://github.com/georchestra/georchestra/pull/1341","diff_url":"https://github.com/georchestra/georchestra/pull/1341.diff","patch_url":"https://github.com/georchestra/georchestra/pull/1341.patch","issue_url":"https://api.github.com/repos/georchestra/georchestra/issues/1341","number":1341,"state":"open","locked":false,"title":"Notes - Share notes about map issues (client side)","user":{"login":"jdenisgiguere","id":973241,"avatar_url":"https://avatars.githubusercontent.com/u/973241?v=3","gravatar_id":"","url":"https://api.github.com/users/jdenisgiguere","html_url":"https://github.com/jdenisgiguere","followers_url":"https://api.github.com/users/jdenisgiguere/followers","following_url":"https://api.github.com/users/jdenisgiguere/following{/other_user}","gists_url":"https://api.github.com/users/jdenisgiguere/gists{/gist_id}","starred_url":"https://api.github.com/users/jdenisgiguere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdenisgiguere/subscriptions","organizations_url":"https://api.github.com/users/jdenisgiguere/orgs","repos_url":"https://api.github.com/users/jdenisgiguere/repos","events_url":"https://api.github.com/users/jdenisgiguere/events{/privacy}","received_events_url":"https://api.github.com/users/jdenisgiguere/received_events","type":"User","site_admin":false},"body":"The notes add-on add a button to report map issues. After selecting the tool, clicking on map sets the location of the issue. A form asks for email and comment. Location, email, comment, map context is sent to the server side of the add-on.  See https://github.com/georchestra/notes for server installation instructions.\r\n\r\n![notes_screenshot](https://cloud.githubusercontent.com/assets/973241/14154025/6f2e5402-f688-11e5-99dc-1e2f8dec3249.png)\r\n\r\n","created_at":"2016-03-30T19:05:53Z","updated_at":"2016-03-30T20:58:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2be128da250fd6181b327025d76470e2efdd0b04","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/georchestra/georchestra/pulls/1341/commits","review_comments_url":"https://api.github.com/repos/georchestra/georchestra/pulls/1341/comments","review_comment_url":"https://api.github.com/repos/georchestra/georchestra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/georchestra/georchestra/issues/1341/comments","statuses_url":"https://api.github.com/repos/georchestra/georchestra/statuses/b40927003109f2509fe6f4106f708a2dd4eef0b7","head":{"label":"jdenisgiguere:notes_ui","ref":"notes_ui","sha":"b40927003109f2509fe6f4106f708a2dd4eef0b7","user":{"login":"jdenisgiguere","id":973241,"avatar_url":"https://avatars.githubusercontent.com/u/973241?v=3","gravatar_id":"","url":"https://api.github.com/users/jdenisgiguere","html_url":"https://github.com/jdenisgiguere","followers_url":"https://api.github.com/users/jdenisgiguere/followers","following_url":"https://api.github.com/users/jdenisgiguere/following{/other_user}","gists_url":"https://api.github.com/users/jdenisgiguere/gists{/gist_id}","starred_url":"https://api.github.com/users/jdenisgiguere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdenisgiguere/subscriptions","organizations_url":"https://api.github.com/users/jdenisgiguere/orgs","repos_url":"https://api.github.com/users/jdenisgiguere/repos","events_url":"https://api.github.com/users/jdenisgiguere/events{/privacy}","received_events_url":"https://api.github.com/users/jdenisgiguere/received_events","type":"User","site_admin":false},"repo":{"id":53415839,"name":"georchestra","full_name":"jdenisgiguere/georchestra","owner":{"login":"jdenisgiguere","id":973241,"avatar_url":"https://avatars.githubusercontent.com/u/973241?v=3","gravatar_id":"","url":"https://api.github.com/users/jdenisgiguere","html_url":"https://github.com/jdenisgiguere","followers_url":"https://api.github.com/users/jdenisgiguere/followers","following_url":"https://api.github.com/users/jdenisgiguere/following{/other_user}","gists_url":"https://api.github.com/users/jdenisgiguere/gists{/gist_id}","starred_url":"https://api.github.com/users/jdenisgiguere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdenisgiguere/subscriptions","organizations_url":"https://api.github.com/users/jdenisgiguere/orgs","repos_url":"https://api.github.com/users/jdenisgiguere/repos","events_url":"https://api.github.com/users/jdenisgiguere/events{/privacy}","received_events_url":"https://api.github.com/users/jdenisgiguere/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdenisgiguere/georchestra","description":"This is the main geOrchestra Spatial Data Infrastructure repository, which hosts the source code.","fork":true,"url":"https://api.github.com/repos/jdenisgiguere/georchestra","forks_url":"https://api.github.com/repos/jdenisgiguere/georchestra/forks","keys_url":"https://api.github.com/repos/jdenisgiguere/georchestra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdenisgiguere/georchestra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdenisgiguere/georchestra/teams","hooks_url":"https://api.github.com/repos/jdenisgiguere/georchestra/hooks","issue_events_url":"https://api.github.com/repos/jdenisgiguere/georchestra/issues/events{/number}","events_url":"https://api.github.com/repos/jdenisgiguere/georchestra/events","assignees_url":"https://api.github.com/repos/jdenisgiguere/georchestra/assignees{/user}","branches_url":"https://api.github.com/repos/jdenisgiguere/georchestra/branches{/branch}","tags_url":"https://api.github.com/repos/jdenisgiguere/georchestra/tags","blobs_url":"https://api.github.com/repos/jdenisgiguere/georchestra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdenisgiguere/georchestra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdenisgiguere/georchestra/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdenisgiguere/georchestra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdenisgiguere/georchestra/statuses/{sha}","languages_url":"https://api.github.com/repos/jdenisgiguere/georchestra/languages","stargazers_url":"https://api.github.com/repos/jdenisgiguere/georchestra/stargazers","contributors_url":"https://api.github.com/repos/jdenisgiguere/georchestra/contributors","subscribers_url":"https://api.github.com/repos/jdenisgiguere/georchestra/subscribers","subscription_url":"https://api.github.com/repos/jdenisgiguere/georchestra/subscription","commits_url":"https://api.github.com/repos/jdenisgiguere/georchestra/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdenisgiguere/georchestra/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdenisgiguere/georchestra/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdenisgiguere/georchestra/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdenisgiguere/georchestra/contents/{+path}","compare_url":"https://api.github.com/repos/jdenisgiguere/georchestra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdenisgiguere/georchestra/merges","archive_url":"https://api.github.com/repos/jdenisgiguere/georchestra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdenisgiguere/georchestra/downloads","issues_url":"https://api.github.com/repos/jdenisgiguere/georchestra/issues{/number}","pulls_url":"https://api.github.com/repos/jdenisgiguere/georchestra/pulls{/number}","milestones_url":"https://api.github.com/repos/jdenisgiguere/georchestra/milestones{/number}","notifications_url":"https://api.github.com/repos/jdenisgiguere/georchestra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdenisgiguere/georchestra/labels{/name}","releases_url":"https://api.github.com/repos/jdenisgiguere/georchestra/releases{/id}","deployments_url":"https://api.github.com/repos/jdenisgiguere/georchestra/deployments","created_at":"2016-03-08T13:50:13Z","updated_at":"2016-03-08T13:50:21Z","pushed_at":"2016-03-30T20:09:13Z","git_url":"git://github.com/jdenisgiguere/georchestra.git","ssh_url":"git@github.com:jdenisgiguere/georchestra.git","clone_url":"https://github.com/jdenisgiguere/georchestra.git","svn_url":"https://github.com/jdenisgiguere/georchestra","homepage":"http://www.georchestra.org/","size":234466,"stargazers_count":0,"watchers_count":0,"language":"Game Maker Language","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":"15.12"}},"base":{"label":"georchestra:15.12","ref":"15.12","sha":"5885a2bd8b15b03115127a3ebbd8033eb4404dc3","user":{"login":"georchestra","id":773831,"avatar_url":"https://avatars.githubusercontent.com/u/773831?v=3","gravatar_id":"","url":"https://api.github.com/users/georchestra","html_url":"https://github.com/georchestra","followers_url":"https://api.github.com/users/georchestra/followers","following_url":"https://api.github.com/users/georchestra/following{/other_user}","gists_url":"https://api.github.com/users/georchestra/gists{/gist_id}","starred_url":"https://api.github.com/users/georchestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georchestra/subscriptions","organizations_url":"https://api.github.com/users/georchestra/orgs","repos_url":"https://api.github.com/users/georchestra/repos","events_url":"https://api.github.com/users/georchestra/events{/privacy}","received_events_url":"https://api.github.com/users/georchestra/received_events","type":"Organization","site_admin":false},"repo":{"id":6066709,"name":"georchestra","full_name":"georchestra/georchestra","owner":{"login":"georchestra","id":773831,"avatar_url":"https://avatars.githubusercontent.com/u/773831?v=3","gravatar_id":"","url":"https://api.github.com/users/georchestra","html_url":"https://github.com/georchestra","followers_url":"https://api.github.com/users/georchestra/followers","following_url":"https://api.github.com/users/georchestra/following{/other_user}","gists_url":"https://api.github.com/users/georchestra/gists{/gist_id}","starred_url":"https://api.github.com/users/georchestra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georchestra/subscriptions","organizations_url":"https://api.github.com/users/georchestra/orgs","repos_url":"https://api.github.com/users/georchestra/repos","events_url":"https://api.github.com/users/georchestra/events{/privacy}","received_events_url":"https://api.github.com/users/georchestra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/georchestra/georchestra","description":"This is the main geOrchestra Spatial Data Infrastructure repository, which hosts the source code.","fork":false,"url":"https://api.github.com/repos/georchestra/georchestra","forks_url":"https://api.github.com/repos/georchestra/georchestra/forks","keys_url":"https://api.github.com/repos/georchestra/georchestra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/georchestra/georchestra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/georchestra/georchestra/teams","hooks_url":"https://api.github.com/repos/georchestra/georchestra/hooks","issue_events_url":"https://api.github.com/repos/georchestra/georchestra/issues/events{/number}","events_url":"https://api.github.com/repos/georchestra/georchestra/events","assignees_url":"https://api.github.com/repos/georchestra/georchestra/assignees{/user}","branches_url":"https://api.github.com/repos/georchestra/georchestra/branches{/branch}","tags_url":"https://api.github.com/repos/georchestra/georchestra/tags","blobs_url":"https://api.github.com/repos/georchestra/georchestra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/georchestra/georchestra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/georchestra/georchestra/git/refs{/sha}","trees_url":"https://api.github.com/repos/georchestra/georchestra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/georchestra/georchestra/statuses/{sha}","languages_url":"https://api.github.com/repos/georchestra/georchestra/languages","stargazers_url":"https://api.github.com/repos/georchestra/georchestra/stargazers","contributors_url":"https://api.github.com/repos/georchestra/georchestra/contributors","subscribers_url":"https://api.github.com/repos/georchestra/georchestra/subscribers","subscription_url":"https://api.github.com/repos/georchestra/georchestra/subscription","commits_url":"https://api.github.com/repos/georchestra/georchestra/commits{/sha}","git_commits_url":"https://api.github.com/repos/georchestra/georchestra/git/commits{/sha}","comments_url":"https://api.github.com/repos/georchestra/georchestra/comments{/number}","issue_comment_url":"https://api.github.com/repos/georchestra/georchestra/issues/comments{/number}","contents_url":"https://api.github.com/repos/georchestra/georchestra/contents/{+path}","compare_url":"https://api.github.com/repos/georchestra/georchestra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/georchestra/georchestra/merges","archive_url":"https://api.github.com/repos/georchestra/georchestra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/georchestra/georchestra/downloads","issues_url":"https://api.github.com/repos/georchestra/georchestra/issues{/number}","pulls_url":"https://api.github.com/repos/georchestra/georchestra/pulls{/number}","milestones_url":"https://api.github.com/repos/georchestra/georchestra/milestones{/number}","notifications_url":"https://api.github.com/repos/georchestra/georchestra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/georchestra/georchestra/labels{/name}","releases_url":"https://api.github.com/repos/georchestra/georchestra/releases{/id}","deployments_url":"https://api.github.com/repos/georchestra/georchestra/deployments","created_at":"2012-10-03T20:55:45Z","updated_at":"2016-03-16T15:16:24Z","pushed_at":"2016-03-30T20:53:44Z","git_url":"git://github.com/georchestra/georchestra.git","ssh_url":"git@github.com:georchestra/georchestra.git","clone_url":"https://github.com/georchestra/georchestra.git","svn_url":"https://github.com/georchestra/georchestra","homepage":"http://www.georchestra.org/","size":246402,"stargazers_count":28,"watchers_count":28,"language":"Game Maker Language","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":305,"forks":50,"open_issues":305,"watchers":28,"default_branch":"15.12"}},"_links":{"self":{"href":"https://api.github.com/repos/georchestra/georchestra/pulls/1341"},"html":{"href":"https://github.com/georchestra/georchestra/pull/1341"},"issue":{"href":"https://api.github.com/repos/georchestra/georchestra/issues/1341"},"comments":{"href":"https://api.github.com/repos/georchestra/georchestra/issues/1341/comments"},"review_comments":{"href":"https://api.github.com/repos/georchestra/georchestra/pulls/1341/comments"},"review_comment":{"href":"https://api.github.com/repos/georchestra/georchestra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/georchestra/georchestra/pulls/1341/commits"},"statuses":{"href":"https://api.github.com/repos/georchestra/georchestra/statuses/b40927003109f2509fe6f4106f708a2dd4eef0b7"}}}}