Browse Source

Updates to release v4.3.4 fixes #728 fixes #730

Kartik Visweswaran 8 năm trước cách đây
mục cha
commit
634170fb44
6 tập tin đã thay đổi với 55 bổ sung51 xóa
  1. 3 1
      CHANGE.md
  2. 4 4
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js
  4. 1 1
      js/locales/ro.js
  5. 47 44
      js/plugins/sortable.js
  6. 0 1
      js/plugins/sortable.min.js

+ 3 - 1
CHANGE.md

@@ -3,13 +3,15 @@ Change Log: `bootstrap-fileinput`
 
 ## version 4.3.4 (under development)
 
-**Date:** 24-Jul-2016
+**Date:** 02-Aug-2016
 
 1. (bug #710): Fix bug for `ifSet` validation.
 2. Add contribution templates.
 3. (enh #718): Update Japanese Translations.
 4. (enh #721): Update Turkish Translations.
 5. (bug #722): Correctly concat ajax output in initial preview.
+6. (enh #728): Change sortable plugin name to avoid conflict with JUI Sortable.
+7. (enh #730): Correct Romanian Translations.
 
 ## version 4.3.3
 

+ 4 - 4
js/fileinput.js

@@ -1045,7 +1045,7 @@
         },
         _initSortable: function () {
             var self = this, $preview = self.$preview, $el, settings;
-            if (!window.Sortable) {
+            if (!window.KvSortable) {
                 return;
             }
             $el = $preview.find('.file-initial-thumbs');
@@ -1066,11 +1066,11 @@
                     });
                 }
             };
-            if ($el.data('sortable')) {
-                $el.sortable('destroy');
+            if ($el.data('kvsortable')) {
+                $el.kvsortable('destroy');
             }
             $.extend(true, settings, self.fileActionSettings.dragSettings);
-            $el.sortable(settings);
+            $el.kvsortable(settings);
         },
         _initPreview: function (isInit) {
             var self = this, cap = self.initialCaption || '', out;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
js/fileinput.min.js


+ 1 - 1
js/locales/ro.js

@@ -42,7 +42,7 @@
         msgProgress: 'Se încarcă fișierul {index} din {files} - {name} - {percent}% încărcat.',
         msgSelected: '{n} {files} încărcate',
         msgFoldersNotAllowed: 'Se poate doar trăgând fișierele! Se renunță la {n} dosar(e).',
-        msgImageWidthSmall: 'Lățimea de fișier de imagine "{name}" trebuie să fie de cel puțin {size px.',
+        msgImageWidthSmall: 'Lățimea de fișier de imagine "{name}" trebuie să fie de cel puțin {size} px.',
         msgImageHeightSmall: 'Înălțimea fișier imagine "{name}" trebuie să fie de cel puțin {size} px.',
         msgImageWidthLarge: 'Lățimea de fișier de imagine "{name}" nu poate depăși {size} px.',
         msgImageHeightLarge: 'Înălțimea fișier imagine "{name}" nu poate depăși {size} px.',

+ 47 - 44
js/plugins/sortable.js

@@ -1,7 +1,10 @@
 /**!
- * Sortable
+ * KvSortable
  * @author	RubaXa   <[email protected]>
  * @license MIT
+ *
+ * Changed kvsortable plugin naming to prevent conflict with JQuery UI KvSortable
+ * @author Kartik Visweswaran
  */
 (function (factory) {
 	"use strict";
@@ -13,18 +16,18 @@
 		module.exports = factory();
 	}
 	else if (typeof Package !== "undefined") {
-		Sortable = factory();  // export for Meteor.js
+		KvSortable = factory();  // export for Meteor.js
 	}
 	else {
 		/* jshint sub:true */
-		window["Sortable"] = factory();
+		window["KvSortable"] = factory();
 	}
 })(function () {
 	"use strict";
 	
 	if (typeof window === "undefined" || typeof window.document == "undefined") {
 		return function() {
-			throw new Error( "Sortable.js requires a window with a document" );
+			throw new Error( "sortable.js requires a window with a document" );
 		}
 	}
 
@@ -56,7 +59,7 @@
 		/** @const */
 		RSPACE = /\s+/g,
 
-		expando = 'Sortable' + (new Date).getTime(),
+		expando = 'KvSortable' + (new Date).getTime(),
 
 		win = window,
 		document = win.document,
@@ -171,13 +174,13 @@
 
 
 	/**
-	 * @class  Sortable
+	 * @class  KvSortable
 	 * @param  {HTMLElement}  el
 	 * @param  {Object}       [options]
 	 */
-	function Sortable(el, options) {
+	function KvSortable(el, options) {
 		if (!(el && el.nodeType && el.nodeType === 1)) {
-			throw 'Sortable: `el` must be HTMLElement, and not ' + {}.toString.call(el);
+			throw 'KvSortable: `el` must be HTMLElement, and not ' + {}.toString.call(el);
 		}
 
 		this.el = el; // root element
@@ -199,8 +202,8 @@
 			scrollSensitivity: 30,
 			scrollSpeed: 10,
 			draggable: /[uo]l/i.test(el.nodeName) ? 'li' : '>*',
-			ghostClass: 'sortable-ghost',
-			chosenClass: 'sortable-chosen',
+			ghostClass: 'kvsortable-ghost',
+			chosenClass: 'kvsortable-chosen',
 			ignore: 'a, img',
 			filter: null,
 			animation: 0,
@@ -212,7 +215,7 @@
 			dataIdAttr: 'data-id',
 			delay: 0,
 			forceFallback: false,
-			fallbackClass: 'sortable-fallback',
+			fallbackClass: 'kvsortable-fallback',
 			fallbackOnBody: false
 		};
 
@@ -250,8 +253,8 @@
 	}
 
 
-	Sortable.prototype = /** @lends Sortable.prototype */ {
-		constructor: Sortable,
+	KvSortable.prototype = /** @lends KvSortable.prototype */ {
+		constructor: KvSortable,
 
 		_onTapStart: function (/** Event|TouchEvent */evt) {
 			var _this = this,
@@ -413,7 +416,7 @@
 				// Apply effect
 				_toggleClass(dragEl, this.options.ghostClass, true);
 
-				Sortable.active = this;
+				KvSortable.active = this;
 
 				// Drag start event
 				_dispatchEvent(this, rootEl, 'start', dragEl, rootEl, oldIndex);
@@ -469,7 +472,7 @@
 		_onTouchMove: function (/**TouchEvent*/evt) {
 			if (tapEvt) {
 				// only set the status to dragging, when we are actually dragging
-				if (!Sortable.active) {
+				if (!KvSortable.active) {
 					this._dragStarted();
 				}
 
@@ -800,7 +803,7 @@
 						}
 					}
 
-					if (Sortable.active) {
+					if (KvSortable.active) {
 						if (newIndex === null || newIndex === -1) {
 							newIndex = oldIndex;
 						}
@@ -838,7 +841,7 @@
 			lastCSS =
 
 			activeGroup =
-			Sortable.active = null;
+			KvSortable.active = null;
 		},
 
 		handleEvent: function (/**Event*/evt) {
@@ -1076,9 +1079,9 @@
 
 
 
-	function _dispatchEvent(sortable, rootEl, name, targetEl, fromEl, startIndex, newIndex) {
+	function _dispatchEvent(kvsortable, rootEl, name, targetEl, fromEl, startIndex, newIndex) {
 		var evt = document.createEvent('Event'),
-			options = (sortable || rootEl[expando]).options,
+			options = (kvsortable || rootEl[expando]).options,
 			onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
 
 		evt.initEvent(name, true, true);
@@ -1094,15 +1097,15 @@
 		rootEl.dispatchEvent(evt);
 
 		if (options[onName]) {
-			options[onName].call(sortable, evt);
+			options[onName].call(kvsortable, evt);
 		}
 	}
 
 
 	function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect) {
 		var evt,
-			sortable = fromEl[expando],
-			onMoveFn = sortable.options.onMove,
+			kvsortable = fromEl[expando],
+			onMoveFn = kvsortable.options.onMove,
 			retVal;
 
 		evt = document.createEvent('Event');
@@ -1118,7 +1121,7 @@
 		fromEl.dispatchEvent(evt);
 
 		if (onMoveFn) {
-			retVal = onMoveFn.call(sortable, evt);
+			retVal = onMoveFn.call(kvsortable, evt);
 		}
 
 		return retVal;
@@ -1237,7 +1240,7 @@
 
 
 	// Export utils
-	Sortable.utils = {
+	KvSortable.utils = {
 		on: _on,
 		off: _off,
 		css: _css,
@@ -1254,21 +1257,21 @@
 
 
 	/**
-	 * Create sortable instance
+	 * Create kvsortable instance
 	 * @param {HTMLElement}  el
 	 * @param {Object}      [options]
 	 */
-	Sortable.create = function (el, options) {
-		return new Sortable(el, options);
+	KvSortable.create = function (el, options) {
+		return new KvSortable(el, options);
 	};
 
 
 	// Export
-	Sortable.version = '1.4.2';
-	return Sortable;
+	KvSortable.version = '1.4.2';
+	return KvSortable;
 });
 /**
- * jQuery plugin for Sortable
+ * jQuery plugin for KvSortable
  * @author	RubaXa   <[email protected]>
  * @license MIT
  */
@@ -1290,37 +1293,37 @@
 
 
 	/**
-	 * jQuery plugin for Sortable
+	 * jQuery plugin for KvSortable
 	 * @param   {Object|String} options
 	 * @param   {..*}           [args]
 	 * @returns {jQuery|*}
 	 */
-	$.fn.sortable = function (options) {
+	$.fn.kvsortable = function (options) {
 		var retVal,
 			args = arguments;
 
 		this.each(function () {
 			var $el = $(this),
-				sortable = $el.data('sortable');
+				kvsortable = $el.data('kvsortable');
 
-			if (!sortable && (options instanceof Object || !options)) {
-				sortable = new Sortable(this, options);
-				$el.data('sortable', sortable);
+			if (!kvsortable && (options instanceof Object || !options)) {
+				kvsortable = new KvSortable(this, options);
+				$el.data('kvsortable', kvsortable);
 			}
 
-			if (sortable) {
+			if (kvsortable) {
 				if (options === 'widget') {
-					return sortable;
+					return kvsortable;
 				}
 				else if (options === 'destroy') {
-					sortable.destroy();
-					$el.removeData('sortable');
+					kvsortable.destroy();
+					$el.removeData('kvsortable');
 				}
-				else if (typeof sortable[options] === 'function') {
-					retVal = sortable[options].apply(sortable, [].slice.call(args, 1));
+				else if (typeof kvsortable[options] === 'function') {
+					retVal = kvsortable[options].apply(kvsortable, [].slice.call(args, 1));
 				}
-				else if (options in sortable.options) {
-					retVal = sortable.option.apply(sortable, args);
+				else if (options in kvsortable.options) {
+					retVal = kvsortable.option.apply(kvsortable, args);
 				}
 			}
 		});

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
js/plugins/sortable.min.js


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác