OSDN Git Service

clean
authoryasushiito <yas@pen-chan.jp>
Mon, 1 Dec 2014 05:08:45 +0000 (14:08 +0900)
committeryasushiito <yas@pen-chan.jp>
Mon, 1 Dec 2014 05:08:45 +0000 (14:08 +0900)
51 files changed:
app/assets/javascripts/controllers/folders.js.coffee
app/assets/javascripts/editor/panel_editor/dock.js.coffee
app/assets/javascripts/locmare/list_group/lib/pager.js.coffee
app/assets/javascripts/locmare/list_group/list/base.js.coffee
app/assets/javascripts/main.js.coffee
app/assets/javascripts/manifest/manifest.js.coffee
app/assets/javascripts/manifest/model.js.coffee
app/assets/javascripts/manifest/model/association.js.coffee
app/assets/javascripts/models/balloon.js.coffee
app/assets/javascripts/models/ground_picture.js.coffee
app/assets/javascripts/models/license.js.coffee
app/assets/javascripts/models/original_picture.js.coffee
app/assets/javascripts/models/panel_picture.js.coffee
app/assets/javascripts/models/picture.js.coffee
app/assets/javascripts/models/resource_picture.js.coffee
app/assets/javascripts/models/speech.js.coffee
app/assets/javascripts/models/speech_balloon.js.coffee
app/assets/javascripts/models/speech_balloon_template.js.coffee
app/assets/javascripts/models/system_picture.js.coffee
app/assets/javascripts/models/user.js.coffee
app/assets/javascripts/models/writing_format.js.coffee
app/assets/javascripts/peta/element_nestable_content.js.coffee
app/assets/javascripts/peta/item.js.coffee
app/assets/javascripts/peta/root.js.coffee
app/assets/javascripts/routes.js.coffee
app/assets/javascripts/views/balloons/element.js.coffee
app/assets/javascripts/views/balloons/summary.js.coffee
app/assets/javascripts/views/common.js.coffee
app/assets/javascripts/views/ground_colors/show.js.coffee
app/assets/javascripts/views/ground_colors/summary.js.coffee
app/assets/javascripts/views/ground_pictures/element_face.js.coffee
app/assets/javascripts/views/ground_pictures/show.js.coffee
app/assets/javascripts/views/ground_pictures/summary.js.coffee
app/assets/javascripts/views/licenses/summary.js.coffee
app/assets/javascripts/views/original_pictures/summary.js.coffee
app/assets/javascripts/views/panel_pictures/element.js.coffee
app/assets/javascripts/views/panel_pictures/element_face.js.coffee
app/assets/javascripts/views/panel_pictures/show.js.coffee
app/assets/javascripts/views/panel_pictures/summary.js.coffee
app/assets/javascripts/views/panels/body.js.coffee
app/assets/javascripts/views/panels/show.js.coffee
app/assets/javascripts/views/panels/summary.js.coffee
app/assets/javascripts/views/pictures/credit.js.coffee
app/assets/javascripts/views/resource_pictures/credit.js.coffee
app/assets/javascripts/views/resource_pictures/summary.js.coffee
app/assets/javascripts/views/scrolls/play.js.coffee
app/assets/javascripts/views/show.js.coffee
app/assets/javascripts/views/speech_balloons/element_face.js.coffee
app/assets/javascripts/views/speech_balloons/show.js.coffee
app/assets/javascripts/views/speech_balloons/summary.js.coffee
app/assets/javascripts/views/speeches/summary.js.coffee

index 5fa72b5..be3225d 100644 (file)
@@ -16,7 +16,7 @@ class Pettanr.FoldersController extends Pettanr.AppController
   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
index 6fb3de4..c90dab0 100644 (file)
@@ -71,9 +71,8 @@ class Editor.PanelEditor.Dock extends Editor.EditorModule.DockBase
       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
@@ -129,13 +128,12 @@ class Editor.EditorModule.DockModule.ElementBay extends Editor.EditorModule.Dock
   \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
@@ -168,15 +166,14 @@ class Editor.EditorModule.DockModule.ElementBay.ElementsTabs extends Backbone.Vi
   \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
@@ -188,9 +185,8 @@ class Editor.EditorModule.DockModule.ElementBay.InnerElementsTabs extends Backbo
   \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
@@ -241,13 +237,12 @@ class Editor.EditorModule.DockModule.ScenarioBay extends Editor.EditorModule.Doc
   \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
@@ -257,13 +252,12 @@ class Editor.EditorModule.DockModule.ScenarioBay extends Editor.EditorModule.Doc
   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
@@ -283,9 +277,8 @@ class Editor.EditorModule.DockModule.ScenarioBay.ScenarioTabs extends Backbone.V
   \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
