OSDN Git Service

fix escape html
[pettanr/pettanr.git] / app / assets / javascripts / models / folder.js.coffee
index cf271bd..5e8e8b3 100644 (file)
@@ -1,5 +1,5 @@
 class Pettanr.Folder extends Peta.Owner\r
-  url: ''\r
+  url: '/folders/'\r
   \r
   @singular: () ->\r
     'Folder'\r
@@ -15,6 +15,10 @@ class Pettanr.Folder extends Peta.Owner
   caption: () ->\r
     @get('name').replace(/\/$/, '').split('/').pop()\r
   \r
+  filer_caption: () ->\r
+    @caption_text = _.escape(@caption())\r
+    @trigger('ready:caption')\r
+  \r
   is_remote: () ->\r
     if @get('category_id') == 10\r
       true\r
@@ -36,16 +40,12 @@ class Pettanr.Folder extends Peta.Owner
       @url = @url + @id\r
   \r
 class Pettanr.FolderWatch extends Pettanr.Folder\r
-  url: ''\r
   initialize: () ->\r
     super()\r
     @url = @url + '?ref=1'\r
-class Pettanr.Folder.Collection extends Backbone.Collection\r
-  model: Pettanr.Folder\r
-  url: 'folders'\r
-class Pettanr.Folder.Root extends Backbone.Collection\r
+class Pettanr.Folder.Root extends Pettanr.Folder\r
   model: Pettanr.Folder\r
-  url: '/folders/root'\r
+  url: '/folders/root?ref=1'\r
 class Pettanr.Folder.Children extends Backbone.Collection\r
   model: Pettanr.Folder\r
   initialize: (options) ->\r