Sha256: dc832195ec4f57afcd57ab3ca2d211e5c809bbcf040cc365ae53258a53df521f

Contents?: true

Size: 1.04 KB

Versions: 8

Compression:

Stored size: 1.04 KB

Contents

-# TODO: markdown lib that is not id based bullshit

= node f, field do
  - if @quick_edit
    = f.text_area field.name, class: 'markdown'
  - else
    = javascript_include_tag 'bhf/includes/showdown'
    #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'
    :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

8 entries across 8 versions & 1 rubygems

Version Path
bhf-0.4.7 app/views/bhf/entries/form/column/_markdown.haml
bhf-0.4.6 app/views/bhf/entries/form/column/_markdown.haml
bhf-0.4.5 app/views/bhf/entries/form/column/_markdown.haml
bhf-0.4.4 app/views/bhf/entries/form/column/_markdown.haml
bhf-0.4.3 app/views/bhf/entries/form/column/_markdown.haml
bhf-0.4.2.7 app/views/bhf/entries/form/column/_markdown.haml
bhf-0.4.2.5 app/views/bhf/entries/form/column/_markdown.haml
bhf-0.4.2.4 app/views/bhf/entries/form/column/_markdown.haml