character 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 458133239b35522811a9d45e7a7aa6dc23d2550b
|
4
|
+
data.tar.gz: cd08086e12ecd53d63cb270a750837a4c757d31d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d48c04a9f210fda478393335b4e0a2a33154f5002c347915d788c5187239e4f180026e0d43d9508dd41693e6783a9a049e13e6c5b5fff1dc02812b1999be7a6f
|
7
|
+
data.tar.gz: bb77c36d5b7e60d9daf2349d4953cf828d068ad63adcdd3676cf1e3ee66a386a30ec6d926feddb5ca70a5e3cdfb8cf72de6457614e1b3d388726970d0befd507
|
data/.gitignore
CHANGED
@@ -48,6 +48,7 @@
|
|
48
48
|
<input id=chr_images_upload class='chr-images-upload' type='file' name='character_image[image]' multiple='' />
|
49
49
|
Upload files...
|
50
50
|
</div>
|
51
|
+
<button id=chr_images_delete class='button chr-images-delete'>Delete</button>
|
51
52
|
</footer>
|
52
53
|
</div>"""
|
53
54
|
|
@@ -56,6 +57,7 @@
|
|
56
57
|
uploadInput: '#chr_images_upload'
|
57
58
|
listContent: '#chr_images_grid'
|
58
59
|
insertButton: '#chr_images_insert'
|
60
|
+
deleteButton: '#chr_images_delete'
|
59
61
|
|
60
62
|
regions:
|
61
63
|
listContent: '#chr_images_grid'
|
@@ -65,6 +67,7 @@
|
|
65
67
|
'click #chr_images_cancel': '_cancel'
|
66
68
|
'click #chr_images_insert': '_insert'
|
67
69
|
'click #chr_images_grid li': '_selectImage'
|
70
|
+
'click #chr_images_delete': '_deleteImage'
|
68
71
|
|
69
72
|
initialize: ->
|
70
73
|
@uploads = {}
|
@@ -95,6 +98,21 @@
|
|
95
98
|
$el.toggleClass 'selected'
|
96
99
|
@ui.insertButton.removeClass 'disabled'
|
97
100
|
|
101
|
+
@ui.deleteButton.show()
|
102
|
+
|
103
|
+
_deleteImage: (e) ->
|
104
|
+
if confirm("""Delete selected image?""")
|
105
|
+
imageId = @ui.listContent.find('.selected').attr('data-id')
|
106
|
+
@removeImageModel(imageId)
|
107
|
+
|
108
|
+
@ui.deleteButton.hide()
|
109
|
+
|
110
|
+
removeImageModel: (id) ->
|
111
|
+
imageModel = @collection.get(id)
|
112
|
+
@collection.remove(imageModel)
|
113
|
+
|
114
|
+
$.post "#{ chr.options.url }/Character-Image/#{id}", { 'character_image[hidden]': 'true' }, ->
|
115
|
+
|
98
116
|
onRender: ->
|
99
117
|
dialogWidth = Math.floor(($(window).width() - 322) / 176 ) * 176 + 20
|
100
118
|
@ui.dialog.css { 'margin-left': dialogWidth / -2, 'width': dialogWidth }
|
@@ -103,6 +121,8 @@
|
|
103
121
|
@listContent.show(@list)
|
104
122
|
|
105
123
|
show: (@callback, @multipleSelection) ->
|
124
|
+
@ui.deleteButton.hide()
|
125
|
+
|
106
126
|
# https://github.com/blueimp/jQuery-File-Upload/wiki/Options
|
107
127
|
@ui.uploadInput.fileupload
|
108
128
|
url: '/admin/Character-Image'
|
@@ -132,6 +152,8 @@ chr.module 'images', (module) ->
|
|
132
152
|
@collection = new Character.Generic.Collection()
|
133
153
|
@collection.options =
|
134
154
|
collectionUrl: "#{ chr.options.url }/Character-Image"
|
155
|
+
where: 'hidden=false'
|
156
|
+
|
135
157
|
@collection.sortField = 'created_at'
|
136
158
|
@collection.sortDirection = 'desc'
|
137
159
|
@collection.fetchPage(1)
|
@@ -933,6 +933,8 @@ b, strong { font-weight: $font_bold;
|
|
933
933
|
}
|
934
934
|
}
|
935
935
|
|
936
|
+
.chr-images-delete { top: -33px; margin-left: 130px; }
|
937
|
+
|
936
938
|
.placeholder.csspinner.double-up:after { border-color: $list_border_color; }
|
937
939
|
.placeholder.csspinner:before { background-color: transparent; }
|
938
940
|
|
data/lib/character/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: character
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kravets
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-07-
|
14
|
+
date: 2014-07-15 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|