OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / models / scroll.js.coffee
index 52f9581..c312605 100644 (file)
@@ -1,25 +1,26 @@
-class Scroll extends Item\r
-  @single: () ->\r
+class Pettanr.Scroll extends Peta.Binder\r
+  url: '/scrolls/'\r
+  \r
+  @singular: () ->\r
     'Scroll'\r
   \r
   @plural: () ->\r
     'Scrolls'\r
   \r
   defaults: {\r
-    id: 11\r
+    id: null,\r
+    visible: 0\r
   } \r
   \r
-  initialize: () ->\r
-    confirm("Welcome to Panel")\r
+  author: () ->\r
+    new Pettanr.Author({id: @get('author_id')})\r
   \r
-  @test: () ->\r
-    confirm( @single())\r
-    confirm( @plural() )\r
-    confirm( @class_name() )\r
-    confirm( @element_name() )\r
-    confirm( @table_name() )\r
-    \r
+  overwrite: (options) ->\r
+    operators = options.operators\r
+    return false if not operators.author\r
+    @set('author_id', operators.author.id)\r
+  \r
+  initialize: () ->\r
+    if @id\r
+      @url = @url + @id\r
   \r
-  test: () ->\r
-\r
-@Panel = Panel\r