children_html: () -> \r
@redraw_title(@params, @item.get('name'))\r
collection = new Pettanr.Folder.Children({id: @item.get('id')})\r
- collection.fetch({cache: true}).done ->\r
+ collection.fetch({cache: true}).done =>\r
f = new Locmare.Filer({\r
item_name: 'folder', \r
items: collection.models, \r
tab.label\r
labels = new Tag.Ul({contents: l, class_name: @dom_labels_class()})\r
this.$el.append(labels.render().el)\r
- _this = this\r
- _.each @tabs, (tab) ->\r
- _this.$el.append(tab.render().el)\r
+ _.each @tabs, (tab) =>\r
+ this.$el.append(tab.render().el)\r
this\r
\r
editor: () ->\r
\r
initialize: (options) ->\r
super(options)\r
- _this = this\r
i = 0\r
- _.each @elements(), (element) ->\r
+ _.each @elements(), (element) =>\r
tab = new Editor.EditorModule.DockModule.ElementBoard({\r
- parent: _this, index: i, name: element.item_name(), element: element\r
+ parent: this, index: i, name: element.item_name(), element: element\r
})\r
- _this.add_tab(\r
+ @add_tab(\r
tab, \r
new Editor.EditorModule.DockModule.TabModule.ElementBoardLabel({parent: tab, name: element.item_name()}), \r
new Editor.EditorModule.DockModule.TabModule.ElementBoardBody({parent: tab})\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
- labels = _.map @tabs, (tab) ->\r
+ labels = _.map @tabs, (tab) =>\r
tab.label\r
inner_elements_tabs = new Editor.EditorModule.DockModule.ElementBay.InnerElementsTabs({\r
labels: labels\r
})\r
this.$el.append(inner_elements_tabs.render().el)\r
- _.each @tabs, (tab) ->\r
- _this.$el.append(tab.body.render().el)\r
+ _.each @tabs, (tab) =>\r
+ this.$el.append(tab.body.render().el)\r
this\r
\r
class Editor.EditorModule.DockModule.ElementBay.InnerElementsTabs extends Backbone.View\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
- _.each @labels, (label) ->\r
- _this.$el.append(label.render().el)\r
+ _.each @labels, (label) =>\r
+ this.$el.append(label.render().el)\r
this\r
\r
class Editor.EditorModule.DockModule.TabModule.ElementBayLabel extends Editor.EditorModule.DockModule.TabModule.BayLabel\r
\r
initialize: (options) ->\r
super(options)\r
- _this = this\r
i = 0\r
- _.each @elements(), (element) ->\r
+ _.each @elements(), (element) =>\r
tab = new Editor.EditorModule.DockModule.ScenarioBoard({\r
- parent: _this, index: i, name: element.item_name(), element: element\r
+ parent: this, index: i, name: element.item_name(), element: element\r
})\r
- _this.add_tab(\r
+ @add_tab(\r
tab, \r
new Editor.EditorModule.DockModule.TabModule.ScenarioBoardLabel({parent: tab, caption: element.item_name()}), \r
new Editor.EditorModule.DockModule.TabModule.ScenarioBoardBody({parent: tab})\r
render: () ->\r
this.$el.html('')\r
this.$el.attr('id', @body.dom_id())\r
- _this = this\r
elements_tabs = new Editor.EditorModule.DockModule.ScenarioBay.ScenarioTabs({\r
tabs: @tabs\r
})\r
this.$el.append(elements_tabs.render().el)\r
- _.each @tabs, (tab) ->\r
- _this.$el.append(tab.body.render().el)\r
+ _.each @tabs, (tab) =>\r
+ this.$el.append(tab.body.render().el)\r
elements_tabs.$el.tabs()\r
this\r
\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
- _.each @tabs, (tab) ->\r
- _this.$el.append(tab.label.render().el)\r
+ _.each @tabs, (tab) =>\r
+ this.$el.append(tab.label.render().el)\r
this\r
\r
class Editor.EditorModule.DockModule.TabModule.ScenarioBayLabel extends Editor.EditorModule.DockModule.TabModule.BayLabel\r
\r
initialize: (options) ->\r
super(options)\r
- _this = this\r
i = 0\r
- _.each @elements(), (element) ->\r
+ _.each @elements(), (element) =>\r
tab = new Editor.EditorModule.DockModule.PriorityBoard({\r
- parent: _this, index: i, name: element.item_name(), element: element\r
+ parent: this, index: i, name: element.item_name(), element: element\r
})\r
- _this.add_tab(\r
+ @add_tab(\r
tab, \r
new Editor.EditorModule.DockModule.TabModule.PriorityBoardLabel({parent: tab, name: element.item_name()}), \r
new Editor.EditorModule.DockModule.TabModule.PriorityBoardBody({parent: tab})\r
render: () ->\r
this.$el.html('')\r
this.$el.attr('id', @body.dom_id())\r
- _this = this\r
elements_tabs = new Editor.EditorModule.DockModule.PriorityBay.PriorityTabs({\r
tabs: @tabs\r
})\r
this.$el.append(elements_tabs.render().el)\r
- _.each @tabs, (tab) ->\r
- _this.$el.append(tab.body.render().el)\r
+ _.each @tabs, (tab) =>\r
+ this.$el.append(tab.body.render().el)\r
elements_tabs.$el.tabs()\r
this\r
\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
- _.each @tabs, (tab) ->\r
- _this.$el.append(tab.label.render().el)\r
+ _.each @tabs, (tab) =>\r
+ this.$el.append(tab.label.render().el)\r
this\r
\r
class Editor.EditorModule.DockModule.TabModule.PriorityBayLabel extends Editor.EditorModule.DockModule.TabModule.BayLabel\r
(new Locmare.ListGroupModule.LibModule.PagerModule.PageGap()).render().el\r
)\r
_.each @range(), (page) =>\r
- _this.$el.append(\r
+ this.$el.append(\r
(new Locmare.ListGroupModule.LibModule.PagerModule.Page({\r
parent: this, page: page, class_name: 'page'\r
})).render().el\r
open: (cb) ->\r
@url = '/' + @action_manifest.url(@params)\r
@fetch({cache: true}).done =>\r
- #_this.boost(items)\r
+ # @boost(items)\r
cb()\r
\r
#i = new Pettanr.PanelPicture({id: 21})\r
#i = new Pettanr.License({id: 4})\r
i = new Pettanr.SpeechBalloon({id: 49})\r
- i.fetch().done ->\r
+ i.fetch().done =>\r
b = new Pettanr.Balloon({id: 49})\r
- b.fetch().done ->\r
+ b.fetch().done =>\r
s = new Pettanr.Speech({id: 49})\r
- s.fetch().done ->\r
+ s.fetch().done =>\r
i.speech = s\r
i.balloon= b\r
form = new Locmare.Bucket.factory(\r
@inflectors = @global_json.inflectors\r
@item_names = {}\r
@table_names = {}\r
- _this = this\r
- _.each @inflectors, (table_name, item_name) ->\r
- _this.item_names[item_name] = table_name # monkey copy\r
- _this.table_names[table_name] = item_name\r
+ _.each @inflectors, (table_name, item_name) =>\r
+ @item_names[item_name] = table_name # monkey copy\r
+ @table_names[table_name] = item_name\r
@items = ManifestBase.load_type_name_args(this, @global_json, 'items', Manifest.ItemFactory)\r
@controllers = Manifest.Controller.load(this, @global_json, 'controllers', Manifest.Controller)\r
@models = Manifest.Model.load(this, @global_json, 'models', Manifest.Model)\r
\r
child_model_manifests: () ->\r
r = []\r
- _this = this\r
- _.each Manifest.manifest().items, (peta_manifest, peta_name) ->\r
+ _.each Manifest.manifest().items, (peta_manifest, peta_name) =>\r
return if not peta_manifest.is_element()\r
- return if peta_manifest.parent_item_name != _this.name\r
+ return if peta_manifest.parent_item_name != @name\r
r.push Manifest.manifest().models[peta_name]\r
r\r
\r
@parent.item_name()\r
\r
parent_models: () ->\r
- _this = this\r
- _.map _belongs_to, (belongs_to_manifest, name) ->\r
- pm = _this.parent.classify()\r
+ _.map _belongs_to, (belongs_to_manifest, name) =>\r
+ pm = @parent.classify()\r
next if not pm.is_element()\r
if pm.my_peta.type == 'element'\r
next if not belongs_to_manifest.model.my_peta.type == 'root'\r
\r
symbol_option: (cb) ->\r
sb = @speech_balloon()\r
- sb.fetch({cache: true}).done ->\r
+ sb.fetch({cache: true}).done =>\r
sbt = sb.speech_balloon_template()\r
- sbt.fetch({cache: true}).done ->\r
+ sbt.fetch({cache: true}).done =>\r
sp = sbt.system_picture()\r
- sp.fetch({cache: true}).done ->\r
+ sp.fetch({cache: true}).done =>\r
cb(sp.tmb_opt_img_tag())\r
\r
initialize: () ->\r
\r
symbol_option: (cb) ->\r
i = @picture()\r
- _this = this\r
- i.fetch({cache: true}).done ->\r
- cb(_this.tmb_opt_img_tag(i))\r
+ i.fetch({cache: true}).done =>\r
+ cb(@tmb_opt_img_tag(i))\r
\r
repeat_text: () ->\r
Pettanr.GroundPicture.repeat_texts()[@get('repeat')]\r
\r
symbol_option: (cb) ->\r
i = @system_picture()\r
- i.fetch({cache: true}).done ->\r
+ i.fetch({cache: true}).done =>\r
cb(i.tmb_opt_img_tag())\r
\r
caption_with_group: () ->\r
@license_group = options.license_group\r
\r
render: () ->\r
- _this = this\r
- @license_group.fetch({cache: true}).done ->\r
- _this.$el.html(_this.license_group.get('caption') + '/' + _this.license.get('caption'))\r
+ @license_group.fetch({cache: true}).done =>\r
+ this.$el.html(@license_group.get('caption') + '/' + @license.get('caption'))\r
this\r
\r
})\r
\r
symbol_option: (cb) ->\r
- _this = this\r
- this.fetch({cache: true}).done ->\r
- cb(_this.tmb_opt_img_tag())\r
+ this.fetch({cache: true}).done =>\r
+ cb(@tmb_opt_img_tag())\r
\r
revision: () ->\r
new Pettanr.OriginalPicture.Head({original_picture: this})\r
@pictures = new Pettanr.OriginalPicture.History({id: @original_picture.get('id')})\r
\r
render: () ->\r
- _this = this\r
- @pictures.fetch({cache: true}).done ->\r
- head = _this.pictures.models[0]\r
+ @pictures.fetch({cache: true}).done =>\r
+ head = @pictures.models[0]\r
value = if head\r
head.get('revision')\r
else\r
'unpublished'\r
- _this.$el.html(value)\r
+ this.$el.html(value)\r
this\r
\r
\r
symbol_option: (cb) ->\r
i = @picture()\r
- _this = this\r
- i.fetch({cache: true}).done ->\r
- cb(_this.tmb_opt_img_tag(i))\r
+ i.fetch({cache: true}).done =>\r
+ cb(@tmb_opt_img_tag(i))\r
\r
element_face: () ->\r
new Pettanr.Views.PanelPicture.ElementFace({element: this})\r
lgn + '[' + ln + ']'\r
\r
symbol_option: (cb) ->\r
- _this = this\r
- this.fetch({cache: true}).done ->\r
- cb(_this.tmb_opt_img_tag())\r
+ @fetch({cache: true}).done =>\r
+ cb(@tmb_opt_img_tag())\r
\r
is_enable: () ->\r
if @head().resource_picture()\r
lgn + '[' + ln + ']'\r
\r
symbol_option: (cb) ->\r
- _this = this\r
- this.fetch({cache: true}).done ->\r
- cb(_this.tmb_opt_img_tag())\r
+ @fetch({cache: true}).done =>\r
+ cb(@tmb_opt_img_tag())\r
\r
credit_icon_view: () ->\r
new Pettanr.Views.ResourcePicture.CreditIcon({item: this})\r
\r
symbol_option: (cb) ->\r
sb = @speech_balloon()\r
- sb.fetch({cache: true}).done ->\r
+ sb.fetch({cache: true}).done =>\r
sbt = sb.speech_balloon_template()\r
- sbt.fetch({cache: true}).done ->\r
+ sbt.fetch({cache: true}).done =>\r
sp = sbt.system_picture()\r
- sp.fetch({cache: true}).done ->\r
+ sp.fetch({cache: true}).done =>\r
cb(sp.tmb_opt_img_tag())\r
\r
text_align_text: () ->\r
\r
symbol_option: (cb) ->\r
sbt = @speech_balloon_template()\r
- sbt.fetch({cache: true}).done ->\r
+ sbt.fetch({cache: true}).done =>\r
sp = sbt.system_picture()\r
- sp.fetch({cache: true}).done ->\r
+ sp.fetch({cache: true}).done =>\r
cb(sp.tmb_opt_img_tag())\r
\r
plain_scenario: () ->\r
\r
symbol_option: (cb) ->\r
i = @system_picture()\r
- i.fetch({cache: true}).done ->\r
+ i.fetch({cache: true}).done =>\r
cb(i.tmb_opt_img_tag())\r
\r
parsed_settings: () ->\r
})\r
\r
symbol_option: (cb) ->\r
- _this = this\r
- this.fetch({cache: true}).done ->\r
- cb(_this.tmb_opt_img_tag())\r
+ @fetch({cache: true}).done =>\r
+ cb(@tmb_opt_img_tag())\r
\r
initialize: () ->\r
if @id\r
class Pettanr.User.Current extends Pettanr.User\r
\r
save: (model_attr, after_save = null) ->\r
- _this = this\r
super(model_attr, {\r
- success: (model, response, options) ->\r
- author = new Pettanr.Author(_this.get('author')) if _this.get('author')\r
- artist = new Pettanr.Artist(_this.get('artist')) if _this.get('artist')\r
+ success: (model, response, options) =>\r
+ author = new Pettanr.Author(@get('author')) if @get('author')\r
+ artist = new Pettanr.Artist(@get('artist')) if @get('artist')\r
window.operators = new Pettanr.Operator({\r
- user: _this, \r
+ user: this, \r
author: author, \r
artist: artist\r
})\r
if after_save\r
- after_save(_this)\r
+ after_save(this)\r
error: (model, response, options) ->\r
r = new Pettanr.Views.User.Index({})\r
$("#pettanr").html(r.render().el)\r
\r
symbol_option: (cb) ->\r
i = @system_picture()\r
- i.fetch({cache: true}).done ->\r
+ i.fetch({cache: true}).done =>\r
cb(i.tmb_opt_img_tag())\r
\r
initialize: () ->\r
@get(n)\r
\r
elements_items: () ->\r
- _this = this\r
- r = _.map @my_class().child_models, (element_model) ->\r
- _this.element_items(element_model)\r
+ r = _.map @my_class().child_models, (element_model) =>\r
+ @element_items(element_model)\r
_.flatten(r)\r
\r
boosts: (level) ->\r
super(level)\r
- _.each @elements_items(), (item) ->\r
+ _.each @elements_items(), (item) =>\r
item.boosts(level)\r
\r
get: (name) ->\r
val = super(name)\r
return val if !(typeof val == 'object')\r
- _this = this\r
attrs = val\r
r = null\r
- _.each @my_class().child_models(), (element_model) ->\r
- n = _this.my_class().my_manifest().associations.child_element_name(element_model)\r
+ _.each @my_class().child_models(), (element_model) =>\r
+ n = @my_class().my_manifest().associations.child_element_name(element_model)\r
if n == name\r
- if _this.my_class().my_manifest().associations.is_has_one(element_model)\r
+ if @my_class().my_manifest().associations.is_has_one(element_model)\r
r = new element_model(attrs)\r
else\r
- r = _.map attrs, (attr) ->\r
+ r = _.map attrs, (attr) =>\r
new element_model(attr)\r
r\r
\r
@item_name()\r
\r
boosts: (level) ->\r
- _this = this\r
c = @my_class().my_peta().boost\r
- _.each c, (boost_manifest, boost_name) ->\r
+ _.each c, (boost_manifest, boost_name) =>\r
return if level == 'read' and boost_manifest.level == 'post'\r
- _this.boost boost_manifest\r
+ @boost boost_manifest\r
\r
boost: (boost_manifest) ->\r
@boosters ||= {}\r
\r
parts_element: () ->\r
r = []\r
- _this = this\r
- _.each @my_class().child_models(), (k) ->\r
- l = _this.element_items(k)\r
+ _.each @my_class().child_models(), (k) =>\r
+ l = @element_items(k)\r
r = r.concat(l)\r
r\r
\r
zorderd_elements: () ->\r
res = []\r
- _.each @parts_element, (e) ->\r
+ _.each @parts_element, (e) =>\r
res[e.get('z')-1] = e\r
res\r
\r
scenario_elements: () ->\r
res = []\r
- _.each @parts_element(), (e) ->\r
+ _.each @parts_element(), (e) =>\r
res[e.get('t')] = e\r
res\r
\r
names = _.map Manifest.manifest().controllers, (controller_manifest, controller_name) ->\r
c = Pettanr[Pettanr.camelize(controller_name) + 'Controller']\r
controller = new c\r
- _.map controller_manifest.actions, (action_manifest, action_name) ->\r
+ _.map controller_manifest.actions, (action_manifest, action_name) =>\r
{\r
event_name: controller_name + '_' + action_name, \r
controller: controller,\r
action_manifest: action_manifest,\r
action_name: action_name\r
}\r
- _this = this\r
- _.each _.flatten(names), (status) ->\r
+ _.each _.flatten(names), (status) =>\r
_status = status\r
switch status.action_manifest.type\r
when 'list'\r
e = status.event_name\r
e_f = e + '_format'\r
- _this[e] = (queryString) ->\r
- params = _this.parse_query_string(query_string)\r
+ this[e] = (queryString) =>\r
+ params = @parse_query_string(query_string)\r
console.log(params)\r
_status.controller[_status.action_name](params)\r
c = _status.controller_name\r
a = _status.action_name\r
c_a_url = c + '/' + a\r
- _this.route(c_a_url, e)\r
+ @route(c_a_url, e)\r
r = r + '?*queryString'\r
- _this.route(r, _status.event_name)\r
+ @route(r, _status.event_name)\r
if _status.action_name == 'index'\r
r = _status.controller_name + '/'\r
- _this.route(r, _status.event_name)\r
+ @route(r, _status.event_name)\r
when 'show'\r
e = status.event_name\r
e_f = e + '_format'\r
- _this[e] = (id, query_string) ->\r
- params = _this.parse_query_string(query_string)\r
+ this[e] = (id, query_string) =>\r
+ params = @parse_query_string(query_string)\r
t = id.split('.')\r
if t.length > 1\r
params['format'] = t[1]\r
console.log(id)\r
console.log(params)\r
_status.controller[_status.action_name](id, params)\r
- _this[e_f] = (id, format, query_string) ->\r
- params = _this.parse_query_string(query_string)\r
+ this[e_f] = (id, format, query_string) =>\r
+ params = @parse_query_string(query_string)\r
params['format'] = format\r
console.log(id)\r
console.log(params)\r
c_id_a_f_url = c + '/:id/' + a + '.:format'\r
c_id_a_q_url = c_id_a_url + q\r
c_id_a_q_url = c_id_a_url + '.:format' + q\r
- _this.route(c_id_a_q_url, e_f)\r
- _this.route(c_id_a_q_url, e)\r
- _this.route(c_id_a_f_url, e_f)\r
- _this.route(c_id_a_url, e)\r
+ @route(c_id_a_q_url, e_f)\r
+ @route(c_id_a_q_url, e)\r
+ @route(c_id_a_f_url, e_f)\r
+ @route(c_id_a_url, e)\r
if a == 'show'\r
c_id_url = c + '/:id'\r
c_id_q_url = c_id_url + q\r
- _this.route(c_id_q_url, e)\r
- _this.route(c_id_url, e)\r
+ @route(c_id_q_url, e)\r
+ @route(c_id_url, e)\r
\r
@spot = options.spot\r
\r
render: () ->\r
- _this = this\r
system_picture = @element.system_picture()\r
- system_picture.fetch({cache: true}).done ->\r
+ system_picture.fetch({cache: true}).done =>\r
attr = {\r
src: system_picture.r_url(), \r
- alt: _this.element.get('caption')\r
+ alt: @element.get('caption')\r
}\r
- _this.$el.attr(attr)\r
+ this.$el.attr(attr)\r
this\r
\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
- @speech_balloon.fetch({cache: true}).done ->\r
- panel = _this.speech_balloon.panel()\r
- panel.fetch({cache: true}).done ->\r
+ @speech_balloon.fetch({cache: true}).done =>\r
+ panel = @speech_balloon.panel()\r
+ panel.fetch({cache: true}).done =>\r
panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
- _this.$el.append(panel_icon.render().el)\r
+ this.$el.append(panel_icon.render().el)\r
this\r
\r
@visible = new Tag.Div({\r
content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
})\r
- _this = this\r
@author = @item.author()\r
- @author.fetch({cache: true}).done ->\r
- _this.author_icon_with_caption = _this.author.icon_with_caption_view(true, 'name', 12)\r
- _this.render()\r
+ @author.fetch({cache: true}).done =>\r
+ @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
+ @render()\r
\r
render: () ->\r
this.$el.html('')\r
@item = options.item\r
@binder_item_name = options.binder_item_name\r
@destination_item_name = options.destination_item_name\r
- _this = this\r
@binder = @item[@binder_item_name]()\r
- @binder.fetch({cache: true}).done ->\r
- _this.binder_icon = _this.binder.icon_view(true)\r
- _this.binder_author = _this.binder.author()\r
- _this.binder_author.fetch({cache: true}).done ->\r
- _this.binder_author_icon_with_caption = _this.binder_author.icon_with_caption_view(true, 'name', 12)\r
- _this.render()\r
+ @binder.fetch({cache: true}).done =>\r
+ @binder_icon = @binder.icon_view(true)\r
+ @binder_author = @binder.author()\r
+ @binder_author.fetch({cache: true}).done =>\r
+ @binder_author_icon_with_caption = @binder_author.icon_with_caption_view(true, 'name', 12)\r
+ @render()\r
@destination = @item[@destination_item_name]()\r
- @destination.fetch({cache: true}).done ->\r
- _this.destination_icon = _this.destination.icon_view(true)\r
- _this.destination_author = _this.destination.author()\r
- _this.destination_author.fetch({cache: true}).done ->\r
- _this.destination_author_icon_with_caption = _this.destination_author.icon_with_caption_view(true, 'name', 12)\r
- _this.render()\r
+ @destination.fetch({cache: true}).done =>\r
+ @destination_icon = @destination.icon_view(true)\r
+ @destination_author = @destination.author()\r
+ @destination_author.fetch({cache: true}).done =>\r
+ @destination_author_icon_with_caption = @destination_author.icon_with_caption_view(true, 'name', 12)\r
+ @render()\r
\r
render: () ->\r
this.$el.html('')\r
caption_url: caption_url,\r
prof_url: prof_url\r
})\r
- _this = this\r
@panel = @item.panel()\r
- @panel.fetch({cache: true}).done ->\r
- _this.author = new Pettanr.Views.Show.HeaderAuthor({item: _this.panel})\r
- _this.render()\r
+ @panel.fetch({cache: true}).done =>\r
+ @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})\r
+ @render()\r
\r
render: () ->\r
this.$el.html('')\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
panel = @item.panel()\r
- panel.fetch({cache: true}).done ->\r
+ panel.fetch({cache: true}).done =>\r
panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
- _this.$el.append(panel_icon.render().el)\r
+ this.$el.append(panel_icon.render().el)\r
this\r
\r
\r
render: () ->\r
picture = @element.picture()\r
- _this = this\r
- picture.fetch({cache: true}).done ->\r
- img = _this.element.tmb_opt_img_tag(picture)\r
- _this.$el.html(img.render().el)\r
+ picture.fetch({cache: true}).done =>\r
+ img = @element.tmb_opt_img_tag(picture)\r
+ this.$el.html(img.render().el)\r
this\r
\r
class Pettanr.Views.GroundPicture.ElementFace extends Backbone.View\r
caption_url: caption_url,\r
prof_url: prof_url\r
})\r
- _this = this\r
@panel = @item.panel()\r
- @panel.fetch({cache: true}).done ->\r
- _this.author = new Pettanr.Views.Show.HeaderAuthor({item: _this.panel})\r
- _this.render()\r
+ @panel.fetch({cache: true}).done =>\r
+ @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})\r
+ @render()\r
\r
render: () ->\r
this.$el.html('')\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
- @picture.fetch({cache: true}).done ->\r
- credit = _this.picture.credit_view(false)\r
- _this.$el.append(credit.render().el)\r
- panel = _this.item.panel()\r
- panel.fetch({cache: true}).done ->\r
+ @picture.fetch({cache: true}).done =>\r
+ credit = @picture.credit_view(false)\r
+ this.$el.append(credit.render().el)\r
+ panel = @item.panel()\r
+ panel.fetch({cache: true}).done =>\r
panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
- _this.$el.append(panel_icon.render().el)\r
+ this.$el.append(panel_icon.render().el)\r
this\r
\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
@system_picture = @item.system_picture()\r
- @system_picture.fetch({cache: true}).done ->\r
+ @system_picture.fetch({cache: true}).done =>\r
img = new Tag.Img({\r
attr: {\r
- src: _this.system_picture.r_url()\r
+ src: @system_picture.r_url()\r
}\r
})\r
- _this.$el.html(img.render().el)\r
+ this.$el.html(img.render().el)\r
this\r
\r
#@item = new Pettanr.OriginalPicture({id: options.item.get('id')}) # with resource_picture\r
\r
render: () ->\r
- _this = this\r
- @item.fetch({cache: false}).done ->\r
- _this.$el.html('')\r
+ @item.fetch({cache: false}).done =>\r
+ this.$el.html('')\r
visible = new Tag.Span({\r
class_name: 'state',\r
- content: I18n.t('original_pictures.' + _this.item.state())\r
+ content: I18n.t('original_pictures.' + @item.state())\r
})\r
- _this.$el.append(visible.render().el)\r
- if ra = _this.item.get('resource_picture')\r
+ this.$el.append(visible.render().el)\r
+ if ra = @item.get('resource_picture')\r
resource_picture = new Pettanr.ResourcePicture(ra)\r
credit = resource_picture.credit_view(true)\r
- _this.$el.append(credit.render().el)\r
+ this.$el.append(credit.render().el)\r
rb = new Tag.RowBreak()\r
- _this.$el.append(rb.render().el)\r
+ this.$el.append(rb.render().el)\r
this\r
\r
@attr = {style: Pettanr.to_style(@opt_div_style())}\r
this.$el.attr(@attr)\r
@picture = @element.picture()\r
- _this = this\r
- @picture.fetch({cache: true}).done ->\r
- _this.img = new Tag.Img({\r
- attr: _this.opt_img_tag(_this.spot)\r
+ @picture.fetch({cache: true}).done =>\r
+ @img = new Tag.Img({\r
+ attr: @opt_img_tag(@spot)\r
})\r
- _this.$el.html(_this.img.render().el)\r
+ this.$el.html(@img.render().el)\r
this\r
\r
opt_div_style: () ->\r
\r
render: () ->\r
picture = @element.picture()\r
- _this = this\r
- picture.fetch({cache: true}).done ->\r
- img = _this.element.tmb_opt_img_tag(picture)\r
- _this.$el.html(img.render().el)\r
+ picture.fetch({cache: true}).done =>\r
+ img = @element.tmb_opt_img_tag(picture)\r
+ this.$el.html(img.render().el)\r
this\r
\r
class Pettanr.Views.PanelPicture.ElementFace extends Backbone.View\r
caption_url: caption_url,\r
prof_url: prof_url\r
})\r
- _this = this\r
@panel = @item.panel({with_elements: true})\r
- @panel.fetch({cache: false}).done -> # with elements\r
- _this.author = new Pettanr.Views.Show.HeaderAuthor({item: _this.panel})\r
- _this.body = new Pettanr.Views.Panel.Body({\r
- panel: _this.panel,\r
- operators: _this.operators,\r
- spot: _this.item\r
+ @panel.fetch({cache: false}).done => # with elements\r
+ @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})\r
+ @body = new Pettanr.Views.Panel.Body({\r
+ panel: @panel,\r
+ operators: @operators,\r
+ spot: @item\r
})\r
- _this.credits = new Pettanr.Views.Panel.Show.Credits({panel: _this.panel})\r
+ @credits = new Pettanr.Views.Panel.Show.Credits({panel: @panel})\r
rb = new Tag.RowBreak()\r
- _this.$el.append(rb.render().el)\r
- _this.render()\r
+ this.$el.append(rb.render().el)\r
+ @render()\r
\r
render: () ->\r
this.$el.html('')\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
- @picture.fetch({cache: true}).done ->\r
- credit = _this.picture.credit_view(false)\r
- _this.$el.append(credit.render().el)\r
- panel = _this.item.panel()\r
- panel.fetch({cache: true}).done ->\r
+ @picture.fetch({cache: true}).done =>\r
+ credit = @picture.credit_view(false)\r
+ this.$el.append(credit.render().el)\r
+ panel = @item.panel()\r
+ panel.fetch({cache: true}).done =>\r
panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
- _this.$el.append(panel_icon.render().el)\r
+ this.$el.append(panel_icon.render().el)\r
this\r
\r
@restyle()\r
if @panel.is_visible(@operators)\r
this.$el.html('')\r
- _this = this\r
l = @panel.scenario_elements()\r
_.each l, (element) =>\r
@add_element(element)\r
@pictures = options.pictures\r
\r
render: () ->\r
- _this = this\r
this.$el.html('')\r
- _.each @pictures, (picture) ->\r
- picture.fetch({cache: true}).done ->\r
+ _.each @pictures, (picture) =>\r
+ picture.fetch({cache: true}).done =>\r
credit = picture.credit_view()\r
- _this.$el.append(credit.render().el)\r
+ this.$el.append(credit.render().el)\r
this\r
\r
@visible = new Tag.Div({\r
content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
})\r
- _this = this\r
@author = @item.author()\r
- @author.fetch({cache: true}).done ->\r
- _this.author_icon_with_caption = _this.author.icon_with_caption_view(true, 'name', 12)\r
- _this.render()\r
+ @author.fetch({cache: true}).done =>\r
+ @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
+ @render()\r
\r
render: () ->\r
this.$el.html('')\r
if @with_icon\r
p = @item.credit_icon_view()\r
this.$el.append(p.render().el)\r
- _this = this\r
if Pettanr.credits[@url]\r
this.$el.append(Pettanr.credits[@url])\r
this.$el.append((new Tag.RowBreak()).render().el)\r
else\r
- f = (data, status) ->\r
- Pettanr.credits[_this.url] = data\r
- _this.$el.append(data)\r
+ f = (data, status) =>\r
+ Pettanr.credits[@url] = data\r
+ this.$el.append(data)\r
rb = new Tag.RowBreak()\r
- _this.$el.append(rb.render().el)\r
+ this.$el.append(rb.render().el)\r
$.get(@url, null, f, 'html')\r
this\r
\r
if @with_icon\r
p = @item.credit_icon_view()\r
this.$el.append(p.render().el)\r
- _this = this\r
- f = (data, status) ->\r
- _this.$el.append(data)\r
+ f = (data, status) =>\r
+ this.$el.append(data)\r
rb = new Tag.RowBreak()\r
- _this.$el.append(rb.render().el)\r
+ this.$el.append(rb.render().el)\r
$.get(@url, null, f, 'html')\r
this\r
\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
- @picture.fetch({cache: true}).done ->\r
- credit = _this.picture.credit_view(false)\r
- _this.$el.append(credit.render().el)\r
+ @picture.fetch({cache: true}).done =>\r
+ credit = @picture.credit_view(false)\r
+ this.$el.append(credit.render().el)\r
this\r
\r
this\r
\r
push: (append_pictures) ->\r
- _this = this\r
- _.each append_pictures, (picture, pid) ->\r
- return if _this.licensed_pictures[pid]\r
- _this.licensed_pictures[pid] = picture\r
- picture.fetch({cache: true}).done ->\r
+ _.each append_pictures, (picture, pid) =>\r
+ return if @licensed_pictures[pid]\r
+ @licensed_pictures[pid] = picture\r
+ picture.fetch({cache: true}).done =>\r
credit = picture.credit_view()\r
- _this.$el.append(credit.render().el)\r
+ this.$el.append(credit.render().el)\r
\r
class Pettanr.Views.Scroll.PlayModule.Panels extends Backbone.View\r
tagName: 'div'\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
- _.each @items, (scroll_panel) ->\r
+ _.each @items, (scroll_panel) =>\r
return if not scroll_panel.has_panel()\r
panel = scroll_panel.panel()\r
- panel.fetch({cache: true}).done ->\r
+ panel.fetch({cache: true}).done =>\r
body = new Pettanr.Views.Panel.Body({\r
panel: panel,\r
- operators: _this.operators,\r
+ operators: @operators,\r
spot: null\r
})\r
- _this.$el.append(body.render().el)\r
+ this.$el.append(body.render().el)\r
footer = new Pettanr.Views.Panel.Footer({\r
scroll_panel: scroll_panel,\r
panel: panel,\r
- operators: _this.operators\r
+ operators: @operators\r
})\r
- _this.$el.append(footer.render().el)\r
- _this.credits.push(panel.licensed_pictures())\r
+ this.$el.append(footer.render().el)\r
+ this.credits.push(panel.licensed_pictures())\r
this\r
\r
class Pettanr.Views.Scroll.PlayModule.Body extends Backbone.View\r
\r
initialize: (options) ->\r
@item = options.item\r
- _this = this\r
@author = @item.author()\r
- @author.fetch({cache: true}).done ->\r
- name = _this.author.get('name')\r
- author_url = Pettanr.url(_this.author.table_name(), 'show', {id: _this.author.get('id')})\r
- _this.linked_author = new Tag.A({\r
+ @author.fetch({cache: true}).done =>\r
+ name = @author.get('name')\r
+ author_url = Pettanr.url(@author.table_name(), 'show', {id: @author.get('id')})\r
+ @linked_author = new Tag.A({\r
attr: {href: '/' + author_url}, \r
handler_name: author_url,\r
content: name\r
})\r
- _this.render()\r
+ @render()\r
\r
render: () ->\r
this.$el.html('')\r
\r
render: () ->\r
speech_balloon_template = @element.speech_balloon_template()\r
- _this = this\r
- speech_balloon_template.fetch({cache: true}).done ->\r
+ speech_balloon_template.fetch({cache: true}).done =>\r
system_picture = speech_balloon_template.system_picture()\r
- system_picture.fetch({cache: true}).done ->\r
+ system_picture.fetch({cache: true}).done =>\r
img = system_picture.tmb_opt_img_tag()\r
- _this.$el.html(img.render().el)\r
+ this.$el.html(img.render().el)\r
this\r
\r
class Pettanr.Views.SpeechBalloon.ElementFace extends Backbone.View\r
caption_url: caption_url,\r
prof_url: prof_url\r
})\r
- _this = this\r
@panel = @item.panel()\r
- @panel.fetch({cache: true}).done ->\r
- _this.author = new Pettanr.Views.Show.HeaderAuthor({item: _this.panel})\r
- _this.render()\r
+ @panel.fetch({cache: true}).done =>\r
+ @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})\r
+ @render()\r
\r
render: () ->\r
this.$el.html('')\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
panel = @item.panel()\r
- panel.fetch({cache: true}).done ->\r
+ panel.fetch({cache: true}).done =>\r
panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
- _this.$el.append(panel_icon.render().el)\r
+ this.$el.append(panel_icon.render().el)\r
this\r
\r
\r
render: () ->\r
this.$el.html('')\r
- _this = this\r
- @speech_balloon.fetch({cache: true}).done ->\r
- panel = _this.speech_balloon.panel()\r
- panel.fetch({cache: true}).done ->\r
+ @speech_balloon.fetch({cache: true}).done =>\r
+ panel = @speech_balloon.panel()\r
+ panel.fetch({cache: true}).done =>\r
panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
- _this.$el.append(panel_icon.render().el)\r
+ this.$el.append(panel_icon.render().el)\r
this\r
\r