GitHub PullRequestReviewCommentEvent at 2014-07-17 04:50:09
Repository: bat-ria
Actor: chestnutchen
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ecomfe/bat-ria/pulls/comments/15041064","id":15041064,"diff_hunk":"@@ -228,16 +229,76 @@ define(function (require) {\n     };\n \n     /**\n-     * 提交表单前锁定提交，完成提交操作后释放提交\n+     * 校验表单前可扩展的操作，在提交之前做`异步`的校验\n+     * 比如弹个框“提交有风险，是否要提交”之类\n+     *\n+     * @return {promise}\n+     */\n+    FormAction.prototype.beforeValidation = function () {\n+        return Deferred.resolved();\n+    };\n+\n+    /**\n+     * 校验表单后可扩展的动作，在校验之后做`异步`的处理\n+     * 比如弹个框“提交仍有风险，是否要提交”之类\n+     *\n+     * @return {promise}\n+     */\n+    FormAction.prototype.afterValidation = function () {\n+        return Deferred.resolved();\n+    };\n+\n+    /**\n+     * 进行校验，先进行表单控件自校验，然后进行自定义校验\n+     *\n+     * @return {promise}\n+     */\n+    FormAction.prototype.validating = function (submitData) {\n+        var form = this.view.get('form');\n+        if (form.validate()) {\n+            var localValidationResult = this.model.validateSubmitData(submitData);\n+            if (localValidationResult === true) {\n+                return Deferred.resolved();\n+            }\n+            else {\n+                var handleResult = this.handleLocalValidationErrors(localValidationResult);\n+                return Deferred.rejected(handleResult);\n+            }\n+        }\n+        return Deferred.rejected();\n+    };\n+\n+    /**\n+     * 此处为点击提交按钮后、表单校验前的准备\n+     * 主要逻辑是锁定提交，在校验通过并完成提交操作后释放表单的提交操作\n+     *\n+     * 提交流程：\n+     * disableSubmit ->\n+     * beforeValidation ->\n+     * validating ->\n+     * afterValidation ->\n+     * sumbmit ->\n+     * enableSubmit\n+     *\n+     * 可针对业务需求扩展beforeValidation、afterValidation\n+     * validating、submit若与业务有冲突，也可自行修改，但不推荐\n      */\n-    FormAction.prototype.submitEdit = function () {","path":"src/mvc/FormAction.js","position":110,"original_position":110,"commit_id":"b19e5bfd344716b9c9560a1e27aac83599ef156e","original_commit_id":"b19e5bfd344716b9c9560a1e27aac83599ef156e","user":{"login":"chestnutchen","id":2787987,"avatar_url":"https://avatars.githubusercontent.com/u/2787987?","gravatar_id":"35512069fcea0672a9df3bd9fbeaf5c0","url":"https://api.github.com/users/chestnutchen","html_url":"https://github.com/chestnutchen","followers_url":"https://api.github.com/users/chestnutchen/followers","following_url":"https://api.github.com/users/chestnutchen/following{/other_user}","gists_url":"https://api.github.com/users/chestnutchen/gists{/gist_id}","starred_url":"https://api.github.com/users/chestnutchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chestnutchen/subscriptions","organizations_url":"https://api.github.com/users/chestnutchen/orgs","repos_url":"https://api.github.com/users/chestnutchen/repos","events_url":"https://api.github.com/users/chestnutchen/events{/privacy}","received_events_url":"https://api.github.com/users/chestnutchen/received_events","type":"User","site_admin":false},"body":"基于那个job会通知他们去改我觉得还好，这里其实项目里边监听了Form的validateAndSubmit里边的各种事件都会gg，因为现在要手动调validate，不走validateAndSubmit。觉得这里既然给出了同步异步都兼容的解决方案，就让他们改一下吧。。这个还要再讨论一下的","created_at":"2014-07-17T04:50:09Z","updated_at":"2014-07-17T04:50:09Z","html_url":"https://github.com/ecomfe/bat-ria/pull/29#discussion_r15041064","pull_request_url":"https://api.github.com/repos/ecomfe/bat-ria/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/ecomfe/bat-ria/pulls/comments/15041064"},"html":{"href":"https://github.com/ecomfe/bat-ria/pull/29#discussion_r15041064"},"pull_request":{"href":"https://api.github.com/repos/ecomfe/bat-ria/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/ecomfe/bat-ria/pulls/29","id":18507894,"html_url":"https://github.com/ecomfe/bat-ria/pull/29","diff_url":"https://github.com/ecomfe/bat-ria/pull/29.diff","patch_url":"https://github.com/ecomfe/bat-ria/pull/29.patch","issue_url":"https://api.github.com/repos/ecomfe/bat-ria/issues/29","number":29,"state":"open","title":"upgrade navigator and FormAction","user":{"login":"chestnutchen","id":2787987,"avatar_url":"https://avatars.githubusercontent.com/u/2787987?","gravatar_id":"35512069fcea0672a9df3bd9fbeaf5c0","url":"https://api.github.com/users/chestnutchen","html_url":"https://github.com/chestnutchen","followers_url":"https://api.github.com/users/chestnutchen/followers","following_url":"https://api.github.com/users/chestnutchen/following{/other_user}","gists_url":"https://api.github.com/users/chestnutchen/gists{/gist_id}","starred_url":"https://api.github.com/users/chestnutchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chestnutchen/subscriptions","organizations_url":"https://api.github.com/users/chestnutchen/orgs","repos_url":"https://api.github.com/users/chestnutchen/repos","events_url":"https://api.github.com/users/chestnutchen/events{/privacy}","received_events_url":"https://api.github.com/users/chestnutchen/received_events","type":"User","site_admin":false},"body":"add `sub navigator`\r\nadd `beforeValidation、validating、afterValidation extending function`\r\nadd `locating to first error label`","created_at":"2014-07-17T03:19:33Z","updated_at":"2014-07-17T04:50:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9b3d36d8dc8fa3139183827524ce7b0c257908c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ecomfe/bat-ria/pulls/29/commits","review_comments_url":"https://api.github.com/repos/ecomfe/bat-ria/pulls/29/comments","review_comment_url":"https://api.github.com/repos/ecomfe/bat-ria/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ecomfe/bat-ria/issues/29/comments","statuses_url":"https://api.github.com/repos/ecomfe/bat-ria/statuses/b19e5bfd344716b9c9560a1e27aac83599ef156e","head":{"label":"chestnutchen:master","ref":"master","sha":"b19e5bfd344716b9c9560a1e27aac83599ef156e","user":{"login":"chestnutchen","id":2787987,"avatar_url":"https://avatars.githubusercontent.com/u/2787987?","gravatar_id":"35512069fcea0672a9df3bd9fbeaf5c0","url":"https://api.github.com/users/chestnutchen","html_url":"https://github.com/chestnutchen","followers_url":"https://api.github.com/users/chestnutchen/followers","following_url":"https://api.github.com/users/chestnutchen/following{/other_user}","gists_url":"https://api.github.com/users/chestnutchen/gists{/gist_id}","starred_url":"https://api.github.com/users/chestnutchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chestnutchen/subscriptions","organizations_url":"https://api.github.com/users/chestnutchen/orgs","repos_url":"https://api.github.com/users/chestnutchen/repos","events_url":"https://api.github.com/users/chestnutchen/events{/privacy}","received_events_url":"https://api.github.com/users/chestnutchen/received_events","type":"User","site_admin":false},"repo":{"id":17164152,"name":"ma-ria","full_name":"chestnutchen/ma-ria","owner":{"login":"chestnutchen","id":2787987,"avatar_url":"https://avatars.githubusercontent.com/u/2787987?","gravatar_id":"35512069fcea0672a9df3bd9fbeaf5c0","url":"https://api.github.com/users/chestnutchen","html_url":"https://github.com/chestnutchen","followers_url":"https://api.github.com/users/chestnutchen/followers","following_url":"https://api.github.com/users/chestnutchen/following{/other_user}","gists_url":"https://api.github.com/users/chestnutchen/gists{/gist_id}","starred_url":"https://api.github.com/users/chestnutchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chestnutchen/subscriptions","organizations_url":"https://api.github.com/users/chestnutchen/orgs","repos_url":"https://api.github.com/users/chestnutchen/repos","events_url":"https://api.github.com/users/chestnutchen/events{/privacy}","received_events_url":"https://api.github.com/users/chestnutchen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chestnutchen/ma-ria","description":"ecma","fork":true,"url":"https://api.github.com/repos/chestnutchen/ma-ria","forks_url":"https://api.github.com/repos/chestnutchen/ma-ria/forks","keys_url":"https://api.github.com/repos/chestnutchen/ma-ria/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chestnutchen/ma-ria/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chestnutchen/ma-ria/teams","hooks_url":"https://api.github.com/repos/chestnutchen/ma-ria/hooks","issue_events_url":"https://api.github.com/repos/chestnutchen/ma-ria/issues/events{/number}","events_url":"https://api.github.com/repos/chestnutchen/ma-ria/events","assignees_url":"https://api.github.com/repos/chestnutchen/ma-ria/assignees{/user}","branches_url":"https://api.github.com/repos/chestnutchen/ma-ria/branches{/branch}","tags_url":"https://api.github.com/repos/chestnutchen/ma-ria/tags","blobs_url":"https://api.github.com/repos/chestnutchen/ma-ria/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chestnutchen/ma-ria/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chestnutchen/ma-ria/git/refs{/sha}","trees_url":"https://api.github.com/repos/chestnutchen/ma-ria/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chestnutchen/ma-ria/statuses/{sha}","languages_url":"https://api.github.com/repos/chestnutchen/ma-ria/languages","stargazers_url":"https://api.github.com/repos/chestnutchen/ma-ria/stargazers","contributors_url":"https://api.github.com/repos/chestnutchen/ma-ria/contributors","subscribers_url":"https://api.github.com/repos/chestnutchen/ma-ria/subscribers","subscription_url":"https://api.github.com/repos/chestnutchen/ma-ria/subscription","commits_url":"https://api.github.com/repos/chestnutchen/ma-ria/commits{/sha}","git_commits_url":"https://api.github.com/repos/chestnutchen/ma-ria/git/commits{/sha}","comments_url":"https://api.github.com/repos/chestnutchen/ma-ria/comments{/number}","issue_comment_url":"https://api.github.com/repos/chestnutchen/ma-ria/issues/comments/{number}","contents_url":"https://api.github.com/repos/chestnutchen/ma-ria/contents/{+path}","compare_url":"https://api.github.com/repos/chestnutchen/ma-ria/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chestnutchen/ma-ria/merges","archive_url":"https://api.github.com/repos/chestnutchen/ma-ria/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chestnutchen/ma-ria/downloads","issues_url":"https://api.github.com/repos/chestnutchen/ma-ria/issues{/number}","pulls_url":"https://api.github.com/repos/chestnutchen/ma-ria/pulls{/number}","milestones_url":"https://api.github.com/repos/chestnutchen/ma-ria/milestones{/number}","notifications_url":"https://api.github.com/repos/chestnutchen/ma-ria/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chestnutchen/ma-ria/labels{/name}","releases_url":"https://api.github.com/repos/chestnutchen/ma-ria/releases{/id}","created_at":"2014-02-25T06:51:19Z","updated_at":"2014-07-17T03:09:37Z","pushed_at":"2014-07-17T03:09:36Z","git_url":"git://github.com/chestnutchen/ma-ria.git","ssh_url":"git@github.com:chestnutchen/ma-ria.git","clone_url":"https://github.com/chestnutchen/ma-ria.git","svn_url":"https://github.com/chestnutchen/ma-ria","homepage":"","size":527,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ecomfe:0.1.17-dev","ref":"0.1.17-dev","sha":"16086658a64ed4518ce3c28115b233b0409a6c9b","user":{"login":"ecomfe","id":2268460,"avatar_url":"https://avatars.githubusercontent.com/u/2268460?","gravatar_id":"52eec96c6d0e280a2c9b07720b72d13f","url":"https://api.github.com/users/ecomfe","html_url":"https://github.com/ecomfe","followers_url":"https://api.github.com/users/ecomfe/followers","following_url":"https://api.github.com/users/ecomfe/following{/other_user}","gists_url":"https://api.github.com/users/ecomfe/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomfe/subscriptions","organizations_url":"https://api.github.com/users/ecomfe/orgs","repos_url":"https://api.github.com/users/ecomfe/repos","events_url":"https://api.github.com/users/ecomfe/events{/privacy}","received_events_url":"https://api.github.com/users/ecomfe/received_events","type":"Organization","site_admin":false},"repo":{"id":16939559,"name":"bat-ria","full_name":"ecomfe/bat-ria","owner":{"login":"ecomfe","id":2268460,"avatar_url":"https://avatars.githubusercontent.com/u/2268460?","gravatar_id":"52eec96c6d0e280a2c9b07720b72d13f","url":"https://api.github.com/users/ecomfe","html_url":"https://github.com/ecomfe","followers_url":"https://api.github.com/users/ecomfe/followers","following_url":"https://api.github.com/users/ecomfe/following{/other_user}","gists_url":"https://api.github.com/users/ecomfe/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomfe/subscriptions","organizations_url":"https://api.github.com/users/ecomfe/orgs","repos_url":"https://api.github.com/users/ecomfe/repos","events_url":"https://api.github.com/users/ecomfe/events{/privacy}","received_events_url":"https://api.github.com/users/ecomfe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ecomfe/bat-ria","description":"RIA extensions for Brand Ads","fork":false,"url":"https://api.github.com/repos/ecomfe/bat-ria","forks_url":"https://api.github.com/repos/ecomfe/bat-ria/forks","keys_url":"https://api.github.com/repos/ecomfe/bat-ria/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecomfe/bat-ria/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecomfe/bat-ria/teams","hooks_url":"https://api.github.com/repos/ecomfe/bat-ria/hooks","issue_events_url":"https://api.github.com/repos/ecomfe/bat-ria/issues/events{/number}","events_url":"https://api.github.com/repos/ecomfe/bat-ria/events","assignees_url":"https://api.github.com/repos/ecomfe/bat-ria/assignees{/user}","branches_url":"https://api.github.com/repos/ecomfe/bat-ria/branches{/branch}","tags_url":"https://api.github.com/repos/ecomfe/bat-ria/tags","blobs_url":"https://api.github.com/repos/ecomfe/bat-ria/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecomfe/bat-ria/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecomfe/bat-ria/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecomfe/bat-ria/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecomfe/bat-ria/statuses/{sha}","languages_url":"https://api.github.com/repos/ecomfe/bat-ria/languages","stargazers_url":"https://api.github.com/repos/ecomfe/bat-ria/stargazers","contributors_url":"https://api.github.com/repos/ecomfe/bat-ria/contributors","subscribers_url":"https://api.github.com/repos/ecomfe/bat-ria/subscribers","subscription_url":"https://api.github.com/repos/ecomfe/bat-ria/subscription","commits_url":"https://api.github.com/repos/ecomfe/bat-ria/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecomfe/bat-ria/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecomfe/bat-ria/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecomfe/bat-ria/issues/comments/{number}","contents_url":"https://api.github.com/repos/ecomfe/bat-ria/contents/{+path}","compare_url":"https://api.github.com/repos/ecomfe/bat-ria/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecomfe/bat-ria/merges","archive_url":"https://api.github.com/repos/ecomfe/bat-ria/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecomfe/bat-ria/downloads","issues_url":"https://api.github.com/repos/ecomfe/bat-ria/issues{/number}","pulls_url":"https://api.github.com/repos/ecomfe/bat-ria/pulls{/number}","milestones_url":"https://api.github.com/repos/ecomfe/bat-ria/milestones{/number}","notifications_url":"https://api.github.com/repos/ecomfe/bat-ria/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecomfe/bat-ria/labels{/name}","releases_url":"https://api.github.com/repos/ecomfe/bat-ria/releases{/id}","created_at":"2014-02-18T06:38:46Z","updated_at":"2014-07-11T08:57:39Z","pushed_at":"2014-07-14T05:21:02Z","git_url":"git://github.com/ecomfe/bat-ria.git","ssh_url":"git@github.com:ecomfe/bat-ria.git","clone_url":"https://github.com/ecomfe/bat-ria.git","svn_url":"https://github.com/ecomfe/bat-ria","homepage":"","size":1976,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ecomfe/bat-ria/pulls/29"},"html":{"href":"https://github.com/ecomfe/bat-ria/pull/29"},"issue":{"href":"https://api.github.com/repos/ecomfe/bat-ria/issues/29"},"comments":{"href":"https://api.github.com/repos/ecomfe/bat-ria/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/ecomfe/bat-ria/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/ecomfe/bat-ria/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ecomfe/bat-ria/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/ecomfe/bat-ria/statuses/b19e5bfd344716b9c9560a1e27aac83599ef156e"}}}}