OSDN Git Service

clean
authoryasushiito <yas@pen-chan.jp>
Fri, 28 Nov 2014 05:08:51 +0000 (14:08 +0900)
committeryasushiito <yas@pen-chan.jp>
Fri, 28 Nov 2014 05:08:51 +0000 (14:08 +0900)
48 files changed:
app/assets/javascripts/addons/circle_speech_balloons/init.js.coffee
app/assets/javascripts/addons/plain_speech_balloons/init.js.coffee
app/assets/javascripts/addons/square_speech_balloons/init.js.coffee
app/assets/javascripts/controllers/artists.js.coffee
app/assets/javascripts/controllers/authors.js.coffee
app/assets/javascripts/controllers/balloons.js.coffee
app/assets/javascripts/controllers/comic_stories.js.coffee
app/assets/javascripts/controllers/comics.js.coffee
app/assets/javascripts/controllers/folders.js.coffee
app/assets/javascripts/controllers/ground_colors.js.coffee
app/assets/javascripts/controllers/ground_pictures.js.coffee
app/assets/javascripts/controllers/license_groups.js.coffee
app/assets/javascripts/controllers/licenses.js.coffee
app/assets/javascripts/controllers/original_pictures.js.coffee
app/assets/javascripts/controllers/panel_pictures.js.coffee
app/assets/javascripts/controllers/panels.js.coffee
app/assets/javascripts/controllers/pictures.js.coffee
app/assets/javascripts/controllers/resource_pictures.js.coffee
app/assets/javascripts/controllers/scroll_panels.js.coffee
app/assets/javascripts/controllers/scrolls.js.coffee
app/assets/javascripts/controllers/sheet_panels.js.coffee
app/assets/javascripts/controllers/sheets.js.coffee
app/assets/javascripts/controllers/speech_balloon_templates.js.coffee
app/assets/javascripts/controllers/speech_balloons.js.coffee
app/assets/javascripts/controllers/speeches.js.coffee
app/assets/javascripts/controllers/stories.js.coffee
app/assets/javascripts/controllers/story_sheets.js.coffee
app/assets/javascripts/controllers/system_pictures.js.coffee
app/assets/javascripts/controllers/writing_formats.js.coffee
app/assets/javascripts/locmare/bucket.js.coffee
app/assets/javascripts/locmare/filer/body/file_body.js.coffee
app/assets/javascripts/locmare/filer/body/file_body/file_item/symbol/default/face/picture.js.coffee
app/assets/javascripts/locmare/form.js.coffee
app/assets/javascripts/locmare/form/extend_field.js.coffee
app/assets/javascripts/locmare/form/field.js.coffee
app/assets/javascripts/locmare/form/field/helper/tail_angle.js.coffee
app/assets/javascripts/locmare/form/field/tag/select.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/locmare/profiler/association.js.coffee
app/assets/javascripts/locmare/profiler/association/belongs_to.js.coffee
app/assets/javascripts/locmare/profiler/association/has_many.js.coffee
app/assets/javascripts/locmare/profiler/association/has_one.js.coffee
app/assets/javascripts/locmare/profiler/column.js.coffee
app/assets/javascripts/locmare/profiler/column/base.js.coffee
app/assets/javascripts/pettanr.js.coffee
app/assets/javascripts/tags.js.coffee
lib/locmare/list_group/list/base.rb

index 9ff71b8..38777a9 100644 (file)
@@ -84,10 +84,9 @@ class Pettanr.CircleSpeechBalloon.Speech extends Backbone.Model
 class Pettanr.CircleSpeechBalloon.SpeechBalloonModule\r
   supply_default: () ->\r
     super()\r
-    _this = this\r
     sbt = @speech_balloon_template()\r
-    sbt.fetch({cache: true}).done ->\r
-      _this.speech_balloon_template_module_name = sbt.get('module_name')\r
+    sbt.fetch({cache: true}).done =>\r
+      @speech_balloon_template_module_name = sbt.get('module_name')\r
   \r
   speech_balloon_extend: () ->\r
     @new_speech_balloon() if not @sbex\r
@@ -129,10 +128,9 @@ class Pettanr.CircleSpeechBalloon.BalloonModule
   \r
   parsed_settings: () ->\r
     return @parsed if @parsed\r
-    _this = this\r
     sbt = @speech_balloon_template()\r
-    sbt.fetch({cache: true}).done ->\r
-      _this.parsed = sbt.parsed_settings()\r
+    sbt.fetch({cache: true}).done =>\r
+      @parsed = sbt.parsed_settings()\r
   \r
   select_system_picture: () ->\r
     tr = @get('r') % 360\r
@@ -175,10 +173,9 @@ class Pettanr.CircleSpeechBalloon.SpeechModule
   \r
   parsed_settings: () ->\r
     return @parsed if @parsed\r
-    _this = this\r
     sbt = @speech_balloon_template()\r
-    sbt.fetch({cache: true}).done ->\r
-      _this.parsed = sbt.parsed_settings()\r
+    sbt.fetch({cache: true}).done =>\r
+      @parsed = sbt.parsed_settings()\r
   \r
   arrayed_quotes: () ->\r
     q = if Pettanr.is_blank(@get('quotes'))\r
index b923e02..4bcf8a9 100644 (file)
@@ -84,10 +84,9 @@ class Pettanr.PlainSpeechBalloon.Speech extends Backbone.Model
 class Pettanr.PlainSpeechBalloon.SpeechBalloonModule\r
   supply_default: () ->\r
     super()\r
-    _this = this\r
     sbt = @speech_balloon_template()\r
