Skip to content

Instantly share code, notes, and snippets.

$(".more_facets_link a").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 more_facets_dialog = $("<div></div>").dialog({ autoOpen: false });
$(this).bind("click", {dialog: more_facets_dialog}, function( event ) {
// Load the original URL on the link into the dialog associated
// with it.
// Rails app will give us an appropriate partial.
$(".more_facets_link a").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 more_facets_dialog = "empty";
$(this).click( function() {
//lazy create of dialog
if ( more_facets_dialog == "empty") {
irb(main):011:0> class AutoHash
irb(main):012:1> def initialize(*args)
irb(main):013:2> super(*args) {|hash, key| hash[key] = AutoHash.new }
irb(main):014:2> end
irb(main):015:1> end
=> nil
irb(main):016:0> a = AutoHash.new
=> {}
irb(main):017:0> a["foo"]["bar"]["baz"]
=> {}
import org.marc4j.marc.Record;
import org.marc4j.marc.DataField;
import org.marc4j.marc.Subfield;
import org.solrmarc.tools.Utils;
// define the base level indexer so that its methods can be called from the script.
// note that the SolrIndexer code will set this value before the script methods are called.
org.solrmarc.index.SolrIndexer indexer = null;
// Max estimation -- biggest delta of unknown dates that we'll take the
====
= config.properties
====
# solrmarc.solr.war.path - must point to either a war file for the version of Solr that
# you want to use, or to a directory of jar files extracted from a Solr war files. If
# this is not provided, SolrMarc can only work by communicating with a running Solr server.
# Uncomment war.path and solr.path only if you want solrmarc to manually
# write lucene indexes to disk. We do not! We want to use conventional
module MarcDisplay
# in order to get our nice shortcut method, we mix in MarcLogicProcs
# as class methods, so we can use them in our class var definition.
self.extend(MarcDisplayLogic::MarcLogicProcs)
def self.default_presenter_config_list
DefaultPresenterConfigList
end
import org.marc4j.marc.Record;
import org.marc4j.marc.DataField;
import org.marc4j.marc.Subfield;
import org.solrmarc.tools.Utils;
// define the base level indexer so that its methods can be called from the script.
// note that the SolrIndexer code will set this value before the script methods are called.
org.solrmarc.index.SolrIndexer indexer = null;
/** Transformational hashes **/
# put this in any .rb file in config/initializers , make up your own, put it in an
# existing one, whatever works for you.
# As with many things in rails/Blacklight, there are many ways to do this, but
# this is one, it looks kinda complicated becuase it's trying to deal with
# cache_classes=false business.
module LocalAssetInclude
def add_local_assets
# my_local_stylesheet.css should be found in your app's public/stylesheets/
@jrochkind
jrochkind / document_namespace_guessing.rb
Created October 26, 2010 21:05
XML::Document#xpath inconsistent use of assumed namespaces
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
xml = %Q{
<root xmlns:example="http://example.org">
<example:element>
<example:child>
@jrochkind
jrochkind / jQuery.collapsible.js
Created November 3, 2010 22:23
modified collapsible.js
/**
* --------------------------------------------------------------------
* jQuery collapsible plugin
* Author: Scott Jehl, [email protected]
* Copyright (c) 2009 Filament Group
* licensed under MIT (filamentgroup.com/examples/mit-license.txt)
* --------------------------------------------------------------------
*
* See: http://dwpe.googlecode.com
* http://filamentgroup.com/lab/expand_and_collapse_content_accessibly_with_progressive_enhancement_jquery/