@trigger('click')\r
\r
\r
-class Pettanr.Views.Common.LoadIcon extends Tag.Img\r
+class Pettanr.Views.Common.EmptyIcon extends Tag.Img\r
\r
- initialize: () ->\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'] = '/images/loading.gif'\r
+ @attr['src'] = @file_name()\r
@attr['width'] = @width\r
@attr['height'] = @height\r
@attr['alt'] = 'Loading'\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.BackIcon extends Pettanr.Views.Common.EmptyIcon\r
+ \r
+ file_name: () ->\r
+ '/images/back.gif'\r
+ \r
+class Pettanr.Views.Common.ForwardIcon extends Pettanr.Views.Common.EmptyIcon\r
+ \r
+ file_name: () ->\r
+ '/images/forward.gif'\r
+ \r
class Pettanr.Views.Common.EmptyCaption extends Backbone.View\r
tagName: 'div'\r
className: 'empty'\r
--- /dev/null
+class Pettanr.Views.History extends Backbone.View\r
+ tagName: 'div'\r
+ className: 'history'\r
+ \r
+ initialize: (options) ->\r
+ @back = new Pettanr.Views.History.Back({})\r
+ @forward = new Pettanr.Views.History.Forward({})\r
+ @list = new Pettanr.Views.History.List({})\r
+ @root = new Pettanr.Views.History.Root({})\r
+ @listenTo(@back, 'click', @click_back)\r
+ @listenTo(@forward, 'click', @click_forward)\r
+ @listenTo(@root, 'click', @click_root)\r
+ \r
+ render: () ->\r
+ this.$el.html('')\r
+ this.$el.append(@back.render().el)\r
+ this.$el.append(@forward.render().el)\r
+ this.$el.append(@list.render().el)\r
+ this.$el.append(@root.render().el)\r
+ this\r
+ \r
+ # push history\r
+ navigate: (params) ->\r
+ # get caption and icon\r
+ \r
+ click_back: () ->\r
+ @list.back()\r
+ \r
+ click_forward: () ->\r
+ @list.forward()\r
+ \r
+ click_root: () ->\r
+ @trigger('http_get', 'folders/root')\r
+ \r
+ \r
+class Pettanr.Views.History.Back extends Backbone.View\r
+ \r
+ initialize: (options) ->\r
+ icon = new Pettanr.Views.Common.BackIcon()\r
+ @button = new Tag.A({\r
+ attr: {href: '#'}, \r
+ content: icon\r
+ })\r
+ @listenTo(@button, 'click', @click)\r
+ \r
+ render: () ->\r
+ this.$el.html(@button.render().el)\r
+ this\r
+ \r
+ click: () ->\r
+ @trigger('click')\r
+ \r
+class Pettanr.Views.History.Forward extends Backbone.View\r
+ \r
+ initialize: (options) ->\r
+ icon = new Pettanr.Views.Common.ForwardIcon()\r
+ @button = new Tag.A({\r
+ attr: {href: '#'}, \r
+ content: icon\r
+ })\r
+ @listenTo(@button, 'click', @click)\r
+ \r
+ render: () ->\r
+ this.$el.html(@button.render().el)\r
+ this\r
+ \r
+ click: () ->\r
+ @trigger('click')\r
+ \r
+class Pettanr.Views.History.List extends Backbone.View\r
+ \r
+class Pettanr.Views.History.Root extends Backbone.View\r
+ \r
+ initialize: (options) ->\r
+ icon = new Pettanr.Views.Common.RootIcon()\r
+ @button = new Tag.A({\r
+ attr: {href: '#'}, \r
+ content: icon\r
+ })\r
+ @listenTo(@button, 'click', @click)\r
+ \r
+ render: () ->\r
+ this.$el.html(@button.render().el)\r
+ this\r
+ \r
+ click: () ->\r
+ @trigger('click')\r
+ \r