Sha256: 67520d0f93d7be2d9fc9f35ff796243ad1a6a2a186f15280165e74072dc54c85

Contents?: true

Size: 1.2 KB

Versions: 196

Compression:

Stored size: 1.2 KB

Contents

$(function(){
  $('#tag_reference').click(function(event){
    event.preventDefault();
    var href = $(this).attr('href');
    $.ajax({
      url: href,
      type: "GET",
      dataType: "html",
      success: function(data, textStatus, xhr){
        $('#popups').append(data);
        Popup.show('tag_reference_popup');
        $('#filter').keyup(function(){

          // Retrieve the input field text and reset the count to zero
          var filter = $(this).val(), count = 0;

          // Loop through the tag list
          $(".tag_description").each(function(){

            // If the list item does not contain the text phrase fade it out
            if ($(this).text().search(new RegExp(filter, "i")) < 0) {
              $(this).fadeOut();

              // Show the list item if the phrase matches and increase the count by 1
            } else {
              $(this).show();
              count++;
            }
          });

          // Update the count
          $("#filter-count").text("Found "+count+" Tags").css("background-color","yellow");
        });
        $('.close_link').click(function(){
          Popup.close();
          $('#tag_reference_popup').remove();
        });
      }
    });
  });
});

Version data entries

196 entries across 196 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 app/assets/javascripts/admin/tags.js
trusty-cms-7.0.2 app/assets/javascripts/admin/tags.js
trusty-cms-7.0.1 app/assets/javascripts/admin/tags.js
trusty-cms-7.0.0 app/assets/javascripts/admin/tags.js
trusty-cms-6.3 app/assets/javascripts/admin/tags.js
trusty-cms-6.2.1 app/assets/javascripts/admin/tags.js
trusty-cms-6.2.2.1 app/assets/javascripts/admin/tags.js
trusty-cms-6.2.0 app/assets/javascripts/admin/tags.js
trusty-cms-6.1.2 app/assets/javascripts/admin/tags.js
trusty-cms-6.1.1 app/assets/javascripts/admin/tags.js
trusty-cms-6.0.5 app/assets/javascripts/admin/tags.js
trusty-cms-6.0.4 app/assets/javascripts/admin/tags.js
trusty-cms-6.0.3 app/assets/javascripts/admin/tags.js
trusty-cms-6.0.2 app/assets/javascripts/admin/tags.js
trusty-cms-6.0.1 app/assets/javascripts/admin/tags.js
trusty-cms-5.6.1 app/assets/javascripts/admin/tags.js
trusty-cms-6.0.0 app/assets/javascripts/admin/tags.js
trusty-cms-5.6.0 app/assets/javascripts/admin/tags.js
trusty-cms-5.5.9 app/assets/javascripts/admin/tags.js
trusty-cms-5.5.8 app/assets/javascripts/admin/tags.js