Skip to content

Commit

Permalink
Merge pull request #22 from anusharanganathan/fuse
Browse files Browse the repository at this point in the history
Fuse
  • Loading branch information
Jessie Keck committed Jun 27, 2016
2 parents d441e82 + a499592 commit 8ffbae3
Show file tree
Hide file tree
Showing 302 changed files with 60,490 additions and 519 deletions.
7 changes: 3 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
Expand Down Expand Up @@ -48,9 +48,7 @@ group :development do
gem 'spring'
end

group :test do
gem 'webmock'
end
gem 'webmock', group: :test

gem 'blacklight', '>= 5.3.0'
gem 'jettywrapper', '>= 2.0'
Expand All @@ -62,6 +60,7 @@ gem 'blacklight-marc', '~> 5.0'
gem 'config', '~> 1.0.0.beta3'
gem 'mods_display', '0.3.4'
gem 'coderay'
gem 'blacklight_range_limit'

group :deployment do
gem 'capistrano', '~> 3.0'
Expand Down
8 changes: 5 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ GEM
blacklight (~> 5.10)
marc (>= 0.4.3, < 1.1)
rails
blacklight_range_limit (5.2.0)
blacklight (~> 5.15)
jquery-rails
rails (>= 3.0, < 5.0)
bootstrap-sass (3.3.5.1)
autoprefixer-rails (>= 5.0.0.1)
sass (>= 3.3.0)
Expand Down Expand Up @@ -292,8 +296,6 @@ GEM
thread_safe (0.3.5)
tilt (2.0.1)
tins (1.6.0)
turbolinks (2.5.3)
coffee-rails
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (2.7.2)
Expand Down Expand Up @@ -325,6 +327,7 @@ PLATFORMS
DEPENDENCIES
blacklight (>= 5.3.0)
blacklight-marc (~> 5.0)
blacklight_range_limit
byebug
capistrano (~> 3.0)
capistrano-bundler
Expand All @@ -351,7 +354,6 @@ DEPENDENCIES
spring
sqlite3
therubyracer
turbolinks
tzinfo-data
uglifier (>= 1.3.0)
web-console (~> 2.0)
Expand Down
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ desc 'Execute the test build that runs on travis'
task ci: [:environment] do
if Rails.env.test?
Rake::Task['db:migrate'].invoke
Rake::Task['jetty:download'].invoke
Rake::Task['jetty:unzip'].invoke
Rake::Task['colligo:download_and_unzip_jetty'].invoke
Rake::Task['colligo:copy_solr_configs'].invoke
Jettywrapper.wrap(Jettywrapper.load_config) do
Rake::Task['colligo:fixtures'].invoke
Rake::Task['spec'].invoke
end
else
Expand Down
Binary file added app/assets/fonts/FontAwesome.otf
Binary file not shown.
Binary file added app/assets/fonts/fontawesome-webfont.eot
Binary file not shown.
504 changes: 504 additions & 0 deletions app/assets/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file added app/assets/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file added app/assets/images/iiif-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/other.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/parker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/play-arrow-16-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/play-arrow-20-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/play-arrow-32-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/stanford.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/walter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 15 additions & 2 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,21 @@
//
//= require jquery
//= require jquery_ujs
//= require turbolinks//
//= require jquery-ui
// require turbolinks
// For Mirador viewer
//= require mirador
// require openseadragon-viewerinputhook
// For scaling fonts
//= require flowtype
// Required by Blacklight
//= require blacklight/blacklight

//= require affix
//= require scrollspy
//= require "jquery.tablesorter"
//= require_tree .
//
// For blacklight_range_limit built-in JS, if you don't want it you don't need
// this:
//= require 'blacklight_range_limit'

