Skip to content

Commit e938f54

Browse files
committedMar 27, 2012
Some formatting
Signed-off-by: Akash Manohar J <akash@akash.im>
1 parent 04e30ec commit e938f54

File tree

3 files changed

+419
-5
lines changed

3 files changed

+419
-5
lines changed
 

‎app/assets/javascripts/application.js

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
//= require jquery
1414
//= require jquery-ui
1515
//= require jquery_ujs
16+
//= require lib/jquery.filedrop
1617
//= require jquery.remotipart
1718
//= require lib/underscore
1819
//= require lib/backbone

‎app/assets/javascripts/backbone/plugins/attachments.js.coffee

+10-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@ class Kandan.Plugins.Attachments
44
@plugin_namespace: "Kandan.Plugins.Attachments"
55

66
@template: _.template('''
7-
<form accept-charset="UTF-8" action="/channels/<%= channel_id %>/attachments.json" data-remote="true" html="{:multipart=&gt;true}" id="file_upload" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓">
8-
<input name="<%=csrf_param %>" type="hidden" value="<%= csrf_token %>"></div>
9-
<input id="channel_id_<%= channel_id %>" name="channel_id[<%= channel_id %>]" type="hidden">
10-
<input id="file" name="file" type="file">
11-
<input name="commit" type="submit" value="Upload">
7+
<form accept-charset="UTF-8" action="/channels/<%= channel_id %>/attachments.json" data-remote="true" html="{:multipart=&gt;true}" id="file_upload" method="post">
8+
<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓">
9+
<input name="<%=csrf_param %>" type="hidden" value="<%= csrf_token %>"/>
10+
</div>
11+
<input id="channel_id_<%= channel_id %>" name="channel_id[<%= channel_id %>]" type="hidden"/>
12+
<input id="file" name="file" type="file"/>
13+
<input name="commit" type="submit" value="Upload"/>
1214
</form>
1315
''')
1416

17+
@supports_drop_upload: ()->
18+
!!(window.File && window.FileList && window.FileReader)
19+
1520
@channel_id: ()->
1621
Kandan.Data.Channels.active_channel_id()
1722

0 commit comments

Comments
 (0)
Please sign in to comment.