{"action":"created","comment":{"url":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/comments/29133333","id":29133333,"diff_hunk":"@@ -0,0 +1,150 @@\n+define([\n+    'html!./rb-progress-button.tpl.html'\n+], function (template) {\n+\n+    /**\n+     * @ngdoc directive\n+     * @name rbProgressButton\n+     * @module rb-progress-button\n+     *\n+     * @restrict A\n+     *\n+     * @description\n+     * `<rb-progress-button>` is an attribute directive that changes the default\n+     * behaviour of a `<button>` from a single click to a click event that\n+     * triggers an execution process that changes the button text between two\n+     * states (messages) every given time interval elapses.\n+     *\n+     * If you supply an `action-label` attribute, it will be set as the first\n+     * message to replace the current button label. Defaults to `Executing`\n+     *\n+     * If you supply a `progress-label` attribute, it will be set as the second\n+     * message to replace the button action label after a time interval elapses.\n+     * Defaults to `Please Wait`\n+     *\n+     * If you supply an `interval` attribute with a number as a value, it will set\n+     * the amount of time for the button label to change between two states (messages)\n+     * Defaults to 2000 milliseconds (2 seconds)\n+     *\n+     * @scope\n+     *  'onExecute': a custom function -that returns a promise- to be executed\n+     *               when button is clicked.\n+     *\n+     * @usage\n+     * <hljs lang=\"html\">\n+     *   <rb-button size=\"small\" state=\"positive\" outline=\"yes\"\n+     *       rb-progress-button on-execute=\"demoCtrl.publish()\"\n+     *       interval=\"500\"\n+     *       action-label=\"Publishing\"\n+     *       progress-label=\"Please Wait\">Publish</rb-button>\n+     * </hljs>\n+     *\n+     * @ngInject\n+     */\n+    function rbProgressButtonDirective ($interval) {\n+\n+        return {\n+            scope: {\n+                onExecute: '&'\n+            },\n+            restrict: 'A',\n+            replace: true,\n+            link: link\n+        };\n+\n+        function link (scope, elem, attr) {\n+\n+            var stopInterval,\n+                originalLabel,\n+                currentLabel,\n+                // Default interval of 2000 milliseconds\n+                interval = 2000,\n+                // Default action message\n+                actionLabel = 'Executing',\n+                // Default progress message\n+                progressLabel = 'Please Wait';\n+\n+            if (angular.isDefined(attr.interval) &&\n+                !isNaN(parseInt(attr.interval)) &&\n+                isFinite(attr.interval)) {\n+\n+                interval = attr.interval;\n+            }\n+\n+            if (angular.isDefined(attr.actionLabel) && !angular.equals(attr.actionLabel, '')) {\n+                actionLabel = attr.actionLabel;\n+            }\n+\n+            if (angular.isDefined(attr.progressLabel) && !angular.equals(attr.progressLabel, '')) {\n+                progressLabel = attr.progressLabel;\n+            }\n+\n+            function onClick () {\n+\n+                originalLabel = elem.text();\n+                currentLabel = actionLabel;\n+\n+                if (!(angular.isDefined(attr.outline) && angular.equals(attr.outline, 'yes'))) {\n+                    elem.addClass('Button--outline');\n+                    elem.removeClass('Button--standard');\n+                }\n+\n+                elem.text(currentLabel);\n+                elem[0].blur();\n+\n+                stopInterval = $interval(function () {\n+                    if (currentLabel === progressLabel) {\n+                        currentLabel = actionLabel;\n+                    } else {\n+                        currentLabel = progressLabel;\n+                    }\n+                    elem.text(currentLabel);\n+                }, interval);","path":"src/rb-progress-button/rb-progress-button-directive.js","position":105,"original_position":102,"commit_id":"40364e927e988b235697dd451795ea24ea2118b6","original_commit_id":"00862bc24b7e0f871ff1369955879fee7d79ad0a","user":{"login":"darwinlopez","id":2146460,"avatar_url":"https://avatars.githubusercontent.com/u/2146460?v=3","gravatar_id":"","url":"https://api.github.com/users/darwinlopez","html_url":"https://github.com/darwinlopez","followers_url":"https://api.github.com/users/darwinlopez/followers","following_url":"https://api.github.com/users/darwinlopez/following{/other_user}","gists_url":"https://api.github.com/users/darwinlopez/gists{/gist_id}","starred_url":"https://api.github.com/users/darwinlopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darwinlopez/subscriptions","organizations_url":"https://api.github.com/users/darwinlopez/orgs","repos_url":"https://api.github.com/users/darwinlopez/repos","events_url":"https://api.github.com/users/darwinlopez/events{/privacy}","received_events_url":"https://api.github.com/users/darwinlopez/received_events","type":"User","site_admin":false},"body":"Yup, and something similar happens when cleaning watchers as well","created_at":"2015-04-27T09:47:08Z","updated_at":"2015-04-27T09:47:08Z","html_url":"https://github.com/rockabox/rbx_ui_components/pull/71#discussion_r29133333","pull_request_url":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/comments/29133333"},"html":{"href":"https://github.com/rockabox/rbx_ui_components/pull/71#discussion_r29133333"},"pull_request":{"href":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/71","id":33968033,"html_url":"https://github.com/rockabox/rbx_ui_components/pull/71","diff_url":"https://github.com/rockabox/rbx_ui_components/pull/71.diff","patch_url":"https://github.com/rockabox/rbx_ui_components/pull/71.patch","issue_url":"https://api.github.com/repos/rockabox/rbx_ui_components/issues/71","number":71,"state":"open","locked":false,"title":"Creates-a-Progress-Button-attr-directive","user":{"login":"darwinlopez","id":2146460,"avatar_url":"https://avatars.githubusercontent.com/u/2146460?v=3","gravatar_id":"","url":"https://api.github.com/users/darwinlopez","html_url":"https://github.com/darwinlopez","followers_url":"https://api.github.com/users/darwinlopez/followers","following_url":"https://api.github.com/users/darwinlopez/following{/other_user}","gists_url":"https://api.github.com/users/darwinlopez/gists{/gist_id}","starred_url":"https://api.github.com/users/darwinlopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darwinlopez/subscriptions","organizations_url":"https://api.github.com/users/darwinlopez/orgs","repos_url":"https://api.github.com/users/darwinlopez/repos","events_url":"https://api.github.com/users/darwinlopez/events{/privacy}","received_events_url":"https://api.github.com/users/darwinlopez/received_events","type":"User","site_admin":false},"body":"Creates a progress button attribute directive that changes the default behaviour of a `<button>` from a single click to a click event that triggers an execution process that changes the button label between two\r\nstates (messages) every given time interval elapses.\r\n\r\nIncludes a extended demo to show how it could be used.","created_at":"2015-04-23T15:39:40Z","updated_at":"2015-04-27T09:47:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5ac38838172ef73477501342da7264d5e5b5f5f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/71/commits","review_comments_url":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/71/comments","review_comment_url":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rockabox/rbx_ui_components/issues/71/comments","statuses_url":"https://api.github.com/repos/rockabox/rbx_ui_components/statuses/40364e927e988b235697dd451795ea24ea2118b6","head":{"label":"rockabox:story/8808-Progress-Button-Directive","ref":"story/8808-Progress-Button-Directive","sha":"40364e927e988b235697dd451795ea24ea2118b6","user":{"login":"rockabox","id":245290,"avatar_url":"https://avatars.githubusercontent.com/u/245290?v=3","gravatar_id":"","url":"https://api.github.com/users/rockabox","html_url":"https://github.com/rockabox","followers_url":"https://api.github.com/users/rockabox/followers","following_url":"https://api.github.com/users/rockabox/following{/other_user}","gists_url":"https://api.github.com/users/rockabox/gists{/gist_id}","starred_url":"https://api.github.com/users/rockabox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockabox/subscriptions","organizations_url":"https://api.github.com/users/rockabox/orgs","repos_url":"https://api.github.com/users/rockabox/repos","events_url":"https://api.github.com/users/rockabox/events{/privacy}","received_events_url":"https://api.github.com/users/rockabox/received_events","type":"Organization","site_admin":false},"repo":{"id":30237405,"name":"rbx_ui_components","full_name":"rockabox/rbx_ui_components","owner":{"login":"rockabox","id":245290,"avatar_url":"https://avatars.githubusercontent.com/u/245290?v=3","gravatar_id":"","url":"https://api.github.com/users/rockabox","html_url":"https://github.com/rockabox","followers_url":"https://api.github.com/users/rockabox/followers","following_url":"https://api.github.com/users/rockabox/following{/other_user}","gists_url":"https://api.github.com/users/rockabox/gists{/gist_id}","starred_url":"https://api.github.com/users/rockabox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockabox/subscriptions","organizations_url":"https://api.github.com/users/rockabox/orgs","repos_url":"https://api.github.com/users/rockabox/repos","events_url":"https://api.github.com/users/rockabox/events{/privacy}","received_events_url":"https://api.github.com/users/rockabox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rockabox/rbx_ui_components","description":"","fork":false,"url":"https://api.github.com/repos/rockabox/rbx_ui_components","forks_url":"https://api.github.com/repos/rockabox/rbx_ui_components/forks","keys_url":"https://api.github.com/repos/rockabox/rbx_ui_components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rockabox/rbx_ui_components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rockabox/rbx_ui_components/teams","hooks_url":"https://api.github.com/repos/rockabox/rbx_ui_components/hooks","issue_events_url":"https://api.github.com/repos/rockabox/rbx_ui_components/issues/events{/number}","events_url":"https://api.github.com/repos/rockabox/rbx_ui_components/events","assignees_url":"https://api.github.com/repos/rockabox/rbx_ui_components/assignees{/user}","branches_url":"https://api.github.com/repos/rockabox/rbx_ui_components/branches{/branch}","tags_url":"https://api.github.com/repos/rockabox/rbx_ui_components/tags","blobs_url":"https://api.github.com/repos/rockabox/rbx_ui_components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rockabox/rbx_ui_components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rockabox/rbx_ui_components/git/refs{/sha}","trees_url":"https://api.github.com/repos/rockabox/rbx_ui_components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rockabox/rbx_ui_components/statuses/{sha}","languages_url":"https://api.github.com/repos/rockabox/rbx_ui_components/languages","stargazers_url":"https://api.github.com/repos/rockabox/rbx_ui_components/stargazers","contributors_url":"https://api.github.com/repos/rockabox/rbx_ui_components/contributors","subscribers_url":"https://api.github.com/repos/rockabox/rbx_ui_components/subscribers","subscription_url":"https://api.github.com/repos/rockabox/rbx_ui_components/subscription","commits_url":"https://api.github.com/repos/rockabox/rbx_ui_components/commits{/sha}","git_commits_url":"https://api.github.com/repos/rockabox/rbx_ui_components/git/commits{/sha}","comments_url":"https://api.github.com/repos/rockabox/rbx_ui_components/comments{/number}","issue_comment_url":"https://api.github.com/repos/rockabox/rbx_ui_components/issues/comments{/number}","contents_url":"https://api.github.com/repos/rockabox/rbx_ui_components/contents/{+path}","compare_url":"https://api.github.com/repos/rockabox/rbx_ui_components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rockabox/rbx_ui_components/merges","archive_url":"https://api.github.com/repos/rockabox/rbx_ui_components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rockabox/rbx_ui_components/downloads","issues_url":"https://api.github.com/repos/rockabox/rbx_ui_components/issues{/number}","pulls_url":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls{/number}","milestones_url":"https://api.github.com/repos/rockabox/rbx_ui_components/milestones{/number}","notifications_url":"https://api.github.com/repos/rockabox/rbx_ui_components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rockabox/rbx_ui_components/labels{/name}","releases_url":"https://api.github.com/repos/rockabox/rbx_ui_components/releases{/id}","created_at":"2015-02-03T10:27:21Z","updated_at":"2015-04-27T08:53:22Z","pushed_at":"2015-04-27T09:43:22Z","git_url":"git://github.com/rockabox/rbx_ui_components.git","ssh_url":"git@github.com:rockabox/rbx_ui_components.git","clone_url":"https://github.com/rockabox/rbx_ui_components.git","svn_url":"https://github.com/rockabox/rbx_ui_components","homepage":null,"size":1744,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"base":{"label":"rockabox:master","ref":"master","sha":"f5a4bdc16618c7cc529aa570fb15c3342e0b166a","user":{"login":"rockabox","id":245290,"avatar_url":"https://avatars.githubusercontent.com/u/245290?v=3","gravatar_id":"","url":"https://api.github.com/users/rockabox","html_url":"https://github.com/rockabox","followers_url":"https://api.github.com/users/rockabox/followers","following_url":"https://api.github.com/users/rockabox/following{/other_user}","gists_url":"https://api.github.com/users/rockabox/gists{/gist_id}","starred_url":"https://api.github.com/users/rockabox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockabox/subscriptions","organizations_url":"https://api.github.com/users/rockabox/orgs","repos_url":"https://api.github.com/users/rockabox/repos","events_url":"https://api.github.com/users/rockabox/events{/privacy}","received_events_url":"https://api.github.com/users/rockabox/received_events","type":"Organization","site_admin":false},"repo":{"id":30237405,"name":"rbx_ui_components","full_name":"rockabox/rbx_ui_components","owner":{"login":"rockabox","id":245290,"avatar_url":"https://avatars.githubusercontent.com/u/245290?v=3","gravatar_id":"","url":"https://api.github.com/users/rockabox","html_url":"https://github.com/rockabox","followers_url":"https://api.github.com/users/rockabox/followers","following_url":"https://api.github.com/users/rockabox/following{/other_user}","gists_url":"https://api.github.com/users/rockabox/gists{/gist_id}","starred_url":"https://api.github.com/users/rockabox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockabox/subscriptions","organizations_url":"https://api.github.com/users/rockabox/orgs","repos_url":"https://api.github.com/users/rockabox/repos","events_url":"https://api.github.com/users/rockabox/events{/privacy}","received_events_url":"https://api.github.com/users/rockabox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rockabox/rbx_ui_components","description":"","fork":false,"url":"https://api.github.com/repos/rockabox/rbx_ui_components","forks_url":"https://api.github.com/repos/rockabox/rbx_ui_components/forks","keys_url":"https://api.github.com/repos/rockabox/rbx_ui_components/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rockabox/rbx_ui_components/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rockabox/rbx_ui_components/teams","hooks_url":"https://api.github.com/repos/rockabox/rbx_ui_components/hooks","issue_events_url":"https://api.github.com/repos/rockabox/rbx_ui_components/issues/events{/number}","events_url":"https://api.github.com/repos/rockabox/rbx_ui_components/events","assignees_url":"https://api.github.com/repos/rockabox/rbx_ui_components/assignees{/user}","branches_url":"https://api.github.com/repos/rockabox/rbx_ui_components/branches{/branch}","tags_url":"https://api.github.com/repos/rockabox/rbx_ui_components/tags","blobs_url":"https://api.github.com/repos/rockabox/rbx_ui_components/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rockabox/rbx_ui_components/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rockabox/rbx_ui_components/git/refs{/sha}","trees_url":"https://api.github.com/repos/rockabox/rbx_ui_components/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rockabox/rbx_ui_components/statuses/{sha}","languages_url":"https://api.github.com/repos/rockabox/rbx_ui_components/languages","stargazers_url":"https://api.github.com/repos/rockabox/rbx_ui_components/stargazers","contributors_url":"https://api.github.com/repos/rockabox/rbx_ui_components/contributors","subscribers_url":"https://api.github.com/repos/rockabox/rbx_ui_components/subscribers","subscription_url":"https://api.github.com/repos/rockabox/rbx_ui_components/subscription","commits_url":"https://api.github.com/repos/rockabox/rbx_ui_components/commits{/sha}","git_commits_url":"https://api.github.com/repos/rockabox/rbx_ui_components/git/commits{/sha}","comments_url":"https://api.github.com/repos/rockabox/rbx_ui_components/comments{/number}","issue_comment_url":"https://api.github.com/repos/rockabox/rbx_ui_components/issues/comments{/number}","contents_url":"https://api.github.com/repos/rockabox/rbx_ui_components/contents/{+path}","compare_url":"https://api.github.com/repos/rockabox/rbx_ui_components/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rockabox/rbx_ui_components/merges","archive_url":"https://api.github.com/repos/rockabox/rbx_ui_components/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rockabox/rbx_ui_components/downloads","issues_url":"https://api.github.com/repos/rockabox/rbx_ui_components/issues{/number}","pulls_url":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls{/number}","milestones_url":"https://api.github.com/repos/rockabox/rbx_ui_components/milestones{/number}","notifications_url":"https://api.github.com/repos/rockabox/rbx_ui_components/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rockabox/rbx_ui_components/labels{/name}","releases_url":"https://api.github.com/repos/rockabox/rbx_ui_components/releases{/id}","created_at":"2015-02-03T10:27:21Z","updated_at":"2015-04-27T08:53:22Z","pushed_at":"2015-04-27T09:43:22Z","git_url":"git://github.com/rockabox/rbx_ui_components.git","ssh_url":"git@github.com:rockabox/rbx_ui_components.git","clone_url":"https://github.com/rockabox/rbx_ui_components.git","svn_url":"https://github.com/rockabox/rbx_ui_components","homepage":null,"size":1744,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/71"},"html":{"href":"https://github.com/rockabox/rbx_ui_components/pull/71"},"issue":{"href":"https://api.github.com/repos/rockabox/rbx_ui_components/issues/71"},"comments":{"href":"https://api.github.com/repos/rockabox/rbx_ui_components/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rockabox/rbx_ui_components/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/rockabox/rbx_ui_components/statuses/40364e927e988b235697dd451795ea24ea2118b6"}}}}