{"action":"created","issue":{"url":"https://api.github.com/repos/enpitut/WakeUp/issues/47","labels_url":"https://api.github.com/repos/enpitut/WakeUp/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/enpitut/WakeUp/issues/47/comments","events_url":"https://api.github.com/repos/enpitut/WakeUp/issues/47/events","html_url":"https://github.com/enpitut/WakeUp/pull/47","id":110827426,"number":47,"title":"短時間の繰り返し機能の追加","user":{"login":"koyamatakayuki","id":13817232,"avatar_url":"https://avatars.githubusercontent.com/u/13817232?v=3","gravatar_id":"","url":"https://api.github.com/users/koyamatakayuki","html_url":"https://github.com/koyamatakayuki","followers_url":"https://api.github.com/users/koyamatakayuki/followers","following_url":"https://api.github.com/users/koyamatakayuki/following{/other_user}","gists_url":"https://api.github.com/users/koyamatakayuki/gists{/gist_id}","starred_url":"https://api.github.com/users/koyamatakayuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koyamatakayuki/subscriptions","organizations_url":"https://api.github.com/users/koyamatakayuki/orgs","repos_url":"https://api.github.com/users/koyamatakayuki/repos","events_url":"https://api.github.com/users/koyamatakayuki/events{/privacy}","received_events_url":"https://api.github.com/users/koyamatakayuki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"koyamatakayuki","id":13817232,"avatar_url":"https://avatars.githubusercontent.com/u/13817232?v=3","gravatar_id":"","url":"https://api.github.com/users/koyamatakayuki","html_url":"https://github.com/koyamatakayuki","followers_url":"https://api.github.com/users/koyamatakayuki/followers","following_url":"https://api.github.com/users/koyamatakayuki/following{/other_user}","gists_url":"https://api.github.com/users/koyamatakayuki/gists{/gist_id}","starred_url":"https://api.github.com/users/koyamatakayuki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koyamatakayuki/subscriptions","organizations_url":"https://api.github.com/users/koyamatakayuki/orgs","repos_url":"https://api.github.com/users/koyamatakayuki/repos","events_url":"https://api.github.com/users/koyamatakayuki/events{/privacy}","received_events_url":"https://api.github.com/users/koyamatakayuki/received_events","type":"User","site_admin":false},"milestone":null,"comments":21,"created_at":"2015-10-11T01:22:56Z","updated_at":"2015-12-10T04:16:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/enpitut/WakeUp/pulls/47","html_url":"https://github.com/enpitut/WakeUp/pull/47","diff_url":"https://github.com/enpitut/WakeUp/pull/47.diff","patch_url":"https://github.com/enpitut/WakeUp/pull/47.patch"},"body":"- [x] 作業時間、休憩時間、作業回数の入力箇所の作成\r\n- [x] 作業時間監視を行い、休憩時間分間隔を開けて作業回数分繰り返しを行う\r\n(11/22)追加\r\n- [x] 休憩時間時の表示の作成(notificateでいいかな・・・・"},"comment":{"url":"https://api.github.com/repos/enpitut/WakeUp/issues/comments/163483878","html_url":"https://github.com/enpitut/WakeUp/pull/47#issuecomment-163483878","issue_url":"https://api.github.com/repos/enpitut/WakeUp/issues/47","id":163483878,"user":{"login":"anqooqie","id":333517,"avatar_url":"https://avatars.githubusercontent.com/u/333517?v=3","gravatar_id":"","url":"https://api.github.com/users/anqooqie","html_url":"https://github.com/anqooqie","followers_url":"https://api.github.com/users/anqooqie/followers","following_url":"https://api.github.com/users/anqooqie/following{/other_user}","gists_url":"https://api.github.com/users/anqooqie/gists{/gist_id}","starred_url":"https://api.github.com/users/anqooqie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anqooqie/subscriptions","organizations_url":"https://api.github.com/users/anqooqie/orgs","repos_url":"https://api.github.com/users/anqooqie/repos","events_url":"https://api.github.com/users/anqooqie/events{/privacy}","received_events_url":"https://api.github.com/users/anqooqie/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T04:16:41Z","updated_at":"2015-12-10T04:16:41Z","body":"1.と2.が終わったので3.をしましょう\r\n要らないコードを整理したり入力チェックを増やしたりlabel要素のfor属性を修正したりしてます\r\n```diff\r\n--- chrome_extension/config.html\r\n+++ chrome_extension/config.html\r\n@@ -70,6 +70,9 @@\r\n             <li class=\"list-group-item\">\r\n                 <input type=\"checkbox\" id=\"show_register_ngsite_button_checkbox\">コンテキストメニューにNGサイト登録機能を表示する\r\n             </li>\r\n+            <li class=\"list-group-item\">\r\n+                <input type=\"checkbox\" id=\"show_loop_button_checkbox\">単純な繰り返し機能\r\n+            </li>\r\n             <li id=\"post_automatically_checkbox_group\" class=\"list-group-item\">\r\n                 <p>以下のとき確認ダイアログを出さずにツイートする</p>\r\n                 <div class=\"panel panel-default\">\r\n@@ -98,9 +101,6 @@\r\n                     <div class=\"panel-heading\">\r\n                         <input type=\"checkbox\" data-property=\"successed\">作業が見積もり時間内に完了したとき（<span class=\"show_tweet_example\">送信されるツイートの例</span>）\r\n                     </div>\r\n-                    <div class=\"panel-heading\">\r\n-                        <input type=\"checkbox\" data-property=\"\" id=\"show_loop_button_checkbox\">単純な繰り返し機能（<span class=\"show_tweet_example\">送信されるツイートの例</span>）\r\n-                    </div>\r\n                 </div>\r\n             </li>\r\n         </ul>\r\n--- chrome_extension/javascripts/config.js\r\n+++ chrome_extension/javascripts/config.js\r\n@@ -183,17 +183,11\r\n         }\r\n     });\r\n\r\n+    $(\"#show_loop_button_checkbox\").prop(\"checked\", loadConfig().showLoopButton);\r\n     $(\"#show_loop_button_checkbox\").change(function () {\r\n-        if ($(this).is(\":checked\")) {\r\n-            modifyConfig(config=>{\r\n-                    config.showLoopButton = true;\r\n-                });\r\n-            $(\"#loop\").css(\"display\",\"block\");\r\n-        } else {\r\n-            modifyConfig(config=>{\r\n-                config.showLoopButton = false;\r\n-                });\r\n-            $(\"#loop\").css(\"display\",\"none\");\r\n-        }\r\n+        let newValue = $(this).is(\":checked\");\r\n+        modifyConfig(config => {\r\n+            config.showLoopButton = newValue;\r\n+        });\r\n     });\r\n });\r\n--- chrome_extension/javascripts/popup.js\r\n+++ chrome_extension/javascripts/popup.js\r\n@@ -62,10 +62,12 @@\r\n     });\r\n\r\n     $(\"#loop_button\").click(() => {\r\n-        let restTime = Number($(\"#rest_loop_time_text\").val()) * 60;\r\n-        let taskTime = Number($(\"#task_loop_time_text\").val()) * 60;\r\n-        let loopCount = Number($(\"#loop_time_text\").val());\r\n+        let restTime = Math.floor(Number($(\"#rest_loop_time_text\").val()) * 60);\r\n+        let taskTime = Math.floor(Number($(\"#task_loop_time_text\").val()) * 60);\r\n+        let loopCount = Math.floor(Number($(\"#loop_time_text\").val()));\r\n+        if (isNaN(restTime) || restTime < 0) return false;\r\n         if(isNaN(taskTime) || taskTime < 0) return false;\r\n+        if (isNaN(loopCount) || loopCount < 0) return false;\r\n         bg.loopTimer(taskTime,restTime,loopCount,isEmptyDescription ? \"\" : $(\"#task_loop_description_text\").val());\r\n         refreshPageContent();\r\n     });\r\n--- chrome_extension/popup.html\r\n+++ chrome_extension/popup.html\r\n@@ -35,15 +35,15 @@\r\n                     </div>\r\n                     <input type=\"button\" value=\"開始\" id=\"start_button\" class=\"btn btn-success btn-block\">\r\n                                        </div>\r\n-                               <div id=\"loop\" class=\"form-group\">\r\n-                                           <label for=\"task_loop_description_text\" class=\"control-label\">所要時間(分)</label>\r\n-                                           <input type=\"text\" value=\"10\" class=\"form-control input-sm\" id=\"task_loop_time_text\" size=\"3\">\r\n-                                           <label for=\"task_description_text\" class=\"control-label\">作業名</label>\r\n+                               <div class=\"form-group\">\r\n+                                           <label for=\"task_loop_time_text\" class=\"control-label\">所要時間(分)</label>\r\n+                                           <input type=\"text\" value=\"10\" class=\"form-control input-sm\" id=\"task_loop_time_text\">\r\n+                                           <label for=\"task_loop_description_text\" class=\"control-label\">作業名</label>\r\n                                            <input type=\"text\" id=\"task_loop_description_text\" class=\"form-control input-sm\">\r\n-                                           <label for=\"task_loop_timen_text\" class=\"control-label\">休憩時間(分)</label>\r\n-                                           <input type=\"text\" value=\"10\" class=\"form-control input-sm\" id=\"rest_loop_time_text\" size=\"3\">\r\n+                                           <label for=\"rest_loop_time_text\" class=\"control-label\">休憩時間(分)</label>\r\n+                                           <input type=\"text\" value=\"10\" class=\"form-control input-sm\" id=\"rest_loop_time_text\">\r\n                                            <label for=\"loop_time_text\" class=\"control-label\">試行回数</label>\r\n-                                           <input type=\"text\" value=\"10\" class=\"form-control input-sm\" id=\"loop_time_text\" size=\"3\">\r\n+                                           <input type=\"text\" value=\"10\" class=\"form-control input-sm\" id=\"loop_time_text\">\r\n                                            <input type=\"button\" value=\"ループ\" id=\"loop_button\" class=\"btn btn-success btn-block\">\r\n                     </div>\r\n                 </form>\r\n```\r\n"}}