Permalink
Browse files

Merge branch 'master' of github.com:avalonmediasystem/avalon

  • Loading branch information...
2 parents 7b718cf + d2086a0 commit bec87d4ec69f53d2741c7acf59fafa3d89aba437 @atomical atomical committed Mar 13, 2013
View
@@ -15,7 +15,7 @@ GIT
GIT
remote: https://github.com/avalonmediasystem/avalon-engage.git
- revision: 67c2ffd4e74141969d36726cf5e6e51345a1db6a
+ revision: a4d0b1fa85a4d5c00a78a06d9c1b138a642365c5
specs:
avalon-engage (0.0.1)
less-rails (~> 2.2.3)
@@ -415,7 +415,7 @@ GEM
capistrano (>= 2.0.0)
sanitize (2.0.3)
nokogiri (>= 1.4.4, < 1.6)
- sass (3.2.6)
+ sass (3.2.7)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (>= 3.1.10)
@@ -457,11 +457,11 @@ GEM
therubyracer (0.10.2)
libv8 (~> 3.3.10)
thor (0.17.0)
- tilt (1.3.4)
+ tilt (1.3.5)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.35)
+ tzinfo (0.3.36)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
@@ -49,4 +49,6 @@
});
};
*/
-Blacklight.do_facet_expand_contract_behavior.selector = '.facets h5';
+//Blacklight.do_facet_expand_contract_behavior.selector = '.facets h5';
+// Use a bogus ID here instead of nil or the function will go down in flames
+Blacklight.do_facet_expand_contract_behavior.selector = '#nosuchid';
@@ -1,56 +1,60 @@
-/**
- * Use an anonymous inner function to scope it from the global namespace.
- * Bad Javascript!
- */
-(function() {
- function setActiveSection(activeSegment) {
+window.AvalonStreams = {
+ setActiveSection: function(activeSegment) {
+ /* Start by resetting the state of all sections */
+ $('a.current-stream ~ i').remove();
$('a[data-segment]').removeClass('current-stream');
+
$("a[data-segment='" + activeSegment + "']").addClass('current-stream');
- $('a.current-stream').trigger('streamswitch')
- }
+ $('a.current-stream').trigger('streamswitch').parent().append(AvalonStreams.nowPlaying);
+ },
- function setActiveLabel(title) {
+ setActiveLabel: function(title) {
target = $('#stream_label');
if (target) {
target.fadeToggle(50, function() { target.text(title); target.fadeToggle(50) });
}
- }
+ },
/*
* This method should take care of the heavy lifting involved in passing a message
* to the player
*/
- function refreshStream(stream_info) {
+ refreshStream: function(stream_info) {
if (stream_info.stream_flash.length > 0) {
var opts = { flash: stream_info.stream_flash,
hls: stream_info.stream_hls,
poster: stream_info.poster_image,
mediaPackageId: stream_info.mediapackage_id };
- if (typeof currentPlayer !== "undefined" && currentPlayer !== null)
+ if (typeof currentPlayer !== "undefined" && currentPlayer !== null) {
+ //debugger;
currentPlayer.switchStream(opts);
- else
+ } else {
currentPlayer = AvalonPlayer.init($('#player'), opts);
+ }
}
- }
+ },
+
+ nowPlaying: '<i class="icon-circle-arrow-left"></i>'
+};
+
+$().ready(function() {
+ /* Initialize the extra eye candy on page load */
+ AvalonStreams.setActiveSection($('a.current-stream').data('segment'));
+
+ $('a[data-segment]').click(function(event) {
+ event.preventDefault();
+ var target = $(this);
- $(document).ready(function() {
- $('a[data-segment]').click(function(event) {
- event.preventDefault();
- var target = $(this);
- /*
- * Do three things to update a stream
- *
- * 1) Replace the H2 container's text with the new section name
- * 2) Set the active stream
- * 3) Refresh the stream by passing a message to the player
- */
- var uri = target.attr('href').split('?')
- $.getJSON(uri[0], uri[1], function(data) {
- setActiveLabel(data.label);
- setActiveSection(target.attr('data-segment'));
- //refreshStream(data.stream, data.mediapackage_id);
- refreshStream(data);
- });
+ /**
+ * Explicitly make this a JSON request
+ */
+ var uri = target.attr('href').split('?')[0] + '.json';
+ var segment = $(this).data('segment');
+
+ $.getJSON(uri, 'content=' + segment, function(data) {
+ AvalonStreams.setActiveLabel(data.label);
+ AvalonStreams.setActiveSection(segment);
+ AvalonStreams.refreshStream(data);
});
});
-}());
+});
@@ -89,7 +89,9 @@ footer {
pointer-events: none !important;
}
-a.current-stream {
+.current-stream {
+ font-weight: bold;
+
&:link { @hidden-disabled-link }
&:hover { @hidden-disabled-link }
&:active { @hidden-disabled-link }
@@ -448,11 +450,16 @@ span.constraints-label {
#facets span.selected, .facets span.selected {color: #2A5459;}
-ul#creation_metadata {
- list-style-type: none;
- margin-left: 0;
- li {
- margin-bottom: 1em;
+#creation_metadata {
+ // Make <pre> formatted text look like normal output instead of
+ // bounded in gray
+ pre {
+ background: $white;
+ font-family: $sansFontFamily;
+ font-size: $baseFontSize;
+ padding: 0;
+ background-color: transparent;
+ border: 0;
}
}
@@ -472,3 +479,22 @@ ul#creation_metadata {
margin-bottom: 0;
cursor: pointer;
}
+
+/**
+ * Fix some stuff relating to the facets so that they hide properly
+ */
+#facets .collapse,
+.facet_limit .collapse {
+ padding-top: 0;
+ padding-bottom: 0;
+ margin-top: 0;
+ margin-bottom:0 ;
+ height: 0;
+ @include transition(all 0.35s ease);
+
+ &.in {
+ padding-top: 0.5em;
+ padding-bottom: 1em;
+ height: auto;
+ }
+}
@@ -48,4 +48,20 @@ def description_index_display args
field = args[:document][args[:field]]
truncate(field.first, length: 200) unless (field.blank? or field.first.blank?)
end
+
+ # Determine whether to expand the facet or not based on the settings in
+ # the catalog controller and the (lack of) presence in the params hash
+ #
+ # This is a new method that doesn't currently exist in the Blacklight
+ # module
+ def expand_facet? facet
+ expand = facet.expanded || false
+ # If the controller doesn't not expand it by default we need to do some
+ # extra work and check the params hash
+ if params[:f].present?
+ expand = expand || params[:f][facet.field].present?
+ end
+
+ expand
+ end
end
@@ -23,6 +23,11 @@ class Derivative < ActiveFedora::Base
has_metadata name: 'encoding', type: EncodingProfileDocument
+ def self.url_handler
+ url_handler_class = Avalon::Configuration['streaming']['server'].to_s.classify
+ @url_handler ||= UrlHandler.const_get(url_handler_class.to_sym)
+ end
+
# Getting the track ID from the fragment is not great but it does reduce the number
# of calls to Matterhorn
def self.create_from_master_file(masterfile, markup)
@@ -0,0 +1,4 @@
+<div class="facet_limit blacklight-<%= facet_field.field.parameterize %>">
+ <h5 data-toggle="collapse" data-target="ul#<%= solr_fname.parameterize %>"><%= facet_field.label -%> <i class="icon-chevron"></i></h5>
+ <%= yield %>
+</div>
@@ -1,9 +1,6 @@
<%# pulled in from blacklight to add autoexpand support %>
-<ul>
- <% if facet_field[:expanded] %>
- <span class="selected" />
- <% end %>
- <% paginator =
+<ul id="<%= solr_fname.parameterize %>" class="collapse <% if expand_facet? facet_field %>in<% end %>">
+ <% paginator =
Blacklight::Solr::FacetPaginator.new(display_facet.items,
:limit => facet_limit_for(solr_field))
%>
@@ -1,4 +1,4 @@
-<div class="row-fluid">
+<div class="row">
<div class="span8" id="left_column">
<%= render 'video_player' %>
<%= render partial: 'sections',
@@ -15,7 +15,11 @@
<dl id="creation_metadata">
<%= display_metadata('Main contributor', @mediaobject.creator, 'Not provided') %>
<%= display_metadata('Date', @mediaobject.date_issued, 'Not provided') %>
- <%= display_metadata('Summary', @mediaobject.abstract, 'No summary available') %>
+ <%# display_metadata('Summary', @mediaobject.abstract, 'No summary available') %>
+ <dt>Summary</dt>
+ <dd>
+ <pre><%= @mediaobject.abstract %></pre>
+ </dd>
<%= display_metadata('Contributor', @mediaobject.contributor) %>
<%= display_metadata('Publisher', @mediaobject.publisher) %>
<%= display_metadata('Genre', @mediaobject.genre) %>
@@ -1,7 +1,7 @@
<%# Partial once the layout makes sense %>
<% show_progress = sections.any? { |s| not s.succeeded? } %>
<% unless (sections.blank? or sections.length == 1) and not show_progress %>
- <section class="whitespace">
+ <section class="whitespace" id="segments">
<legend><i class="icon-list-alt"></i> Sections</legend>
<ol id="section_links">
<% sections.each do |section| %>
@@ -1 +1 @@
-<p>Summary provides a space for describing the contents of the item. Examples include liner notes, contents list, or an opera scene abstract. This field is not meant for cataloger's descriptions but for descriptions that accompany the item. The first 15-20 words are included in search result listings.</p>
+<p>Summary provides a space for describing the contents of the item. Examples include liner notes, contents list, or an opera scene abstract. This field is not meant for cataloger's descriptions but for descriptions that accompany the item. Depending on the length of the summary it may be truncated in search results.</p>
@@ -1 +1 @@
-<p><strong>Required field.</strong> Title is used for display in search results and single item views. Only the first 32 characters of a title are included in search results listings. Recommended use is to reflect the content captured in digitized media files (such as the title of the piece performed or a short description of the content of a home movie).</p>
+<p><strong>Required field.</strong> Title is used for display in search results and single item views. Recommended use is to reflect the content captured in digitized media files (such as the title of the piece performed or a short description of the content of a home movie). Lengthy titles may be truncated in the search results view.</p>
@@ -38,10 +38,17 @@
config.assets.debug = true
# Keep only five logs and rotate them every 5 MB
- config.logger = Logger.new(Rails.root.join("log",
- Rails.env + ".log"),
- 10, 10*(2**20))
+ #config.logger = Logger.new(Rails.root.join("log",
+ # Rails.env + ".log"),
+ # 10, 10*(2**20))
+ # Configure logging to provide a meaningful context such as the
+ # timestamp and log level. This only works under Rails 3.2.x so if you
+ # are using an older version be sure to comment it out
+ config.log_tags = ['AVALON',
+ :remote_ip,
+ Proc.new { Time.now.strftime('%Y.%m.%D %H:%M:%S.%L')}]
+
config.action_mailer.delivery_method = :letter_opener if ENV['LETTER_OPENER']
#config.middleware.insert_before Rails::Rack::Logger, DisableAssetsLogger
@@ -24,15 +24,16 @@ module Avalon
Configuration = DEFAULT_CONFIGURATION.deep_merge(YAML::load(File.read(Rails.root.join('config', 'avalon.yml')))[env])
['dropbox','matterhorn','mediainfo','email','streaming'].each { |key| Configuration[key] ||= {} }
DropboxService = Dropbox.new Avalon::Configuration['dropbox']['path']
+
begin
mipath = Avalon::Configuration['mediainfo']['path']
unless mipath.blank?
Mediainfo.path = Avalon::Configuration['mediainfo']['path']
end
- url_handler_class = Avalon::Configuration['streaming']['server'].to_s.classify
- Derivative.url_handler = UrlHandler.const_get(url_handler_class.to_sym)
- rescue
- #TODO log some helpful error here instead of silently failing
+ rescue Exception => e
+ logger.fatal "Initialization failed"
+ logger.fatal e.backtrace
+ raise
end
def self.matterhorn_config

0 comments on commit bec87d4

Please sign in to comment.