[Python-apps-commits] r13881 - in packages/sabnzbdplus/trunk (6 files)

jcfp-guest at users.alioth.debian.org jcfp-guest at users.alioth.debian.org
Sat Jan 14 19:18:31 UTC 2017


    Date: Saturday, January 14, 2017 @ 19:18:30
  Author: jcfp-guest
Revision: 13881

missing-source, copyright: add entry for jq tablesort

Added:
  packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery-ui.min.js
  packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery.tablesort.min.js
  packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery.tablesort_0.0.11.js
Modified:
  packages/sabnzbdplus/trunk/debian/changelog
  packages/sabnzbdplus/trunk/debian/copyright
  packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/README

Modified: packages/sabnzbdplus/trunk/debian/changelog
===================================================================
--- packages/sabnzbdplus/trunk/debian/changelog	2017-01-14 18:54:14 UTC (rev 13880)
+++ packages/sabnzbdplus/trunk/debian/changelog	2017-01-14 19:18:30 UTC (rev 13881)
@@ -19,6 +19,11 @@
   * Lintian: remove unused override for convenience copy of jquery.js in
     wizard: file no longer installed.
   * README.Debian: refresh cherrypy rationale with current bugs/patches.
+  * Missing-sources:
+    + bump jquery and bootstrap versions in Config to match upstream.
+    + handle missing jquery-ui in Config by adding a symlink to its
+      equivalent in Glitter.
+    + add jquery tablesorter.
 
  -- JCF Ploemen (jcfp) <linux at jcf.pm>  Wed, 07 Dec 2016 10:58:24 +0000
 

Modified: packages/sabnzbdplus/trunk/debian/copyright
===================================================================
--- packages/sabnzbdplus/trunk/debian/copyright	2017-01-14 18:54:14 UTC (rev 13880)
+++ packages/sabnzbdplus/trunk/debian/copyright	2017-01-14 19:18:30 UTC (rev 13881)
@@ -262,6 +262,13 @@
 License: MIT
 
 
+* interfaces/Config/templates/staticcfg/js/jquery.tablesort.min.js
+* interfaces/Config/templates/staticcfg/js/src/jquery.tablesort_0.0.11.js
+	Copyright (C) 2012 Kyle Fox
+	Origin: https://github.com/kylefox/jquery-tablesort
+License: MIT
+
+
 * interfaces/Glitter/templates/static/javascripts/date.min.js
 	Copyright (C) 2015 by Gregory Wild-Smith <gregory at wild-smith.com>
 	Origin: https://github.com/abritinthebay/datejs

Modified: packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/README
===================================================================
--- packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/README	2017-01-14 18:54:14 UTC (rev 13880)
+++ packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/README	2017-01-14 19:18:30 UTC (rev 13881)
@@ -4,6 +4,12 @@
 # interfaces/Config/templates/staticcfg/js/jquery-3.1.1.min.js
 jQuery 3.1.1
 
+# interfaces/Config/templates/staticcfg/js/jquery-ui.min.js
+jquery-ui 1.12.1
+
+# interfaces/Config/templates/staticcfg/js/jquery.tablesort.min.js
+jquery.tablesort 0.0.11
+
 # interfaces/Config/templates/staticcfg/js/script.js
 bootstrap3-typeahead 3.1.0
 jquery.form.js 3.51.0-2014.06.20

Added: packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery-ui.min.js
===================================================================
--- packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery-ui.min.js	                        (rev 0)
+++ packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery-ui.min.js	2017-01-14 19:18:30 UTC (rev 13881)
@@ -0,0 +1 @@
+link ../../../../../Glitter/templates/static/javascripts/src/jquery-ui_1.12.1.js
\ No newline at end of file


Property changes on: packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery-ui.min.js
___________________________________________________________________
Added: svn:special
   + *

Added: packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery.tablesort.min.js
===================================================================
--- packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery.tablesort.min.js	                        (rev 0)
+++ packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery.tablesort.min.js	2017-01-14 19:18:30 UTC (rev 13881)
@@ -0,0 +1 @@
+link jquery.tablesort_0.0.11.js
\ No newline at end of file


Property changes on: packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery.tablesort.min.js
___________________________________________________________________
Added: svn:special
   + *

