<commit_before>= render :partial => 'menu'
script src="/ace/ace.js"

.scripts-edit
  h2 Edit Script "#{@script.name}"

  = form_tag "/#{@script.user.slug}/#{@script.slug}/", {:method => :put} do
    fieldset

      label style="display:none"
        ' Content from
        a.url href=""
          | URL
        '  |
        a.text href=""
          ' Text
      textarea style="display: none" rows="18" name="script[body]"

    #editor
     = @script.body

    div
      button type='submit' Update

  div
    = form_tag("/#{@script.user.slug}/#{@script.slug}",{:method=>:delete,:confirm=>"sure?"}) do
      = button_tag "Delete", :confirm => "Delete #{@script.name}?"

  div
    h3 Storage
    p #{@script.storage.inspect}

  div
    = form_tag("/#{@script.user.slug}/#{@script.slug}/reset",{:confirm=>"sure?"}) do
      = button_tag "Reset", :confirm => "Reset stored variables for #{@script.name}?"

javascript:
  $(function(){
    scripts_edit_setup(#{{@script.to_json}}, #{{@script.body.to_json}})
  })
<commit_msg>a little more edit page tweaking<commit_after>= render :partial => 'menu'
script src="/ace/ace.js"

.scripts-edit
  h2 Edit Script "#{@script.name}"

  = form_tag "/#{@script.user.slug}/#{@script.slug}/", {:method => :put} do
    button type='submit' Save

    fieldset
      label style="display:none"
        ' Content from
        a.url href=""
          | URL
        '  |
        a.text href=""
          ' Text
      textarea style="display: none" rows="18" name="script[body]"

    #editor
     = @script.body



  div
    h3 Storage
    p #{@script.storage.inspect}

  div
    = form_tag("/#{@script.user.slug}/#{@script.slug}/reset",{:confirm=>"sure?"}) do
      = button_tag "Reset Values", :confirm => "Erase stored variables for #{@script.name}?"

  div
    h3 Delete Script
    = form_tag("/#{@script.user.slug}/#{@script.slug}",{:method=>:delete,:confirm=>"sure?"}) do
      = button_tag "Delete", :confirm => "Delete #{@script.name}?"

javascript:
  $(function(){
    scripts_edit_setup(#{{@script.to_json}}, #{{@script.body.to_json}})
  })

{'fraction_non_alphanumeric': 0.19845857418111754, 'fraction_numerical': 0.004335260115606936, 'mean_word_length': 2.963740458015267, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5373380', 'n_tokens_mistral': 714, 'n_tokens_neox': 711, 'n_words': 140}