Module: Card::Set::Abstract::Script::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod017-card-mod-script/abstract/script.rb,
card/tmpsets/set/mod016-card-mod-script/abstract/script.rb

Instance Method Summary collapse

Instance Method Details

#ace_modeObject



72
73
74
# File 'card/tmpsets/set/mod017-card-mod-script/abstract/script.rb', line 72

def ace_mode
  :javascript
end

#content_changes(action, diff_type, hide_diff = false) ⇒ Object



76
77
78
# File 'card/tmpsets/set/mod017-card-mod-script/abstract/script.rb', line 76

def content_changes action, diff_type, hide_diff=false
  wrap_with(:pre) { super }
end

#highlight(script) ⇒ Object



85
86
87
# File 'card/tmpsets/set/mod017-card-mod-script/abstract/script.rb', line 85

def highlight script
  ::CodeRay.scan(script, :js).div
end

#input_typeObject



68
69
70
# File 'card/tmpsets/set/mod017-card-mod-script/abstract/script.rb', line 68

def input_type
  :ace_editor
end

#view: coreObject



80
81
82
83
# File 'card/tmpsets/set/mod017-card-mod-script/abstract/script.rb', line 80

view :core do
  script = card.format(:js).render_core
  process_content highlight(script)
end