From 22f729ba0074d5ca323d3a726822155a05539c68 Mon Sep 17 00:00:00 2001 From: taxus13 Date: Tue, 9 Jun 2015 22:06:57 +0200 Subject: Support range selection on history page Support range selection on history page by adding jquery.checkboxes --- public_html/data/js/main.js | 4 +++- public_html/data/js/vendor/jquery.checkboxes-1.0.6.min.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 public_html/data/js/vendor/jquery.checkboxes-1.0.6.min.js (limited to 'public_html') diff --git a/public_html/data/js/main.js b/public_html/data/js/main.js index 5710dcb68..3ba5c5c76 100644 --- a/public_html/data/js/main.js +++ b/public_html/data/js/main.js @@ -6,7 +6,8 @@ requirejs.config({ 'bootstrap': ['jquery'], 'jquery.tablesorter': ['jquery'], 'jquery.lazyload': ['jquery'], - 'jquery.colorbox': ['jquery'] + 'jquery.colorbox': ['jquery'], + 'jquery.checkboxes': ['jquery'] }, paths: { 'jquery': 'vendor/jquery-2.0.3.min', @@ -15,6 +16,7 @@ requirejs.config({ 'jquery.tablesorter': 'vendor/jquery.tablesorter.min', 'jquery.lazyload': 'vendor/jquery.lazyload', 'jquery.colorbox': 'vendor/jquery.colorbox', + 'jquery.checkboxes': 'vendor/jquery.checkboxes-1.0.6.min.js', 'underscore': 'vendor/underscore' } }); diff --git a/public_html/data/js/vendor/jquery.checkboxes-1.0.6.min.js b/public_html/data/js/vendor/jquery.checkboxes-1.0.6.min.js new file mode 100644 index 000000000..b8ab064ff --- /dev/null +++ b/public_html/data/js/vendor/jquery.checkboxes-1.0.6.min.js @@ -0,0 +1 @@ +/*! checkboxes.js v1.0.6 | (c) 2013, 2014 Rubens Mariuzzo | http://github.com/rmariuzzo/checkboxes.js/LICENSE */"use strict";!function(a){var b=function(a){this.$context=a};b.prototype.check=function(){this.$context.find(":checkbox").filter(":not(:disabled)").prop("checked",!0)},b.prototype.uncheck=function(){this.$context.find(":checkbox").filter(":not(:disabled)").prop("checked",!1)},b.prototype.toggle=function(){this.$context.find(":checkbox").filter(":not(:disabled)").each(function(){var b=a(this);b.prop("checked",!b.is(":checked"))})},b.prototype.max=function(a){if(a>0){var b=this;this.$context.on("click.checkboxes.max",":checkbox",function(){b.$context.find(":checked").length===a?b.$context.find(":checkbox:not(:checked)").prop("disabled",!0):b.$context.find(":checkbox:not(:checked)").prop("disabled",!1)})}else this.$context.off("click.checkboxes")},b.prototype.range=function(b){if(b){var c=this;this.$context.on("click.checkboxes.range",":checkbox",function(b){var d=a(b.target);if(b.shiftKey&&c.$last){var e=c.$context.find(":checkbox"),f=e.index(c.$last),g=e.index(d),h=Math.min(f,g),i=Math.max(f,g)+1;e.slice(h,i).filter(":not(:disabled)").prop("checked",d.prop("checked"))}c.$last=d})}else this.$context.off("click.checkboxes.range")};var c=a.fn.checkboxes;a.fn.checkboxes=function(c){var d=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=a(this),f=e.data("checkboxes");f||e.data("checkboxes",f=new b(e,"object"==typeof c&&c)),"string"==typeof c&&f[c]&&f[c].apply(f,d)})},a.fn.checkboxes.Constructor=b,a.fn.checkboxes.noConflict=function(){return a.fn.checkboxes=c,this};var d=function(b){var c=a(b.target),d=c.attr("href"),e=a(c.data("context")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=c.data("action");e&&f&&(c.is(":checkbox")||b.preventDefault(),e.checkboxes(f))},e=function(){a("[data-toggle^=checkboxes]").each(function(){var b=a(this),c=b.data();delete c.toggle;for(var d in c)b.checkboxes(d,c[d])})};a(document).on("click.checkboxes.data-api","[data-toggle^=checkboxes]",d),a(document).on("ready.checkboxes.data-api",e)}(window.jQuery); \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 07cc0d00f670fd94d7aa0e23953d177036ded4e8 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 18 Jul 2015 19:27:20 +0200 Subject: Fix checkboxes.js - Incorrect path to .js file - Autoloading and the data-api don't work so load and run it explicitly Signed-off-by: Florian Pritz --- public_html/data/js/application.js | 8 +++++++- public_html/data/js/main.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'public_html') diff --git a/public_html/data/js/application.js b/public_html/data/js/application.js index 310362dd9..374ae56fe 100644 --- a/public_html/data/js/application.js +++ b/public_html/data/js/application.js @@ -11,7 +11,8 @@ define( 'tablesorter', 'jquery', 'jquery.lazyload', - 'bootstrap' + 'bootstrap', + 'jquery.checkboxes' ], function ( require, @@ -49,6 +50,11 @@ define( this.setupToggleSelectAllEvent(); this.setupLineWrapToggle(); this.setupLazyLoadingImages(); + this.setupTableRangeSelect(); + }, + + setupTableRangeSelect: function () { + $('#upload_history').checkboxes('range', true); }, setupLineHighlight: function () { diff --git a/public_html/data/js/main.js b/public_html/data/js/main.js index 3ba5c5c76..482981fc7 100644 --- a/public_html/data/js/main.js +++ b/public_html/data/js/main.js @@ -16,7 +16,7 @@ requirejs.config({ 'jquery.tablesorter': 'vendor/jquery.tablesorter.min', 'jquery.lazyload': 'vendor/jquery.lazyload', 'jquery.colorbox': 'vendor/jquery.colorbox', - 'jquery.checkboxes': 'vendor/jquery.checkboxes-1.0.6.min.js', + 'jquery.checkboxes': 'vendor/jquery.checkboxes-1.0.6.min', 'underscore': 'vendor/underscore' } }); -- cgit v1.2.3-24-g4f1b