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

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod019-script/abstract/00_script.rb

Instance Method Summary collapse

Instance Method Details

#ace_modeObject

[View source]

72
73
74
# File 'platypus/tmp/set/gem-defaults/mod019-script/abstract/00_script.rb', line 72

def ace_mode
  :javascript
end

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

[View source]

76
77
78
# File 'platypus/tmp/set/gem-defaults/mod019-script/abstract/00_script.rb', line 76

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

#highlight(script) ⇒ Object

[View source]

89
90
91
# File 'platypus/tmp/set/gem-defaults/mod019-script/abstract/00_script.rb', line 89

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

#input_typeObject

[View source]

68
69
70
# File 'platypus/tmp/set/gem-defaults/mod019-script/abstract/00_script.rb', line 68

def input_type
  :ace_editor
end

#view: coreObject

[View source]

80
81
82
83
# File 'platypus/tmp/set/gem-defaults/mod019-script/abstract/00_script.rb', line 80

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

#view: javascript_include_tagObject

[View source]

85
86
87
# File 'platypus/tmp/set/gem-defaults/mod019-script/abstract/00_script.rb', line 85

view :javascript_include_tag, cache: :never do
  javascript_include_tag path(format: :js)
end