Skip to content

Commit

Permalink
[#1788]: Avoid using HTML5 data- attributes to fix IE7.
Browse files Browse the repository at this point in the history
  • Loading branch information
teajaymars committed Mar 30, 2012
1 parent 35b7f65 commit 065b9e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 3 additions & 2 deletions ckan/public/scripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ CKAN.View.ResourceAddUpload = Backbone.View.extend({
this.$messages = this.el.find('.alert');
this.$uploader = this.el.find('#fileupload');
this.setupFileUpload();
this.endpoint = "http://test-ckan-net-storage.commondatastorage.googleapis.com/";
},

events: {
Expand Down Expand Up @@ -743,7 +744,7 @@ CKAN.View.ResourceAddUpload = Backbone.View.extend({
self.client.getStorageAuthForm(key, {
async: false,
success: function(data) {
self.$uploader.attr('data-url', data.action);
self.endpoint = data.action;
_tmpl = '<input type="hidden" name="${name}" value="${value}" />';
var $hidden = $(self.el.find('div.hidden-inputs')[0]);
$.each(data.fields, function(idx, item) {
Expand All @@ -765,7 +766,7 @@ CKAN.View.ResourceAddUpload = Backbone.View.extend({
alert('No file selected');
return;
}
var jqXHR = this.$uploader.fileupload('send', {files: this.fileData.files, url: this.$uploader.attr('data-url')});
var jqXHR = this.$uploader.fileupload('send', {files: this.fileData.files, url: this.endpoint});
},

onUploadComplete: function(key) {
Expand Down
5 changes: 1 addition & 4 deletions ckan/templates/package/new_package_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,7 @@ <h2>Errors in form</h2>
<div class="js-add-upload-form">
<div class="hidden-inputs"></div>
<!-- enctype="multipart/form-data" method="POST"-->
<input id="fileupload" type="file" name="file"
data-url="http://test-ckan-net-storage.commondatastorage.googleapis.com/"
data-sequential-uploads="true"
data-form-data='{"script": "true"}'/>
<input id="fileupload" type="file" name="file" />
<div class="fileinfo"></div>
<button id="upload" name="upload" class="btn btn-primary">Upload</button>
</div>
Expand Down

0 comments on commit 065b9e1

Please sign in to comment.