@filer().items\r
\r
add_pick: (target_model) ->\r
- @pick = new Pettanr.Views.Common.PickIcon({\r
- name: target_model.pick_type(@item_name()), class_name: 'filer-item-pick'\r
+ @pick = new Pettanr.View.Pick(target_model.pick_type(@item_name()), {\r
+ class_name: 'filer-item-pick',\r
+ context: this,\r
+ click: () =>\r
+ @trigger('click:pick', this)\r
})\r
- @listenTo(@pick, 'click', @click_pick)\r
@render()\r
\r
- click_pick: () ->\r
- @trigger('click:pick', this)\r
- \r
click_symbol: () ->\r
@trigger('click:symbol', this)\r
\r
@listenTo(@face, 'ready:caption', @ready_caption)\r
\r
render: () ->\r
- icon = new Pettanr.Views.Common.LoadIcon()\r
+ icon = new Pettanr.View.Minicon(Pettanr.View.Image.icon_loading_file())\r
this.$el.html(icon.render().el)\r
@face.render()\r
this\r
\r
replace_empty: () ->\r
if Pettanr.is_blank(@caption())\r
- empty = new Pettanr.Views.Common.EmptyCaption()\r
+ empty = new Pettanr.View.EmptyDiv()\r
this.$el.html(empty.render().el)\r
else\r
this.$el.html(@caption())\r
# not render\r
# get caption data and send message\r
render: () ->\r
- caption = Pettanr.Views.Common.replace_empty(@item.escape(@my_manifest.column_name))\r
+ caption = Pettanr.View.replace_empty(@item.escape(@my_manifest.column_name))\r
@trigger('ready:caption', caption)\r
\r
if @item[@method_name()]\r
@item[@method_name()].call(@item, this, {\r
success: (caption) =>\r
- @trigger('ready:caption', Pettanr.Views.Common.replace_empty(caption))\r
+ @trigger('ready:caption', Pettanr.View.replace_empty(caption))\r
})\r
this\r
\r
@listenTo(@face, 'ready:symbol', @ready_symbol)\r
\r
render: () ->\r
- icon = new Pettanr.Views.Common.LoadIcon()\r
+ icon = new Pettanr.View.Minicon(Pettanr.View.Image.icon_loading_file())\r
this.$el.html(icon.render().el)\r
@face.render()\r
this\r
\r
Pettanr.cache = new Pettanr.Cache({operators: new Pettanr.Operator({})})\r
layout = if Pettanr.is_sns()\r
- new Pettanr.Views.Layout.Sns()\r
+ new Pettanr.View.Layout.Sns()\r
else\r
- new Pettanr.Views.Layout.Blog()\r
+ new Pettanr.View.Layout.Blog()\r
$('#pettanr').html(layout.render().el)\r
layout.start()\r
\r
\r
overwrite: (options) ->\r
\r
- icon_with_caption_view: (half = true, column_name = 'name', length = 12) ->\r
- new Pettanr.Views.Common.IconWithCaption({item: this, half: half, column_name: column_name, length: length})\r
- \r
initialize: (attr = {}, options = {}) ->\r
super(attr, options)\r
\r
\r
overwrite: (options) ->\r
\r
- icon_with_caption_view: (half = true, column_name = 'name', length = 12) ->\r
- new Pettanr.Views.Common.IconWithCaption({item: this, half: half, column_name: column_name, length: length})\r
- \r
initialize: (attr = {}, options = {}) ->\r
super(attr, options)\r
\r
options.success.call(context, symbol_item.symbol_file())\r
})\r
\r
- face_file: () ->\r
+ @face_file: () ->\r
new Pettanr.ImageFile('/images/' + @item_name() + '.gif')\r
\r
+ face_file: () ->\r
+ @my_class().face_file()\r
+ \r
# thumbnail size picture\r
symbol_file: (subdir) ->\r
new Pettanr.PictureFile(this, subdir)\r
url = options.url || @show_url()\r
new Pettanr.View.Button(url, _.escape(@label()), options)\r
\r
+ # faced_label({\r
+ # url: @show_url(),\r
+ # context: this,\r
+ # click: () =>\r
+ # # ...\r
+ # })\r
faced_label: (options) ->\r
new Pettanr.View.FacedLabel(this, options)\r
\r
class Peta.Leaf extends Peta.Content\r
+ \r
+ parent_model: () ->\r
+ Manifest.manifest().models[@my_class().my_peta().parent_item_name].classify()\r
+ \r
+ binder_model: () ->\r
+ @parent_model()\r
+ \r
+ destination_model: () ->\r
+ Manifest.manifest().models[@my_class().my_peta().destination_item_name].classify()\r
+ \r
+ binder_key: () ->\r
+ @my_class().my_peta().parent_item_name + '_id'\r
+ \r
+ destination_key: () ->\r
+ @my_class().my_peta().destination_item_name + '_id'\r
+ \r
options.content = content\r
new Tag.Div(options)\r
\r
+ @replace_empty: (caption) ->\r
+ if Pettanr.is_blank(caption)\r
+ empty = new Pettanr.View.EmptyDiv()\r
+ empty.render().el\r
+ else\r
+ caption\r
+ \r
@face_button: (item, image, options = {}) ->\r
icon = new Pettanr.View.Icon(image)\r
new Pettanr.View.Button(item.show_url(), icon.render().el, options)\r
--- /dev/null
+class Pettanr.View.EmptyDiv extends Pettanr.View\r
+ tagName: 'div'\r
+ className: 'empty'\r
+ \r
+ render: () ->\r
+ this.$el.html('empty')\r
+ this\r
+ \r
[Math.floor(w*hr/100), Math.floor(h*hr/100)]\r
r\r
\r
+ @image_dir: () ->\r
+ '/images/'\r
+ \r
@icon_prof_file: () ->\r
- new Pettanr.ImageFile('/images/prof.gif')\r
+ new Pettanr.ImageFile(@image_dir() + 'prof.gif')\r
+ \r
+ @icon_inspire_file: () ->\r
+ new Pettanr.ImageFile(@image_dir() + 'inspire.gif')\r
+ \r
+ @icon_loading_file: () ->\r
+ new Pettanr.ImageFile(@image_dir() + 'loading.gif')\r
+ \r
+ @icon_root_file: () ->\r
+ new Pettanr.ImageFile(@image_dir() + 'root.png')\r
+ \r
+ @icon_pick_file: (type) ->\r
+ new Pettanr.ImageFile(@image_dir() + type + '.png')\r
\r
-class Pettanr.Views.Layout\r
-class Pettanr.Views.Layout.Base extends Pettanr.View\r
+class Pettanr.View.Layout\r
+class Pettanr.View.Layout.Base extends Pettanr.View\r
\r
-class Pettanr.Views.Layout.Sns extends Pettanr.Views.Layout.Base\r
+class Pettanr.View.Layout.Sns extends Pettanr.View.Layout.Base\r
className: 'layout-sns'\r
\r
initialize: (options) ->\r
@global_router = new Pettanr.GlobalRouter({})\r
@listenTo(@global_router, 'go', @body_get)\r
@gate = new Pettanr.BeforeUnload()\r
- @header = new Pettanr.Views.Layout.Sns.Header({parent: this})\r
+ @header = new Pettanr.View.Layout.Sns.Header({parent: this})\r
@history = new Pettanr.Views.History({parent: this})\r
@listenTo(@history, 'http_get', @body_http_get)\r
@listenTo(@history, 'get', @body_get)\r
- @body = new Pettanr.Views.Layout.Sns.Body({parent: this})\r
- @footer = new Pettanr.Views.Layout.Sns.Footer({parent: this})\r
+ @body = new Pettanr.View.Layout.Sns.Body({parent: this})\r
+ @footer = new Pettanr.View.Layout.Sns.Footer({parent: this})\r
\r
render: () ->\r
this.$el.html('')\r
\r
cancel: (params, form) ->\r
\r
-class Pettanr.Views.Layout.Blog extends Pettanr.Views.Layout.Base\r
+class Pettanr.View.Layout.Blog extends Pettanr.View.Layout.Base\r
className: 'layout-blog'\r
\r
start: () ->\r
-class Pettanr.Views.Layout.Blog.Header extends Pettanr.View\r
+class Pettanr.View.Layout.Blog.Header extends Pettanr.View\r
tagName: 'div'\r
id: 'header'\r
\r
@router.navigate(url, {trigger: true, replace: false})\r
@trigger('navigate', url)\r
\r
-class Pettanr.Views.Layout.Blog.Body extends Pettanr.View\r
+class Pettanr.View.Layout.Blog.Body extends Pettanr.View\r
tagName: 'div'\r
id: 'body'\r
\r
@router.navigate(url, {trigger: true, replace: false})\r
@trigger('navigate', url)\r
\r
-class Pettanr.Views.Layout.Blog.Footer extends Pettanr.View\r
+class Pettanr.View.Layout.Blog.Footer extends Pettanr.View\r
tagName: 'div'\r
id: 'footer'\r
\r
--- /dev/null
+class Pettanr.View.Layout.Logo extends Tag.Span\r
+ id: 'logo'\r
+ \r
+ constructor: (options) ->\r
+ super(options)\r
+ \r
+ initialize: (options) ->\r
+ options.class_name ||= 'logo'\r
+ title = Manifest.manifest().magic_numbers['profile']['users']['caption']\r
+ url = '/'\r
+ @logo_button = new Pettanr.View.Button(url, _.escape(title), options)\r
+ \r
+ render: () ->\r
+ this.$el.html(@logo_button.render().el)\r
+ this\r
+ \r
-class Pettanr.Views.Layout.Sns.Header extends Pettanr.View\r
+class Pettanr.View.Layout.Sns.Header extends Pettanr.View\r
tagName: 'div'\r
id: 'header'\r
\r
refresh: (view) ->\r
this.$el.html(view.el)\r
\r
-class Pettanr.Views.Layout.Sns.Body extends Pettanr.View\r
+class Pettanr.View.Layout.Sns.Body extends Pettanr.View\r
tagName: 'div'\r
id: 'body'\r
\r
refresh: (view) ->\r
this.$el.html(view.el)\r
\r
-class Pettanr.Views.Layout.Sns.Footer extends Pettanr.View\r
+class Pettanr.View.Layout.Sns.Footer extends Pettanr.View\r
tagName: 'div'\r
id: 'footer'\r
\r
--- /dev/null
+class Pettanr.View.Pick extends Pettanr.View\r
+ \r
+ constructor: (@type, options) ->\r
+ super(options)\r
+ \r
+ initialize: (options) ->\r
+ @class_name = options.class_name\r
+ @content = if @is_button()\r
+ new Pettanr.View.Button('/pick', @icon().render().el, options)\r
+ else\r
+ @icon()\r
+ \r
+ render: () ->\r
+ this.$el.html('')\r
+ @el.className = @class_name if @class_name\r
+ this.$el.append(@content.render().el)\r
+ this\r
+ \r
+ is_button: () ->\r
+ @type != 'none'\r
+ \r
+ icon: () ->\r
+ new Pettanr.View.Icon(Pettanr.View.Image.icon_pick_file(@type))\r
+ \r
+class Pettanr.View.MiniPick extends Pettanr.View.Pick\r
+ \r
+ icon: () ->\r
+ new Pettanr.View.Minicon(Pettanr.View.Image.icon_pick_file(@type))\r
+ \r
this.$el.append(@prof_button.render().el)\r
this\r
\r
- click_pick: () ->\r
- @trigger('click:pick')\r
- \r
add_pick: (target_model) ->\r
- @pick = new Pettanr.Views.Common.PickIcon({\r
- name: target_model.pick_type(@item.item_name()), half: true\r
+ @pick = new Pettanr.View.MiniPick(target_model.pick_type(@item.item_name()), {\r
+ context: this,\r
+ click: () =>\r
+ @trigger('click:pick')\r
})\r
- @listenTo(@pick, 'click', @click_pick)\r
@render()\r
\r
@listenTo(this, 'ready', @render)\r
\r
clear: () ->\r
- icon = new Pettanr.Views.Common.LoadIcon()\r
+ icon = new Pettanr.View.Minicon(Pettanr.View.Image.icon_loading_file())\r
this.$el.html(icon.render().el)\r
this\r
\r
})\r
@item.get_parent('author', this, {\r
success: (@author) =>\r
- @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@author_icon_with_caption, 'click', @author_click)\r
+ @author_mini_faced_label = @author.mini_faced_label({\r
+ context: this,\r
+ click: () =>\r
+ @trigger('http_get', @author.show_url())\r
+ })\r
+ this.$el.append(@author_mini_faced_label.render().el)\r
@trigger('ready')\r
})\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@visible.render().el)\r
- this.$el.append(@author_icon_with_caption.render().el)\r
+ this.$el.append(@author_mini_faced_label.render().el)\r
this\r
\r
author_click: () ->\r
initialize: (options) ->\r
super(options)\r
@item = options.item\r
- @binder_item_name = options.binder_item_name\r
- @destination_item_name = options.destination_item_name\r
- @binder_view = new Tag.Span({})\r
- @destination_view = new Tag.Span({})\r
+ @binder = new Pettanr.View.Summary.Leaf.Binder(@item, {})\r
+ @destination = new Pettanr.View.Summary.Leaf.Binder(@item, options.destination_item_name, {})\r
@load()\r
\r
load: () ->\r
@trigger('ready')\r
\r
load_binder: () ->\r
- @item.get_parent(@binder_item_name, this, {\r
- success: (@binder) =>\r
- @binder_icon = @binder.icon_view(true)\r
- @listenTo(@binder_icon, 'click', @binder_click)\r
- @binder.get_parent('author', this, {\r
- success: (@binder_author) =>\r
- @binder_author_icon_with_caption = @binder_author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@binder_author_icon_with_caption, 'click', @binder_author_click)\r
- @binder_view.$el.append(@binder_icon.render().el)\r
- @binder_view.$el.append(@binder_author_icon_with_caption.render().el)\r
- @trigger('load_binder')\r
- })\r
- })\r
\r
load_destination: () ->\r
@item.get_parent(@destination_item_name, this, {\r
@listenTo(@destination_icon, 'click', @destination_click)\r
@destination.get_parent('author', this, {\r
success: (@destination_author) =>\r
- @destination_author_icon_with_caption = @destination_author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@destination_author_icon_with_caption, 'click', @destination_author_click)\r
- @destination_view.$el.append(@destination_icon.render().el)\r
- @destination_view.$el.append(@destination_author_icon_with_caption.render().el)\r
+ @destination_author_mini_faced_label = @destination_author.mini_faced_label({\r
+ context: this,\r
+ click: () =>\r
+ @trigger('http_get', @destination_author.show_url())\r
+ })\r
+ this.$el.append(@destination_author_mini_faced_label.render().el)\r
@trigger('load_destination')\r
})\r
})\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append(@binder_view.render().el)\r
- this.$el.append(@destination_view.render().el)\r
+ this.$el.append(@binder_author_mini_faced_label.render().el)\r
+ this.$el.append(@destination_author_mini_faced_label.render().el)\r
this\r
\r
binder_click: () ->\r
destination_author_click: () ->\r
@trigger('http_get', @destination_author_icon_with_caption.url())\r
\r
+class Pettanr.View.Summary.Leaf.Binder extends Tag.Span\r
+ \r
+ constructor: (@item, @binder_item_name, options) ->\r
+ super(options)\r
+ @binder_model = @item.my_class().binder_model()\r
+ \r
+ initialize: (options) ->\r
+ @item.get_parent(@binder_model.item_name(), this, {\r
+ success: (@binder) =>\r
+ @face_button = @binder.mini_face_button(true)\r
+ @binder.get_parent('author', this, {\r
+ success: (@author) =>\r
+ @author_mini_faced_label = @author.mini_faced_label({\r
+ context: this,\r
+ click: () =>\r
+ @trigger('http_get', @author.show_url())\r
+ })\r
+ this.$el.append(@author_mini_faced_label.render().el)\r
+ @trigger('load_binder')\r
+ })\r
+ })\r
+ \r
class Pettanr.Views.Artist.ShowModule\r
-class Pettanr.Views.Artist.ShowModule.Header extends Pettanr.Views.Show.Header\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
class Pettanr.Views.Artist.ShowModule.ResourcePictures extends Pettanr.View\r
\r
initialize: (options) ->\r
+++ /dev/null
-class Pettanr.Views.Author.Icon extends Pettanr.Views.Common.Icon\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
super(options)\r
@item = options.item\r
@panels_body = new Pettanr.Views.Author.ShowModule.PanelsBody({item: @item})\r
- @credits = new Pettanr.View.Credits({parent: this})\r
+ @credits = new Pettanr.View.Credits(this, {icon: true})\r
\r
render: () ->\r
@listenTo(@panels_body, 'ready', @ready)\r
success: (@speech_balloon) =>\r
@speech_balloon.get_parent('panel', this, {\r
success: (@panel) =>\r
- @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
- @listenTo(@panel_icon, 'click', @panel_click)\r
+ @panel_face_button = @panel.mini_face_button({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', @panel.show_url())\r
+ })\r
@panel.get_parent('author', this, {\r
success: (@author) =>\r
- @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@author_icon_with_caption, 'click', @author_click)\r
+ @author_faced_label = @author.mini_faced_label({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', @author.show_url())\r
+ })\r
@trigger('ready')\r
})\r
})\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append(@panel_icon.render().el)\r
- this.$el.append(@author_icon_with_caption.render().el)\r
+ this.$el.append(@panel_face_button.render().el)\r
+ this.$el.append(@author_faced_label.render().el)\r
this\r
\r
- panel_click: () ->\r
- @trigger('http_get', @panel_icon.url())\r
- \r
- author_click: () ->\r
- @trigger('http_get', @author_icon_with_caption.url())\r
- \r
+++ /dev/null
-class Pettanr.Views.Comic.Icon extends Pettanr.Views.Common.Icon\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
class Pettanr.Views.Comic.PlayModule\r
-class Pettanr.Views.Comic.PlayModule.Header extends Pettanr.Views.Show.Header\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Comic.PlayModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
class Pettanr.Views.Comic.PlayModule.Footer extends Pettanr.View\r
tagName: 'table'\r
className: 'no-border'\r
+++ /dev/null
-class Pettanr.Views.Common\r
- @replace_empty: (caption) ->\r
- if Pettanr.is_blank(caption)\r
- empty = new Pettanr.Views.Common.EmptyCaption()\r
- empty.render().el\r
- else\r
- caption\r
- \r
-class Pettanr.Views.Common.Logo extends Tag.Span\r
- id: 'logo'\r
- \r
- initialize: () ->\r
- title = Manifest.manifest().magic_numbers['profile']['users']['caption']\r
- @logo_button = new Tag.A({\r
- attr: {href: '/'}, \r
- class_name: 'logo',\r
- content: _.escape(title)\r
- })\r
- @listenTo(@logo_button, 'click', @click)\r
- \r
- render: () ->\r
- this.$el.html(@logo_button.render().el)\r
- this\r
- \r
- click: () ->\r
- @trigger('click')\r
- \r
-\r
-class Pettanr.Views.Common.EmptyIcon extends Tag.Img\r
- \r
- initialize: (options) ->\r
- @attr = {}\r
- @width = Manifest.manifest().magic_numbers['thumbnail_width']\r
- @height = Manifest.manifest().magic_numbers['thumbnail_height']\r
- @width = Pettanr.to_i(@width/2)\r
- @height = Pettanr.to_i(@height/2)\r
- @attr['src'] = @file_name()\r
- @attr['width'] = @width\r
- @attr['height'] = @height\r
- @attr['alt'] = 'Loading'\r
- @attr['title'] = 'Loading'\r
- opt = {\r
- attr: @attr,\r
- }\r
- super(opt)\r
- \r
- file_name: () ->\r
- '/images/empty.gif'\r
-\r
-class Pettanr.Views.Common.LoadIcon extends Pettanr.Views.Common.EmptyIcon\r
- \r
- file_name: () ->\r
- '/images/loading.gif'\r
- \r
-class Pettanr.Views.Common.RootIcon extends Pettanr.Views.Common.EmptyIcon\r
- \r
- file_name: () ->\r
- '/images/root.png'\r
- \r
-class Pettanr.Views.Common.PickIcon extends Pettanr.View\r
- \r
- initialize: (options) ->\r
- @class_name = options.class_name\r
- @name = options.name\r
- @half = options.half\r
- @button = if @is_button()\r
- @linked_icon()\r
- else\r
- @icon()\r
- \r
- render: () ->\r
- this.$el.html('')\r
- @el.className = @class_name if @class_name\r
- if @is_button()\r
- @listenTo(@button, 'click', @click)\r
- this.$el.append(@button.render().el)\r
- this\r
- \r
- is_button: () ->\r
- @name != 'none'\r
- \r
- icon: () ->\r
- new Pettanr.Image.SymbolImg({attr: {src: '/images/' + @name + '.gif'}, half: @half})\r
- \r
- linked_icon: () ->\r
- new Tag.A({\r
- attr: {href: '#'},\r
- content: @icon().render().el\r
- })\r
- \r
- click: () ->\r
- @trigger('click', this)\r
- \r
-class Pettanr.Views.Common.EmptyCaption extends Pettanr.View\r
- tagName: 'div'\r
- className: 'empty'\r
- \r
- render: () ->\r
- this.$el.html('empty')\r
- this\r
- \r
-class Pettanr.Views.Common.Icon extends Pettanr.View\r
- tagName: 'span'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @half = options.half\r
- @icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- @icon = new Pettanr.Image.Icon({item: @item, half: @half})\r
- @icon_button = new Tag.A({\r
- attr: {href: '/' + @icon_url}, \r
- class_name: 'icon',\r
- content: @icon.render().el\r
- })\r
- @listenTo(@icon_button, 'click', @click)\r
- \r
- render: () ->\r
- this.$el.html(@icon_button.render().el)\r
- this\r
- \r
- click: () ->\r
- @trigger('click')\r
- \r
- url: () ->\r
- @icon_url\r
- \r
-class Pettanr.Views.Common.Caption extends Pettanr.View\r
- tagName: 'span'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @column_name = options.column_name\r
- @length = options.length\r
- @name = Pettanr.truncate(@item.get(@column_name), @length)\r
- @url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})\r
- @linked_name = new Tag.A({\r
- attr: {href: '/' + @url}, \r
- content: _.escape(@name)\r
- })\r
- @listenTo(@linked_name, 'click', @click)\r
- \r
- render: () ->\r
- this.$el.html(@linked_name.render().el)\r
- this\r
- \r
- click: () ->\r
- @trigger('click')\r
- \r
- url: () ->\r
- @url\r
- \r
-class Pettanr.Views.Common.IconWithCaption extends Pettanr.View\r
- tagName: 'span'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @half = options.half\r
- @column_name = options.column_name\r
- @length = options.length\r
- @icon = new Pettanr.Views.Common.Icon({item: @item, half: @half})\r
- @caption = new Pettanr.Views.Common.Caption({item: @item, column_name: @column_name, length: @length})\r
- @listenTo(@icon, 'click', @click)\r
- @listenTo(@caption, 'click', @click)\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append(@icon.render().el)\r
- this.$el.append(@caption.render().el)\r
- this\r
- \r
- click: () ->\r
- @trigger('click')\r
- \r
- url: () ->\r
- @icon.url()\r
- \r
-class Pettanr.Views.Common.Summary extends Pettanr.View\r
- \r
- initialize: (options) ->\r
- @clear()\r
- @listenTo(this, 'ready', @render)\r
- \r
- clear: () ->\r
- icon = new Pettanr.Views.Common.LoadIcon()\r
- this.$el.html(icon.render().el)\r
- this\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this\r
- \r
-class Pettanr.Views.Common.Binder\r
-class Pettanr.Views.Common.Binder.Summary extends Pettanr.Views.Common.Summary\r
- \r
- initialize: (options) ->\r
- super(options)\r
- @item = options.item\r
- @visible_t = options.visible_t\r
- @visible_column_name = options.visible_column_name\r
- @load()\r
- \r
- load: () ->\r
- @visible = new Tag.Div({\r
- content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
- })\r
- @item.get_parent('author', this, {\r
- success: (@author) =>\r
- @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@author_icon_with_caption, 'click', @author_click)\r
- @trigger('ready')\r
- })\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append(@visible.render().el)\r
- this.$el.append(@author_icon_with_caption.render().el)\r
- this\r
- \r
- author_click: () ->\r
- @trigger('http_get', @author_icon_with_caption.url())\r
- \r
-class Pettanr.Views.Common.Leaf\r
-class Pettanr.Views.Common.Leaf.Summary extends Pettanr.Views.Common.Summary\r
- \r
- initialize: (options) ->\r
- super(options)\r
- @item = options.item\r
- @binder_item_name = options.binder_item_name\r
- @destination_item_name = options.destination_item_name\r
- @binder_view = new Tag.Span({})\r
- @destination_view = new Tag.Span({})\r
- @load()\r
- \r
- load: () ->\r
- @listenTo(this, 'load_binder', @load_destination)\r
- @listenTo(this, 'load_destination', @ready)\r
- @load_binder()\r
- \r
- ready: () ->\r
- @trigger('ready')\r
- \r
- load_binder: () ->\r
- @item.get_parent(@binder_item_name, this, {\r
- success: (@binder) =>\r
- @binder_icon = @binder.icon_view(true)\r
- @listenTo(@binder_icon, 'click', @binder_click)\r
- @binder.get_parent('author', this, {\r
- success: (@binder_author) =>\r
- @binder_author_icon_with_caption = @binder_author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@binder_author_icon_with_caption, 'click', @binder_author_click)\r
- @binder_view.$el.append(@binder_icon.render().el)\r
- @binder_view.$el.append(@binder_author_icon_with_caption.render().el)\r
- @trigger('load_binder')\r
- })\r
- })\r
- \r
- load_destination: () ->\r
- @item.get_parent(@destination_item_name, this, {\r
- success: (@destination) =>\r
- @destination_icon = @destination.icon_view(true)\r
- @listenTo(@destination_icon, 'click', @destination_click)\r
- @destination.get_parent('author', this, {\r
- success: (@destination_author) =>\r
- @destination_author_icon_with_caption = @destination_author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@destination_author_icon_with_caption, 'click', @destination_author_click)\r
- @destination_view.$el.append(@destination_icon.render().el)\r
- @destination_view.$el.append(@destination_author_icon_with_caption.render().el)\r
- @trigger('load_destination')\r
- })\r
- })\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append(@binder_view.render().el)\r
- this.$el.append(@destination_view.render().el)\r
- this\r
- \r
- binder_click: () ->\r
- @trigger('http_get', @binder_icon.url())\r
- \r
- destination_click: () ->\r
- @trigger('http_get', @destination_icon.url())\r
- \r
- binder_author_click: () ->\r
- @trigger('http_get', @binder_author_icon_with_caption.url())\r
- \r
- destination_author_click: () ->\r
- @trigger('http_get', @destination_author_icon_with_caption.url())\r
- \r
-class Pettanr.Views.Common.Credits extends Pettanr.View\r
- tagName: 'div'\r
- className: 'credits'\r
- \r
- initialize: (options) ->\r
- @parent = options.parent\r
- @licensed_pictures = {}\r
- \r
- clear: () ->\r
- this.$el.html('')\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this\r
- \r
- push: (retrievers) ->\r
- _.each retrievers, (retriever, pid) =>\r
- Pettanr.Picture.retrieve(pid, this, {\r
- success: (picture) =>\r
- pid = picture.get('id')\r
- return if @licensed_pictures[pid]\r
- @licensed_pictures[pid] = picture\r
- credit = picture.credit_view()\r
- @listenTo(credit, 'click:icon', @click_credit_icon)\r
- this.$el.append(credit.render().el)\r
- })\r
- \r
- click_credit_icon: (item) ->\r
- @trigger('click:credit:icon', item)\r
- \r
@item = options.item\r
@item.get_parent('panel', this, {\r
success: (@panel) =>\r
- @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
- @listenTo(@panel_icon, 'click', @panel_click)\r
+ @panel_face_button = @panel.mini_face_button({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', @panel.show_url())\r
+ })\r
@panel.get_parent('author', this, {\r
success: (@author) =>\r
- @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@author_icon_with_caption, 'click', @author_click)\r
+ @author_faced_label = @author.mini_faced_label({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', @author.show_url())\r
+ })\r
@trigger('ready')\r
})\r
})\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append(@panel_icon.render().el)\r
- this.$el.append(@author_icon_with_caption.render().el)\r
+ this.$el.append(@panel_face_button.render().el)\r
+ this.$el.append(@author_faced_label.render().el)\r
this\r
\r
- panel_click: () ->\r
- @trigger('http_get', @panel_icon.url())\r
- \r
- author_click: () ->\r
- @trigger('http_get', @author_icon_with_caption.url())\r
- \r
@credit = new Pettanr.View.Credit(@picture, {})\r
@item.get_parent('panel', this, {\r
success: (@panel) =>\r
- @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
- @listenTo(@panel_icon, 'click', @panel_click)\r
+ @panel_face_button = @panel.mini_face_button({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', @panel.show_url())\r
+ })\r
@trigger('ready')\r
})\r
})\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@credit.render().el)\r
- this.$el.append(@panel_icon.render().el)\r
+ this.$el.append(@panel_face_button.render().el)\r
this\r
\r
- panel_click: () ->\r
- @trigger('http_get', @panel_icon.url())\r
- \r
tagName: 'div'\r
\r
initialize: (options) ->\r
- icon = new Pettanr.Views.Common.RootIcon()\r
- @button = new Tag.A({\r
- attr: {href: '/'}, \r
- content: icon.render().el\r
+ image = new Pettanr.ImageFile(Pettanr.View.Image.icon_root_file())\r
+ icon = new Pettanr.View.Icon(image)\r
+ @button = new Pettanr.View.Button('/', icon.render().el, {\r
+ context: this,\r
+ click: () =>\r
+ @trigger('click')\r
})\r
- @listenTo(@button, 'click', @click)\r
\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@button.render().el)\r
this\r
\r
- click: () ->\r
- @trigger('click')\r
- \r
+++ /dev/null
-class Pettanr.Views.OriginalPicture.Img extends Pettanr.View\r
- tagName: 'img'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.attr(@attr())\r
- this\r
- \r
- attr: () ->\r
- {\r
- src: @item.src(), \r
- width: Pettanr.to_s(Math.abs(@item.get('width'))) + 'px', \r
- height: Pettanr.to_s(Math.abs(@item.get('height'))) + 'px', \r
- }\r
- \r
class Pettanr.Views.OriginalPicture.ShowModule\r
-class Pettanr.Views.OriginalPicture.ShowModule.LinkedLicenseButton extends Tag.A\r
- \r
- initialize: (options) ->\r
- item = options.item\r
- super({\r
- attr: {href: '/' + item.license_url()}, \r
- content: I18n.t('original_pictures.show.select')\r
- })\r
- \r
-class Pettanr.Views.OriginalPicture.ShowModule.LinkedReplaceButton extends Tag.A\r
- \r
- initialize: (options) ->\r
- item = options.item\r
- super({\r
- attr: {href: '/' + item.edit_url()}, \r
- content: I18n.t('original_pictures.show.replace')\r
- })\r
- \r
-class Pettanr.Views.OriginalPicture.ShowModule.LinkedDropButton extends Tag.A\r
- \r
- initialize: (options) ->\r
- item = options.item\r
- super({\r
- attr: {href: '/' + item.destroy_url()}, \r
- content: I18n.t('link.destroy')\r
- })\r
- \r
-class Pettanr.Views.OriginalPicture.ShowModule.OwnerFooter extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show-owner-footer'\r
- \r
- initialize: (@item, options) ->\r
- @license = new Pettanr.Views.OriginalPicture.ShowModule.LinkedLicenseButton({item: @item})\r
- @edit = new Pettanr.Views.OriginalPicture.ShowModule.LinkedReplaceButton({item: @item})\r
- @destroy = new Pettanr.Views.OriginalPicture.ShowModule.LinkedDropButton({item: @item})\r
- @listenTo(@license, 'click', @click_license)\r
- @listenTo(@edit, 'click', @click_edit)\r
- @listenTo(@destroy, 'click', @click_destroy)\r
- \r
- render: () ->\r
- super()\r
- this.$el.append(@license.render().el)\r
- this.$el.append(@edit.render().el)\r
- dh = new Tag.H3({\r
- content: 'expert only'\r
- })\r
- this.$el.append(dh.render().el)\r
- this.$el.append(@destroy.render().el)\r
- this\r
- \r
- click_license: () ->\r
- @trigger('click:license')\r
- \r
- click_edit: () ->\r
- @trigger('click:edit')\r
- \r
- click_destroy: () ->\r
- @trigger('click:destroy')\r
- \r
-class Pettanr.Views.OriginalPicture.ShowModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- @listenTo(@footer, 'click:license', @click_license)\r
- \r
- click_license: () ->\r
- @trigger('click:footer:license')\r
- @trigger('click:license')\r
- \r
- footer_class: () ->\r
- Pettanr.Views.OriginalPicture.ShowModule.OwnerFooter\r
- \r
class Pettanr.Views.OriginalPicture.ShowModule.History extends Pettanr.View\r
\r
initialize: (options) ->\r
class Pettanr.Views.OriginalPicture.Show extends Pettanr.View.Show\r
\r
initialize: (options) ->\r
- @header = new Pettanr.View.Show.Header(@item, this, @binder_header_options())\r
+ @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())\r
@authored_by = @item.authored_by()\r
- @img = new Pettanr.Views.OriginalPicture.Img({item: @item})\r
+ @img = @item.real_picture()\r
+ @listenTo(@header, 'click:pick', @click_pick)\r
+ @listenTo(@authored_by, 'click', @click_authored_by)\r
@owner = new Pettanr.View.Show.Footer(@item, this, {\r
actions: {\r
- license: {\r
+ select: {\r
+ url: @original_picture.license_url(),\r
dic_name: 'original_pictures.show.select', \r
click: () =>\r
@create_dialog()\r
@trigger('click:license', @dialog)\r
}, \r
- edit: {\r
+ replace: {\r
+ url: @original_picture.edit_url(),\r
dic_name: 'original_pictures.show.replace', \r
click: () =>\r
@trigger('http_get', @item.edit_url())\r
}, \r
destroy: {\r
+ url: @item.destroy_url(),\r
click: () =>\r
redirect = (url) =>\r
@trigger('http_get', url)\r
}, \r
})\r
@history = new Pettanr.Views.OriginalPicture.ShowModule.History({item: @item})\r
- @listenTo(@authored_by, 'click', @click_authored_by)\r
@listenTo(@history, 'http_get', @http_get)\r
\r
render: () ->\r
this.$el.append(@header.render().el)\r
this.$el.append(@authored_by.render().el)\r
this.$el.append(@img.render().el)\r
- this.$el.append(@owner.render().el)\r
+ @item.get_parent('picture', this, {\r
+ success: (@picture) =>\r
+ @credit = new Pettanr.View.Credit(@picture, {\r
+ icon: {\r
+ click: () =>\r
+ @trigger('http_get', @picture.show_url())\r
+ }\r
+ })\r
+ this.$el.append(@credit.render().el)\r
+ this.$el.append(@owner.render().el)\r
+ })\r
this.$el.append(@history.render().el)\r
this\r
\r
- click_license: () ->\r
- @create_dialog()\r
- @trigger('click:license', @dialog)\r
- \r
- click_edit: () ->\r
- @trigger('http_get', @item.edit_url())\r
- \r
- click_destroy: () ->\r
- redirect = (url) =>\r
- @trigger('http_get', url)\r
- Pettanr.Proxy.destroy(@item, {redirect: redirect})\r
- \r
http_get: (url) ->\r
@trigger('http_get', url)\r
\r
+++ /dev/null
-class Pettanr.Views.SpeechBalloon.Icon extends Pettanr.Views.Common.Icon\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
@credit = new Pettanr.View.Credit(@picture, {})\r
@item.get_parent('panel', this, {\r
success: (@panel) =>\r
- @mini_face_button =@panel.mini_face_button({\r
+ @panel_face_button =@panel.mini_face_button({\r
context: this, \r
click: () ->\r
@trigger('http_get', @panel.show_url())\r
render: () ->\r
this.$el.html('')\r
this.$el.append(@credit.render().el)\r
- this.$el.append(@mini_face_button.render().el)\r
+ this.$el.append(@panel_face_button.render().el)\r
this\r
\r
this.$el.html('')\r
@panel.get_parent('author', this, {\r
success: (@author) =>\r
- @panel_icon = new Pettanr.Views.Panel.Icon({item: @panel, half: true})\r
- @author_icon = new Pettanr.Views.Author.Icon({item: @author, half: true})\r
- @inspire_icon = new Pettanr.Views.Show.LinkedInspireIcon({item: @panel, half: true})\r
- @edit_button = new Pettanr.Views.Show.LinkedEditButton({item: @panel})\r
- @listenTo(@panel_icon, 'click', @click_panel)\r
- @listenTo(@author_icon, 'click', @click_author)\r
- @listenTo(@edit_button, 'click', @click_edit)\r
- @listenTo(@inspire_icon, 'click', @click_inspire)\r
- this.$el.append(@panel_icon.render().el)\r
- this.$el.append(@author_icon.render().el)\r
+ panel_face_button = @panel.mini_face_button({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('click:panel')\r
+ })\r
+ author_face_button = @author.mini_face_button({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('click:author')\r
+ })\r
+ this.$el.append(panel_face_button.render().el)\r
+ this.$el.append(author_face_button.render().el)\r
this.$el.append(\r
Pettanr.AppHelper.distance_of_time_in_words_to_now(@panel.get('updated_at'))\r
)\r
if Pettanr.cache.operators.is_author()\r
- this.$el.append(@inspire_icon.render().el)\r
+ inspire_button = Pettanr.View.mini_face_button(\r
+ @panel, \r
+ Pettanr.View.Image.icon_inspire_file(), \r
+ {\r
+ context: this, \r
+ click: () =>\r
+ @trigger('click:inspire')\r
+ }\r
+ )\r
+ this.$el.append(inspire_icon.render().el)\r
if @panel.is_own()\r
- this.$el.append(@edit_button.render().el)\r
+ edit_button = new Pettanr.View.Button.ItemAction(@panel, 'edit', {\r
+ context: this, \r
+ click: () =>\r
+ @trigger('click:edit')\r
+ })\r
+ this.$el.append(edit_button.render().el)\r
})\r
this\r
\r
- click_panel: () ->\r
- @trigger('click:panel')\r
- \r
- click_author: () ->\r
- @trigger('click:author')\r
- \r
- click_edit: () ->\r
- @trigger('click:edit')\r
- \r
- click_inspire: () ->\r
- @trigger('click:inspire')\r
- \r
+++ /dev/null
-class Pettanr.Views.Panel.Icon extends Pettanr.Views.Common.Icon\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
+++ /dev/null
-class Pettanr.Views.ResourcePicture.Img extends Pettanr.View\r
- tagName: 'img'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.attr(@attr())\r
- this\r
- \r
- attr: () ->\r
- {\r
- src: @item.full_src(), \r
- width: Pettanr.to_s(Math.abs(@item.get('width'))) + 'px', \r
- height: Pettanr.to_s(Math.abs(@item.get('height'))) + 'px', \r
- }\r
- \r
+++ /dev/null
-class Pettanr.Views.ScrollPanel.Icon extends Pettanr.Views.Common.Icon\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
+++ /dev/null
-class Pettanr.Views.Scroll.Icon extends Pettanr.Views.Common.Icon\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
class Pettanr.Views.Scroll.PlayModule\r
-class Pettanr.Views.Scroll.PlayModule.Header extends Pettanr.Views.Show.Header\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Scroll.PlayModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
class Pettanr.Views.Scroll.PlayModule.FooterSwitch extends Pettanr.View\r
tagName: 'div'\r
className: 'player-item-switch'\r
+++ /dev/null
-class Pettanr.Views.Sheet.Icon extends Pettanr.Views.Common.Icon\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
class Pettanr.Views.Sheet.PlayModule\r
-class Pettanr.Views.Sheet.PlayModule.Header extends Pettanr.Views.Show.Header\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Sheet.PlayModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
class Pettanr.Views.Sheet.PlayModule.Footer extends Pettanr.View\r
tagName: 'table'\r
className: 'no-border'\r
+++ /dev/null
-class Pettanr.Views.Show\r
-class Pettanr.Views.Show.Header extends Pettanr.View\r
- tagName: 'h1'\r
- className: 'show-header'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @title = options.caption\r
- @icon_url = options.icon_url\r
- @caption_url = options.caption_url\r
- @prof_url = options.prof_url\r
- \r
- @pick = null\r
- @icon = new Pettanr.Image.Icon({item: @item, half: true})\r
- @icon_button = new Tag.A({\r
- attr: {href: '/' + @icon_url}, \r
- class_name: 'icon',\r
- content: @icon.render().el\r
- })\r
- @caption = new Tag.A({\r
- attr: {href: '/' + @caption_url},\r
- class_name: 'caption',\r
- content: _.escape(@title)\r
- })\r
- @prof = new Pettanr.Image.SymbolImg({attr: {src: '/images/prof.gif'}, half: true})\r
- @prof_button = new Tag.A({\r
- attr: {href: '/' + @prof_url}, \r
- class_name: 'prof',\r
- content: @prof.render().el\r
- })\r
- @listenTo(@icon_button, 'click', @click_icon)\r
- @listenTo(@caption, 'click', @click_caption)\r
- @listenTo(@prof_button, 'click', @click_prof)\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append(@pick.render().el) if @pick\r
- this.$el.append(@icon_button.render().el)\r
- this.$el.append(@caption.render().el)\r
- this.$el.append(@prof_button.render().el)\r
- this\r
- \r
- click_pick: () ->\r
- @trigger('click:pick')\r
- \r
- click_icon: () ->\r
- @trigger('click:icon')\r
- \r
- click_caption: () ->\r
- @trigger('click:caption')\r
- \r
- click_prof: () ->\r
- @trigger('click:prof')\r
- \r
- add_pick: (target_model) ->\r
- @pick = new Pettanr.Views.Common.PickIcon({\r
- name: target_model.pick_type(@item.item_name()), half: true\r
- })\r
- @listenTo(@pick, 'click', @click_pick)\r
- @render()\r
- \r
-class Pettanr.Views.Show.HeaderAuthor extends Pettanr.View\r
- tagName: 'div'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @item.get_parent('author', this, {\r
- success: (@author) =>\r
- name = @author.escape('name')\r
- author_url = @author.show_url()\r
- @linked_author = new Tag.A({\r
- attr: {href: '/' + author_url}, \r
- content: name\r
- })\r
- @listenTo(@linked_author, 'click', @click)\r
- @render()\r
- })\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append(Pettanr.AppHelper.t_a(@item.item_name(), 'author_id'))\r
- this.$el.append(@linked_author.render().el) if @linked_author\r
- this\r
- \r
- click: () ->\r
- @trigger('click:author')\r
- \r
-class Pettanr.Views.Show.HeaderArtist extends Pettanr.View\r
- tagName: 'div'\r
- \r
- initialize: (options) ->\r
- @item = options.item\r
- @item.get_parent('artist', this, {\r
- success: (@artist) =>\r
- name = @artist.escape('name')\r
- artist_url = @artist.show_url()\r
- @linked_artist = new Tag.A({\r
- attr: {href: '/' + artist_url}, \r
- content: name\r
- })\r
- @listenTo(@linked_artist, 'click', @click)\r
- @render()\r
- })\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append(Pettanr.AppHelper.t_a(@item.item_name(), 'artist_id'))\r
- this.$el.append(@linked_artist.render().el) if @linked_artist\r
- this\r
- \r
- click: () ->\r
- @trigger('click:artist')\r
- \r
-class Pettanr.Views.Show.LinkedNewButton extends Tag.A\r
- \r
- initialize: (options) ->\r
- item = options.item\r
- dn = options.dic_name || 'link.new'\r
- super({\r
- attr: {href: '/' + item.new_url()}, \r
- content: I18n.t(dn)\r
- })\r
- \r
-class Pettanr.Views.Show.LinkedEditButton extends Tag.A\r
- \r
- initialize: (options) ->\r
- item = options.item\r
- dn = options.dic_name || 'link.edit'\r
- super({\r
- attr: {href: '/' + item.edit_url()}, \r
- content: I18n.t(dn)\r
- })\r
- \r
-class Pettanr.Views.Show.LinkedDestroyButton extends Tag.A\r
- \r
- initialize: (options) ->\r
- item = options.item\r
- dn = options.dic_name || 'link.destroy'\r
- super({\r
- attr: {href: '/' + item.destroy_url()}, \r
- content: I18n.t(dn)\r
- })\r
- \r
-class Pettanr.Views.Show.LinkedInspireIcon extends Tag.A\r
- \r
- initialize: (options) ->\r
- item = options.item\r
- half = options.half\r
- img = new Pettanr.Image.SymbolImg({\r
- attr: {src: '/images/inspire.gif'}, half: half\r
- })\r
- super({\r
- attr: {href: '/' + item.index_url() + '/inspire'}, \r
- content: img.render().el\r
- })\r
- \r
-class Pettanr.Views.Show.OwnerFooter extends Pettanr.View\r
- tagName: 'div'\r
- className: 'show-owner-footer'\r
- \r
- initialize: (options) ->\r
- super(options)\r
- @item = options.item\r
- @edit = new Pettanr.Views.Show.LinkedEditButton({item: @item})\r
- @destroy = new Pettanr.Views.Show.LinkedDestroyButton({item: @item})\r
- @listenTo(@edit, 'click', @click_edit)\r
- @listenTo(@destroy, 'click', @click_destroy)\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append(@edit.render().el)\r
- this.$el.append(@destroy.render().el)\r
- this\r
- \r
- click_edit: () ->\r
- @trigger('click:edit')\r
- \r
- click_destroy: () ->\r
- @trigger('click:destroy')\r
- \r
-class Pettanr.Views.Show.Owner extends Pettanr.View\r
- tagName: 'div'\r
- \r
- initialize: (options) ->\r
- super(options)\r
- @item = options.item\r
- @header = new Tag.H3({\r
- class_name: 'owner-header',\r
- content: I18n.t('editor')\r
- })\r
- fc = @footer_class()\r
- @footer = new fc({item: @item})\r
- @listenTo(@footer, 'click:edit', @click_edit)\r
- @listenTo(@footer, 'click:destroy', @click_destroy)\r
- \r
- render: () ->\r
- this.$el.html('')\r
- this.$el.append(@header.render().el)\r
- this.$el.append(@footer.render().el)\r
- this\r
- \r
- click_edit: () ->\r
- @trigger('click:footer:edit')\r
- @trigger('click:edit')\r
- \r
- click_destroy: () ->\r
- @trigger('click:footer:destroy')\r
- @trigger('click:destroy')\r
- \r
- footer_class: () ->\r
- Pettanr.Views.Show.OwnerFooter\r
- \r
@item = options.item\r
@item.get_parent('panel', this, {\r
success: (@panel) =>\r
- @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
- @listenTo(@panel_icon, 'click', @panel_click)\r
+ @panel_face_button = @panel.mini_face_button({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', @panel.show_url())\r
+ })\r
@panel.get_parent('author', this, {\r
success: (@author) =>\r
- @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@author_icon_with_caption, 'click', @author_click)\r
+ @author_faced_label = @author.mini_faced_label({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', @author.show_url())\r
+ })\r
@trigger('ready')\r
})\r
})\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append(@panel_icon.render().el)\r
- this.$el.append(@author_icon_with_caption.render().el)\r
+ this.$el.append(@panel_face_button.render().el)\r
+ this.$el.append(@author_faced_label.render().el)\r
this\r
\r
- panel_click: () ->\r
- @trigger('http_get', @panel_icon.url())\r
- \r
- author_click: () ->\r
- @trigger('http_get', @author_icon_with_caption.url())\r
- \r
success: (@speech_balloon) =>\r
@speech_balloon.get_parent('panel', this, {\r
success: (@panel) =>\r
- @panel_icon = new Pettanr.Views.Common.Icon({item: @panel, half: true})\r
- @listenTo(@panel_icon, 'click', @panel_click)\r
+ @panel_face_button = @panel.mini_face_button({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', @panel.show_url())\r
+ })\r
@panel.get_parent('author', this, {\r
success: (@author) =>\r
- @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
- @listenTo(@author_icon_with_caption, 'click', @author_click)\r
+ @author_faced_label = @author.mini_faced_label({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', @author.show_url())\r
+ })\r
@trigger('ready')\r
})\r
})\r
\r
render: () ->\r
this.$el.html('')\r
- this.$el.append(@panel_icon.render().el)\r
- this.$el.append(@author_icon_with_caption.render().el)\r
+ this.$el.append(@panel_face_button.render().el)\r
+ this.$el.append(@author_faced_label.render().el)\r
this\r
\r
- panel_click: () ->\r
- @trigger('http_get', @panel_icon.url())\r
- \r
- author_click: () ->\r
- @trigger('http_get', @author_icon_with_caption.url())\r
- \r
+++ /dev/null
-class Pettanr.Views.Story.Icon extends Pettanr.Views.Common.Icon\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
class Pettanr.Views.Story.PlayModule\r
-class Pettanr.Views.Story.PlayModule.Header extends Pettanr.Views.Show.Header\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
-class Pettanr.Views.Story.PlayModule.Owner extends Pettanr.Views.Show.Owner\r
- \r
- initialize: (options) ->\r
- super(options)\r
- \r
class Pettanr.Views.Story.PlayModule.Footer extends Pettanr.View\r
tagName: 'table'\r
className: 'no-border'\r
\r
render: () ->\r
this.$el.html('')\r
- @logo = new Pettanr.Views.Common.Logo({})\r
- @listenTo(@logo, 'click', @logo_click)\r
+ @logo = new Pettanr.View.Layout.Logo({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', '')\r
+ })\r
this.$el.append(@logo.render().el)\r
if @author\r
@author_mini_faced_label = @author.mini_faced_label({\r
this.$el.append(sign_out.render().el)\r
this\r
\r
- logo_click: () ->\r
- @trigger('http_get', '')\r
- \r
sign_out_click: () ->\r
@trigger('http_post', 'users/sign_out')\r
return false\r
className: 'account'\r
\r
initialize: (options) ->\r
+ super(options)\r
\r
render: () ->\r
this.$el.html('')\r
- @logo = new Pettanr.Views.Common.Logo({})\r
- @listenTo(@logo, 'click', @logo_click)\r
- this.$el.append(@logo.render().el)\r
- sign_in = new Tag.A({\r
- attr: {href: '/users/sign_in'}, \r
+ @logo = new Pettanr.View.Layout.Logo({\r
+ context: this, \r
+ click: () ->\r
+ @trigger('http_get', '')\r
+ })\r
+ @sign_in_button = new Pettanr.View.Button('/users/sign_in', 'sign in', {\r
+ context: this, \r
class_name: 'sign_in', \r
- content: 'sign in'\r
+ click: () ->\r
+ @trigger('http_get', 'user_sessions/new')\r
})\r
- @listenTo(sign_in, 'click', @sign_in_click)\r
- this.$el.append(sign_in.render().el)\r
+ this.$el.append(@logo.render().el)\r
+ this.$el.append(@sign_in_button.render().el)\r
this\r
\r
- logo_click: () ->\r
- @trigger('http_get', '')\r
- return false\r
- \r
- sign_in_click: () ->\r
- @trigger('http_get', 'user_sessions/new')\r
- return false\r
- \r
//= require_directory ./models
//= require_directory ./view
//= require_directory ./view/button
+//= require_directory ./view/layout
//= require_directory ./view/show
//= require_directory ./view/show/header
//= require_directory ./view/show/footer
//= require_directory ./views/ground_colors
//= require_directory ./views/ground_pictures
//= require_directory ./views/home
-//= require_directory ./views/layouts
//= require_directory ./views/licenses
//= require_directory ./views/license_groups
//= require_directory ./views/original_pictures