-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
759 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ | |
# Ignore all logfiles and tempfiles. | ||
/log/*.log | ||
/tmp | ||
/public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rvm --create use "ruby-2.0.0@dropzone" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Place all the behaviors and hooks related to the matching controller here. | ||
# All this logic will automatically be available in application.js. | ||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ | ||
|
||
$(document).ready -> | ||
|
||
org_success = Dropzone.prototype.defaultOptions.success | ||
org_removed = Dropzone.prototype.defaultOptions.removedfile | ||
|
||
Dropzone.options.assetsDropzone = { | ||
addRemoveLinks: true, | ||
paramName: 'image', | ||
previewTemplate: '<div class="dz-preview dz-file-preview"> <div class="dz-details"> <div class="dz-filename"><span data-dz-name></span></div> <div class="dz-size" data-dz-size></div> <img data-dz-thumbnail /> </div> <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div> <div class="dz-success-mark"><span>✔</span></div> <div class="dz-error-mark"><span>✘</span></div> <div class="dz-error-message"><span data-dz-errormessage></span></div><div class="dz-primary-mark"></div><a class="dz-set-primary">Set Primary</a></div>', | ||
removedfile: (file) -> | ||
$.ajax({ | ||
url: "/#{file._id}/remove_image", | ||
method: 'post' | ||
}) | ||
org_removed(file) | ||
, | ||
success: (file, data) -> | ||
index = $('#assets-dropzone').get(0).dropzone.files.indexOf(file) | ||
$('#assets-dropzone').get(0).dropzone.files[index]["_id"] = data["asset_id"] | ||
$('#assets-dropzone').get(0).dropzone.files[index].previewElement.id = data["asset_id"] | ||
org_success(file) | ||
} | ||
Dropzone.autoDiscover = false | ||
|
||
$('#assets-dropzone').on 'click', '.dz-set-primary', -> | ||
$.ajax({ | ||
url: "/#{$(this).parent().attr('id')}/set_primary", | ||
method: 'post' | ||
}) | ||
|
||
if images? | ||
$('#assets-dropzone').dropzone() | ||
|
||
$.each images, (i, image) -> | ||
$('#assets-dropzone').get(0).dropzone.addExistingFile(image) | ||
|
||
primary_asset = images.filter((x) -> | ||
x if x.is_primary is true | ||
)[0] | ||
|
||
$('#'+primary_asset._id).addClass('dz-primary') if primary_asset? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.