-    sbt.fetch({cache: true}).done ->\r
-      _this.speech_balloon_template_module_name = sbt.get('module_name')\r
+    sbt.fetch({cache: true}).done =>\r
+      @speech_balloon_template_module_name = sbt.get('module_name')\r
   \r
   speech_balloon_extend: () ->\r
     @new_speech_balloon() if not @sbex\r
@@ -129,10 +128,9 @@ class Pettanr.PlainSpeechBalloon.BalloonModule
   \r
   parsed_settings: () ->\r
     return @parsed if @parsed\r
-    _this = this\r
     sbt = @speech_balloon_template()\r
-    sbt.fetch({cache: true}).done ->\r
-      _this.parsed = sbt.parsed_settings()\r
+    sbt.fetch({cache: true}).done =>\r
+      @parsed = sbt.parsed_settings()\r
   \r
   select_system_picture: () ->\r
     s = @parsed_settings()['all']['balloon']\r
@@ -169,10 +167,9 @@ class Pettanr.PlainSpeechBalloon.SpeechModule
   \r
   parsed_settings: () ->\r
     return @parsed if @parsed\r
-    _this = this\r
     sbt = @speech_balloon_template()\r
-    sbt.fetch({cache: true}).done ->\r
-      _this.parsed = sbt.parsed_settings()\r
+    sbt.fetch({cache: true}).done =>\r
+      @parsed = sbt.parsed_settings()\r
   \r
   arrayed_quotes: () ->\r
     q = if Pettanr.is_blank(@get('quotes'))\r
index b6d46ad..2fd5365 100644 (file)
@@ -84,10 +84,9 @@ class Pettanr.SquareSpeechBalloon.Speech extends Backbone.Model
 class Pettanr.SquareSpeechBalloon.SpeechBalloonModule\r
   supply_default: () ->\r
     super()\r
-    _this = this\r
     sbt = @speech_balloon_template()\r
-    sbt.fetch({cache: true}).done ->\r
-      _this.speech_balloon_template_module_name = sbt.get('module_name')\r
+    sbt.fetch({cache: true}).done =>\r
+      @speech_balloon_template_module_name = sbt.get('module_name')\r
   \r
   speech_balloon_extend: () ->\r
     @new_speech_balloon() if not @sbex\r
@@ -129,10 +128,9 @@ class Pettanr.SquareSpeechBalloon.BalloonModule
   \r
   parsed_settings: () ->\r
     return @parsed if @parsed\r
-    _this = this\r
     sbt = @speech_balloon_template()\r
-    sbt.fetch({cache: true}).done ->\r
-      _this.parsed = sbt.parsed_settings()\r
+    sbt.fetch({cache: true}).done =>\r
+      @parsed = sbt.parsed_settings()\r
   \r
   select_system_picture: () ->\r
     s = @parsed_settings()['all']['balloon']\r
@@ -169,10 +167,9 @@ class Pettanr.SquareSpeechBalloon.SpeechModule
   \r
   parsed_settings: () ->\r
     return @parsed if @parsed\r
-    _this = this\r
     sbt = @speech_balloon_template()\r
-    sbt.fetch({cache: true}).done ->\r
-      _this.parsed = sbt.parsed_settings()\r
+    sbt.fetch({cache: true}).done =>\r
+      @parsed = sbt.parsed_settings()\r
   \r
   arrayed_quotes: () ->\r
     q = if Pettanr.is_blank(@get('quotes'))\r
index 769a3d6..bee94df 100644 (file)
@@ -5,13 +5,12 @@ class Pettanr.ArtistsController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('title'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('title'))\r
       view = new Pettanr.Views.Artist.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index 94cf317..240772c 100644 (file)
@@ -5,13 +5,12 @@ class Pettanr.AuthorsController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('name'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('name'))\r
       view = new Pettanr.Views.Author.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index 0731262..d09e6d8 100644 (file)
@@ -14,12 +14,11 @@ class Pettanr.BalloonsController extends Pettanr.AppController
   \r
   show_html: () -> \r
     @redraw_title(@params)\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
+    @item.fetch({cache: true}).done =>\r
       view = new Pettanr.Views.Balloon.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index f1686b9..b0e760a 100644 (file)
@@ -18,12 +18,11 @@ class Pettanr.ComicStoriesController extends Pettanr.AppController
   \r
   show_html: () -> \r
     @redraw_title(@params)\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
+    @item.fetch({cache: true}).done =>\r
       view = new Pettanr.Views.ComicStory.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index 4db24e9..1cbca39 100644 (file)
@@ -13,13 +13,12 @@ class Pettanr.ComicsController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('title'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('title'))\r
       view = new Pettanr.Views.Comic.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index ddafdb2..5fa72b5 100644 (file)
@@ -8,9 +8,8 @@ class Pettanr.FoldersController extends Pettanr.AppController
     @redraw_title(@params)\r
     @set_model()\r
     @item = new Pettanr.Folder.Root()\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.children_html()\r
+    @item.fetch({cache: true}).done =>\r
+      @children_html()\r
   \r
   show_html_format: (format) -> \r
   \r
@@ -27,24 +26,22 @@ class Pettanr.FoldersController extends Pettanr.AppController
       $("#pettanr").html(f.render().el)\r
   \r
   show: () ->\r
-    console.log(@params)\r
     if @params['format'] == 'prof'\r
       @set_show()\r
       @item = new Pettanr.FolderWatch({id: @params['id']})  # replace refference item\r
       @show_prof()\r
     else\r
       @item = new Pettanr.FolderWatch({id: @params['id']})\r
-      _this = this\r
-      @item.fetch({cache: true}).done () ->\r
-        if _this.item.is_remote()\r
-          c = _this.item.get('controller_name')\r
-          a = if Pettanr.is_blank(_this.item.get('action_name'))\r
+      @item.fetch({cache: true}).done () =>\r
+        if @item.is_remote()\r
+          c = @item.get('controller_name')\r
+          a = if Pettanr.is_blank(@item.get('action_name'))\r
             'index'\r
           else\r