Added: packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery.tablesort_0.0.11.js
===================================================================
--- packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery.tablesort_0.0.11.js	                        (rev 0)
+++ packages/sabnzbdplus/trunk/missing-sources/interfaces/Config/templates/staticcfg/js/src/jquery.tablesort_0.0.11.js	2017-01-14 19:18:30 UTC (rev 13881)
@@ -0,0 +1,132 @@
+/*
+	A simple, lightweight jQuery plugin for creating sortable tables.
+	https://github.com/kylefox/jquery-tablesort
+	Version 0.0.11
+*/
+
+(function($) {
+	$.tablesort = function ($table, settings) {
+		var self = this;
+		this.$table = $table;
+		this.$thead = this.$table.find('thead');
+		this.settings = $.extend({}, $.tablesort.defaults, settings);
+		this.$sortCells = this.$thead.length > 0 ? this.$thead.find('th:not(.no-sort)') : this.$table.find('th:not(.no-sort)');
+		this.$sortCells.on('click.tablesort', function() {
+			self.sort($(this));
+		});
+		this.index = null;
+		this.$th = null;
+		this.direction = null;
+	};
+
+	$.tablesort.prototype = {
+
+		sort: function(th, direction) {
+			var start = new Date(),
+				self = this,
+				table = this.$table,
+				rowsContainer = table.find('tbody').length > 0 ? table.find('tbody') : table,
+				rows = rowsContainer.find('tr').has('td, th'),
+				cells = rows.find(':nth-child(' + (th.index() + 1) + ')').filter('td, th'),
+				sortBy = th.data().sortBy,
+				sortedMap = [];
+
+			var unsortedValues = cells.map(function(idx, cell) {
+				if (sortBy)
+					return (typeof sortBy === 'function') ? sortBy($(th), $(cell), self) : sortBy;
+				return ($(this).data().sortValue != null ? $(this).data().sortValue : $(this).text());
+			});
+			if (unsortedValues.length === 0) return;
+
+			//click on a different column
+			if (this.index !== th.index()) {
+				this.direction = 'asc';
+				this.index = th.index();
+			}
+			else if (direction !== 'asc' && direction !== 'desc')
+				this.direction = this.direction === 'asc' ? 'desc' : 'asc';
+			else
+				this.direction = direction;
+
+			direction = this.direction == 'asc' ? 1 : -1;
+
+			self.$table.trigger('tablesort:start', [self]);
+			self.log("Sorting by " + this.index + ' ' + this.direction);
+
+			// Try to force a browser redraw
+			self.$table.css("display");
+			// Run sorting asynchronously on a timeout to force browser redraw after
+			// `tablesort:start` callback. Also avoids locking up the browser too much.
+			setTimeout(function() {
+				self.$sortCells.removeClass(self.settings.asc + ' ' + self.settings.desc);
+				for (var i = 0, length = unsortedValues.length; i < length; i++)
+				{
+					sortedMap.push({
+						index: i,
+						cell: cells[i],
+						row: rows[i],
+						value: unsortedValues[i]
+					});
+				}
+
+				sortedMap.sort(function(a, b) {
+					return self.settings.compare(a.value, b.value) * direction;
+				});
+
+				$.each(sortedMap, function(i, entry) {
+					rowsContainer.append(entry.row);
+				});
+
+				th.addClass(self.settings[self.direction]);
+
+				self.log('Sort finished in ' + ((new Date()).getTime() - start.getTime()) + 'ms');
+				self.$table.trigger('tablesort:complete', [self]);
+				//Try to force a browser redraw
+				self.$table.css("display");
+			}, unsortedValues.length > 2000 ? 200 : 10);
+		},
+
+		log: function(msg) {
+			if(($.tablesort.DEBUG || this.settings.debug) && console && console.log) {
+				console.log('[tablesort] ' + msg);
+			}
+		},
+
+		destroy: function() {
+			this.$sortCells.off('click.tablesort');
+			this.$table.data('tablesort', null);
+			return null;
+		}
+
+	};
+
+	$.tablesort.DEBUG = false;
+
+	$.tablesort.defaults = {
+		debug: $.tablesort.DEBUG,
+		asc: 'sorted ascending',
+		desc: 'sorted descending',
+		compare: function(a, b) {
+			if (a > b) {
+				return 1;
+			} else if (a < b) {
+				return -1;
+			} else {
+				return 0;
+			}
+		}
+	};
+
+	$.fn.tablesort = function(settings) {
+		var table, sortable, previous;
+		return this.each(function() {
+			table = $(this);
+			previous = table.data('tablesort');
+			if(previous) {
+				previous.destroy();
+			}
+			table.data('tablesort', new $.tablesort(table, settings));
+		});
+	};
+
+})(window.Zepto || window.jQuery);




More information about the Python-apps-commits mailing list