Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ gem 'coffee-rails'
gem 'coffee-rails-source-maps'
gem 'uglifier'
gem 'jquery-rails' # needed for general jQuery stuff
gem 'jquery-ui-rails' # needed specifically for drag-and-drop ability
gem 'jquery-ui-rails', git: 'https://github.com/kylesferrazza/jquery-ui-rails' # needed specifically for drag-and-drop ability
gem 'jquery-tablesorter' # needed to allow re-sortable tables
gem 'cocoon' # used for dynamically generating nested forms

Expand Down
13 changes: 9 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
GIT
remote: https://github.com/kylesferrazza/jquery-ui-rails
revision: cde4160b2148e96ddf03ea16f40aeadcc96759d6
specs:
jquery-ui-rails (6.1.0)
railties (>= 3.2.16)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -139,8 +146,6 @@ GEM
thor (>= 0.14, < 2.0)
jquery-tablesorter (1.27.1)
railties (>= 3.2)
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
json (2.2.0)
kramdown (2.1.0)
kramdown-parser-gfm (1.1.0)
Expand Down Expand Up @@ -324,7 +329,7 @@ DEPENDENCIES
i18n
jquery-rails
jquery-tablesorter
jquery-ui-rails
jquery-ui-rails!
kramdown
kramdown-parser-gfm
launchy
Expand Down Expand Up @@ -354,4 +359,4 @@ DEPENDENCIES
yaml_db

BUNDLED WITH
2.0.1
2.1.4
10 changes: 5 additions & 5 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery3
//= require jquery-ui/widgets/draggable
//= require jquery-ui/widgets/resizable
//= require jquery-ui/widgets/sortable
Expand Down Expand Up @@ -47,7 +47,7 @@


