<% params[:name] ||= 'looking_for_window' %> var window_id = "<%= params[:name] %>"; <% if params[:validate] == 'true' %> <% if !params[:fill].nil? %> <% params[:fill].each do |key, value| %> $("#<%= value %>").val(""); <% end %> <% end %> <% end %> if ($("#"+window_id).length == 0) { var p_width = <%= params[:width] || 500 %>; var p_height = <%= params[:height] || 300 %>; $("
").dialog({autoOpen: true,title: 'Looking for..',height: p_height,width: p_width,modal: true, close: function(ev, ui) {$(this).remove();}}); $("#"+window_id).html("<%= escape_javascript(render('looking_for')) %>"); $("#"+window_id).effect('slide'); } $("#"+window_id).dialog('open'); $("#looking_for-toolbar").html("<%= escape_javascript(render('toolbar')) %>"); $("#looking_for-results").html("<%= escape_javascript(render('results')) %>"); $("#looking_for-pagination").html("<%= escape_javascript(render('pagination')) %>"); $("#looking_for_prev").button({text: false, icons: { primary: "ui-icon-seek-prev"}}); $("#looking_for_next").button({text: false, icons: { primary: "ui-icon-seek-next"}}); $("#looking_for_find").button({text: false, icons: { primary: "ui-icon-search"}}); $('#looking_for_prev').click ( function() { $('#looking_for_form input[name=page]').val(parseInt($('#looking_for_form input[name=page]').val())-1); $('#looking_for_form').submit(); } ); $('#looking_for_find').click ( function() { $('#looking_for_form input[name=page]').val(1); $('#looking_for_form').submit(); } ); $('#looking_for_next').click ( function() { $('#looking_for_form input[name=page]').val(parseInt($('#looking_for_form input[name=page]').val())+1); $('#looking_for_form').submit(); } );