OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge:
[pettanr/pettanr.git]
/
app
/
assets
/
javascripts
/
models
/
system_picture.js.coffee
diff --git
a/app/assets/javascripts/models/system_picture.js.coffee
b/app/assets/javascripts/models/system_picture.js.coffee
index
82e60c8
..
36bda58
100644
(file)
--- a/
app/assets/javascripts/models/system_picture.js.coffee
+++ b/
app/assets/javascripts/models/system_picture.js.coffee
@@
-11,6
+11,9
@@
class Pettanr.SystemPicture extends Peta.SystemResource
id: null
\r
}
\r
\r
id: null
\r
}
\r
\r
+ picture: () ->
\r
+ new Pettanr.Cache.Retriever(Pettanr.Picture, @get('picture_id'))
\r
+
\r
filename: () ->
\r
@get('id') + '.' + @get('ext')
\r
\r
filename: () ->
\r
@get('id') + '.' + @get('ext')
\r
\r
@@
-24,16
+27,23
@@
class Pettanr.SystemPicture extends Peta.SystemResource
{src: @r_url(), width: @get('width'), height: @get('height')}
\r
\r
tmb_opt_img_tag: () ->
\r
{src: @r_url(), width: @get('width'), height: @get('height')}
\r
\r
tmb_opt_img_tag: () ->
\r
- wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))
\r
- {src: @r_url(), width: wh[0], height: wh[1]}
\r
+ new Pettanr.Image.SymbolPicture({
\r
+ attr: {
\r
+ src: @r_url()
\r
+ },
\r
+ picture: this
\r
+ })
\r
\r
symbol_option: () ->
\r
\r
symbol_option: () ->
\r
- @tmb_opt_img_tag()
\r
+ retriever = @retriever()
\r
+ @listenTo(retriever, 'retrieve', @retrieve_symbol)
\r
+ retriever.retrieve()
\r
+
\r
+ retrieve_symbol: (item) ->
\r
+ @trigger('ready:symbol', item.tmb_opt_img_tag())
\r
\r
\r
- initialize: () ->
\r
+ initialize: (attr = {}, options = {}) ->
\r
+ super(attr, options)
\r
if @id
\r
@url = @url + @id
\r
\r
if @id
\r
@url = @url + @id
\r
\r
-class Pettanr.SystemPicture.Collection extends Backbone.Collection
\r
- model: Pettanr.SystemPicture
\r
- url: '/system_pictures'
\r