Sha256: 07564460ced37fa0c0c6ead2b79d269ed1af6ccc9ff8eefd7a96b50a3a4a550f

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

-# TODO: markdown editor

= node f, field do
  - if @quick_edit
    = f.text_area field.name, :id => 'wmd-input', :class => 'markdown'
  - else
    = javascript_include_tag '/javascripts/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 '/javascripts/bhf_includes/wmd.js'
    :javascript
      var toggleMdPreview = function(e){
        var a = e.target.id === 'toggle_html_preview';
        $('wmd-preview').toggleClass('hide', a);
        $('wmd-output').toggleClass('hide', !a);
        $('toggle_live_preview').toggleClass('active', !a);
        $('toggle_html_preview').toggleClass('active', a);
      };
      $('toggle_live_preview').addEvent('click', toggleMdPreview);
      $('toggle_html_preview').addEvent('click', toggleMdPreview);
      

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bhf-0.3.11 app/views/bhf/entries/form/column/_markdown.haml
bhf-0.3.10 app/views/bhf/entries/form/column/_markdown.haml
bhf-0.3.9 app/views/bhf/entries/form/column/_markdown.haml
bhf-0.3.8 app/views/bhf/entries/form/column/_markdown.haml