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-3.5.0 app/assets/javascripts/admin/tags.js
trusty-cms-3.4.0 app/assets/javascripts/admin/tags.js
trusty-cms-3.3.7 app/assets/javascripts/admin/tags.js
trusty-cms-3.3.6 app/assets/javascripts/admin/tags.js
trusty-cms-3.3.5 app/assets/javascripts/admin/tags.js
trusty-cms-3.3.3 app/assets/javascripts/admin/tags.js
trusty-cms-3.3.2 app/assets/javascripts/admin/tags.js
trusty-cms-3.3.1 app/assets/javascripts/admin/tags.js
trusty-cms-3.2.1 app/assets/javascripts/admin/tags.js
trusty-cms-3.3.0 app/assets/javascripts/admin/tags.js
trusty-cms-3.2.0 app/assets/javascripts/admin/tags.js
trusty-cms-3.1.11 app/assets/javascripts/admin/tags.js
trusty-cms-3.1.10 app/assets/javascripts/admin/tags.js
trusty-cms-3.1.9 app/assets/javascripts/admin/tags.js
trusty-cms-3.1.8 app/assets/javascripts/admin/tags.js
trusty-cms-3.1.7 app/assets/javascripts/admin/tags.js
trusty-cms-3.1.6 app/assets/javascripts/admin/tags.js
trusty-cms-3.1.5 app/assets/javascripts/admin/tags.js
trusty-cms-3.1.3 app/assets/javascripts/admin/tags.js
trusty-cms-3.1.2 app/assets/javascripts/admin/tags.js