Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: boonious/ux2library
base: 30bb3f06d5
...
head fork: boonious/ux2library
compare: 7eeb22ced0
  • 8 commits
  • 19 files changed
  • 0 commit comments
  • 1 contributor
View
39 app/controllers/catalog_controller.rb
@@ -69,6 +69,12 @@ def mobile
redirect_to request.referrer
end
+ def refine
+ (@response, @document_list) = get_search_results
+ @filters = params[:f] || []
+ render :layout => 'item'
+ end
+
def facet_list_limit
if params[:id].include? "pub_date"
170
@@ -86,6 +92,16 @@ def facet
@pagination = get_facet_pagination(params[:id], params)
end
+ def facet_mobile
+ if !params.has_key?("catalog_facet.sort") and (params[:id].include? "pub_date" or params[:id].include? "format" or params[:id].include? "mimetype_facet")
+ params.merge!({:"catalog_facet.sort"=>"index"})
+ elsif !params.has_key?("catalog_facet.sort") and (params[:id].include? "author_facet" or params[:id].include? "subject_topic_facet")
+ params.merge!({:"catalog_facet.sort"=>"index"}) # a-z sort for the time being
+ end
+ @pagination = get_facet_pagination(params[:id], params)
+ render 'facet', :layout => 'refine'
+ end
+
# Blacklight solr_helper method override for a,b,..z alphabetic
# range faceting navigation, to contruct the appropriate
# solr_params to retrieve the additional a-z facets (if)
@@ -197,15 +213,18 @@ def create_zemanta_suggestions(text_for_suggestions)
end
def parse_voyager_holding_details(holding_details)
- holding_details.xpath('//tr').collect { |node|
- if !node.xpath('th/a').empty? and node.xpath('th/a').text=='Location (click for local info)'
- {
- :location => node.xpath('normalize-space(td)').gsub("STANDARD LOAN", "Standard Loan").gsub("SHORT LOAN", "Short Loan"),
- :shelfmark => node.xpath('following-sibling::tr[th ="Shelfmark:"][1]/td').text.strip!,
- :status => node.xpath('following-sibling::tr[th ="Status:"][1]/td').text.strip!.gsub("(Not Charged)","").downcase,
- :copies => node.xpath('following-sibling::tr[th ="Number of Items:"][1]/td').text.strip!
- }
- end
+ holding_details.xpath('//div[@class="displayHoldings"]').collect { |node|
+ location_text = node.xpath('.//li[span="Location Information:"]/span[@class="subfieldData"]/a').text
+ shelfmark_text = node.xpath('.//li[span="Shelfmark:"]/span[@class="subfieldData"]/a').text
+ status_nodes = node.xpath('.//li[span="Status:"]/span[@class="subfieldData"]/text()')
+ status_text = status_nodes.collect {|status_node| status_node.text}
+ copies_text = node.xpath('.//li[span="Number of Items:"]/span[@class="subfieldData"]/text()')
+ {
+ :location => location_text.gsub("STANDARD LOAN", "Standard Loan").gsub("SHORT LOAN", "Short Loan"),
+ :shelfmark => shelfmark_text.strip!,
+ :status => status_text, #'status_text.strip!.gsub("(Not Charged)","").downcase'
+ :copies => copies_text.last.text().strip
+ }
}.compact
end
@@ -256,6 +275,8 @@ def get_gdata_eulholding_details
@gdata_viewability = REXML::XPath.first(gdata_doc, "//entry/gbs:viewability")
end
#@eulholding = parse_voyager_holding_details Nokogiri::HTML(open('http://catalogue.lib.ed.ac.uk/cgi-bin/Pwebrecon.cgi?DB=local&Search_Arg=isbn+'+@document[:isbn_t].last+'&Search_Code=CMD&CNT=25'))
+ @eulholding = parse_voyager_holding_details Nokogiri::HTML(open('http://catalogue.lib.ed.ac.uk/vwebv/search?searchArg='+@document[:isbn_t].last+'&searchCode=GKEY%5E*&searchType=0'))
+ @euldetails = Nokogiri::HTML(open('http://catalogue.lib.ed.ac.uk/vwebv/search?searchArg='+@document[:isbn_t].last+'&searchCode=GKEY%5E*&searchType=0'))
end
end
View
12 app/views/catalog/_constraints_refine.mobile.haml
@@ -0,0 +1,12 @@
+-# cf. Blacklight, instead using 'params' directly, make use of the 'params_for_ui' helper
+-# which preserves the order of key-value pairs in request URL - in preparation for
+-# breadcrumb navigation. NOTE: for faceting breadcrumb only (no keyword search)
+
+-if !params_for_ui[:q].empty?
+ %p
+ %strong= "Keywords "
+ = params[:q]
+-if !params_for_ui[:f].empty?
+ %p
+ %strong= "Scope "
+ = render_constraints_filters(params_for_ui)
View
17 app/views/catalog/_facet_limit.mobile.haml
@@ -0,0 +1,17 @@
+- display_facet = @response.facets.detect {|f| f.name == solr_field}
+- if display_facet && display_facet.items.length > 0
+ %section.facet_limit
+ %hr
+ %b=facet_field_labels[solr_field]
+ %ul
+ - paginator = Blacklight::Solr::FacetPaginator.new(display_facet.items, :limit => facet_limit_for(solr_field))
+ - paginator.items.each do |item|
+ %li
+ - if facet_in_params?( solr_field, item.value )
+ %p= render_selected_facet_value(solr_field, item)
+ - else
+ %p= render_facet_value(solr_field, item)
+
+ - if(paginator.has_next?)
+ %li.more_facets_link
+ %p= link_to('more »', params.merge(:id => solr_field, :action=>"facet_mobile").delete_if {|key, value| key == "format" }, :class => "more_facets_link")
View
19 app/views/catalog/_facet_listing.mobile.haml
@@ -0,0 +1,19 @@
+- item_groups.each do |group|
+ - if params[:id].include? "pub_date"
+ %ul
+ - group.each do |item|
+ - if item
+ %li
+ -if facet_in_params?( params[:id], item.value )
+ = render_selected_facet_value(params[:id], item)
+ - else
+ = render_facet_value(params[:id], item)
+ - else
+ %ul
+ - group.each do |item|
+ - if item
+ %li
+ -if facet_in_params?( params[:id], item.value )
+ = render_selected_facet_value(params[:id], item)
+ - else
+ = render_facet_value(params[:id], item)
View
48 app/views/catalog/_facet_pagination.mobile.haml
@@ -0,0 +1,48 @@
+%nav.facet_more_a_to_z_navigation
+ /
+ - if a_to_z_pagination
+ - if pagination.prefix
+ %span.a_to_z_facet
+ =link_to('All', catalog_facet_path(params))
+ - else
+ %span.a_to_z_facet
+ %b All
+  
+
+ - ("a".."z").each do |alphabet|
+ - paginator_alphabet = a_to_z_pagination.items.find { |item| item.value==alphabet }
+ - if paginator_alphabet
+ - if pagination.prefix and pagination.prefix.downcase.include? paginator_alphabet.value
+ %span.a_to_z_facet
+ %b= paginator_alphabet.value.upcase
+ %span.facet_number= paginator_alphabet.hits
+ - else
+ %span.a_to_z_facet
+ = render_a_to_z_facet_value(Blacklight.config[:facet][:a_to_z][params["id"]], paginator_alphabet)
+ - else
+ %span.a_to_z_facet.inactive= alphabet.upcase
+
+%nav.facet_more_navigation
+ - if pagination.has_previous? || pagination.has_next?
+ - if pagination.has_previous?
+ = link_to('« Previous', catalog_facet_path( pagination.params_for_previous_url( params) ), :class=>:prev_page)
+ - else
+ %span.disabled.ui-state-active.prev_page « Previous
+
+ - if pagination.has_next?
+ = link_to('Next »', catalog_facet_path( pagination.params_for_next_url(params)), :class => :next_page )
+ - else
+ %span.disabled.ui-state-active.next_page Next »
+  
+ - if !pagination.prefix
+ - if pagination.sort == 'index'
+ Sort by:
+ %span.small
+ %b A-Z
+ = link_to_unless(pagination.sort == 'count', "Relevance", pagination.params_for_resort_url('count', params), :class => "small sort_change numeric")
+
+ - elsif pagination.sort == 'count'
+ Sort by:
+ = link_to("A-Z", pagination.params_for_resort_url('index', params), :class => "small sort_change az")
+ %span.small
+ %b Relevance
View
3  app/views/catalog/_facets.mobile.haml
@@ -0,0 +1,3 @@
+= render 'constraints_refine', :localized_params=>params
+- facet_field_names.each do |solr_fname|
+ = render_facet_limit(solr_fname)
View
20 app/views/catalog/_show_partials/_default.html.haml
@@ -27,6 +27,7 @@
%span.facet_number=article.xpath("url").text.gsub("http://", "").gsub("https://", "").split('/')[0].gsub("www.","")
- else
+
- if @gdata_image and @gdata_image.to_s.include? "zoom"
%p.book_cover
%img{:src => @gdata_image.to_s.gsub("zoom=5","zoom=1") }
@@ -83,11 +84,6 @@
= render :partial=>'bookmark_control', :locals=>{:document=>document}
- - if @gdata_description
- %p= @gdata_description.text
- - elsif document["description_display"]
- %p= document["description_display"][0]
-
- if @eulholding
- if !@eulholding.empty?
%section#eulholding
@@ -96,9 +92,19 @@
%ul
- @eulholding.each do |item|
%li
- = item[:location] + ", " + item[:shelfmark] + " (shelfmark)"
+ = item[:location] + ", "
+ %strong= item[:shelfmark]
+ " (shelfmark)"
%br
- = item[:copies] + " item(s), " + item[:status]
+ = item[:copies] + " item(s)"
+ %ul
+ - item[:status].each do |copy|
+ %li= copy
+
+ - if @gdata_description
+ %p= @gdata_description.text
+ - elsif document["description_display"]
+ %p= document["description_display"][0]
- if !@gdata_embeddability
%section#custom_preview
View
32 app/views/catalog/_show_partials/_default.mobile.haml
@@ -88,19 +88,25 @@
- link_text = link.size < 88 ? link : link[0..55] + "..." + link[-18..-1]
%li.small= link_to link_text, link, :title => link, :class => "document_list_link"
+
+ - if @eulholding
+ - if !@eulholding.empty?
+ %section#eulholding
+ %h5 Availability - Edinburgh University Library
+ %p
+ %ul
+ - @eulholding.each do |item|
+ %li
+ = item[:location] + ", "
+ %strong= item[:shelfmark]
+ " (shelfmark)"
+ %br
+ = item[:copies] + " item(s)"
+ %ul
+ - item[:status].each do |copy|
+ %li= copy
+
- if @gdata_description
%p= @gdata_description.text
- elsif document["description_display"]
- %p= document["description_display"][0]
-
- - if @eulholding
- - if !@eulholding.empty?
- %section#eulholding
- %h5 Availability - Edinburgh University Library
- %p
- %ul
- - @eulholding.each do |item|
- %li
- = item[:location] + ", " + item[:shelfmark] + " (shelfmark)"
- %br
- = item[:copies] + " item(s), " + item[:status]
+ %p= document["description_display"][0]
View
13 app/views/catalog/facet.mobile.haml
@@ -0,0 +1,13 @@
+%section#commons
+ %section#facet_listing
+ %h5= facet_field_labels[params[:id]]
+
+ -if @pagination.is_a? Hash
+ =render :partial=>'facet_pagination', :locals=>{:pagination => @pagination[params["id"]], :a_to_z_pagination=>@pagination[Blacklight.config[:facet][:a_to_z][params["id"]]]}
+ =render :partial=>'facet_listing', :locals=>{:item_groups=>@pagination[params["id"]].items.in_groups_of(20)}
+ =render :partial=>'facet_pagination', :locals=>{:pagination => @pagination[params["id"]], :a_to_z_pagination=>@pagination[Blacklight.config[:facet][:a_to_z][params["id"]]]}
+ -else
+ =render :partial=>'facet_pagination', :locals=>{:pagination => @pagination, :a_to_z_pagination=>nil}
+ =render :partial=>'facet_listing', :locals=>{:item_groups=>@pagination.items.in_groups_of(20)}
+ =render :partial=>'facet_pagination', :locals=>{:pagination => @pagination, :a_to_z_pagination=>nil}
+
View
6 app/views/catalog/refine.mobile.haml
@@ -0,0 +1,6 @@
+-if params[:q].blank? and params[:f].blank? and params[:search_field].blank?
+ -# if there are no input/search related params, display the "home" partial
+ = render 'home'
+-else
+ %section#commons
+ = render :partial=>'facets'
View
6 app/views/layouts/application.mobile.haml
@@ -27,10 +27,12 @@
%section#left_header_menu
%ul
%li= link_to 'Home', root_path
- -#%li= link_to 'JISC UX2.0', 'http://ux2.nesc.ed.ac.uk'
+ - if params[:q] or params[:f]
+ %li= link_to 'Refine', refine_catalog_path({:q=>params[:q], :f=>params[:f]})
+ -#%li= 'JISC UX2.0', 'http://ux2.nesc.ed.ac.uk'
-#%li= link_to 'Library', root_path
-#%li= link_to "History", search_history_index_path
- -#%section#right_header_menu
+ %section#right_header_menu
-#= render :partial=>'/user_util_links'
-#= render :partial=>'/flash_msg'
= yield
View
2  app/views/layouts/item.mobile.haml
@@ -25,7 +25,7 @@
%nav
%section#left_header_menu
%ul
- %li= link_back_to_catalog
+ %li= link_back_to_catalog :label=>"Back"
-#%li= link_to 'Home', root_path
-#%li= link_to 'JISC UX2.0', 'http://ux2.nesc.ed.ac.uk'
-#%li= link_to "Search History", search_history_index_path
View
38 app/views/layouts/refine.mobile.haml
@@ -0,0 +1,38 @@
+!!!
+%meta{:charset=>"utf-8"}
+%meta{:name=>"description", :content=>"UX2.0: Usability and Contemporary User Experience in Digital Libraries"}
+%title=h(@page_title || application_name)
+%meta{:name=>"language", :content=>I18n.locale}
+%meta{'http-equiv'=>"content-style-type", :content=>"text/css"}
+%meta{'http-equiv'=>"content-type", :content=>"text/html; charset=utf-8"}
+%meta{:name=>"title", :content=>h(@page_title || application_name)}
+%meta{:name=>"keywords", :content=>"ux2, usability, user experience, digital libraries"}
+%meta{:name=>"author", :content=>"Boon Low"}
+%meta{:content=>"width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no", :name=>"viewport"}
+-#%meta{:content=>"yes", :name=>"apple-mobile-web-app-capable"}
+-#%meta{:content=>"black", :name=>"apple-mobile-web-app-status-bar-style"}
+-#%link{:rel=>"apple-touch-icon", :href=>"http://ux2.nesc.ed.ac.uk/images/projectLogoGreen.png"}
+
+- if is_device?("iphone")
+ %link{:rel=>"stylesheet", :href=>"/stylesheets/layout_iphone.css", :type=>"text/css"}
+ %link{:rel=>"stylesheet", :href=>"/stylesheets/surface_iphone.css", :type=>"text/css"}
+- else
+ %link{:rel=>"stylesheet", :href=>"/stylesheets/surface.css", :type=>"text/css"}
+ %link{:rel=>"stylesheet", :href=>"/stylesheets/layout.css", :type=>"text/css"}
+
+%section#page
+ %header.masthead
+ %nav
+ %section#left_header_menu
+ %ul
+ %li= link_to_function "Back", "history.back()"
+ -#%li= link_to 'Home', root_path
+ -#%li= link_to 'JISC UX2.0', 'http://ux2.nesc.ed.ac.uk'
+ -#%li= link_to "Search History", search_history_index_path
+ %section#right_header_menu
+ -#= render :partial=>'/user_util_links'
+ -#= render :partial=>'/flash_msg'
+ = yield
+ %footer.mobile_main_footer
+ -#= @footer
+ = render :partial=>'footer'
View
2  config/initializers/blacklight_config.rb
@@ -225,7 +225,7 @@
},
:zemanta => {
:endpoint => 'http://api.zemanta.com/services/rest/0.0/',
- :developer_key => ''
+ :developer_key => 'c9e66y95zpx248rhng6r52ny'
}
}
end
View
2  config/routes.rb
@@ -6,7 +6,7 @@
# /catalog/:id/availability
:member=>{:image=>:get, :status=>:get, :availability=>:get, :librarian_view=>:get},
# /catalog/map
- :collection => {:map => :get, :opensearch=>:get, :citation=>:get, :email=>:get, :sms=>:get, :endnote=>:get, :send_email_record=>:post, :classic => :get, :mobile => :get}
+ :collection => {:map => :get, :opensearch=>:get, :citation=>:get, :email=>:get, :sms=>:get, :endnote=>:get, :send_email_record=>:post, :classic => :get, :mobile => :get, :refine =>:get}
)
Blacklight::Routes.build map
View
2  public/plugin_assets/blacklight/javascripts/accordion.js
@@ -7,7 +7,7 @@ $(document).ready(function() {
// hide it
f_content.hide();
} else {
- $(this).addClass('twiddle-open');
+ $(this).prev('h3').addClass('twiddle-open');
}
// attach the toggle behavior to the h3 tag
View
276 public/plugin_assets/blacklight/javascripts/application.js
@@ -2,15 +2,18 @@ $(function(){
var bl = new Blacklight();
});
+
+
+
$(document).ready(function() {
// adds classes for zebra striping table rows
$('table.zebra tr:even').addClass('zebra_stripe');
$('ul.zebra li:even').addClass('zebra_stripe');
-});
-
-
-//function for adding items to your folder with Ajax
-$(document).ready(function() {
+
+
+ /* function for adding items to your folder with Ajax */
+
+
// each form for adding things into the folder.
$("form.addFolder, form.deleteFolder").each(function() {
var form = $(this);
@@ -36,91 +39,198 @@ $(document).ready(function() {
$("#folder_number").text(folder_num);
form.attr("action",new_form_action);
form.children("input[type=submit]").attr("value",new_button_text);
- });
+ }, "json");
return false;
});
}
});
-});
-
-/*************
- * Facet more dialog. Uses JQuery UI Dialog. Use crazy closure technique.
- * http://docs.jquery.com/UI/Dialog
- */
-
-jQuery(document).ready(function($) {
+ //end folder actions
+
+ //add ajaxy dialogs to certain links, using the ajaxyDialog widget.
+ $("a.more_facets_link").ajaxyDialog({
+ width: $(window).width() / 2,
+ chainAjaxySelector: "a.next_page, a.prev_page, a.sort_change"
+ });
+ $("a.lightboxLink").ajaxyDialog({
+ chainAjaxySelector: false
+ });
+ //But make the librarian link wider than 300px default.
+ $('a.lightboxLink#librarianLink').ajaxyDialog("option", "width", 650);
+ //And the email one too needs to be wider to fit the textarea
+ $("a.lightboxLink#emailLink").ajaxyDialog("option", "width", 500);
- //Make sure more facet lists loaded in this dialog have
- //ajaxy behavior added to next/prev/sort
- function addBehaviorToMoreFacetDialog(dialog) {
- var dialog = $(dialog)
-
- // Make next/prev/sort links load ajaxy
- dialog.find("a.next_page, a.prev_page, a.sort_change").click( function() {
- $("body").css("cursor", "progress");
- dialog.find("ul.facet_extended_list").animate({opacity: 0});
- dialog.load( this.href,
- function() {
- addBehaviorToMoreFacetDialog(dialog);
- $("body").css("cursor", "auto");
- // Remove first header from loaded content, and make it a dialog
- // title instead
- var heading = dialog.find("h1, h2, h3, h4, h5, h6").eq(0).remove();
- if (heading.size() > 0 ) {
- dialog.dialog("option", "title", heading.text());
- }
- }
- );
- //don't follow original href
- return false;
- });
- }
+});
- function positionDialog(dialog) {
- dialog = $(dialog);
-
- dialog.dialog("option", "height", $(window).height()-125);
- dialog.dialog("option", "width", Math.max( ($(window).width() /2), 45));
- dialog.dialog("option", "position", ['center', 75]);
- dialog.dialog("open").dialog("moveToTop");
- }
-
-
- $("a.more_facets_link,a.lightboxLink").each(function() {
- //We use each to let us make a Dialog object for each
- //a, tied to that a, through the miracle of closures. the second
- // arg to 'bind' is used to make sure the event handler gets it's
- // own dialog.
- var dialog_box = "empty";
- var link = $(this);
- $(this).click( function() {
- //lazy create of dialog
- if ( dialog_box == "empty") {
- dialog_box = $('<div class="dialog_box"></div>').dialog({ autoOpen: false});
- }
- // Load the original URL on the link into the dialog associated
- // with it. Rails app will give us an appropriate partial.
- // pull dialog title out of first heading in contents.
- $("body").css("cursor", "progress");
- dialog_box.load( this.href , function() {
- if(link.attr("class") == "more_facets_link"){
- addBehaviorToMoreFacetDialog(dialog_box);
- }
- // Remove first header from loaded content, and make it a dialog
- // title instead
- var heading = dialog_box.find("h1, h2, h3, h4, h5, h6").eq(0).remove();
- dialog_box.dialog("option", "title", heading.text());
- $("body").css("cursor", "auto");
- });
-
- positionDialog(dialog_box);
-
- return false; // do not execute default href visit
- });
+/* A widget written by jrochkind to make a link or form result in
+ an in-window ajaxy dialog, instead of page load, using JQuery UI
+ Dialog widget.
- });
-});
-
+ This widget is actually hosted at: https://github.com/jrochkind/jquery.uiExt.ajaxyDialog
+
+
+ Included in this main file because I just couldn't bare to add yet
+ another JS file to our app, until we figure out a good fix those too
+ many JS files are serious page load speed problem. */
+ (function($) {
+ var widgetNamespace = "uiExt";
+ var widgetName = "ajaxyDialog";
+
+ $.widget(widgetNamespace + "." + widgetName, {
+ options: {
+ extractTitleSelector: "h1, h2, h3, h4, h5",
+ chainAjaxySelector: "a:not([target]), form:not([target])",
+ closeDialogSelector: "a.dialog-close",
+ beforeDisplay: jQuery.noop
+ },
+
+ _create: function() {
+ var self = this;
+ var element = self.element[0];
+ if (element.tagName.toUpperCase() == "A") {
+ $(element).bind("click."+self.widgetName, function(event, ui) {
+ self._handleClick();
+ return false;
+ });
+ }
+ else if (element.tagName.toUpperCase() == "FORM") {
+ $(element).bind("submit."+self.widgetName, function(event, ui) {
+ self._handleSubmit();
+ return false;
+ });
+ }
+ },
+
+ open: function() {
+ var self = this;
+ var element = self.element[0];
+
+ if ( element.tagName.toUpperCase() == "A") {
+ self._handleClick();
+ } else if (element.tagName.toUpperCase() == "FORM") {
+ self._handleSubmit();
+ }
+ },
+
+ close: function() {
+ this.dialogContainer().dialog("close");
+ },
+
+ _handleClick: function() {
+ var self = this;
+ var url = this.element.attr("href");
+ var requestDialog = self.dialogContainer();
+
+ $("body").css("cursor", "progress");
+
+ $.ajax({
+ url: url,
+ dataType: "html",
+ success: function(resp, status) {
+ self._loadToDialog(resp);
+ },
+ error: function(xhr, msg) {
+ self._displayFailure(url, xhr, msg);
+ }
+ });
+ },
+
+ _handleSubmit: function() {
+ var self = this;
+ var form = self.element;
+ var actionUri = form.attr("action");
+ var serialized = form.serialize();
+
+ $("body").css("cursor", "progress");
+
+ $.ajax({
+ url: actionUri,
+ data: serialized,
+ type: form.attr("method").toUpperCase(),
+ dataType: "html",
+ success: function(resp, status) {
+ self._loadToDialog(resp);
+ },
+ error: function(xhr, msg) {
+ self._displayFailure(actionUri, xhr, msg);
+ }
+ });
+ },
+
+ _loadToDialog: function(html_content) {
+ var self = this;
+ var dialog = self.dialogContainer();
+ //Cheesy way to restore it to it's default options, plus
+ //our own local options, since its' a reuseable dialog.
+ //for now we insist on modal:true.
+ dialog.dialog($.extend({},
+ $.ui.dialog.prototype.options,
+ self.options,
+ {autoOpen:false, modal:true}
+ ));
+
+ if (self._trigger('beforeDisplay', 0, html_content) !== false) {
+ dialog.html( html_content );
+
+ //extract and set title
+ var title;
+ self.options.extractTitleSelector &&
+ (title = dialog.find(self.options.extractTitleSelector).first().remove().text());
+ title = title ||
+ self.element.attr("title")
+ title && dialog.dialog("option", "title", title);
+
+ //Make any hyperlinks or forms ajaxified, by applying
+ //this very same plugin to em, and passing on our options.
+ if (self.options.chainAjaxySelector) {
+ dialog.find(self.options.chainAjaxySelector).ajaxyDialog(self.options);
+ }
+
+ //Make any links marked dialog-close do so
+ if ( self.options.closeDialogSelector ) {
+ dialog.find(self.options.closeDialogSelector).unbind("click." + widgetName);
+ dialog.find(self.options.closeDialogSelector).bind("click." + widgetName, function() {
+ dialog.dialog("close");
+ return false;
+ });
+ }
+
+ dialog.dialog("open");
+ }
+ $("body").css("cursor", "auto");
+ },
+
+ _displayFailure: function(uri, xhr, serverMsg) {
+ if ( this._trigger("error", 0, {uri:uri, xhr: xhr, serverMsg: serverMsg}) !== false) {
+ var dialog = this.dialogContainer();
+
+ dialog.html("<div class='ui-state-error' style='padding: 1em;'><p><span style='float: left; margin-right: 0.3em;' class='ui-icon ui-icon-alert'></span>Sorry, a software error has occured.</p><p>" + uri + ": " + xhr.status + " " + serverMsg+"</p></div>");
+ dialog.dialog("option", "title", "Sorry, an error has occured.");
+ dialog.dialog("option", "buttons", {"OK": function() { dialog.dialog("close"); }});
+ dialog.dialog("open");
+ }
+ $("body").css("cursor", "auto");
+ },
+
+ // The DOM element which has a ui dialog() called on it.
+ // Right now we insist upon modal dialogs, and re-use the same
+ // <div>.dialog() for all of them. It's lazily created here.
+ // If client calls dialog("destroy") on it, no problem, it'll
+ // be lazily created if it's needed again.
+ dialogContainer: function() {
+ var existing = $("#reusableModalDialog");
+ if ( existing.size() > 0) {
+ return existing.first();
+ }
+ else {
+ //single shared element for modal dialogs
+ var requestDialog = $('<div id="reusableModalDialog" style="display:none"></div>').appendTo('body').
+ dialog({autoOpen: false});
+ return requestDialog;
+ }
+ }
+
+ });
+ }(jQuery));
View
25 public/plugin_assets/blacklight/stylesheets/application.css
@@ -241,25 +241,32 @@ font-weight:bold;
float: right;
}
+/* 'Document functions', Bookmark/Folder. Appear on both results/index and
+ detail/show views. */
+.documentFunctions {text-align:right; float: right; margin-left: 0.5em; margin-bottom: 0.5em;}
+.documentFunctions .deleteFolder, .documentFunctions .addFolder, .documentFunctions .remove_bookmark, .documentFunctions .add_bookmark {float:right;}
+
+
/* Search Results */
-.document {padding: 0.5em 0 0 0; background-color: #fff; border-bottom: 1px dotted #ccc;}
+.document {padding: 0.5em 0 0 0; background-color: #fff; border-bottom: 1px dotted #ccc; clear: both;}
#documents {background-color: #eee; color: #333; margin-top: 1.5em; margin-bottom: 1.5em; }
#documents .documentHeader {background-color: #fff; padding: 0px;}
-#documents .documentHeader .documentFunctions {text-align:right;}
+
+
#documents .per_page {padding-right: 5px;}
/* Result List (http://www.quirksmode.org/css/clearing.html) */
-h3.index_title {clear: both; margin: 0px; padding: 0px; width: 460px;}
+h3.index_title { margin: 0px; padding: 0px; }
dl {margin: 0px; padding: 0px;}
-dl.defList {overflow: auto; padding: 0.5em 0;}
+dl.defList {overflow: auto; padding: 0.5em 0; clear: both}
dl.defList dt {float:left; text-align: right; width: 20%; clear: both; color: #888; margin: 0; padding: 2px 1em 2px 0px;}
dl.defList dd {float: left; text-align: left; margin: 0; padding: 2px 0; width: 450px;}
/* Individual Result Listing */
+#document {margin-top: 1em;}
#document h1 {margin: 0px; padding: 0px 0px 1em 0px;}
-#document .deleteFolder, #document .addFolder {float:right;}
#marc_view {padding:5px; text-align:left;}
#marc_view .ind1, #marc_view .ind2 {padding:0 5px; display:inline;}
#marc_view .tag_ind {float:left;}
@@ -333,10 +340,10 @@ ul.folderTools li.refworks form input.submit{display:none;}
#login form {margin-bottom:1em;}
-.error, .notice, .errorExplanation {background-color:lightyellow; padding:1em; margin-bottom:1em; border:solid 1px #CDC;}
-.error, .notice {font-size: 1.5em;}
-.error, .errorExplanation {color: #C30;}
-.notice {color: #060;}
+.error, .notice, .errorExplanation { padding:1em; margin-bottom:1em;}
+.error, .notice { }
+.error, .errorExplanation { }
+.notice { }
/* IE 6 Adjustments */
* html #hd .yui-g .yui-u {margin-top: -5em;}
2  vendor/plugins/blacklight
@@ -1 +1 @@
-Subproject commit fbfb469c078a9f925830d0eadb4638d7e856fe20
+Subproject commit bf2233a5011b054687ce4c042e853b04519e8c08

No commit comments for this range

Something went wrong with that request. Please try again.