<commit_before>-# Set the JS type vars if a saved expression atom already exists when first showing the editor
- if @edit && @edit.fetch_path(@expkey, :val1, :type)
  = javascript_tag("miq_val1_type = '#{@edit[@expkey][:val1][:type]}';")
  = javascript_tag("miq_val1_title = '#{@edit[@expkey][:val1][:title]}';")
- if @edit && @edit.fetch_path(@expkey, :val2, :type)
  = javascript_tag("miq_val2_type = '#{@edit[@expkey][:val2][:type]}';")
  = javascript_tag("miq_val2_title = '#{@edit[@expkey][:val2][:title]}';")

#exp_editor_div
  %fieldset{:style => "width: auto; padding-left: 6px; padding-top: 6px"}
    %ul#searchtoolbar
      - if @edit[@expkey][:exp_idx] > 0
        %li
          = link_to(image_tag('/images/toolbars/undo.png',
                              :alt => 'Undo the previous change'),
                    {:action  => 'exp_button',
                     :pressed => 'undo'},
                    "data-miq_sparkle_on"  => true,
                    "data-miq_sparkle_off" => true,
                    :remote                => true,
                    :title                 => _('Undo the previous change'))
      - else
        %li.dimmed
          = image_tag("/images/toolbars/undo.png")

      - if @edit[@expkey][:exp_idx] < @edit[@expkey][:exp_array].length - 1
        %li
          = link_to(image_tag('/images/toolbars/redo.png',
                              :alt => 'Redo the next change'),
                    {:action  => 'exp_button',
                     :pressed => 'redo'},
                    "data-miq_sparkle_on"  => true,
                    "data-miq_sparkle_off" => true,
                    :remote                => true,
                    :title                 => _('Redo the next change'))
      - else
        %li.dimmed
          = image_tag("/images/toolbars/redo.png")

      %span#exp_buttons_off
        - %w(and or not discard).each do |image|
          %li.dimmed
            = image_tag("/images/toolbars/#{image}.png")

      %span#exp_buttons_not{:style => "display: none"}
        - [[_("AND with a new expression element"), 'and',     'and'],
           [_("OR with a new expression element"),  'or',      'or'],
           ["",                                     'not',     ''],
           [_("Remove this expression element"),    'discard', 'remove']].each do |title, image, pressed|
          - if title.empty?
            %li.dimmed
              = link_to(image_tag("/images/toolbars/#{image}.png"))
          - else<commit_msg>Changed tooltip text when Adding new VM Policy<commit_after>-# Set the JS type vars if a saved expression atom already exists when first showing the editor
- if @edit && @edit.fetch_path(@expkey, :val1, :type)
  = javascript_tag("miq_val1_type = '#{@edit[@expkey][:val1][:type]}';")
  = javascript_tag("miq_val1_title = '#{@edit[@expkey][:val1][:title]}';")
- if @edit && @edit.fetch_path(@expkey, :val2, :type)
  = javascript_tag("miq_val2_type = '#{@edit[@expkey][:val2][:type]}';")
  = javascript_tag("miq_val2_title = '#{@edit[@expkey][:val2][:title]}';")

#exp_editor_div
  %fieldset{:style => "width: auto; padding-left: 6px; padding-top: 6px"}
    %ul#searchtoolbar
      - if @edit[@expkey][:exp_idx] > 0
        %li
          = link_to(image_tag('/images/toolbars/undo.png',
                              :alt => 'Undo the last change'),
                    {:action  => 'exp_button',
                     :pressed => 'undo'},
                    "data-miq_sparkle_on"  => true,
                    "data-miq_sparkle_off" => true,
                    :remote                => true,
                    :title                 => _('Undo the last change'))
      - else
        %li.dimmed
          = image_tag("/images/toolbars/undo.png")

      - if @edit[@expkey][:exp_idx] < @edit[@expkey][:exp_array].length - 1
        %li
          = link_to(image_tag('/images/toolbars/redo.png',
                              :alt => 'Re-apply the previous change'),
                    {:action  => 'exp_button',
                     :pressed => 'redo'},
                    "data-miq_sparkle_on"  => true,
                    "data-miq_sparkle_off" => true,
                    :remote                => true,
                    :title                 => _('Re-apply the previous change'))
      - else
        %li.dimmed
          = image_tag("/images/toolbars/redo.png")

      %span#exp_buttons_off
        - %w(and or not discard).each do |image|
          %li.dimmed
            = image_tag("/images/toolbars/#{image}.png")

      %span#exp_buttons_not{:style => "display: none"}
        - [[_("AND with a new expression element"), 'and',     'and'],
           [_("OR with a new expression element"),  'or',      'or'],
           ["",                                     'not',     ''],
           [_("Remove this expression element"),    'discard', 'remove']].each do |title, image, pressed|
          - if title.empty?
            %li.dimmed
              = link_to(image_tag("/images/toolbars/#{image}.png"))
          - else
{'fraction_non_alphanumeric': 0.16325719960278054, 'fraction_numerical': 0.005561072492552135, 'mean_word_length': 1.7579408543263966, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7044592', 'n_tokens_mistral': 1604, 'n_tokens_neox': 1526, 'n_words': 298}