Sha256: a1ea118f15f7a7d8fec51486e3621ba35f8402f7575c3d199f713a8d92cf8893

Contents?: true

Size: 944 Bytes

Versions: 14

Compression:

Stored size: 944 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'coffee-script'
require 'uglifier'

require_dependency 'card/machine'
require_dependency 'card/machine_input'

include Machine
include MachineInput

def compile_coffee script
  ::CoffeeScript.compile script
rescue =>e
  e
end

machine_input do
  Uglifier.compile( compile_coffee format(:js)._render_raw )
end

store_machine_output filetype: 'js'

def clean_html?
  false
end


format do
  def chunk_list  #turn off autodetection of uri's
    :inclusion_only
  end
end


format :html do
  view :editor, mod: Html::HtmlFormat

  view :content_changes do |args|
    %{
      <pre>#{super(args)}</pre>
    }
  end

  view :core do |args|
    js = card.compile_coffee _render_raw
    highlighted_js = ::CodeRay.scan( js, :js ).div
    process_content highlighted_js
  end

end


format do
  view :core do |args|
    process_content card.compile_coffee(_render_raw)
  end
end

def diff_args
  { format: :text }
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
card-1.17.4 mod/03_machines/set/type/coffee_script.rb
card-1.17.3 mod/03_machines/set/type/coffee_script.rb
card-1.17.2 mod/03_machines/set/type/coffee_script.rb
card-1.17.1 mod/03_machines/set/type/coffee_script.rb
card-1.17.0 mod/03_machines/set/type/coffee_script.rb
card-1.16.15 mod/03_machines/set/type/coffee_script.rb
card-1.16.14 mod/03_machines/set/type/coffee_script.rb
card-1.16.13 mod/03_machines/set/type/coffee_script.rb
card-1.16.12 mod/03_machines/set/type/coffee_script.rb
card-1.16.11 mod/03_machines/set/type/coffee_script.rb
card-1.16.10 mod/03_machines/set/type/coffee_script.rb
card-1.16.9 mod/03_machines/set/type/coffee_script.rb
card-1.16.8 mod/03_machines/set/type/coffee_script.rb
card-1.16.7 mod/03_machines/set/type/coffee_script.rb