From 8fdacb7e346ba71ca7b244035afe4c194ff53997 Mon Sep 17 00:00:00 2001 From: bugron Date: Tue, 1 Sep 2015 07:18:44 +0400 Subject: [PATCH 1/4] This commit extends 'Bug' button's functionality --- client/main.js | 14 +++++++++++++- server/views/partials/challenge-modals.jade | 11 +++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/client/main.js b/client/main.js index 8a72664bbf7..a74e8d1c94b 100644 --- a/client/main.js +++ b/client/main.js @@ -66,10 +66,22 @@ $(document).ready(function() { }, 200); }); + $('#search-issue').unbind('click'); + $('#search-issue').on('click', function() { + var queryIssue = window.location.href.toString(); + $('#issue-modal').modal('hide'); + window.open('https://github.com/FreeCodeCamp/FreeCodeCamp/issues?q=is:issue is:all '+ queryIssue.substr(queryIssue.lastIndexOf('challenges/') + 11).replace('/', ''), '_blank'); + }); + $('#report-issue').unbind('click'); $('#report-issue').on('click', function() { + var textMessage = 'https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge ' + window.location.href + ' has an issue. Please describe how to reproduce it, and include links to screenshots if possible.'; + if($('#user-agent-checkbox').is(':checked')) { + textMessage += ' My User Agent is: ' + navigator.userAgent + ''; + textMessage = textMessage.replace(';', ','); //GitHub cuts User Agent text because of ';' symbol so I just replace it with ',' + } $('#issue-modal').modal('hide'); - window.open('https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge '+ window.location.href +' has an issue. Please describe how to reproduce it, and include links to screenshots if possible.', '_blank') + window.open(textMessage, '_blank'); }); $('#completed-courseware').unbind('click'); diff --git a/server/views/partials/challenge-modals.jade b/server/views/partials/challenge-modals.jade index 21244c383d8..c4b509d3fca 100644 --- a/server/views/partials/challenge-modals.jade +++ b/server/views/partials/challenge-modals.jade @@ -20,6 +20,17 @@ .modal-body.text-center h3 This will open our GitHub Issues page. h3 Please tell us how to reproduce the bug and link us to screenshots if possible. + h4.row + .col-xs-1.col-sm-1.col-md-1 + input#user-agent-checkbox(type='checkbox') + .col-xs-11.col-sm-11.col-md-11 + label.text-warning.bg-info(for='user-agent-checkbox' style='cursor:pointer;') Include your OS and Browser version in the text of issue to provide more detailed information + h3 It's recommended first to search issues in GitHub. It could be a similar issue opened or already solved! + h3 + | Also take a look at this helpful Wiki article: + br + a(href='https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Help-I%27ve-Found-a-Bug', target='_blank') Help I've Found a Bug + a.btn.btn-lg.btn-success.btn-block#search-issue(name='_csrf', value=_csrf) Search issues on this challenge in GitHub a.btn.btn-lg.btn-primary.btn-block#report-issue(name='_csrf', value=_csrf) Create my GitHub issue a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel From 887722d5c8c079c1edfef70eb76a7fd2dd8946b6 Mon Sep 17 00:00:00 2001 From: bugron Date: Tue, 1 Sep 2015 17:13:16 +0400 Subject: [PATCH 2/4] checkbox is now checked by default --- server/views/partials/challenge-modals.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/views/partials/challenge-modals.jade b/server/views/partials/challenge-modals.jade index c4b509d3fca..43a102f7048 100644 --- a/server/views/partials/challenge-modals.jade +++ b/server/views/partials/challenge-modals.jade @@ -22,7 +22,7 @@ h3 Please tell us how to reproduce the bug and link us to screenshots if possible. h4.row .col-xs-1.col-sm-1.col-md-1 - input#user-agent-checkbox(type='checkbox') + input#user-agent-checkbox(type='checkbox', checked) .col-xs-11.col-sm-11.col-md-11 label.text-warning.bg-info(for='user-agent-checkbox' style='cursor:pointer;') Include your OS and Browser version in the text of issue to provide more detailed information h3 It's recommended first to search issues in GitHub. It could be a similar issue opened or already solved! From 46a83b42a1ea5646af2b3300bb353da8350feadb Mon Sep 17 00:00:00 2001 From: bugron Date: Sun, 6 Sep 2015 11:40:06 +0400 Subject: [PATCH 3/4] removes the checkbox at all --- client/main.js | 6 ++---- server/views/partials/challenge-modals.jade | 5 ----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/client/main.js b/client/main.js index a74e8d1c94b..30110eb97e8 100644 --- a/client/main.js +++ b/client/main.js @@ -76,10 +76,8 @@ $(document).ready(function() { $('#report-issue').unbind('click'); $('#report-issue').on('click', function() { var textMessage = 'https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge ' + window.location.href + ' has an issue. Please describe how to reproduce it, and include links to screenshots if possible.'; - if($('#user-agent-checkbox').is(':checked')) { - textMessage += ' My User Agent is: ' + navigator.userAgent + ''; - textMessage = textMessage.replace(';', ','); //GitHub cuts User Agent text because of ';' symbol so I just replace it with ',' - } + textMessage += ' My User Agent is: ' + navigator.userAgent + '.'; + textMessage = textMessage.replace(';', ','); //GitHub cuts User Agent text because of ';' symbol so I just replace it with ',' $('#issue-modal').modal('hide'); window.open(textMessage, '_blank'); }); diff --git a/server/views/partials/challenge-modals.jade b/server/views/partials/challenge-modals.jade index 43a102f7048..b703581a3cd 100644 --- a/server/views/partials/challenge-modals.jade +++ b/server/views/partials/challenge-modals.jade @@ -20,11 +20,6 @@ .modal-body.text-center h3 This will open our GitHub Issues page. h3 Please tell us how to reproduce the bug and link us to screenshots if possible. - h4.row - .col-xs-1.col-sm-1.col-md-1 - input#user-agent-checkbox(type='checkbox', checked) - .col-xs-11.col-sm-11.col-md-11 - label.text-warning.bg-info(for='user-agent-checkbox' style='cursor:pointer;') Include your OS and Browser version in the text of issue to provide more detailed information h3 It's recommended first to search issues in GitHub. It could be a similar issue opened or already solved! h3 | Also take a look at this helpful Wiki article: From c2468b4946afa968b03509cb606fe59ae1a175eb Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Mon, 7 Sep 2015 07:54:29 -0700 Subject: [PATCH 4/4] Tweak @bugron's improvements to our issue submission process --- client/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/main.js b/client/main.js index 30110eb97e8..8dcc2a19db4 100644 --- a/client/main.js +++ b/client/main.js @@ -69,14 +69,14 @@ $(document).ready(function() { $('#search-issue').unbind('click'); $('#search-issue').on('click', function() { var queryIssue = window.location.href.toString(); - $('#issue-modal').modal('hide'); window.open('https://github.com/FreeCodeCamp/FreeCodeCamp/issues?q=is:issue is:all '+ queryIssue.substr(queryIssue.lastIndexOf('challenges/') + 11).replace('/', ''), '_blank'); }); $('#report-issue').unbind('click'); $('#report-issue').on('click', function() { - var textMessage = 'https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge ' + window.location.href + ' has an issue. Please describe how to reproduce it, and include links to screenshots if possible.'; - textMessage += ' My User Agent is: ' + navigator.userAgent + '.'; + var textMessage = 'https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge ' + window.location.href + ' has an issue.'; + textMessage += ' User Agent is: ' + navigator.userAgent + '.'; + textMessage += ' Please describe how to reproduce this issue, and include links to screenshots if possible.%0A%0A'; textMessage = textMessage.replace(';', ','); //GitHub cuts User Agent text because of ';' symbol so I just replace it with ',' $('#issue-modal').modal('hide'); window.open(textMessage, '_blank');