X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fmodels%2Fpicture.js.coffee;h=4cbe1a377688a8a20d1e6398b453716578704180;hp=b1d85c344a2dfa37c9f274c7937d8af0d2c86e60;hb=d7c8065be895b67dc453b0e11ad0f259f1ca6706;hpb=00f1b75256d14796fa5b6f75c79dabe4ecbe35ed diff --git a/app/assets/javascripts/models/picture.js.coffee b/app/assets/javascripts/models/picture.js.coffee index b1d85c34..4cbe1a37 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')) @@ -62,6 +43,8 @@ class Pettanr.Picture extends Peta.Content @retrieve(this, { success: (symbol_item) => options.success.call(context, symbol_item.to_symbol()) + 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)