Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Saurabh110 committed Mar 7, 2021
2 parents cfc54c3 + 6a7042a commit f6c084e
Show file tree
Hide file tree
Showing 209 changed files with 2,047 additions and 1,001 deletions.
46 changes: 0 additions & 46 deletions .mention-bot

This file was deleted.

2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ gem 'capistrano-rvm'
gem 'chartjs-ror'
gem 'coffee-rails'
gem 'coveralls', require: false
gem 'danger', git: 'https://github.com/Winbobob/danger.git', ref: '6df469a', require: false
gem 'danger', git: 'https://github.com/Winbobob/danger.git', ref: '1ccfed23f809a1e5c46e2533cfd7a3138f6cd821', require: false
gem 'delayed_job_active_record'
gem 'dynamic_form'
gem 'edavis10-ruby-web-search'
Expand Down
21 changes: 12 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/Winbobob/danger.git
revision: 6df469a1c1359ea06ce7ba7eccd4a0ad73a9efdb
ref: 6df469a
revision: 1ccfed23f809a1e5c46e2533cfd7a3138f6cd821
ref: 1ccfed23f809a1e5c46e2533cfd7a3138f6cd821
specs:
danger (5.8.0)
danger (5.16.1)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
Expand Down Expand Up @@ -125,7 +125,7 @@ GEM
rails (>= 3.1)
childprocess (0.8.0)
ffi (~> 1.0, >= 1.0.11)
claide (1.0.2)
claide (1.0.3)
claide-plugins (0.9.2)
cork
nap
Expand Down Expand Up @@ -194,7 +194,8 @@ GEM
gchartrb (0.8)
gdata (1.1.2)
gherkin (5.0.0)
git (1.5.0)
git (1.7.0)
rchardet (~> 1.8)
globalid (0.4.2)
activesupport (>= 4.2.0)
googlecharts (1.6.12)
Expand Down Expand Up @@ -326,7 +327,8 @@ GEM
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
octokit (4.13.0)
octokit (4.19.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
omniauth (1.8.1)
hashie (>= 3.4.6, < 3.6.0)
Expand Down Expand Up @@ -403,6 +405,7 @@ GEM
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rb-readline (0.5.5)
rchardet (1.8.0)
react-rails (1.11.0)
babel-transpiler (>= 0.7.0)
connection_pool
Expand Down Expand Up @@ -487,9 +490,9 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
scrypt (2.1.1)
ffi-compiler (>= 0.0.2)
rake
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ Contributing
------------

* [Fork](http://help.github.com/fork-a-repo/) the expertiza project
* [Create a new branch](http://progit.org/book) for your contribution with a descriptive name
* [Commit and push](http://progit.org/book) until you are happy with your contribution - follow the style guidelines below
* [Create a new branch](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/creating-and-deleting-branches-within-your-repository) for your contribution with a descriptive name
* Commit and push until you are happy with your contribution - follow the style guidelines below
* Make sure to add tests for it; the tests should fail before your contribution/fix and pass afterward
* [Send a pull request](http://help.github.com/send-pull-requests) to have your code reviewed for merging back into Expertiza
* [Send a pull request](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-pull-requests) to have your code reviewed for merging back into Expertiza

Style Guidelines
----------------
Expand Down
4 changes: 4 additions & 0 deletions app/assets/javascripts/answer_tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ toggleLabel = function(range) {
var element_id = range.id.replace("tag_prompt_","")
var no_text_id = "no_text_" + element_id
var yes_text_id = "yes_text_" + element_id
// Changing the value of particular tags dynamically
if (val < 0) {
$('#' + no_text_id).attr('class', 'toggle-false-msg textActive');
$('#' + yes_text_id).attr('class', 'toggle-true-msg');
$('#' + range.id).attr('value', '-1');
} else if (val == 0) {
$('#' + no_text_id).attr('class', 'toggle-false-msg');
$('#' + yes_text_id).attr('class', 'toggle-true-msg');
$('#' + range.id).attr('value', '0');
} else if (val > 0) {
$('#' + no_text_id).attr('class', 'toggle-false-msg');
$('#' + yes_text_id).attr('class', 'toggle-true-msg textActive');
$('#' + range.id).attr('value', '1');
}
}
76 changes: 76 additions & 0 deletions app/assets/javascripts/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,79 @@
* To be moved back here once the javascripts can be loaded to seperate pages, instead of globaly
**/

var vis = (function(){
var stateKey, eventKey, keys = {
hidden: "visibilitychange",
webkitHidden: "webkitvisibilitychange",
mozHidden: "mozvisibilitychange",
msHidden: "msvisibilitychange"
};
for (stateKey in keys) {
if (stateKey in document) {
eventKey = keys[stateKey];
break;
}
}
return function(c) {
if (c) document.addEventListener(eventKey, c);
return !document[stateKey];
}
})();

// AUTO SAVE: triggers every 60 seconds to save the draft version of the review
var interval = 60000
var last_save = new Date()
var autoSavePost = function() {
//if it's was in the background, don't auto save to reduce bandwidth
var autosave_cbx = document.getElementById("autosave_cbx");
if(autosave_cbx){
if(vis() && document.getElementById("autosave_cbx").checked) {
executeSave();
}
setTimeout(autoSavePost, interval);
}
};

function executeSave(){
diff = (new Date().getTime() - last_save.getTime())/1000;
// ignore saving unless the last save was more than 5s
if (diff>5 && $('.review_form').length > 0) {
$('form').attr('data-remote', 'true');
document.getElementById('save_review').click();
last_save = new Date;
if ($('input[name=saved]').value = "0")$('input[name=saved]').val("1");
$('form').removeAttr('data-remote');
}
$('#save_progress').html('<span id="tick"> &#10004; </span>' + 'Draft was saved at ' + last_save.toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: true }));
}

jQuery(document).ready(function(){
// workaround because all script are loaded in every pages now. need to clean it up
if (document.title.indexOf("response") > -1){
// start saving review every interval of time
setTimeout(autoSavePost, interval);
autosave_lbl = document.getElementById("autosave_cbx_lbl")
if (autosave_lbl)
autosave_lbl.innerHTML = "&nbsp;Auto save your respond every " + interval / 1000 + " seconds?&nbsp;&nbsp;"
vis(function () {
// save review when the window is sent to background
if (!vis()) {
executeSave();
}
});
}
});
// END AUTO SAVE

// add star rating option to each dropdown box in review form
jQuery(document).ready(function($){
$('.review-rating').each(function(index, el) {
var $El;
$El = $(el);
$El.barrating({
theme: 'fontawesome-stars',
initialRating: $El.attr('data-current-rating'),
showSelectedRating: true
});
});
});
Loading

0 comments on commit f6c084e

Please sign in to comment.