function enableShowUsernames(elts) {
$(elts).click(function(){
$(elts).on("click", function(){
$(this).toggleClass("active");
$("#" + $(this).data("target")).toggleClass("showusernames");
});
Expand Down Expand Up @@ -179,7 +179,7 @@ function activate_file_picker($e) {
$e.find(".remove-custom-file").prop('disabled', false).removeClass("btn-default").addClass("btn-warning");
$e.find("input.remove-custom-file").val('');
});
$e.find(".remove-custom-file").click(function() {
$e.find(".remove-custom-file").on("click", function() {
$e.find("input.custom-file").replaceWith(
$e.find("input.custom-file").clone(true));
$(this).prop('disabled', true).addClass("btn-default").removeClass("btn-warning");
Expand Down Expand Up @@ -291,7 +291,7 @@ function activateSpinner(obj, options) {
input.prop("disabled", false);
validate();
});
input.bind("paste", function(e) { e.preventDefault(); });
input.on("paste", function(e) { e.preventDefault(); });

$(upArrow).on('mousedown', function() {
if (input.prop("disabled")) return;
Expand Down Expand Up @@ -323,7 +323,7 @@ function makeSpinner(options) {
var input = $("<input>")
.addClass("form-control numeric")
.val(options.val || 0)
.bind("paste", function(e) { e.preventDefault(); });
.on("paste", function(e) { e.preventDefault(); });
if (options.klass !== undefined)
input.addClass(options.klass);
if (options.max !== undefined) input.data("max", options.max);
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/assignments.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
}
});

$("form").submit(function(e) {
$("form").on("submit", function(e) {
var graderTypeInputs =
$("li.grader").filter(function(index) {
return $(this).find("input[id^='assignment_graders_'][id$='_destroy'][value='1']").length == 0;
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/courses.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
function init() {
enableReflectiveCalls();
$("span.findUser").each(function(i) { enableLookupUser($(this)); });
$(".add-section-button").click(add_section);
$(".add-section-button").on("click", add_section);
$("input.numeric").on("keypress", validateNumericInput);

$('#sections').on('cocoon:after-insert', on_add_section);
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/grades.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function() {
function initFiles() {
$(".symlink-jump").click(function(e) {
$(".symlink-jump").on("click", function(e) {
e.preventDefault();
e.stopPropagation();
selectTreeviewFileByHref($(this).data("root"), $(this).attr("href"));
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/jquery.matchHeight.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@
$(matchHeight._applyDataApi);

// update heights on load and resize events
$(window).bind('load', function(event) {
$(window).on('load', function(event) {
matchHeight._update(false, event);
});

// throttled update heights on resize events
$(window).bind('resize orientationchange', function(event) {
$(window).on('resize orientationchange', function(event) {
matchHeight._update(true, event);
});

Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/submissions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function() {
function initFiles() {
$(".symlink-jump").click(function(e) {
$(".symlink-jump").on("click", function(e) {
e.preventDefault();
e.stopPropagation();
selectTreeviewFileByHref($(this).data("root"), $(this).attr("href"));
Expand Down
2 changes: 1 addition & 1 deletion app/views/assignments/_codereview_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
}
})
$("#type-codereview").find("input[name$='[review_count]']").prop("disabled", <%= asgn&.graders&.first&.review_target != "peer" %>);
$("form").submit(function() {
$("form").on("submit", function() {
enableSpinner($("#type-codereview").find("input[name$='[review_count]']"));
});
</script>
2 changes: 1 addition & 1 deletion app/views/assignments/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
</div>
</div>
<script>
$(function() { $("a[href='#type-<%= @assignment.type.downcase %>']").click(); });
$(function() { $("a[href='#type-<%= @assignment.type.downcase %>']").trigger("click"); });
</script>
</div>
2 changes: 1 addition & 1 deletion app/views/assignments/_index.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $(function() {
var assnNames = $("#assignments-table tbody td:first-child").map(function() { return $(this).text(); }).get();
var routeToSub = "<%= course_assignment_submission_path(course_id: @course.id, assignment_id: '(aid)', id: '(sid)') %>";
GoogleCharts.load('corechart', function() {
$("#students-table tbody tr").click(function(e) {
$("#students-table tbody tr").on("click", function(e) {
var $p = $(this).find("p");
if ($(e.target).closest("p")[0] != $p[0]) { $p.toggleClass("hidden"); }
var grades = $p.data("grades");
Expand Down
2 changes: 1 addition & 1 deletion app/views/assignments/edit_weights.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ $(function() {
}
weights.blur(refresh);
refresh();
$("form").submit(ensureValidNumericInputOnSubmit);
$("form").on("submit", ensureValidNumericInputOnSubmit);
});
</script>

Expand Down
6 changes: 3 additions & 3 deletions app/views/grades/_edit_exam_grades.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function getGrades($table) {
});

// Handle the modal dialogs
$("#grades-table button.trigger").click(function() {
$("#grades-table button.trigger").on("click", function() {
var $target = $("#enter_grades");
var $row = $(this).closest("tr");
var name = $(this).data("name");
Expand All @@ -123,7 +123,7 @@ function getGrades($table) {
$("button.trigger").prop("disabled", false);
$("#" + $(this).data("row") + " button.trigger").focus();
});
$("button.save").click(function() {
$("button.save").on("click", function() {
var $modal = $(this).closest("div.modal");
var $row = $("#" + $modal.data("row"));
var countBlanks = 0;
Expand Down Expand Up @@ -164,7 +164,7 @@ function getGrades($table) {
}
});
});
$("button.cancel").click(function() {
$("button.cancel").on("click", function() {
$(this).closest("div.modal").modal("hide");
});
$('.spinner').each(function() {
Expand Down
2 changes: 1 addition & 1 deletion app/views/grades/_enter_comments.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ $(function() {
}
window.updateScore = updateScore;

$("form").submit(function(e) {
$("form").on("submit", function(e) {
if (autosavePromise) {
e.preventDefault();
alert("Please wait for autosave to complete");
Expand Down
4 changes: 2 additions & 2 deletions app/views/grades/edit_CodereviewGrader.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@
<div class="col-sm-6 text-center">
<%= f.submit "Submit grade", id: "completed", class: "btn btn-success" %>
<script>
$(".navbar-header a").click(function(e) {
$(".navbar-header a").on("click", function(e) {
window.scrollTo(0, $($(this).attr("href"))[0].offsetTop);
e.stopPropagation();
e.preventDefault();
});
$("form").submit(ensureValidNumericInputOnSubmit);
$("form").on("submit", ensureValidNumericInputOnSubmit);
</script>
</div>
<% end %><%# form-for %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/grades/edit_ManualGrader.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
}
}
);
$("form").submit(ensureValidNumericInputOnSubmit);
$("form").on("submit", ensureValidNumericInputOnSubmit);
});
</script>

Expand Down
2 changes: 1 addition & 1 deletion app/views/grades/edit_QuestionsGrader.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<span class="col-sm-12 text-center">
<%= f.submit "Submit grade", id: "completed", class: "btn btn-success" %>
</span>
<script>$("form").submit(ensureValidNumericInputOnSubmit);</script>
<script>$("form").on("submit", ensureValidNumericInputOnSubmit);</script>
</div>
<% end %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/grades/edit_exam_grades.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</div>
<script>
$(".file-picker").each(function(index) { activate_file_picker($(this)); });
$("#bulk-entry form").submit(function() {
$("#bulk-entry form").on("submit", function() {
if ($("input[type='file']")[0].files.length == 0) {
alert("No grades file selected");
return false;
Expand Down
2 changes: 1 addition & 1 deletion app/views/grades/edit_tap_comment_grades.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</div>
<script>
$(".file-picker").each(function(index) { activate_file_picker($(this)); });
$("#bulk-entry form").submit(function() {
$("#bulk-entry form").on("submit", function() {
if ($("input[type='file']")[0].files.length == 0) {
alert("No grades file selected");
return false;
Expand Down
4 changes: 2 additions & 2 deletions app/views/individual_extensions/_edit.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $(function() {
$("#sucess_" + $form.find("input[name='id']").val()).addClass("hidden");
});
});
$(".submit").click(function(e) {
$(".submit").on("click", function(e) {
e.preventDefault();
var $submit = $(this);
var $row = $submit.closest("tr");
Expand Down Expand Up @@ -46,7 +46,7 @@ $(function() {
.tooltip('fixTitle');
});
});
$(".revoke").click(function(e) {
$(".revoke").on("click", function(e) {
e.preventDefault();
var $revoke = $(this);
var $row = $revoke.closest("tr");
Expand Down
2 changes: 1 addition & 1 deletion app/views/registrations/bulk_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</table>
<% end %>
<script>
$("form").submit(function() {
$("form").on("submit", function() {
var $form = $(this);
var $success = $("#" + $form.attr("id").replace('reg', 'success'));
var $failure = $("#" + $form.attr("id").replace('reg', 'failure'));
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/_codereview_details.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<% end %><%# @submission_info.each %>

<script>
$(".navbar-header a").click(function(e) {
$(".navbar-header a").on("click", function(e) {
window.scrollTo(0, $($(this).attr("href"))[0].offsetTop);
e.stopPropagation();
e.preventDefault();
Expand Down
4 changes: 2 additions & 2 deletions app/views/submissions/_comment_edit_widgets.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,15 @@ $(function() {
this.areaComment = $("<div>").lineCommentView(this.options.commentEditor);
var $expand = $("<span>").addClass("btn btn-alert pull-right").css({padding: "3px"})
.append($("<span>").addClass("glyphicon glyphicon-edit"))
.click((e) => {
.on("click", (e) => {
page = $expand.closest(".page")[0];
this.element.toggleClass("expanded");
this.positionEditWidget();
e.stopImmediatePropagation();
return false;
});
this.element.append($expand)
.click((e) => e.stopPropagation())
.on("click", (e) => e.stopPropagation())
.mousedown((e) => e.stopPropagation());
},
_stopResizing: function(e, ui) {
Expand Down
4 changes: 2 additions & 2 deletions app/views/submissions/_new_questions.js.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(function() {
$('button.btn.answer').click(function() {
$('button.btn.answer').on("click", function() {
$('button.btn.answer[data-id="'+$(this).data('id')+'"]').removeClass('active');
$(this).addClass('active');
$('input#'+$(this).data('id')).val($(this).text());
Expand Down Expand Up @@ -103,7 +103,7 @@ $(function() {
$(this).next("input").prop('disabled', true).removeClass("unanswered").removeClass("badAnswer");
});

$("form").submit(function(e) {
$("form").on("submit", function(e) {
try {
var unansweredInputs = [];
function findUnanswered(cur) {
Expand Down
8 changes: 4 additions & 4 deletions app/views/submissions/_render_pdfs.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ $(function() {
////////////////////////////////////////
//////////////////// Zooming
////////////////////////////////////////
$div.find("#zoomOut").click(function(e) {
$div.find("#zoomOut").on("click", function(e) {
var $scale = $div.find("#scaleSelect");
var $options = $scale.find("option");
var newIndex = Math.max($scale[0].selectedIndex - 1, 0);
$scale.val($options[newIndex].value).change();
e.stopImmediatePropagation();
return false;
});
$div.find("#zoomIn").click(function(e) {
$div.find("#zoomIn").on("click", function(e) {
var $scale = $div.find("#scaleSelect");
var $options = $scale.find("option");
var newIndex = Math.min($scale[0].selectedIndex + 1, $options.length - 1);
Expand All @@ -196,11 +196,11 @@ $(function() {
//////////////////// Downloading
////////////////////////////////////////
var clickingDownload = false;
$div.find("#new_window").click(function(e) {
$div.find("#new_window").on("click", function(e) {
window.open(encodePath($div.data("source")), "_blank");
e.stopPropagation();
});
$div.find("#download").click(function(e) {
$div.find("#download").on("click", function(e) {
// console.log("Clicking on button");
var dm = new pdfjsViewer.DownloadManager({});
dm.downloadUrl(encodePath($div.data("source")), $div.data("alt"));
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/_render_questions.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $(function() {
prevLine[href] = line;
}
}
$('[data-show-file]').click(function(d) {
$('[data-show-file]').on("click", function(d) {
var args = $(this).data('showFile');
showFile(args[0], args[1]);
});
Expand Down
4 changes: 2 additions & 2 deletions app/views/submissions/new_codereview.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
<% end %><%# form-for %>
<script>
<%= render partial: "new_questions.js", locals: {count: @count.to_i} %>
$(".navbar-header a").click(function(e) {
$(".navbar-header a").on("click", function(e) {
window.scrollTo(0, $($(this).attr("href"))[0].offsetTop);
e.stopPropagation();
e.preventDefault();
Expand All @@ -179,7 +179,7 @@
warning.find("p").removeClass("hidden");
warning.find("h3").removeClass("hidden");
}, Math.max(deadline - now, 0));
$("form").submit(function(e) {
$("form").on("submit", function(e) {
return ensureValidNumericInputOnSubmit(e, "input.numeric:not([disabled])");
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/new_files.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
$("#archive-warning").addClass("hidden");
}
});
$("form").submit(function(e) {
$("form").on("submit", function(e) {
var num = ensureValidNumericInputOnSubmit(e, "span.spinner > input");
var files = ensureFilesPresentOnSubmit(e);
return num && files;
Expand Down
Loading