Class: ODDB::View::EditChapterForm

Inherits:
Form
  • Object
show all
Defined in:
src/view/chapter.rb

Constant Summary

COMPONENTS =
{
  [0,0]  =>  :heading,
  #[1,1]  =>  :toolbar,
  [0,1,1]=>  :edit_chapter,
  [1,2]  =>  :submit,
}
LABELS =
true
LEGACY_INTERFACE =
false
SYMBOL_MAP =
{ }
CSS_CLASS =
'composite tundra'
CSS_MAP =
{
  [0,0]  =>  'list',
  [0,1]  =>  'list top',
}
COMPONENT_CSS_MAP =
{
  #[0,0,1]  =>  'standard',
}

Constants included from FormMethods

ACCEPT_CHARSET, DEFAULT_CLASS, EVENT

Instance Method Summary (collapse)

Methods included from FormMethods

#delete_item, #delete_item_warn, #get_event_button, #post_event_button

Constructor Details

- (EditChapterForm) initialize(name, *args)

A new instance of EditChapterForm



160
161
162
163
# File 'src/view/chapter.rb', line 160

def initialize(name, *args)
  @name = name
  super(*args)
end

Instance Method Details

- (Object) edit_chapter(model)



164
165
166
167
168
169
170
171
# File 'src/view/chapter.rb', line 164

def edit_chapter(model)
  editor = ChapterEditor.new(:html_chapter, model, @session, self)
  editor.value = model.send(@name)
  editor.label = true
  editor.css_id = "html-chapter"
  self.onsubmit = "this.html_chapter.value = dijit.byId('html-chapter').getValue();"
  editor
end

- (Object) heading(model)



172
173
174
175
# File 'src/view/chapter.rb', line 172

def heading(model)
  HtmlGrid::InputText.new(:heading, model.send(@name), 
    @session, self)
end

- (Object) hidden_fields(context)



176
177
178
179
180
# File 'src/view/chapter.rb', line 176

def hidden_fields(context)
  chapter = {'name' => 'chapter', 'value' => @name}
  html = {'name' => 'html_chapter', 'value' => ''}
  super << context.(chapter) << context.(html)
end

- (Object) toolbar(model)



181
182
183
184
185
186
187
# File 'src/view/chapter.rb', line 181

def toolbar(model)
  args = {
    "templatePath"  => @lookandfeel.resource_global(:javascript, 
                         'dojo/HtmlEditorToolbar.html'),
  }
  dojo_tag("Editor2Toolbar", args)
end