205 changes: 205 additions & 0 deletions app/assets/javascripts/browse_century.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
window.onload = function () {
var century = $("#century");
if (century.length == 0) {
return;
}
// Vertical slider
var century_slider = $("#century_slider");
var boundaries = century_slider.data('boundaries');
// var slider_ticks = century_slider.data('ticks');
var min = boundaries[0];
var max = boundaries[1];
//*******Century HORIZONTAL BAR CHART
//http://www.jqueryflottutorial.com/how-to-make-jquery-flot-horizontal-bar-chart.html
var century_panel = $('#century_panel');
century_panel.width(century.width() - century_slider.width());
var rawData = century_panel.data('rawdata');
var ticks = century_panel.data('ticks');
var pointer_lookup = century_panel.data('pointerlookup');
// var display_ratio = 1/(1.618 * 2);
century_panel.height( century_panel.width() * 2 );
var dataSet = [{ label: "", data: rawData, color: "#009933" }];
var options = {
series: {
bars: {
show: true
}
},
bars: {
align: "center",
barWidth: 80,
horizontal: true,
fillColor: { colors: [{ opacity: 0.5 }, { opacity: 1}] },
lineWidth: 1
},
yaxis: {
//axisLabel: "Precious Metals",
//axisLabelUseCanvas: true,
//axisLabelFontSizePixels: 12,
//axisLabelFontFamily: 'Verdana, Arial',
//axisLabelPadding: 3,
//tickColor: "#5E5E5E",
ticks: ticks,
color: "white",
tickDecimals: 0
},
//legend: {
// noColumns: 0,
// labelBoxBorderColor: "#858585",
// position: "ne"
//},
grid: {
hoverable: true,
borderWidth: 0,
backgroundColor: { colors: ["#ffffff", "#ffffff"] },
autoHighlight: true,
clickable: true
}
};
//******Plot the graph, draw the slider, and define event handlers
$(document).ready(function () {
var plot;
var browse_century = $("#browse_century");
var form = century.parent().find("form.range_limit");
var begin_el = form.find("input.range_begin");
var end_el = form.find("input.range_end");
// Plot the graph
plot = $.plot(browse_century, dataSet, options);
var find_segment_for = function_for_find_segment(pointer_lookup);
var last_segment = null;
// plothover event
browse_century.bind("plothover", function (event, pos, item) {
if (item) {
var segment = find_segment_for(pos.y);
var msg = segment.label + ' (' + segment.count + ')';
if (segment == last_segment) {
$("#tooltip").remove();
last_segment = null;
} else {
$("#tooltip").remove();
showTooltip(item.pageX, item.pageY, '#000000', msg);
last_segment = segment;
}
}
});
// define the slider
var placeholder_input = $('<input type="text" data-slider-placeholder="true">').appendTo(century_slider);
if (placeholder_input.bootstrapSlider !== undefined) {
placeholder_input.bootstrapSlider({
min: min,
max: max,
value: [min, max],
tooltip_position: "right",
orientation: 'vertical',
reversed: true,
//step: 100,
//ticks: slider_ticks,
handle: 'custom'
});
}
// Match slider height to plot
var slider_body = $(".slider.slider-vertical");
slider_body.height( plot.height()-35 );
slider_body.css('margin-top',"25px");
// set values of form elements to min and max
begin_el.val(min);
end_el.val(max);
// on plot click
browse_century.bind("plotclick", function (event, pos, item) {
if ( plot.getSelection() == null) {
var segment = find_segment_for(pos.y);
plot.setSelection( normalized_selection(segment.from, segment.to));
begin_el.val(segment.from);
end_el.val(segment.to);
var slider_placeholder = century_slider.find("[data-slider-placeholder]");
if (slider_placeholder) {
slider_placeholder.bootstrapSlider("setValue", [segment.from, segment.to]);
}
}
});
// on plot select
browse_century.bind("plotselected plotselecting", function(event, ranges) {
if (ranges != null ) {
var from = Math.floor(ranges.yaxis.from);
var to = Math.floor(ranges.yaxis.to);
begin_el.val(from);
end_el.val(to);
var slider_placeholder = century_slider.find("[data-slider-placeholder]");
if (slider_placeholder) {
slider_placeholder.bootstrapSlider("setValue", [from, to+1]);
}
}
});
// on form input fields value change
form.find("input.range_begin, input.range_end").change(function () {
plot.setSelection( form_selection(form, min, max) , true );
});
begin_el.change( function() {
var val = BlacklightRangeLimit.parseNum($(this).val());
if ( isNaN(val) || val < min) {
//for weird data, set slider at min
val = min;
}
var values = placeholder_input.data("bootstrapSlider").getValue();
values[0] = val;
placeholder_input.bootstrapSlider("setValue", values);
});
end_el.change( function() {
var val = BlacklightRangeLimit.parseNum($(this).val());
if ( isNaN(val) || val > max ) {
//weird entry, set slider to max
val = max;
}
var values = placeholder_input.data("bootstrapSlider").getValue();
values[1] = val;
placeholder_input.bootstrapSlider("setValue", values);
});
// on slider value change
var slider_placeholder = century_slider.find("[data-slider-placeholder]");
slider_placeholder.on("change", function(event) {
var values = $(event.target).data("bootstrapSlider").getValue();
begin_el.val(values[0]);
end_el.val(values[1]);
plot.setSelection( normalized_selection(values[0], Math.max(values[0], values[1]-1)), true);
});
});

function showTooltip(x, y, color, contents) {
$('<div id="tooltip">' + contents + '</div>').css({
position: 'absolute',
display: 'none',
top: y - 10,
left: x + 10,
border: '2px solid ' + color,
padding: '3px',
'font-size': '12px',
'border-radius': '5px',
'background-color': '#fff',
'font-family': 'Verdana, Arial, Helvetica, Tahoma, sans-serif',
opacity: 0.9
}).appendTo("body").fadeIn(200);
}

function function_for_find_segment(pointer_lookup_arr) {
return function(y_coord) {
for (var i = pointer_lookup_arr.length-1 ; i >= 0 ; i--) {
var hash = pointer_lookup_arr[i];
if (y_coord >= hash.from) {
return hash;
}
}
return pointer_lookup_arr[0];
};
}

function normalized_selection(min, max) {
max += 0.99999;
return {xaxis: { 'from':min, 'to':max}}
}

/*
function isInt(n) {
return n % 1 === 0;
}
*/
};
43 changes: 43 additions & 0 deletions app/assets/javascripts/colligo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Tabs on homepage
$(document).on('click', '.search-tabs li', function() {
$(".search-tabs li").removeClass("active");
$(this).addClass("active");
$("#main_search_field").val($(this).data("field"));
$("#q" ).focus();
});

// Tabs on folio page
$(document).on('click', '.folio-tabs li', function() {
$(".folio-tabs li").removeClass("active");
$(".tab-pane").removeClass("active");
$(this).addClass("active");
var tab_ele = $(this).data('tab-id');
$("#"+tab_ele).addClass("active");
$("#folio-title").html(tab_ele[0].toUpperCase() + tab_ele.slice(1));
});


// nav on manuscript show
$(document).on('click', '.navbar-green li', function() {
$(".navbar-green li").removeClass("active");
$(this).addClass("active");
});

// enable top on scroll
$(window).scroll(function() {
if ($(window).scrollTop() > 0) {
$("#nav_top").css('display', 'block');
} else {
$("#nav_top").css('display', 'none');
}
});


$(document).on("focus", ".ui-autocomplete-input", function() {
$(this).val("");
});

$(document).on("click", "#home_modal_button", function(){
lookup_init('facet-language');
$(".tablesorter").tablesorter({});
});
Loading

0 comments on commit 8ffbae3

Please sign in to comment.