Skip to content

Commit 01c7dd9

Browse files
chdorneraptonic
authored andcommitted
Fixed bug when uploading a single document
Signed-off-by: aptonic <contact@aptonic.com>
1 parent 281e835 commit 01c7dd9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

gdocs_uploader.dropzone

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# OptionsNIB: Login
1313
# LoginTitle: Google Documents Login Details
1414

15+
# Version: 0.2
16+
1517
require 'rubygems'
1618
require 'gdata'
1719
require 'mime/types'
@@ -38,7 +40,9 @@ def dragged
3840
end
3941
sleep(1)
4042

41-
$dz.begin("Uploading document" + ("s" if $items.size > 1))
43+
updoc = "Uploading document"
44+
updoc += "s" unless $items.size == 1
45+
$dz.begin(updoc)
4246
$dz.percent(60)
4347
errors = []
4448
$items.each do |file_path|
@@ -69,8 +73,11 @@ def dragged
6973
$dz.error("Unsupported Document", error)
7074
end
7175
sleep (1)
72-
73-
$dz.finish("Document" + ("s" if $items.size > 1) + " uploaded")
76+
77+
updoc = "Document"
78+
updoc += "s" unless $items.size == 1
79+
updoc += " uploaded"
80+
$dz.finish(updoc)
7481
if $items.size > 1
7582
$dz.url(gdocs_home_url)
7683
elsif url != ''

0 commit comments

Comments
 (0)