-            _this.item.get('action_name')\r
+            @item.get('action_name')\r
           window.router['c_i'](c, a, '') # call action event in router for redirect\r
         else\r
-          _this.children_html()\r
+          @children_html()\r
   \r
   count: () ->\r
   \r
index daaf943..a06b298 100644 (file)
@@ -13,13 +13,12 @@ class Pettanr.GroundColorsController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('caption'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('caption'))\r
       view = new Pettanr.Views.GroundColor.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       #view.render()\r
   \r
index 53e311b..41e10aa 100644 (file)
@@ -14,13 +14,12 @@ class Pettanr.GroundPicturesController extends Pettanr.AppController
   \r
   show_html: () -> \r
     @redraw_title(@params)\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('caption'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('caption'))\r
       view = new Pettanr.Views.GroundPicture.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       #view.render()\r
   \r
index 2794e6f..ec4cfc8 100644 (file)
@@ -5,13 +5,12 @@ class Pettanr.LicenseGroupsController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('caption'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('caption'))\r
       view = new Pettanr.Views.LicenseGroup.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index 032dcca..807471e 100644 (file)
@@ -13,9 +13,8 @@ class Pettanr.LicensesController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('caption'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('caption'))\r
       view = new Pettanr.Views.License.Show({\r
         el: "#pettanr",\r
         item: @item,\r
index 5648e68..d014a07 100644 (file)
@@ -9,13 +9,12 @@ class Pettanr.OriginalPicturesController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
     @redraw_title(@params)\r
-    @item.fetch({cache: true}).done ->\r
+    @item.fetch({cache: true}).done =>\r
       view = new Pettanr.Views.OriginalPicture.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
     view.render()\r
   \r
index d20aec9..832aee1 100644 (file)
@@ -13,13 +13,12 @@ class Pettanr.PanelPicturesController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('caption'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('caption'))\r
       view = new Pettanr.Views.PanelPicture.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       #view.render()\r
   \r
index 9bb5d2c..6fc280b 100644 (file)
@@ -21,14 +21,13 @@ class Pettanr.PanelsController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () ->\r
-    _this = this\r
     @item = new Pettanr.Panel({id: @item.get('id')}, {with_elements: true}) # retake panel for 'with_elements' mode\r
-    @item.fetch({cache: false}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('caption'))\r
+    @item.fetch({cache: false}).done =>\r
+      @redraw_title(@params, @item.get('caption'))\r
       view = new Pettanr.Views.Panel.Show({\r
         el: "#pettanr",\r
-        panel: _this.item,\r
-        operators: _this.operators,\r
+        panel: @item,\r
+        operators: @operators,\r
         spot: null\r
       })\r
       view.render()\r
@@ -52,11 +51,10 @@ class Pettanr.PanelsController extends Pettanr.AppController
   \r
   edit: () ->\r
     @redraw_title(@params)\r
-    _this = this\r
     @set_model()\r
     @item = new Pettanr.Panel({id: @params['id']}, {with_elements: true})\r
-    @item.fetch({cache: false}).done ->\r
-      editor = new Editor.PanelEditor({root_item: _this.item, operators: _this.operators})\r
+    @item.fetch({cache: false}).done =>\r
+      editor = new Editor.PanelEditor({root_item: @item, operators: @operators})\r
       $("#pettanr").html(editor.render().el)\r
   \r
   create: () ->\r
index 6aade7f..9073a6a 100644 (file)
@@ -10,12 +10,11 @@ class Pettanr.PicturesController extends Pettanr.AppController
   \r
   show_html: () -> \r
     @redraw_title(@params)\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
+    @item.fetch({cache: true}).done =>\r
       view = new Pettanr.Views.Picture.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index f8c8dd0..2df8256 100644 (file)
@@ -18,12 +18,11 @@ class Pettanr.ResourcePicturesController extends Pettanr.AppController
   \r
   show_html: () -> \r
     @redraw_title(@params)\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
+    @item.fetch({cache: true}).done =>\r
       view = new Pettanr.Views.ResourcePicture.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index cac28e6..c0fa60d 100644 (file)
@@ -18,12 +18,11 @@ class Pettanr.ScrollPanelsController extends Pettanr.AppController
   \r
   show_html: () -> \r
     @redraw_title(@params)\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
+    @item.fetch({cache: true}).done =>\r
       view = new Pettanr.Views.ScrollPanel.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index 0351b22..5b6fcbd 100644 (file)
@@ -13,13 +13,12 @@ class Pettanr.ScrollsController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('title'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('title'))\r
       view = new Pettanr.Views.Scroll.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
@@ -33,22 +32,18 @@ class Pettanr.ScrollsController extends Pettanr.AppController
   \r
   play: () ->\r
     @set_play()\r
-    _list = @list\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _list.open(() ->\r
-        _this.redraw_title(_this.params, _this.item.get('title'))\r
+    @item.fetch({cache: true}).done =>\r
+      @list.open(() => \r
+        @redraw_title(@params, @item.get('title'))\r
         view = new Pettanr.Views.Scroll.Play({\r
           el: "#pettanr",\r
-          item: _this.item,\r
-          list: _this.list,\r
-          operators: _this.operators\r
+          item: @item,\r
+          list: @list,\r
+          operators: @operators\r
         })\r
         view.render()\r
       )\r
   \r
-  count: () ->\r
-  \r
   new: () ->\r
     @redraw_title(@params)\r
     @form_new()\r
index 3c0eb38..3a1dd2e 100644 (file)
@@ -18,12 +18,11 @@ class Pettanr.SheetPanelsController extends Pettanr.AppController
   \r
   show_html: () -> \r
     @redraw_title(@params)\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
+    @item.fetch({cache: true}).done =>\r
       view = new Pettanr.Views.SheetPanel.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index 530f6f8..0c7da59 100644 (file)
@@ -17,13 +17,12 @@ class Pettanr.SheetsController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('caption'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('caption'))\r
       view = new Pettanr.Views.Sheet.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index 9fadbe1..1025cf1 100644 (file)
@@ -13,13 +13,12 @@ class Pettanr.SpeechBalloonTemplatesController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('caption'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('caption'))\r
       view = new Pettanr.Views.SpeechBalloonTemplate.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index 40b34e7..eacb165 100644 (file)
@@ -17,13 +17,12 @@ class Pettanr.SpeechBalloonsController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('caption'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('caption'))\r
       view = new Pettanr.Views.SpeechBalloon.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       #view.render()\r
   \r
index 7895a58..68aa806 100644 (file)
@@ -14,12 +14,11 @@ class Pettanr.SpeechesController extends Pettanr.AppController
   \r
   show_html: () -> \r
     @redraw_title(@params)\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
+    @item.fetch({cache: true}).done =>\r
       view = new Pettanr.Views.Speech.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index bbaf39c..13fb5fc 100644 (file)
@@ -17,13 +17,12 @@ class Pettanr.StoriesController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('title'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('title'))\r
       view = new Pettanr.Views.Story.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index c856481..a6d328b 100644 (file)
@@ -18,12 +18,11 @@ class Pettanr.StorySheetsController extends Pettanr.AppController
   \r
   show_html: () -> \r
     @redraw_title(@params)\r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
+    @item.fetch({cache: true}).done =>\r
       view = new Pettanr.Views.StorySheet.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index a323e49..b22af43 100644 (file)
@@ -5,13 +5,12 @@ class Pettanr.SystemPicturesController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
     @redraw_title(@params)\r
-    @item.fetch({cache: true}).done ->\r
+    @item.fetch({cache: true}).done =>\r
       view = new Pettanr.Views.SystemPicture.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index f33bc55..8ae4b8c 100644 (file)
@@ -9,13 +9,12 @@ class Pettanr.WritingFormatsController extends Pettanr.AppController
     @filer_list()\r
   \r
   show_html: () -> \r
-    _this = this\r
-    @item.fetch({cache: true}).done ->\r
-      _this.redraw_title(_this.params, _this.item.get('caption'))\r
+    @item.fetch({cache: true}).done =>\r
+      @redraw_title(@params, @item.get('caption'))\r
       view = new Pettanr.Views.WritingFormat.Show({\r
         el: "#pettanr",\r
-        item: _this.item,\r
-        operators: _this.operators\r
+        item: @item,\r
+        operators: @operators\r
       })\r
       view.render()\r
   \r
index 442c71c..64f939c 100644 (file)
@@ -56,40 +56,37 @@ class Locmare.Bucket extends Backbone.View
     @members_fold_extend_settings @item, params[@item.item_name()], @manifest\r
   \r
   members_fold_extend_settings: (fold_item, attr, man) ->\r
-    _this = this\r
-    _.each man.members, (member_manifest, member_name) ->\r
+    _.each man.members, (member_manifest, member_name) =>\r
       member_item = fold_item[member_name]()\r
       member_item.my_class().fold_extend_settings attr[member_name + '_attributes']\r
-      _this.members_fold_extend_settings member_item, attr[member_name + '_attributes'], member_manifest\r
+      @members_fold_extend_settings member_item, attr[member_name + '_attributes'], member_manifest\r
   \r
   push_form: (key, form_name, item) ->\r
   \r
   init_forms: (key, man, item) ->\r
-    _this = this\r
-    _.each man.members, (member_manifest, member_name) ->\r
+    _.each man.members, (member_manifest, member_name) =>\r
       form_name = member_name   # write exchange function if you want\r
       member_item = item.get(form_name)\r
       new_key = key + '.' + form_name\r
-      _this.forms[new_key] = new Locmare.Form({\r
+      @forms[new_key] = new Locmare.Form({\r
         form_name: new_key, \r
         item: member_item, \r
-        mounted: _this.mounted, \r
+        mounted: @mounted, \r
         submit: false, \r
-        operators: _this.operators\r
+        operators: @operators\r
       })\r
-      _this.init_forms(new_key, member_manifest, member_item)\r
+      @init_forms(new_key, member_manifest, member_item)\r
   \r
   init_fields: () ->\r
-    _this = this\r
     _.each @manifest.form_field_names, (form_field_name) ->\r
       r = if Pettanr.is_blank(form_field_name.form_name)\r
         ''\r
       else\r
         '.' + form_field_name.form_name\r
-      key = _this.item.item_name() + r\r
-      form = _this.forms[key]\r
+      key = @item.item_name() + r\r
+      form = @forms[key]\r
       field = form.fields[form_field_name.field_name]\r
-      _this.form_fields.push(field)\r
+      @form_fields.push(field)\r
   \r
   image_dir: () ->\r
     '/images/'\r
index bb143f2..191fa48 100644 (file)
@@ -4,17 +4,15 @@ class Locmare.FilerModule.BodyModule.FileBody extends Backbone.View
   initialize: (options) ->\r
     @body = options.body\r
     @file_items = []\r
-    _this = this\r
-    @file_items = _.map @filer().items, (item) ->\r
-      fi = _this.file_item_class()\r
-      new fi({'file_body': _this, 'item': item})\r
-    _this.render()\r
+    @file_items = _.map @filer().items, (item) =>\r
+      fi = @file_item_class()\r
+      new fi({'file_body': this, 'item': item})\r
+    @render()\r
 \r
   render: () ->\r
-    _this = this\r
     this.$el.html('')\r
-    _.each @file_items, (file_item) ->\r
-      _this.$el.append(file_item.render().el)\r
+    _.each @file_items, (file_item) =>\r
+      this.$el.append(file_item.render().el)\r
     this\r
   \r
   file_item_class: () ->\r
index 10802e1..34642f9 100644 (file)
@@ -2,11 +2,10 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.SymbolItemCol
   \r
   initialize: (options) ->\r
     super(options)\r
-    _this = this\r
     if @item[@method_name()]\r
-      @item[@method_name()]((pic) ->\r
-        _this.picture = pic\r
-        _this.render()\r
+      @item[@method_name()]((pic) =>\r
+        @picture = pic\r
+        @render()\r
       )\r
     else\r
       @picture = new Pettanr.Image.SymbolImg({\r
@@ -14,7 +13,7 @@ class Locmare.FilerModule.BodyModule.FileBodyModule.FileItemModule.SymbolItemCol
           src: '/images/error.png'\r
         }\r
       })\r
-      _this.render()\r
+      @render()\r
   \r
   render: () ->\r
     if @picture\r
index bd2c9e5..9a32fbd 100644 (file)
@@ -71,28 +71,27 @@ class Locmare.Form extends Locmare.FormBase
     this\r
   \r
   init_fields: () ->\r
-    _this = this\r
-    _.each _this.manifest.field_names, (field_name) ->\r
-      field_manifest = _this.manifest.fields[field_name]\r
-      boost_name = _this.item.my_class().find_boost_name(field_name)\r
+    _.each @manifest.field_names, (field_name) =>\r
+      field_manifest = @manifest.fields[field_name]\r
+      boost_name = @item.my_class().find_boost_name(field_name)\r
       extend_model = if boost_name \r
-        _this.item.boosters[boost_name].extend_model()\r
+        @item.boosters[boost_name].extend_model()\r
       else\r
         null\r
       if boost_name and extend_model # field is extend setting AND template has a extend model\r
-        extend_form_name = _this.item.boosters[boost_name].item_name()\r
-        extend_item = _this.item.boosters[boost_name].extend_item()\r
-        _this.fields[field_name] = new Locmare.ExtendForm({\r
-          parent: _this, \r
+        extend_form_name = @item.boosters[boost_name].item_name()\r
+        extend_item = @item.boosters[boost_name].extend_item()\r
+        @fields[field_name] = new Locmare.ExtendForm({\r
+          parent: this, \r
           form_name: extend_form_name, \r
           item: extend_item, \r
-          mounted: _this.mounted, \r
-          operators: _this.operators, \r
+          mounted: @mounted, \r
+          operators: @operators, \r
           field_name: field_name\r
         })\r
       else\r
-        _this.fields[field_name] = new Locmare.FormModule.Field({\r
-          form: _this, \r
+        @fields[field_name] = new Locmare.FormModule.Field({\r
+          form: this, \r
           field_name: field_name, \r
           field_manifest: field_manifest\r
         })\r
@@ -106,9 +105,8 @@ class Locmare.Form extends Locmare.FormBase
     @submits()[@submit]\r
   \r
   post: () ->\r
-    _this = this\r
-    _.each @fields, (field) ->\r
-      _this.item.set(field.field_name, field.val())\r
+    _.each @fields, (field) =>\r
+      @item.set(field.field_name, field.val())\r
     if @item.save()\r
       window.router.navigate('/' + @item.table_name() + '/' + Pettanr.to_s(@item.get('id')), true)\r
       return false\r
@@ -116,9 +114,8 @@ class Locmare.Form extends Locmare.FormBase
       alert('invalid')\r
   \r
   put: () ->\r
-    _this = this\r
-    _.each @fields, (field) ->\r
-      _this.item.set(field.field_name, field.val())\r
+    _.each @fields, (field) =>\r
+      @item.set(field.field_name, field.val())\r
     @item.overwrite({operators: @operators})\r
     if @item.save()\r
       window.router.navigate('/' + @item.table_name() + '/' + Pettanr.to_s(@item.get('id')), true)\r
@@ -151,11 +148,10 @@ class Locmare.ExtendForm extends Locmare.FormBase
     this\r
   \r
   init_fields: () ->\r
-    _this = this\r
-    _.each _this.manifest.field_names, (field_name) ->\r
-      field_manifest = _this.manifest.fields[field_name]\r
-      _this.fields[field_name] = new Locmare.FormModule.ExtendField({\r
-        form: _this, \r
+    _.each @manifest.field_names, (field_name) =>\r
+      field_manifest = @manifest.fields[field_name]\r
+      @fields[field_name] = new Locmare.FormModule.ExtendField({\r
+        form: this, \r
         field_name: field_name, \r
         field_manifest: field_manifest\r
       })\r
@@ -174,10 +170,9 @@ class Locmare.FormModule.Fields extends Backbone.View
   \r
   render: () ->\r
     this.$el.html('')\r
-    _this = this\r
-    _.each @fields, (field) ->\r
-      _this.$el.append(field.render().el)\r
-      _this.$el.append(field.rb.render().el) if field.rb\r
+    _.each @fields, (field) =>\r
+      this.$el.append(field.render().el)\r
+      this.$el.append(field.rb.render().el) if field.rb\r
     this\r
   \r
 class Locmare.FormModule.SubmitModule\r
index 492685d..4f450d2 100644 (file)
@@ -9,9 +9,8 @@ class Locmare.FormModule.ExtendField extends Backbone.View
     @label = Locmare.FormModule.FieldModule.LabelFactory.factory this, @field_manifest.label\r
     @tag = Locmare.FormModule.FieldModule.TagFactory.factory this, @field_manifest.tag\r
     @helpers = {}\r
-    _this = this\r
-    _.each @field_manifest.helpers, (helper_manifest, helper_name) ->\r
-      _this.helpers[helper_name] = Locmare.FormModule.FieldModule.HelperFactory.factory(_this, helper_manifest)\r
+    _.each @field_manifest.helpers, (helper_manifest, helper_name) =>\r
+      @helpers[helper_name] = Locmare.FormModule.FieldModule.HelperFactory.factory(this, helper_manifest)\r
     @rb = @row_break()\r
     @options = {'data-model': @field_manifest.item_name()}\r
   \r
@@ -19,9 +18,8 @@ class Locmare.FormModule.ExtendField extends Backbone.View
     this.$el.html('')\r
     this.$el.append(@label.render().el) if not @label.hidden()\r
     this.$el.append(@tag.render().el)\r
-    _this = this\r
-    _.each @helpers, (helper) ->\r
-      _this.$el.append(helper.render().el)\r
+    _.each @helpers, (helper) =>\r
+      this.$el.append(helper.render().el)\r
     this.$el.append(@rb.render().el) if @rb\r
     this\r
   \r
index 476216b..3a92a9e 100644 (file)
@@ -63,14 +63,12 @@ class Locmare.FormModule.FieldModule.Helpers extends Backbone.View
     @field = options.field\r
     @field_manifest = options.field_manifest\r
     @helpers = {}\r
-    _this = this\r
-    _.each @field_manifest.helpers, (helper_manifest, helper_name) ->\r
-      _this.helpers[helper_name] = Locmare.FormModule.FieldModule.HelperFactory.factory(_this.field, helper_manifest)\r
+    _.each @field_manifest.helpers, (helper_manifest, helper_name) =>\r
+      @helpers[helper_name] = Locmare.FormModule.FieldModule.HelperFactory.factory(@field, helper_manifest)\r
   \r
   render: () ->\r
     this.$el.html('')\r
-    _this = this\r
-    _.each @helpers, (helper) ->\r
-      _this.$el.append(helper.render().el)\r
+    _.each @helpers, (helper) =>\r
+      this.$el.append(helper.render().el)\r
     this\r
   \r
index f52f25e..ca0b0ca 100644 (file)
@@ -10,9 +10,8 @@ class Locmare.FormModule.FieldModule.HelperModule.TailAngle extends Locmare.Form
     @speech_balloon_template = new Pettanr.SpeechBalloonTemplate({\r
       id: @field.item().get('speech_balloon_template_id')\r
     })\r
-    _this = this\r
-    @speech_balloon_template.fetch({cache: true}).done ->\r
-      _this.r_step = _this._r_step()\r
+    @speech_balloon_template.fetch({cache: true}).done =>\r
+      @r_step = @_r_step()\r
   \r
   render: () ->\r
     @attr = {\r
index 0a1eec3..f3db69f 100644 (file)
@@ -8,14 +8,13 @@ class Locmare.FormModule.FieldModule.TagModule.SelectTag extends Locmare.FormMod
     }\r
     _.extend(@attr, @options())\r
     this.$el.attr(@attr)\r
-    _this = this\r
-    @select_values((members) ->\r
-      _.each members, (member) ->\r
-        selected = if _this.is_selected(member)\r
+    @select_values((members) =>\r
+      _.each members, (member) =>\r
+        selected = if @is_selected(member)\r
           ' selected'\r
         else\r
           ''\r
-        _this.$el.append('<option value="' + member[1] + '"' + selected + '>' + member[0] + '</option>')\r
+        this.$el.append('<option value="' + member[1] + '"' + selected + '>' + member[0] + '</option>')\r
     )\r
     this\r
   \r
index c2d093e..05a0d2c 100644 (file)
@@ -46,11 +46,10 @@ class Locmare.ListGroupModule.LibModule.PagerModule.Default extends Backbone.Vie
       this.$el.append(\r
         (new Locmare.ListGroupModule.LibModule.PagerModule.PageGap()).render().el\r
       )\r
-    _this = this\r
-    _.each @range(), (page) ->\r
+    _.each @range(), (page) =>\r
       _this.$el.append(\r
         (new Locmare.ListGroupModule.LibModule.PagerModule.Page({\r
-          parent: _this, page: page, class_name: 'page'\r
+          parent: this, page: page, class_name: 'page'\r
         })).render().el\r
       )\r
     if @hasNextPageGap()\r
index 9b6d4f2..bf6dea2 100644 (file)
@@ -22,17 +22,15 @@ class Locmare.ListGroupModule.Base extends Backbone.Collection
     res.list\r
   \r
   items: () ->\r
-    _this = this\r
-    _.map @models, (model) ->\r
-      new _this.model_class(model.attributes)\r
+    _.map @models, (model) =>\r
+      new @model_class(model.attributes)\r
   \r
   count: () ->\r
     new Pettanr.CounterModel({}, {url: '/' + @action_manifest.counter_url(@params)})\r
   \r
   open: (cb) ->\r
     @url = '/' + @action_manifest.url(@params)\r
-    _this = this\r
-    @fetch({cache: true}).done ->\r
+    @fetch({cache: true}).done =>\r
       #_this.boost(items)\r
       cb()\r
   \r
index 3dedcf4..2d6bb1f 100644 (file)
@@ -14,21 +14,20 @@ class Locmare.ProfilerModule.Association extends Backbone.View
   \r
   render: () ->\r
     this.$el.html('')\r
-    _this = this\r
     caption = new Tag.Div({class_name: 'caption', content: 'associations'})\r
     this.$el.append(caption.render().el)\r
     caption = new Tag.Div({class_name: 'caption', content: 'belongs_to'})\r
     this.$el.append(caption.render().el)\r
-    _.each @belongs_to, (f) ->\r
-      _this.$el.append(f.render().el)\r
+    _.each @belongs_to, (f) =>\r
+      this.$el.append(f.render().el)\r
     caption = new Tag.Div({class_name: 'caption', content: 'has_many'})\r
     this.$el.append(caption.render().el)\r
-    _.each @has_many, (f) ->\r
-      _this.$el.append(f.render().el)\r
+    _.each @has_many, (f) =>\r
+      this.$el.append(f.render().el)\r
     caption = new Tag.Div({class_name: 'caption', content: 'has_one'})\r
     this.$el.append(caption.render().el)\r
-    _.each @has_one, (f) ->\r
-      _this.$el.append(f.render().el)\r
+    _.each @has_one, (f) =>\r
+      this.$el.append(f.render().el)\r
     this\r
   \r
   item: () ->\r
index d10b983..7ac4046 100644 (file)
@@ -6,15 +6,14 @@ class Locmare.ProfilerModule.AssociationModule.BelongsTo extends Backbone.View
     @belongs_to_manifest = options.belongs_to_manifest\r
     pm = @parent_model()\r
     m = new pm({id: @parent_id()})\r
-    _this = this\r
-    m.fetch({cache: true}).done ->\r
-      _this.filer = new Locmare.Filer({\r
-        item_name: _this.parent_model().item_name(), \r
+    m.fetch({cache: true}).done =>\r
+      @filer = new Locmare.Filer({\r
+        item_name: @parent_model().item_name(), \r
         items: [m], \r
         pager: null, \r
-        operators: _this.profiler().operators\r
+        operators: @profiler().operators\r
       })\r
-      _this.render()\r
+      @render()\r
   \r
   render: () ->\r
     this.$el.html(@filer.el) if @filer\r
index 7e6d847..d2475a1 100644 (file)
@@ -11,15 +11,14 @@ class Locmare.ProfilerModule.AssociationModule.HasMany extends Backbone.View
       action.path_name(), action.name, \r
       @profiler().operators, {id: @item().get('id'), page: 1, page_size: 3}\r
     )\r
-    _this = this\r
-    @list.open((page_status) ->\r
-      _this.filer = new Locmare.Filer({\r
-        item_name: _this.has_many_model().item_name(), \r
-        items: _this.list.items(), \r
-        pager: _this.pager, \r
-        operators: _this.profiler().operators\r
+    @list.open((page_status) =>\r
+      @filer = new Locmare.Filer({\r
+        item_name: @has_many_model().item_name(), \r
+        items: @list.items(), \r
+        pager: @pager, \r
+        operators: @profiler().operators\r
       })\r
-      _this.render()\r
+      @render()\r
     )\r
   \r
   render: () ->\r
index 7ea42b4..a07f4f8 100644 (file)
@@ -11,15 +11,14 @@ class Locmare.ProfilerModule.AssociationModule.HasOne extends Backbone.View
       action.path_name(), action.name, \r
       @profiler().operators, {id: @item().get('id')}\r
     )\r
-    _this = this\r
-    @list.open((page_status) ->\r
-      _this.filer = new Locmare.Filer({\r
-        item_name: _this.has_one_model().item_name(), \r
-        items: _this.list.items(), \r
-        pager: _this.pager, \r
-        operators: _this.profiler().operators\r
+    @list.open((page_status) =>\r
+      @filer = new Locmare.Filer({\r
+        item_name: @has_one_model().item_name(), \r
+        items: @list.items(), \r
+        pager: @pager, \r
+        operators: @profiler().operators\r
       })\r
-      _this.render()\r
+      @render()\r
     )\r
   \r
   render: () ->\r
index 42c89bd..663341b 100644 (file)
@@ -6,15 +6,13 @@ class Locmare.ProfilerModule.Column extends Backbone.View
     @profiler = options.profiler\r
     @profiler_manifest = @profiler.profiler_manifest\r
     @columns = {}\r
-    _this = this\r
-    _.each @profiler_manifest.columns, (column, name) ->\r
-      _this.columns[name] = _this.factory(_this.profiler, column)\r
+    _.each @profiler_manifest.columns, (column, name) =>\r
+      @columns[name] = @factory(@profiler, column)\r
   \r
   render: () ->\r
-    _this = this\r
     this.$el.html('')\r
-    _.each @sorted_columns(), (column) ->\r
-      _this.$el.append(column.render().el)\r
+    _.each @sorted_columns(), (column) =>\r
+      this.$el.append(column.render().el)\r
     this\r
   \r
   types: () ->\r
@@ -35,7 +33,7 @@ class Locmare.ProfilerModule.Column extends Backbone.View
   \r
   sorted_columns: () ->\r
     _.map @profiler_manifest.column_names, (column_name) =>\r
-      _this.columns[column_name]\r
+      @columns[column_name]\r
   \r
 class Locmare.ProfilerModule.ColumnModule\r
 \r
index 9b97ffa..cb9802e 100644 (file)
@@ -91,26 +91,23 @@ class Locmare.ProfilerModule.ColumnModule.ExtendValue extends Backbone.View
   initialize: (options) ->\r
     @column = options.column\r
     @columns = {}\r
-    _this = this\r
-    _.each @extend_settings().column_names, (extend_column_name) ->\r
-      extend_column_manifest = _this.extend_settings().columns[extend_column_name] || {}\r
-      _this.columns[extend_column_name] = new Locmare.ProfilerModule.ColumnModule.ExtendModule.ExtendColumn({\r
-        column: _this, \r
+    _.each @extend_settings().column_names, (extend_column_name) =>\r
+      extend_column_manifest = @extend_settings().columns[extend_column_name] || {}\r
+      @columns[extend_column_name] = new Locmare.ProfilerModule.ColumnModule.ExtendModule.ExtendColumn({\r
+        column: this, \r
         extend_column_name: extend_column_name, \r
         extend_column_manifest: extend_column_manifest\r
       })\r
   \r
   render: () ->\r
-    _this = this\r
     this.$el.html('')\r
-    _.each @sorted_columns(), (extend_column) ->\r
-      _this.$el.append(extend_column.render().el)\r
+    _.each @sorted_columns(), (extend_column) =>\r
+      this.$el.append(extend_column.render().el)\r
     this\r
   \r
   sorted_columns: () ->\r
-    _this = this\r
-    _.map @extend_settings().column_names, (column_name) ->\r
-      _this.columns[column_name]\r
+    _.map @extend_settings().column_names, (column_name) =>\r
+      @columns[column_name]\r
   \r
   extend_settings: () ->\r
     @template_model_profiler().extend_settings[@booster().item_name()]\r
index 0ea32bd..a917530 100644 (file)
@@ -127,16 +127,14 @@ class Pettanr
     \r
     filer_list: () ->\r
       @set_list()\r
-      _this = this\r
-      _list = @list\r
-      @list.open(() ->\r
-        pager = Locmare.ListGroupModule.LibModule.Pager.factory(_list.page_status, _this.params)\r
+      @list.open(() =>\r
+        pager = Locmare.ListGroupModule.LibModule.Pager.factory(@list.page_status, @params)\r
         f = new Locmare.Filer({\r
           el: "#pettanr",\r
-          item_name: _this.my_list_model_class.item_name(), \r
-          items: _this.list.items(), \r
+          item_name: @my_list_model_class.item_name(), \r
+          items: @list.items(), \r
           pager: pager, \r
-          operators: _this.operators\r
+          operators: @operators\r
         })\r
       )\r
       false\r
@@ -150,24 +148,21 @@ class Pettanr
       @item = new @binder_model_class({id: @params['id']})\r
     \r
     play_list: () ->\r
-      _this = this\r
-      _list = @list\r
-      @list.open(() ->\r
-        console.log _this.list.items()\r
+      @list.open(() =>\r
+        console.log @list.items()\r
       )\r
       false\r
     \r
     show_prof: () ->\r
-      _this = this\r
-      @item.fetch({cache: true}).done ->\r
-        _this.item.boosts 'post'\r
+      @item.fetch({cache: true}).done =>\r
+        @item.boosts 'post'\r
         profiler = new Locmare.Profiler({\r
-          item_name: _this.item.item_name(), \r
-          item: _this.item, \r
-          operators: _this.operators\r
+          item_name: @item.item_name(), \r
+          item: @item, \r
+          operators: @operators\r
         })\r
         $("#pettanr").html(profiler.render().el)\r
-        _this.redraw_title(_this.params)\r
+        @redraw_title(@params)\r
     \r
     set_new: () ->\r
       @set_model()\r
@@ -179,10 +174,9 @@ class Pettanr
     set_edit: () ->\r
       @set_model()\r
       @item = new @my_model_class({id: @params['id']})\r
-      _this = this\r
-      @item.fetch({cache: true}).done ->\r
-        _this.item.boosts 'post'\r
-        _this.render_form()\r
+      @item.fetch({cache: true}).done =>\r
+        @item.boosts 'post'\r
+        @render_form()\r
     \r
     render_form: () ->\r
       @form = new Locmare.Form({\r
@@ -207,27 +201,6 @@ class Pettanr
       site_caption = Manifest.manifest().magic_numbers.profile.users.caption\r
       $(document).attr('title', t + ' - ' + site_caption)\r
     \r
-  class Pettanr.FilerRender\r
-    constructor: (item_name, list_result, pager_type, operators) ->\r
-      @item_name = item_name\r
-      @list_result = list_result\r
-      @pager_type = pager_type\r
-      @operators = operators\r
-      _this = this\r
-      @list_result.fetch({cache: true}).done () ->\r
-        _this.render()\r
-    \r
-    render: () ->\r
-      items = @list_result.models\r
-      f = new Locmare.Filer({\r
-        item_name: @item_name, \r
-        items: items, \r
-        list_result: @list_result, \r
-        pager_type: @pager_type, \r
-        operators: @operators\r
-      })\r
-      $("#pettanr").html(f.render().el)\r
-\r
   #>> https://gist.github.com/davidjbeveridge/3813724\r
   @xeach: (arr, func, index=0) ->\r
     if index < arr.length then [ func(arr[index], index), @xeach(arr, func, index + 1)... ] else []\r
index 471b96e..4782689 100644 (file)
@@ -63,11 +63,10 @@ class Tag.Ul extends Backbone.View
   \r
   render: () ->\r
     @el.className = @class_name if @class_name\r
-    _this = this\r
     this.$el.attr(@attr)\r
     this.$el.html('')\r
-    _.each @contents, (content) ->\r
-      _this.$el.append(content.render().el)\r
+    _.each @contents, (content) =>\r
+      this.$el.append(content.render().el)\r
     this\r
   \r
 class Tag.RowBreak extends Tag.Div\r
index 0f57609..dc7881f 100644 (file)
@@ -27,7 +27,10 @@ module Locmare
       end
       
       def init
-        @page_status = LibModule::PageStatus.load self, self.total, @options
+      end
+      
+      def page_status
+        @page_status ||= LibModule::PageStatus.load self, self.total, @options
       end
       
       def model_name