{"action":"created","comment":{"url":"https://api.github.com/repos/syncthing/syncthing/pulls/comments/56571066","id":56571066,"diff_hunk":"@@ -0,0 +1,38 @@\n+angular.module('syncthing.core')\n+    .directive('pathIsSubDir', function () {\n+        return {\n+            require: 'ngModel',\n+            priority: 1000,\n+            link: function (scope, elm, attrs, ctrl) {\n+                ctrl.$parsers.unshift(function (viewValue) {\n+                    // This function checks whether xdir is a subdirectory of ydir,\n+                    // e.g. it would return true if xdir = \"/home/a\", ydir = \"/home/a/b\".\n+                    function isSubDir(xdir, ydir) {\n+                        var xdirArr = xdir.split(\"/\");\n+                        var ydirArr = ydir.split(\"/\");\n+                        if (xdirArr.slice(-1).pop() === \"\") {\n+                            xdirArr = xdirArr.slice(0, -1);\n+                        }\n+                        if (xdirArr.length > ydirArr.length) {\n+                            return false;\n+                        }\n+                        return xdirArr.map(function(e, i) {\n+                            return xdirArr[i] === ydirArr[i];\n+                        }).every(e => e == true);","path":"gui/default/syncthing/core/pathIsSubDirDirective.js","position":21,"original_position":21,"commit_id":"2288cd431ba8078e1b056648c509e5c17e6868b9","original_commit_id":"2288cd431ba8078e1b056648c509e5c17e6868b9","user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"body":"This is not Javascript according to my browser.","created_at":"2016-03-17T20:21:46Z","updated_at":"2016-03-17T20:21:46Z","html_url":"https://github.com/syncthing/syncthing/pull/2825#discussion_r56571066","pull_request_url":"https://api.github.com/repos/syncthing/syncthing/pulls/2825","_links":{"self":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/comments/56571066"},"html":{"href":"https://github.com/syncthing/syncthing/pull/2825#discussion_r56571066"},"pull_request":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2825"}}},"pull_request":{"url":"https://api.github.com/repos/syncthing/syncthing/pulls/2825","id":62163980,"html_url":"https://github.com/syncthing/syncthing/pull/2825","diff_url":"https://github.com/syncthing/syncthing/pull/2825.diff","patch_url":"https://github.com/syncthing/syncthing/pull/2825.patch","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/2825","number":2825,"state":"open","locked":false,"title":"Confirmation box for when adding multiple folders on the same path (#1960)","user":{"login":"kc1212","id":1093806,"avatar_url":"https://avatars.githubusercontent.com/u/1093806?v=3","gravatar_id":"","url":"https://api.github.com/users/kc1212","html_url":"https://github.com/kc1212","followers_url":"https://api.github.com/users/kc1212/followers","following_url":"https://api.github.com/users/kc1212/following{/other_user}","gists_url":"https://api.github.com/users/kc1212/gists{/gist_id}","starred_url":"https://api.github.com/users/kc1212/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kc1212/subscriptions","organizations_url":"https://api.github.com/users/kc1212/orgs","repos_url":"https://api.github.com/users/kc1212/repos","events_url":"https://api.github.com/users/kc1212/events{/privacy}","received_events_url":"https://api.github.com/users/kc1212/received_events","type":"User","site_admin":false},"body":"### Purpose\r\n\r\nI'm horrendous at JS but this PR should fix #1960. It's not perfect yet but does the job, so I'm putting it up for some feedback before I work on it further. I understand that the strings should go into the the assets folder, but I haven't figured out how those assets are used yet, will look into it the next time I find a chance.\r\n\r\n### Testing\r\n\r\nI did a lot of bench testing, it looked fine. Not sure whether Syncthing has automated tests for GUI functions.\r\n\r\n### Screenshots\r\n\r\n![screenshot from 2016-03-09 01-50-41](https://cloud.githubusercontent.com/assets/1093806/13621764/3b77f022-e59a-11e5-9ff6-5179f134a2be.png)\r\n","created_at":"2016-03-09T01:00:06Z","updated_at":"2016-03-17T20:21:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d452d5463cbe07ac825dbebc024d24a4e8aa1f38","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/syncthing/syncthing/pulls/2825/commits","review_comments_url":"https://api.github.com/repos/syncthing/syncthing/pulls/2825/comments","review_comment_url":"https://api.github.com/repos/syncthing/syncthing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/2825/comments","statuses_url":"https://api.github.com/repos/syncthing/syncthing/statuses/2288cd431ba8078e1b056648c509e5c17e6868b9","head":{"label":"kc1212:master","ref":"master","sha":"2288cd431ba8078e1b056648c509e5c17e6868b9","user":{"login":"kc1212","id":1093806,"avatar_url":"https://avatars.githubusercontent.com/u/1093806?v=3","gravatar_id":"","url":"https://api.github.com/users/kc1212","html_url":"https://github.com/kc1212","followers_url":"https://api.github.com/users/kc1212/followers","following_url":"https://api.github.com/users/kc1212/following{/other_user}","gists_url":"https://api.github.com/users/kc1212/gists{/gist_id}","starred_url":"https://api.github.com/users/kc1212/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kc1212/subscriptions","organizations_url":"https://api.github.com/users/kc1212/orgs","repos_url":"https://api.github.com/users/kc1212/repos","events_url":"https://api.github.com/users/kc1212/events{/privacy}","received_events_url":"https://api.github.com/users/kc1212/received_events","type":"User","site_admin":false},"repo":{"id":53343108,"name":"syncthing","full_name":"kc1212/syncthing","owner":{"login":"kc1212","id":1093806,"avatar_url":"https://avatars.githubusercontent.com/u/1093806?v=3","gravatar_id":"","url":"https://api.github.com/users/kc1212","html_url":"https://github.com/kc1212","followers_url":"https://api.github.com/users/kc1212/followers","following_url":"https://api.github.com/users/kc1212/following{/other_user}","gists_url":"https://api.github.com/users/kc1212/gists{/gist_id}","starred_url":"https://api.github.com/users/kc1212/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kc1212/subscriptions","organizations_url":"https://api.github.com/users/kc1212/orgs","repos_url":"https://api.github.com/users/kc1212/repos","events_url":"https://api.github.com/users/kc1212/events{/privacy}","received_events_url":"https://api.github.com/users/kc1212/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kc1212/syncthing","description":"Open Source Continuous File Synchronization","fork":true,"url":"https://api.github.com/repos/kc1212/syncthing","forks_url":"https://api.github.com/repos/kc1212/syncthing/forks","keys_url":"https://api.github.com/repos/kc1212/syncthing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kc1212/syncthing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kc1212/syncthing/teams","hooks_url":"https://api.github.com/repos/kc1212/syncthing/hooks","issue_events_url":"https://api.github.com/repos/kc1212/syncthing/issues/events{/number}","events_url":"https://api.github.com/repos/kc1212/syncthing/events","assignees_url":"https://api.github.com/repos/kc1212/syncthing/assignees{/user}","branches_url":"https://api.github.com/repos/kc1212/syncthing/branches{/branch}","tags_url":"https://api.github.com/repos/kc1212/syncthing/tags","blobs_url":"https://api.github.com/repos/kc1212/syncthing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kc1212/syncthing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kc1212/syncthing/git/refs{/sha}","trees_url":"https://api.github.com/repos/kc1212/syncthing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kc1212/syncthing/statuses/{sha}","languages_url":"https://api.github.com/repos/kc1212/syncthing/languages","stargazers_url":"https://api.github.com/repos/kc1212/syncthing/stargazers","contributors_url":"https://api.github.com/repos/kc1212/syncthing/contributors","subscribers_url":"https://api.github.com/repos/kc1212/syncthing/subscribers","subscription_url":"https://api.github.com/repos/kc1212/syncthing/subscription","commits_url":"https://api.github.com/repos/kc1212/syncthing/commits{/sha}","git_commits_url":"https://api.github.com/repos/kc1212/syncthing/git/commits{/sha}","comments_url":"https://api.github.com/repos/kc1212/syncthing/comments{/number}","issue_comment_url":"https://api.github.com/repos/kc1212/syncthing/issues/comments{/number}","contents_url":"https://api.github.com/repos/kc1212/syncthing/contents/{+path}","compare_url":"https://api.github.com/repos/kc1212/syncthing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kc1212/syncthing/merges","archive_url":"https://api.github.com/repos/kc1212/syncthing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kc1212/syncthing/downloads","issues_url":"https://api.github.com/repos/kc1212/syncthing/issues{/number}","pulls_url":"https://api.github.com/repos/kc1212/syncthing/pulls{/number}","milestones_url":"https://api.github.com/repos/kc1212/syncthing/milestones{/number}","notifications_url":"https://api.github.com/repos/kc1212/syncthing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kc1212/syncthing/labels{/name}","releases_url":"https://api.github.com/repos/kc1212/syncthing/releases{/id}","deployments_url":"https://api.github.com/repos/kc1212/syncthing/deployments","created_at":"2016-03-07T17:04:49Z","updated_at":"2016-03-07T17:04:52Z","pushed_at":"2016-03-14T18:55:40Z","git_url":"git://github.com/kc1212/syncthing.git","ssh_url":"git@github.com:kc1212/syncthing.git","clone_url":"https://github.com/kc1212/syncthing.git","svn_url":"https://github.com/kc1212/syncthing","homepage":"http://forum.syncthing.net/","size":64361,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"syncthing:master","ref":"master","sha":"d8fba4787066b1d713f165bf4888283fab77db11","user":{"login":"syncthing","id":7628018,"avatar_url":"https://avatars.githubusercontent.com/u/7628018?v=3","gravatar_id":"","url":"https://api.github.com/users/syncthing","html_url":"https://github.com/syncthing","followers_url":"https://api.github.com/users/syncthing/followers","following_url":"https://api.github.com/users/syncthing/following{/other_user}","gists_url":"https://api.github.com/users/syncthing/gists{/gist_id}","starred_url":"https://api.github.com/users/syncthing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syncthing/subscriptions","organizations_url":"https://api.github.com/users/syncthing/orgs","repos_url":"https://api.github.com/users/syncthing/repos","events_url":"https://api.github.com/users/syncthing/events{/privacy}","received_events_url":"https://api.github.com/users/syncthing/received_events","type":"Organization","site_admin":false},"repo":{"id":14712850,"name":"syncthing","full_name":"syncthing/syncthing","owner":{"login":"syncthing","id":7628018,"avatar_url":"https://avatars.githubusercontent.com/u/7628018?v=3","gravatar_id":"","url":"https://api.github.com/users/syncthing","html_url":"https://github.com/syncthing","followers_url":"https://api.github.com/users/syncthing/followers","following_url":"https://api.github.com/users/syncthing/following{/other_user}","gists_url":"https://api.github.com/users/syncthing/gists{/gist_id}","starred_url":"https://api.github.com/users/syncthing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syncthing/subscriptions","organizations_url":"https://api.github.com/users/syncthing/orgs","repos_url":"https://api.github.com/users/syncthing/repos","events_url":"https://api.github.com/users/syncthing/events{/privacy}","received_events_url":"https://api.github.com/users/syncthing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/syncthing/syncthing","description":"Open Source Continuous File Synchronization","fork":false,"url":"https://api.github.com/repos/syncthing/syncthing","forks_url":"https://api.github.com/repos/syncthing/syncthing/forks","keys_url":"https://api.github.com/repos/syncthing/syncthing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/syncthing/syncthing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/syncthing/syncthing/teams","hooks_url":"https://api.github.com/repos/syncthing/syncthing/hooks","issue_events_url":"https://api.github.com/repos/syncthing/syncthing/issues/events{/number}","events_url":"https://api.github.com/repos/syncthing/syncthing/events","assignees_url":"https://api.github.com/repos/syncthing/syncthing/assignees{/user}","branches_url":"https://api.github.com/repos/syncthing/syncthing/branches{/branch}","tags_url":"https://api.github.com/repos/syncthing/syncthing/tags","blobs_url":"https://api.github.com/repos/syncthing/syncthing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/syncthing/syncthing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/syncthing/syncthing/git/refs{/sha}","trees_url":"https://api.github.com/repos/syncthing/syncthing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/syncthing/syncthing/statuses/{sha}","languages_url":"https://api.github.com/repos/syncthing/syncthing/languages","stargazers_url":"https://api.github.com/repos/syncthing/syncthing/stargazers","contributors_url":"https://api.github.com/repos/syncthing/syncthing/contributors","subscribers_url":"https://api.github.com/repos/syncthing/syncthing/subscribers","subscription_url":"https://api.github.com/repos/syncthing/syncthing/subscription","commits_url":"https://api.github.com/repos/syncthing/syncthing/commits{/sha}","git_commits_url":"https://api.github.com/repos/syncthing/syncthing/git/commits{/sha}","comments_url":"https://api.github.com/repos/syncthing/syncthing/comments{/number}","issue_comment_url":"https://api.github.com/repos/syncthing/syncthing/issues/comments{/number}","contents_url":"https://api.github.com/repos/syncthing/syncthing/contents/{+path}","compare_url":"https://api.github.com/repos/syncthing/syncthing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/syncthing/syncthing/merges","archive_url":"https://api.github.com/repos/syncthing/syncthing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/syncthing/syncthing/downloads","issues_url":"https://api.github.com/repos/syncthing/syncthing/issues{/number}","pulls_url":"https://api.github.com/repos/syncthing/syncthing/pulls{/number}","milestones_url":"https://api.github.com/repos/syncthing/syncthing/milestones{/number}","notifications_url":"https://api.github.com/repos/syncthing/syncthing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/syncthing/syncthing/labels{/name}","releases_url":"https://api.github.com/repos/syncthing/syncthing/releases{/id}","deployments_url":"https://api.github.com/repos/syncthing/syncthing/deployments","created_at":"2013-11-26T09:48:21Z","updated_at":"2016-03-17T20:17:50Z","pushed_at":"2016-03-17T20:10:46Z","git_url":"git://github.com/syncthing/syncthing.git","ssh_url":"git@github.com:syncthing/syncthing.git","clone_url":"https://github.com/syncthing/syncthing.git","svn_url":"https://github.com/syncthing/syncthing","homepage":"http://forum.syncthing.net/","size":103458,"stargazers_count":11524,"watchers_count":11524,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":881,"mirror_url":null,"open_issues_count":175,"forks":881,"open_issues":175,"watchers":11524,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2825"},"html":{"href":"https://github.com/syncthing/syncthing/pull/2825"},"issue":{"href":"https://api.github.com/repos/syncthing/syncthing/issues/2825"},"comments":{"href":"https://api.github.com/repos/syncthing/syncthing/issues/2825/comments"},"review_comments":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2825/comments"},"review_comment":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2825/commits"},"statuses":{"href":"https://api.github.com/repos/syncthing/syncthing/statuses/2288cd431ba8078e1b056648c509e5c17e6868b9"}}}}