Skip to content

Commit

Permalink
Some formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Akash Manohar J <akash@akash.im>
  • Loading branch information
HashNuke committed Mar 27, 2012
1 parent 04e30ec commit e938f54
Show file tree
Hide file tree
Showing 3 changed files with 419 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require lib/jquery.filedrop
//= require jquery.remotipart
//= require lib/underscore
//= require lib/backbone
Expand Down
15 changes: 10 additions & 5 deletions app/assets/javascripts/backbone/plugins/attachments.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ class Kandan.Plugins.Attachments
@plugin_namespace: "Kandan.Plugins.Attachments"

@template: _.template('''
<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="✓">
<input name="<%=csrf_param %>" type="hidden" value="<%= csrf_token %>"></div>
<input id="channel_id_<%= channel_id %>" name="channel_id[<%= channel_id %>]" type="hidden">
<input id="file" name="file" type="file">
<input name="commit" type="submit" value="Upload">
<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="✓">
<input name="<%=csrf_param %>" type="hidden" value="<%= csrf_token %>"/>
</div>
<input id="channel_id_<%= channel_id %>" name="channel_id[<%= channel_id %>]" type="hidden"/>
<input id="file" name="file" type="file"/>
<input name="commit" type="submit" value="Upload"/>
</form>
''')

@supports_drop_upload: ()->
!!(window.File && window.FileList && window.FileReader)

@channel_id: ()->
Kandan.Data.Channels.active_channel_id()

Expand Down
Loading

0 comments on commit e938f54

Please sign in to comment.