{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fels_131/pulls/comments/65855004","id":65855004,"diff_hunk":"@@ -0,0 +1,139 @@\n+/**\n+ * Created by luongs3 on 5/9/2016.\n+ */\n+$(document).ready(function () {\n+    function readURL(input) {\n+        if (input.files && input.files[0]) {\n+            var reader = new FileReader();\n+\n+            reader.onload = function (e) {\n+                $('#image_url').attr('src', e.target.result);\n+            };\n+            reader.readAsDataURL(input.files[0]);\n+        }\n+    }\n+\n+    $(\"#image\").change(function () {\n+        $('#image_hidden').val('');\n+        readURL(this);\n+    });\n+    $(\"#btn-back\").click(function () {\n+        window.history.back();\n+    });\n+    $('section').on('click', '.btn-check', function (event) {\n+        var lessonId = $(this).attr('id');\n+        var wordId = $('.word').attr('id').split('-')[1];\n+        var wordSelectId = $(\"input[type='radio']:checked\").attr('id');\n+        $.ajax({\n+            type: \"get\",\n+            url: \"/lessons/\" + lessonId + \"/check\",\n+            data: {\n+                word_id: wordId,\n+                word_select_id: wordSelectId\n+            },\n+            success: function (data, status) {\n+                $('.answer').find('#' + data.answer_id).parent().addClass('true');\n+                if (data.correct == false) {\n+                    $('.answer').find('#' + wordSelectId).parent().addClass('false');\n+                }\n+                if (data.next == true) {\n+                    $('.btn-check').html('next').removeClass('btn-check').addClass('btn-next');\n+                } else {\n+                    $('.btn-check').html('result').removeClass('btn-check').addClass('btn-result');\n+                }\n+            }\n+        });\n+    });\n+    $('section').on('click', '.btn-next', function (event) {\n+        var lessonId = $(this).attr('id');\n+        var wordId = $('.word').attr('id').split('-')[1];\n+        $.ajax({\n+            type: \"get\",\n+            url: \"/lessons/\" + lessonId + \"/next\",\n+            data: {\n+                word_id: wordId\n+            },\n+            success: function (data, status) {\n+                $('.word').attr('id', 'word-' + data.id);\n+                $('.word').html(data.content);\n+                for (var i = 0; i < 4; i++) {\n+                    $('.answer-' + i).attr('id', data.word_answers[i].id);\n+                    $('.answer-' + i)[0].checked = false;\n+                    $('.answer-' + i).parent().removeClass('true').removeClass('false');\n+                    $('.answer-' + i).next().html(data.word_answers[i].content).attr('for', data.word_answers[i].id);\n+                }\n+                $('.progress').html(data.progress);\n+                $('.btn-next').html('check').removeClass('btn-next').addClass('btn-check');\n+            }\n+        });\n+    });\n+    $('section').on('click', '.btn-result', function (event) {\n+        var lessonId = $(this).attr('id');\n+        window.location.replace(\"/lessons/\" + lessonId + \"/result\");\n+    });\n+    $('section').on('click', '.btn-add', function (event) {\n+        var subject = $('table').attr('id');\n+        var response = confirm(\"Do you want do delete these items?\");\n+        if (response) {\n+            var arr = [];\n+            var token = $('[name=\"csrf_token\"]').attr('content');\n+            $(\"input[type='checkbox']:checked\").each(function () {\n+                arr.push($(this).val())\n+            });\n+            if (arr.length == 0) {\n+                alert(\"Choose item before deleting\");\n+                return false;\n+            }\n+            $.ajax({\n+                    type: 'POST',\n+                    url: \"/\" + subject + \"/massive-delete\",\n+                    data: {\n+                        ids: JSON.stringify(arr),\n+                        _token: token\n+                    },\n+                    success: function () {\n+                        window.location.replace(\"/\" + subject + \"/manage\");\n+                    }\n+                }\n+            );\n+        }\n+    });\n+    $('section').on('click', '.btn-create', function (event) {\n+        var subject = $('table').attr('id');\n+        window.location.replace(\"/\" + subject + \"/create\");","path":"resources/assets/js/all.js","position":103,"original_position":103,"commit_id":"d8ce5f762e7e9da1e1cfc59d84cef4ead093dfc1","original_commit_id":"d8ce5f762e7e9da1e1cfc59d84cef4ead093dfc1","user":{"login":"euclid1990","id":5584709,"avatar_url":"https://avatars.githubusercontent.com/u/5584709?v=3","gravatar_id":"","url":"https://api.github.com/users/euclid1990","html_url":"https://github.com/euclid1990","followers_url":"https://api.github.com/users/euclid1990/followers","following_url":"https://api.github.com/users/euclid1990/following{/other_user}","gists_url":"https://api.github.com/users/euclid1990/gists{/gist_id}","starred_url":"https://api.github.com/users/euclid1990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/euclid1990/subscriptions","organizations_url":"https://api.github.com/users/euclid1990/orgs","repos_url":"https://api.github.com/users/euclid1990/repos","events_url":"https://api.github.com/users/euclid1990/events{/privacy}","received_events_url":"https://api.github.com/users/euclid1990/received_events","type":"User","site_admin":false},"body":"hardcode URL","created_at":"2016-06-06T08:45:47Z","updated_at":"2016-06-06T08:45:47Z","html_url":"https://github.com/framgia/fels_131/pull/8#discussion_r65855004","pull_request_url":"https://api.github.com/repos/framgia/fels_131/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_131/pulls/comments/65855004"},"html":{"href":"https://github.com/framgia/fels_131/pull/8#discussion_r65855004"},"pull_request":{"href":"https://api.github.com/repos/framgia/fels_131/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fels_131/pulls/8","id":72672945,"html_url":"https://github.com/framgia/fels_131/pull/8","diff_url":"https://github.com/framgia/fels_131/pull/8.diff","patch_url":"https://github.com/framgia/fels_131/pull/8.patch","issue_url":"https://api.github.com/repos/framgia/fels_131/issues/8","number":8,"state":"open","locked":false,"title":"word list: filter words by learned, not learned, all, categories.","user":{"login":"luongs3","id":12150725,"avatar_url":"https://avatars.githubusercontent.com/u/12150725?v=3","gravatar_id":"","url":"https://api.github.com/users/luongs3","html_url":"https://github.com/luongs3","followers_url":"https://api.github.com/users/luongs3/followers","following_url":"https://api.github.com/users/luongs3/following{/other_user}","gists_url":"https://api.github.com/users/luongs3/gists{/gist_id}","starred_url":"https://api.github.com/users/luongs3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luongs3/subscriptions","organizations_url":"https://api.github.com/users/luongs3/orgs","repos_url":"https://api.github.com/users/luongs3/repos","events_url":"https://api.github.com/users/luongs3/events{/privacy}","received_events_url":"https://api.github.com/users/luongs3/received_events","type":"User","site_admin":false},"body":"add feature in word list: filter by learned, not learned, all, categories.","created_at":"2016-06-06T08:33:21Z","updated_at":"2016-06-06T08:45:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c999291910c8f213e5da03299e12fd1812cdb013","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fels_131/pulls/8/commits","review_comments_url":"https://api.github.com/repos/framgia/fels_131/pulls/8/comments","review_comment_url":"https://api.github.com/repos/framgia/fels_131/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fels_131/issues/8/comments","statuses_url":"https://api.github.com/repos/framgia/fels_131/statuses/d8ce5f762e7e9da1e1cfc59d84cef4ead093dfc1","head":{"label":"luongs3:develop","ref":"develop","sha":"d8ce5f762e7e9da1e1cfc59d84cef4ead093dfc1","user":{"login":"luongs3","id":12150725,"avatar_url":"https://avatars.githubusercontent.com/u/12150725?v=3","gravatar_id":"","url":"https://api.github.com/users/luongs3","html_url":"https://github.com/luongs3","followers_url":"https://api.github.com/users/luongs3/followers","following_url":"https://api.github.com/users/luongs3/following{/other_user}","gists_url":"https://api.github.com/users/luongs3/gists{/gist_id}","starred_url":"https://api.github.com/users/luongs3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luongs3/subscriptions","organizations_url":"https://api.github.com/users/luongs3/orgs","repos_url":"https://api.github.com/users/luongs3/repos","events_url":"https://api.github.com/users/luongs3/events{/privacy}","received_events_url":"https://api.github.com/users/luongs3/received_events","type":"User","site_admin":false},"repo":{"id":58017414,"name":"fels_131","full_name":"luongs3/fels_131","owner":{"login":"luongs3","id":12150725,"avatar_url":"https://avatars.githubusercontent.com/u/12150725?v=3","gravatar_id":"","url":"https://api.github.com/users/luongs3","html_url":"https://github.com/luongs3","followers_url":"https://api.github.com/users/luongs3/followers","following_url":"https://api.github.com/users/luongs3/following{/other_user}","gists_url":"https://api.github.com/users/luongs3/gists{/gist_id}","starred_url":"https://api.github.com/users/luongs3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luongs3/subscriptions","organizations_url":"https://api.github.com/users/luongs3/orgs","repos_url":"https://api.github.com/users/luongs3/repos","events_url":"https://api.github.com/users/luongs3/events{/privacy}","received_events_url":"https://api.github.com/users/luongs3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luongs3/fels_131","description":"Framgia E-Learning System (training)","fork":true,"url":"https://api.github.com/repos/luongs3/fels_131","forks_url":"https://api.github.com/repos/luongs3/fels_131/forks","keys_url":"https://api.github.com/repos/luongs3/fels_131/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luongs3/fels_131/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luongs3/fels_131/teams","hooks_url":"https://api.github.com/repos/luongs3/fels_131/hooks","issue_events_url":"https://api.github.com/repos/luongs3/fels_131/issues/events{/number}","events_url":"https://api.github.com/repos/luongs3/fels_131/events","assignees_url":"https://api.github.com/repos/luongs3/fels_131/assignees{/user}","branches_url":"https://api.github.com/repos/luongs3/fels_131/branches{/branch}","tags_url":"https://api.github.com/repos/luongs3/fels_131/tags","blobs_url":"https://api.github.com/repos/luongs3/fels_131/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luongs3/fels_131/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luongs3/fels_131/git/refs{/sha}","trees_url":"https://api.github.com/repos/luongs3/fels_131/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luongs3/fels_131/statuses/{sha}","languages_url":"https://api.github.com/repos/luongs3/fels_131/languages","stargazers_url":"https://api.github.com/repos/luongs3/fels_131/stargazers","contributors_url":"https://api.github.com/repos/luongs3/fels_131/contributors","subscribers_url":"https://api.github.com/repos/luongs3/fels_131/subscribers","subscription_url":"https://api.github.com/repos/luongs3/fels_131/subscription","commits_url":"https://api.github.com/repos/luongs3/fels_131/commits{/sha}","git_commits_url":"https://api.github.com/repos/luongs3/fels_131/git/commits{/sha}","comments_url":"https://api.github.com/repos/luongs3/fels_131/comments{/number}","issue_comment_url":"https://api.github.com/repos/luongs3/fels_131/issues/comments{/number}","contents_url":"https://api.github.com/repos/luongs3/fels_131/contents/{+path}","compare_url":"https://api.github.com/repos/luongs3/fels_131/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luongs3/fels_131/merges","archive_url":"https://api.github.com/repos/luongs3/fels_131/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luongs3/fels_131/downloads","issues_url":"https://api.github.com/repos/luongs3/fels_131/issues{/number}","pulls_url":"https://api.github.com/repos/luongs3/fels_131/pulls{/number}","milestones_url":"https://api.github.com/repos/luongs3/fels_131/milestones{/number}","notifications_url":"https://api.github.com/repos/luongs3/fels_131/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luongs3/fels_131/labels{/name}","releases_url":"https://api.github.com/repos/luongs3/fels_131/releases{/id}","deployments_url":"https://api.github.com/repos/luongs3/fels_131/deployments","created_at":"2016-05-04T02:40:59Z","updated_at":"2016-05-04T02:32:42Z","pushed_at":"2016-06-06T08:31:41Z","git_url":"git://github.com/luongs3/fels_131.git","ssh_url":"git@github.com:luongs3/fels_131.git","clone_url":"https://github.com/luongs3/fels_131.git","svn_url":"https://github.com/luongs3/fels_131","homepage":null,"size":133,"stargazers_count":0,"watchers_count":0,"language":null,"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":"framgia:develop","ref":"develop","sha":"ebd3ac4208df1e26c91faab75ac4422ed3f6be5d","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":58016936,"name":"fels_131","full_name":"framgia/fels_131","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/fels_131","description":"Framgia E-Learning System (training)","fork":false,"url":"https://api.github.com/repos/framgia/fels_131","forks_url":"https://api.github.com/repos/framgia/fels_131/forks","keys_url":"https://api.github.com/repos/framgia/fels_131/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fels_131/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fels_131/teams","hooks_url":"https://api.github.com/repos/framgia/fels_131/hooks","issue_events_url":"https://api.github.com/repos/framgia/fels_131/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fels_131/events","assignees_url":"https://api.github.com/repos/framgia/fels_131/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fels_131/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fels_131/tags","blobs_url":"https://api.github.com/repos/framgia/fels_131/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fels_131/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fels_131/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fels_131/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fels_131/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fels_131/languages","stargazers_url":"https://api.github.com/repos/framgia/fels_131/stargazers","contributors_url":"https://api.github.com/repos/framgia/fels_131/contributors","subscribers_url":"https://api.github.com/repos/framgia/fels_131/subscribers","subscription_url":"https://api.github.com/repos/framgia/fels_131/subscription","commits_url":"https://api.github.com/repos/framgia/fels_131/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fels_131/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fels_131/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fels_131/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fels_131/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fels_131/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fels_131/merges","archive_url":"https://api.github.com/repos/framgia/fels_131/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fels_131/downloads","issues_url":"https://api.github.com/repos/framgia/fels_131/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fels_131/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fels_131/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fels_131/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fels_131/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fels_131/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fels_131/deployments","created_at":"2016-05-04T02:32:42Z","updated_at":"2016-05-04T02:32:42Z","pushed_at":"2016-06-06T08:33:21Z","git_url":"git://github.com/framgia/fels_131.git","ssh_url":"git@github.com:framgia/fels_131.git","clone_url":"https://github.com/framgia/fels_131.git","svn_url":"https://github.com/framgia/fels_131","homepage":null,"size":129,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fels_131/pulls/8"},"html":{"href":"https://github.com/framgia/fels_131/pull/8"},"issue":{"href":"https://api.github.com/repos/framgia/fels_131/issues/8"},"comments":{"href":"https://api.github.com/repos/framgia/fels_131/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fels_131/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fels_131/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fels_131/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fels_131/statuses/d8ce5f762e7e9da1e1cfc59d84cef4ead093dfc1"}}}}
{"actor":{"display_login":"euclid1990"}}