Sha256: 368f5e6958f35e2b6ad6821bcd1e419b14965366aef6a53d355d968e268f2496

Contents?: true

Size: 1.8 KB

Versions: 2

Compression:

Stored size: 1.8 KB

Contents

o: ActiveSupport::Cache::Entry	:@compressedF:@value{	"
_version"%9ecde56ee5f5298e3a098f99e8437609"digest"%022e38f7ffb496be7940d46219f63883"lengthiW"source"W/* search_autocomplete.js.  Add autocomplete to Umlaut journal title search. */

jQuery(document).ready(function($) {
    
    $("form.OpenURL").live("submit", function() {
       var form = $(this);
       if ( form.find(".rft_title").val() != $(this).val()) {
          form.find(".rft_object_id").val("");
          form.find(".rft_title").val("");
       }
    });
    
  $("input.title_search").autocomplete({
            minLength: 3,
            source: function(request, response) {              
              var form = $(this.element).closest("form");
              $.ajax({
                  url: form.attr("action").replace("journal_search", "auto_complete_for_journal_title"),
                  dataType: "json",
                  data: form.serialize(),
                  success: function(data) {
                    response($.map(data, function(item) {
                      return {
                        label: item.title,
                        id: item.object_id
                      }
                    }));
                  }
              });
            },
            select: function(event, ui) {
              var form = $(event.target).closest("form");
              
              form.find("input.rft_object_id").val(ui.item.id);
              form.find("input.rft_title").val( ui.item.label );
              form.find("select.sfx_title_search").val("exact");
            }
          });
  
});


/*					select: function(event, ui) {
						log(ui.item ? ("Selected: " + ui.item.value + ", geonameId: " + ui.item.id) : "Nothing selected, input was " + this.value);
					}
				});
*/
;
:@created_atf1325027173.887568حي:@expires_in0

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
umlaut-3.0.0alpha2 test/dummy/tmp/cache/assets/D71/6B0/sprockets%2Fde558b71b494cf09b1bf055c8dff0353
umlaut-3.0.0alpha1 test/dummy/tmp/cache/assets/D71/6B0/sprockets%2Fde558b71b494cf09b1bf055c8dff0353