X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fmodels%2Fpicture.js.coffee;h=6dce3159d05338411e7eb1c762a13cc342e8b7cd;hp=b1d85c344a2dfa37c9f274c7937d8af0d2c86e60;hb=HEAD;hpb=2ad2de8db58dac6a0e81f1db91a1a8415b2b9de7 diff --git a/app/assets/javascripts/models/picture.js.coffee b/app/assets/javascripts/models/picture.js.coffee index b1d85c34..6dce3159 100644 --- a/app/assets/javascripts/models/picture.js.coffee +++ b/app/assets/javascripts/models/picture.js.coffee @@ -27,31 +27,12 @@ class Pettanr.Picture extends Peta.Content mime_type: () -> 'image/' + @get('ext') - r_url: () -> - '/pictures/' + @filename() - - img_option: () -> - title = if @['get'] # is instance? - @model_name() + ' ID:' + Pettanr.to_s(@get('id')) + r_url: (subdir = null) -> + q = if subdir + '?subdir=' + subdir else - @model_name() - { - title: title - alt: @model_name() - } - - opt_img_tag: () -> - @picture_file() - - tmb_opt_img_tag: () -> - @symbol_file() - - tail_opt_img_tag: (img) -> - {src: img, width: @get('width'), height: @get('height')} - - tail_tmb_opt_img_tag: (img) -> - wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height')) - {src: img, width: wh[0], height: wh[1]} + '' + '/pictures/' + @filename() + q alt_name: () -> lgn = Pettanr.to_s(@license().license_group().get('caption')) @@ -61,7 +42,9 @@ class Pettanr.Picture extends Peta.Content symbol_option: (context, options) -> @retrieve(this, { success: (symbol_item) => - options.success.call(context, symbol_item.to_symbol()) + options.success.call(context, symbol_item.symbol_file()) + fail: (response, opt) => + options.fail.call(context, response, opt) }) is_enable: () -> @@ -90,9 +73,6 @@ class Pettanr.Picture extends Peta.Content return true if @is_own(operators) #@is_enable() and @is_head() - history_view: () -> - new Pettanr.Views.Picture.History({item: this}) - initialize: (attr = {}, options = {}) -> super(attr, options)