@@ -318,13 +311,12 @@ class Editor.EditorModule.DockModule.PriorityBay extends Editor.EditorModule.Doc
   \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
@@ -334,13 +326,12 @@ class Editor.EditorModule.DockModule.PriorityBay extends Editor.EditorModule.Doc
   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
@@ -360,9 +351,8 @@ class Editor.EditorModule.DockModule.PriorityBay.PriorityTabs extends Backbone.V
   \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
index 05a0d2c..e055aff 100644 (file)
@@ -47,7 +47,7 @@ class Locmare.ListGroupModule.LibModule.PagerModule.Default extends Backbone.Vie
         (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
index bf6dea2..0c04999 100644 (file)
@@ -31,6 +31,6 @@ class Locmare.ListGroupModule.Base extends Backbone.Collection
   open: (cb) ->\r
     @url = '/' + @action_manifest.url(@params)\r
     @fetch({cache: true}).done =>\r
-      #_this.boost(items)\r
+      # @boost(items)\r
       cb()\r
   \r
index 8093b36..526c1ca 100644 (file)
@@ -48,11 +48,11 @@ $ ->
     #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
index ad044ba..1d8e0c7 100644 (file)
@@ -9,10 +9,9 @@ class Manifest
     @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
index 98c8ee1..8f8ba93 100644 (file)
@@ -49,10 +49,9 @@ class Manifest.Model extends ManifestBase.Base
   \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
index 6c862b1..f548dd9 100644 (file)
@@ -16,9 +16,8 @@ class Manifest.ModelModule.Association extends ManifestBase.Values
     @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
index f1b8eab..9ac7cb2 100644 (file)
@@ -27,11 +27,11 @@ class Pettanr.Balloon extends Peta.Element
   \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
index ccadfa9..698ceb0 100644 (file)
@@ -37,9 +37,8 @@ class Pettanr.GroundPicture extends Peta.Element
   \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
index c5f32eb..b1901bf 100644 (file)
@@ -19,7 +19,7 @@ class Pettanr.License extends Peta.SystemResource
   \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
@@ -36,8 +36,7 @@ class Pettanr.License.Caption extends Backbone.View
     @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
index d373bfe..96d16d9 100644 (file)
@@ -39,9 +39,8 @@ class Pettanr.OriginalPicture extends Peta.Content
     })\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
@@ -92,13 +91,12 @@ class Pettanr.OriginalPicture.Head extends Backbone.View
     @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
index 3c3003d..8547958 100644 (file)
@@ -51,9 +51,8 @@ class Pettanr.PanelPicture extends Peta.Element
   \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
index c7f0f6d..2747127 100644 (file)
@@ -50,9 +50,8 @@ class Pettanr.Picture extends Peta.Content
     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
index cc05204..54a27bc 100644 (file)
@@ -50,9 +50,8 @@ class Pettanr.ResourcePicture extends Peta.Content
     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
index 3a131e6..50207cc 100644 (file)
@@ -23,11 +23,11 @@ class Pettanr.Speech extends Peta.Element
   \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
index 23e821b..643a8df 100644 (file)
@@ -24,9 +24,9 @@ class Pettanr.SpeechBalloon extends Peta.Element
   \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
index f802146..91431f7 100644 (file)
@@ -16,7 +16,7 @@ class Pettanr.SpeechBalloonTemplate extends Peta.Template
   \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
index 024469d..52f514b 100644 (file)
@@ -35,9 +35,8 @@ class Pettanr.SystemPicture extends Peta.SystemResource
     })\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
index 131c2e8..4e95aff 100644 (file)
@@ -17,18 +17,17 @@ class Pettanr.User extends Backbone.Model
 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
index 7b9f1da..92d189b 100644 (file)
@@ -16,7 +16,7 @@ class Pettanr.WritingFormat extends Peta.Template
   \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
index 5fb8392..b9e4d1f 100644 (file)
@@ -4,29 +4,27 @@ class Peta.ElementNestableContent extends Peta.Content
     @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
index 4dd8ee8..db071bd 100644 (file)
@@ -115,11 +115,10 @@ class Peta.Item extends Backbone.Model
       @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
index f6d2445..6e44a60 100644 (file)
@@ -2,21 +2,20 @@ class Peta.Root extends Peta.ElementNestableContent
   \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
index e4019e0..c56221d 100644 (file)
@@ -88,7 +88,7 @@ class Pettanr.Router extends Backbone.Router
     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
@@ -96,31 +96,30 @@ class Pettanr.Router extends Backbone.Router
           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
@@ -128,8 +127,8 @@ class Pettanr.Router extends Backbone.Router
             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
@@ -142,13 +141,13 @@ class Pettanr.Router extends Backbone.Router
           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
