[packages/jquery-uploadify] fix units display
glen
glen at pld-linux.org
Tue Aug 6 13:43:50 CEST 2013
commit ee1fbefd4b25aaa95340879603d7af7a2c0d4a96
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Tue Aug 6 14:43:14 2013 +0300
fix units display
jquery-uploadify.spec | 19 +++++++++++--------
units.patch | 39 +++++++++++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 8 deletions(-)
---
diff --git a/jquery-uploadify.spec b/jquery-uploadify.spec
index fd049f3..deb3c74 100644
--- a/jquery-uploadify.spec
+++ b/jquery-uploadify.spec
@@ -16,6 +16,7 @@ Source0: http://www.uploadify.com/wp-content/uploads/files/uploadify.zip
Patch0: css-path.patch
Patch1: jquery-ns.patch
Patch2: var-leaks.patch
+Patch3: units.patch
URL: http://www.uploadify.com/
BuildRequires: closure-compiler
BuildRequires: js
@@ -36,14 +37,6 @@ jQuery Multiple File Upload Plugin - Uploadify.
%prep
%setup -qc
%undos -f php,txt,css,js
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-
-mv "Change Log.txt" "ChangeLog.txt"
-
-install -d examples
-mv *.php examples
# keep original for reference
cp -p jquery.uploadify.js{,.bak}
@@ -54,6 +47,16 @@ cp -p jquery.uploadify.js{,.bak}
# unmmodified SWFUpload 2.2.0.1
%{__sed} -i -e 1,14d jquery.uploadify.js
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+mv "Change Log.txt" "ChangeLog.txt"
+
+install -d examples
+mv *.php examples
+
%build
# version check
grep 'Uploadify v%{version}' jquery.uploadify.js
diff --git a/units.patch b/units.patch
new file mode 100644
index 0000000..58be3a1
--- /dev/null
+++ b/units.patch
@@ -0,0 +1,39 @@
+--- jquery-uploadify-3.2.1/jquery.uploadify.js 2013-08-06 14:18:16.302874877 +0300
++++ jquery-uploadify-3.2.1/jquery.uploadify.js 2013-08-06 14:16:55.990812689 +0300
+@@ -554,10 +554,10 @@
+
+ // Get the size of the file
+ var fileSize = Math.round(file.size / 1024);
+- var suffix = 'KB';
+- if (fileSize > 1000) {
+- fileSize = Math.round(fileSize / 1000);
+- suffix = 'MB';
++ var suffix = 'KiB';
++ if (fileSize > 1024) {
++ fileSize = Math.round(fileSize / 1024);
++ suffix = 'MiB';
+ }
+ var fileSizeParts = fileSize.toString().split('.');
+ fileSize = fileSizeParts[0];
+@@ -810,7 +810,7 @@
+ var percentage = Math.round(fileBytesLoaded / fileTotalBytes * 100);
+
+ // Calculate the average speed
+- var suffix = 'KB/s';
++ var suffix = 'KiB/s';
+ var mbs = 0;
+ var kbs = (lapsedBytes / 1024) / (lapsedTime / 1000);
+ kbs = Math.floor(kbs * 10) / 10;
+@@ -819,10 +819,10 @@
+ } else {
+ this.queueData.averageSpeed = Math.floor(kbs);
+ }
+- if (kbs > 1000) {
++ if (kbs > 1024) {
+ mbs = (kbs * .001);
+ this.queueData.averageSpeed = Math.floor(mbs);
+- suffix = 'MB/s';
++ suffix = 'MiB/s';
+ }
+
+ // Call the default event handler
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/jquery-uploadify.git/commitdiff/ee1fbefd4b25aaa95340879603d7af7a2c0d4a96
More information about the pld-cvs-commit
mailing list