Sha256: ee25380879ce91278b76d8094ef24ba2151581bf93671792910f6213cb0026d5

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

-# TODO: markdown editor

= node f, field do
  - if @quick_edit
    = f.text_area field.name, class: 'markdown'
  - else
    = javascript_include_tag 'bhf_includes/showdown.js'
    #wmd-editor.wmd-pane
      #wmd-button-bar
      = f.text_area field.name, id: 'wmd-input', class: 'markdown'
    %h6.preview_switch
      Preview
      %span#toggle_html_preview HTML
      %span#toggle_live_preview.active Live
    #wmd-preview.wmd-panel
    #wmd-output.wmd-panel.hide
    = javascript_include_tag 'bhf_includes/wmd.js'
    :javascript
      var toggleMdPreview = function(e){
        var htmlPreview = e.target.id === 'toggle_html_preview';
        $('wmd-preview').toggleClass('hide', htmlPreview);
        $('wmd-output').toggleClass('hide', !htmlPreview);
        $('toggle_live_preview').toggleClass('active', !htmlPreview);
        $('toggle_html_preview').toggleClass('active', htmlPreview);
      };
      $('toggle_live_preview').addEvent('click', toggleMdPreview);
      $('toggle_html_preview').addEvent('click', toggleMdPreview);
      

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bhf-0.4.2.3 app/views/bhf/entries/form/column/_markdown.haml