index dd14345..85bd9a7 100644 (file)
@@ -8,13 +8,12 @@ class Pettanr.Views.Balloon.Element extends Backbone.View
     @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
index 705b485..ad0930e 100644 (file)
@@ -6,11 +6,10 @@ class Pettanr.Views.Balloon.Summary extends Backbone.View
   \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
index eac4581..bec019a 100644 (file)
@@ -64,11 +64,10 @@ class Pettanr.Views.Common.Binder.Summary extends Backbone.View
     @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
@@ -84,21 +83,20 @@ class Pettanr.Views.Common.Leaf.Summary extends Backbone.View
     @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
index 94fc168..eb03707 100644 (file)
@@ -22,11 +22,10 @@ class Pettanr.Views.GroundColor.Show extends Backbone.View
       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
index b146fce..8b38aaa 100644 (file)
@@ -5,10 +5,9 @@ class Pettanr.Views.GroundColor.Summary extends Backbone.View
   \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
index 721c6c8..43870b0 100644 (file)
@@ -7,10 +7,9 @@ class Pettanr.Views.GroundPicture.ElementSymbol extends Backbone.View
   \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
index 80ce802..3d6b3a7 100644 (file)
@@ -22,11 +22,10 @@ class Pettanr.Views.GroundPicture.Show extends Backbone.View
       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
index 1fc26be..f04667a 100644 (file)
@@ -6,13 +6,12 @@ class Pettanr.Views.GroundPicture.Summary extends Backbone.View
   \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
index 93c2e1e..37c8301 100644 (file)
@@ -5,14 +5,13 @@ class Pettanr.Views.License.Summary extends Backbone.View
   \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
index 3782bc9..2d05a1f 100644 (file)
@@ -6,19 +6,18 @@ class Pettanr.Views.OriginalPicture.Summary extends Backbone.View
     #@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
index c3e05f4..35801ca 100644 (file)
@@ -11,12 +11,11 @@ class Pettanr.Views.PanelPicture.Element extends Backbone.View
     @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
index f871fb3..88368a7 100644 (file)
@@ -7,10 +7,9 @@ class Pettanr.Views.PanelPicture.ElementSymbol extends Backbone.View
   \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
index dddd872..ee1b040 100644 (file)
@@ -22,19 +22,18 @@ class Pettanr.Views.PanelPicture.Show extends Backbone.View
       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
index a92c55d..fff5289 100644 (file)
@@ -6,13 +6,12 @@ class Pettanr.Views.PanelPicture.Summary extends Backbone.View
   \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
index 70af2ff..e32dde4 100644 (file)
@@ -14,7 +14,6 @@ class Pettanr.Views.Panel.Body extends Backbone.View
     @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
index 0af75f2..3733d80 100644 (file)
@@ -49,11 +49,10 @@ class Pettanr.Views.Panel.Show.Credits extends Backbone.View
     @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
index 78e0a6a..30a7f13 100644 (file)
@@ -9,11 +9,10 @@ class Pettanr.Views.Panel.Summary extends Backbone.View
     @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
index 94bbef1..4f6f21e 100644 (file)
@@ -12,16 +12,15 @@ class Pettanr.Views.Picture.Credit extends Backbone.View
     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
index 2fa72d7..6b12575 100644 (file)
@@ -12,11 +12,10 @@ class Pettanr.Views.ResourcePicture.Credit extends Backbone.View
     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
index e355f62..8acbdeb 100644 (file)
@@ -6,9 +6,8 @@ class Pettanr.Views.ResourcePicture.Summary extends Backbone.View
   \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
index 914e3b7..43f13a4 100644 (file)
@@ -53,13 +53,12 @@ class Pettanr.Views.Scroll.PlayModule.Credits extends Backbone.View
     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
@@ -72,24 +71,23 @@ class Pettanr.Views.Scroll.PlayModule.Panels extends Backbone.View
   \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
index 4a23494..e7425ff 100644 (file)
@@ -44,17 +44,16 @@ class Pettanr.Views.Show.HeaderAuthor extends Backbone.View
   \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
index 3a8c175..8c0bc0f 100644 (file)
@@ -7,12 +7,11 @@ class Pettanr.Views.SpeechBalloon.ElementSymbol extends Backbone.View
   \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
index e203c4d..be851b1 100644 (file)
@@ -22,11 +22,10 @@ class Pettanr.Views.SpeechBalloon.Show extends Backbone.View
       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
index 72d8b72..ef310ab 100644 (file)
@@ -5,10 +5,9 @@ class Pettanr.Views.SpeechBalloon.Summary extends Backbone.View
   \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
index 390aa2e..0b10eef 100644 (file)
@@ -6,11 +6,10 @@ class Pettanr.Views.Speech.Summary extends Backbone.View
   \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