geoblacklight 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/app/assets/javascripts/geoblacklight/geoblacklight.js +1 -1
  4. data/app/assets/stylesheets/geoblacklight/{_geoblacklight.css.scss → _geoblacklight.scss} +1 -1
  5. data/app/assets/stylesheets/geoblacklight/{_styles.css.scss → _styles.scss} +0 -4
  6. data/app/assets/stylesheets/geoblacklight/{application.css.scss → application.scss} +0 -0
  7. data/app/assets/stylesheets/geoblacklight/modules/{geosearch.css.scss → geosearch.scss} +0 -0
  8. data/app/assets/stylesheets/geoblacklight/modules/{home.css.scss → home.scss} +9 -1
  9. data/app/assets/stylesheets/geoblacklight/modules/{icon-customization.css.scss → icon-customization.scss} +0 -0
  10. data/app/assets/stylesheets/geoblacklight/modules/{icons.css.scss → icons.scss} +0 -0
  11. data/app/assets/stylesheets/geoblacklight/modules/{item.css.scss → item.scss} +0 -0
  12. data/app/assets/stylesheets/geoblacklight/modules/{layer_opacity.css.scss → layer_opacity.scss} +0 -0
  13. data/app/assets/stylesheets/geoblacklight/modules/{mixins.css.scss → mixins.scss} +0 -0
  14. data/app/assets/stylesheets/geoblacklight/modules/{results.css.scss → results.scss} +0 -0
  15. data/app/controllers/download_controller.rb +2 -2
  16. data/app/helpers/geoblacklight_helper.rb +4 -0
  17. data/app/views/catalog/_home_text.html.erb +3 -1
  18. data/app/views/catalog/_index_split_default.html.erb +1 -1
  19. data/app/views/catalog/_search_form_no_navbar.html.erb +20 -0
  20. data/app/views/catalog/_show_tools.html.erb +63 -0
  21. data/geoblacklight.gemspec +5 -4
  22. data/lib/geoblacklight/engine.rb +2 -2
  23. data/lib/geoblacklight/version.rb +1 -1
  24. data/spec/features/split_view.html.erb_spec.rb +1 -1
  25. data/spec/test_app_templates/lib/generators/test_app_generator.rb +1 -1
  26. data/template.rb +2 -0
  27. metadata +42 -29
  28. data/app/views/catalog/_show_sidebar.html.erb +0 -63
  29. data/vendor/assets/javascripts/leaflet-iiif.js +0 -152
  30. data/vendor/assets/javascripts/readmore.min.js +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4fd9593775bde01f2a17df2c07bb29748536c7d
4
- data.tar.gz: 1b1ae1ae6b713505d889bf3649c3f630d05b3783
3
+ metadata.gz: 03c5c0f3c8ea0fd560d61c83f6ac4ef72a01fd41
4
+ data.tar.gz: f70eecf129433a06f95909b43fe3e305a28c7abc
5
5
  SHA512:
6
- metadata.gz: 00b34d97c3bf7c073f2d67f55ce14a59c6d59331b331002fdc94fb3db6a13f0e92b5cf856866547c565cc92504703e570cfe4bc7c2334133fe1a35831d460b89
7
- data.tar.gz: ab6bb8533387cafb5c62fe37f1f46e962b1edcbfb1aaec7091c0088e0066dc4fdf508e5449421badb4f1e09b96047d4b5f8ffb1e262075098a0fbeacff21b1ea
6
+ metadata.gz: 456079db8a4fc890f902a56a688d74beba805919f39d31f52475644553ef7e69f7369697c5569c501bb4a25321dd59eff22054fea48522930ec2ed74019ca2ac
7
+ data.tar.gz: 11a6fd6f2c0253f595b6ad2ac1a3dd2fa6b48472a869f22a0c46c57d2df5cb15389aeaef31100e91f47e24c86d422950c8d921918610c721cfe9c15cffadda3f
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  source 'https://rubygems.org'
2
+ source 'https://rails-assets.org'
2
3
 
3
4
  # Specify your gem's dependencies in geoblacklight.gemspec
4
5
  gemspec
@@ -1,7 +1,7 @@
1
1
  //= require leaflet
2
2
  //= require leaflet-iiif
3
3
  //= require native.history
4
- //= require readmore.min
4
+ //= require readmore
5
5
 
6
6
  !function(global) {
7
7
  'use strict';
@@ -8,8 +8,8 @@
8
8
  * You're free to add application-wide styles to this file and they'll appear at the top of the
9
9
  * compiled file, but it's generally better to create a new file per style scope.
10
10
  *
11
- *= require leaflet
12
11
  */
12
+ @import 'leaflet';
13
13
 
14
14
  @import 'font-awesome';
15
15
  @import 'geoblacklight/styles';
@@ -2,7 +2,3 @@
2
2
  overflow:scroll;
3
3
  max-height: 450px;
4
4
  }
5
-
6
- .show-tools .bookmark_toggle {
7
- padding: 0px 0px;
8
- }
@@ -3,7 +3,15 @@
3
3
  }
4
4
 
5
5
  .home-search-area {
6
- text-align: center;
6
+
7
+ h2,
8
+ h3 {
9
+ text-align: center;
10
+ }
11
+
12
+ .input-group.search-input-group {
13
+ width: 100%;
14
+ }
7
15
  }
8
16
 
9
17
  .home-facet-link {
@@ -2,7 +2,7 @@ class DownloadController < ApplicationController
2
2
  include Blacklight::SolrHelper
3
3
 
4
4
  def show
5
- @response, @document = get_solr_response_for_doc_id
5
+ @response, @document = get_solr_response_for_doc_id params[:id]
6
6
  restricted_should_authenticate
7
7
  response = check_type
8
8
  validate response
@@ -20,7 +20,7 @@ class DownloadController < ApplicationController
20
20
  end
21
21
 
22
22
  def hgl
23
- @response, @document = get_solr_response_for_doc_id
23
+ @response, @document = get_solr_response_for_doc_id params[:id]
24
24
  if params[:email]
25
25
  response = HglDownload.new(@document, params[:email]).get
26
26
  if response.nil?
@@ -36,6 +36,10 @@ module GeoblacklightHelper
36
36
  content_tag :span, '', class: "geoblacklight-icon geoblacklight-#{name.downcase.gsub(' ', '-')}", title: name
37
37
  end
38
38
 
39
+ def render_search_form_no_navbar
40
+ render partial: 'catalog/search_form_no_navbar'
41
+ end
42
+
39
43
  ##
40
44
  # Renders an unique array of search links based off of terms
41
45
  # passed in using the facet parameter
@@ -2,7 +2,9 @@
2
2
  <div class='home-search-area'>
3
3
  <%= content_tag :h2, t('geoblacklight.home.headline') %>
4
4
  <%= content_tag :h3, t('geoblacklight.home.search_heading') %>
5
- <%= render_search_bar %>
5
+ <div class='col-md-6 col-md-offset-3'>
6
+ <%= render_search_form_no_navbar %>
7
+ </div>
6
8
  </div>
7
9
  </div>
8
10
 
@@ -10,7 +10,7 @@
10
10
  <span class="document-counter">
11
11
  <%= t('blacklight.search.documents.counter', :counter => counter) if counter %>
12
12
  </span>
13
- <%= link_to_document document, :label=>document_show_link_field(document), :counter => counter, :title => document['dc_title_s'] %>
13
+ <%= link_to_document document, document_show_link_field(document), counter: counter, title: document['dc_title_s'] %>
14
14
  </h5>
15
15
 
16
16
  <div class='col-md-12 more-info-area'>
@@ -0,0 +1,20 @@
1
+ <%= form_tag search_action_url, :method => :get, :class => 'search-query-form clearfix' do %>
2
+ <%= render_hash_as_hidden_fields(params_for_search().except(:q, :search_field, :qt, :page, :utf8)) %>
3
+
4
+ <% unless search_fields.empty? %>
5
+ <label for="search_field" class="sr-only"><%= t('blacklight.search.form.search_field.label') %></label>
6
+ <%= select_tag(:search_field, options_for_select(search_fields, h(params[:search_field])), :title => t('blacklight.search.form.search_field.title'), :class=>"search_field form-control") %>
7
+ <span class="sr-only"><%= t('blacklight.search.form.search_field.post_label') %></span>
8
+ <% end %>
9
+ <div class="input-group search-input-group">
10
+ <label for="q" class="sr-only"><%= t('blacklight.search.form.q') %></label>
11
+ <%= text_field_tag :q, params[:q], :placeholder => t('blacklight.search.form.q'), :class => "search_q q form-control", :id => "q", :autofocus => should_autofocus_on_search_box? %>
12
+
13
+ <span class="input-group-btn">
14
+ <button type="submit" class="btn btn-primary search-btn" id="search">
15
+ <span class="submit-search-text"><%=t('blacklight.search.form.submit')%></span>
16
+ <span class="glyphicon glyphicon-search"></span>
17
+ </button>
18
+ </span>
19
+ </div>
20
+ <% end %>
@@ -0,0 +1,63 @@
1
+ <% document ||= @document %>
2
+ <div class="panel panel-default show-tools">
3
+ <div class="panel-heading">
4
+ <%= t('blacklight.tools.title') %>
5
+ </div>
6
+
7
+ <div class="panel-body">
8
+ <ul class="nav">
9
+ <%= render_show_doc_actions @document do |config, inner| %>
10
+ <li class="<%= config.key %>">
11
+ <%= inner %>
12
+ </li>
13
+ <% end %>
14
+ </ul>
15
+ </div>
16
+ <% if document_downloadable? %>
17
+ <div class='panel-body'>
18
+ <div class='btn-group' itemprop='distribution' itemscope='itemscope' itemtype='http://schema.org/DataDownload'>
19
+ <% if document.direct_download.present? %>
20
+ <%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], class: 'btn btn-default', 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document[:layer_slug_s] }) %>
21
+ <% elsif document.hgl_download.present? %>
22
+ <%= link_to(download_text(document.download_types.first[0]),
23
+ download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document[:layer_slug_s] },
24
+ class: 'btn btn-default') %>
25
+ <% else %>
26
+ <%= link_to(download_text(document.download_types.first[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: document.download_types.first[0])}", download: 'trigger', download_type: document.download_types.first[0], download_id: document[:layer_slug_s] }, class: 'btn btn-default') %>
27
+ <% end %>
28
+ <button type='button' class='btn btn-default dropdown-toggle download-dropdown-toggle' data-toggle='dropdown' aria-expanded='false'>
29
+ <span class='caret'></span>
30
+ <span class='sr-only'>Toggle Download Dropdown</span>
31
+ </button>
32
+ <ul class='dropdown-menu' role='menu'>
33
+ <% if document.hgl_download.present? %>
34
+ <li role="presentation" class="dropdown-header">Original</li>
35
+ <li>
36
+ <%= link_to(download_text(document.download_types.first[0]),
37
+ download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document[:layer_slug_s] }) %>
38
+ </li>
39
+ <% else %>
40
+ <% if document.direct_download.present? %>
41
+ <li role="presentation" class="dropdown-header">Original</li>
42
+ <li>
43
+ <%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document[:layer_slug_s] }) %>
44
+ </li>
45
+ <% end %>
46
+ <% if document.download_types.present? %>
47
+ <li role="presentation" class="dropdown-header">Generated</li>
48
+ <% document.download_types.each do |type| %>
49
+ <%= content_tag(:li) do %>
50
+ <% link_to(download_text(type[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: type[0])}", download: 'trigger', download_type: type[0], download_id: document[:layer_slug_s] }) %>
51
+ <% end %>
52
+ <% end %>
53
+ <% end %>
54
+ <% end %>
55
+ </ul>
56
+ </div>
57
+ </div>
58
+ <% elsif document.restricted? && document.same_institution? %>
59
+ <div class='panel-body'>
60
+ <%= link_to t('geoblacklight.tools.login_to_view'), new_user_session_path(referrer: request.original_url) %>
61
+ </div>
62
+ <% end %>
63
+ </div>
@@ -18,18 +18,19 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'blacklight', '~> 5.7.2'
21
+ spec.add_dependency 'blacklight', '~> 5.8.2'
22
22
  spec.add_dependency 'leaflet-rails', '~> 0.7.3'
23
- spec.add_dependency 'blacklight_range_limit', '~> 5.0.1'
23
+ spec.add_dependency 'blacklight_range_limit', '~> 5.0.2'
24
24
  spec.add_dependency 'font-awesome-rails', '~> 4.1.0.0'
25
- spec.add_dependency 'httparty', '~> 0.13.1'
26
25
  spec.add_dependency 'rails_config'
27
26
  spec.add_dependency 'faraday'
27
+ spec.add_dependency 'rails-assets-leaflet-iiif', '~> 0.0.3'
28
+ spec.add_dependency 'rails-assets-readmore'
28
29
 
29
30
  spec.add_development_dependency 'bundler', '~> 1.5'
30
31
  spec.add_development_dependency 'rake', '~> 10.3.2'
31
32
  spec.add_development_dependency 'rspec-rails', '~> 3.0.1'
32
- spec.add_development_dependency 'jettywrapper', '~> 1.7.0'
33
+ spec.add_development_dependency 'jettywrapper', '~> 1.8.3'
33
34
  spec.add_development_dependency 'engine_cart', '~> 0.4.0'
34
35
  spec.add_development_dependency 'capybara', '~> 2.3.0'
35
36
  spec.add_development_dependency 'poltergeist', '~> 1.5.0'
@@ -1,7 +1,7 @@
1
1
  require 'blacklight'
2
2
  require 'leaflet-rails'
3
- # move towards removing httparty, replaced by faraday
4
- require 'httparty'
3
+ require 'rails-assets-leaflet-iiif'
4
+ require 'rails-assets-readmore'
5
5
  require 'font-awesome-rails'
6
6
  require 'rails_config'
7
7
  require 'faraday'
@@ -1,3 +1,3 @@
1
1
  module Geoblacklight
2
- VERSION = '0.4.2'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -40,7 +40,7 @@ feature 'Index view', js: true do
40
40
  scenario 'click on a record area to expand collapse' do
41
41
  within('.documentHeader', match: :first) do
42
42
  expect(page).to_not have_css('.collapse')
43
- find('.status-icons').click
43
+ find('.status-icons').trigger('click')
44
44
  expect(page).to have_css('.collapse', visible: true)
45
45
  end
46
46
  end
@@ -4,7 +4,7 @@ class TestAppGenerator < Rails::Generators::Base
4
4
  source_root "./spec/test_app_templates"
5
5
 
6
6
  def add_gems
7
- gem 'blacklight', "~> 5.7.1"
7
+ gem 'blacklight', "~> 5.8.2"
8
8
  Bundler.with_clean_env do
9
9
  run "bundle install"
10
10
  end
data/template.rb CHANGED
@@ -2,6 +2,8 @@ gem 'blacklight'
2
2
  gem 'geoblacklight', github: 'geoblacklight/geoblacklight'
3
3
  gem 'jettywrapper'
4
4
 
5
+ add_source "https://rails-assets.org"
6
+
5
7
  run 'bundle install'
6
8
 
7
9
  generate 'blacklight:install', '--devise'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoblacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Graves
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-12-19 00:00:00.000000000 Z
14
+ date: 2015-01-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: blacklight
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 5.7.2
22
+ version: 5.8.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 5.7.2
29
+ version: 5.8.2
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: leaflet-rails
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -47,14 +47,14 @@ dependencies:
47
47
  requirements:
48
48
  - - "~>"
49
49
  - !ruby/object:Gem::Version
50
- version: 5.0.1
50
+ version: 5.0.2
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
- version: 5.0.1
57
+ version: 5.0.2
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: font-awesome-rails
60
60
  requirement: !ruby/object:Gem::Requirement
@@ -70,21 +70,21 @@ dependencies:
70
70
  - !ruby/object:Gem::Version
71
71
  version: 4.1.0.0
72
72
  - !ruby/object:Gem::Dependency
73
- name: httparty
73
+ name: rails_config
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - "~>"
76
+ - - ">="
77
77
  - !ruby/object:Gem::Version
78
- version: 0.13.1
78
+ version: '0'
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - "~>"
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: 0.13.1
85
+ version: '0'
86
86
  - !ruby/object:Gem::Dependency
87
- name: rails_config
87
+ name: faraday
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
90
  - - ">="
@@ -98,7 +98,21 @@ dependencies:
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  - !ruby/object:Gem::Dependency
101
- name: faraday
101
+ name: rails-assets-leaflet-iiif
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: 0.0.3
107
+ type: :runtime
108
+ prerelease: false
109
+ version_requirements: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: 0.0.3
114
+ - !ruby/object:Gem::Dependency
115
+ name: rails-assets-readmore
102
116
  requirement: !ruby/object:Gem::Requirement
103
117
  requirements:
104
118
  - - ">="
@@ -159,14 +173,14 @@ dependencies:
159
173
  requirements:
160
174
  - - "~>"
161
175
  - !ruby/object:Gem::Version
162
- version: 1.7.0
176
+ version: 1.8.3
163
177
  type: :development
164
178
  prerelease: false
165
179
  version_requirements: !ruby/object:Gem::Requirement
166
180
  requirements:
167
181
  - - "~>"
168
182
  - !ruby/object:Gem::Version
169
- version: 1.7.0
183
+ version: 1.8.3
170
184
  - !ruby/object:Gem::Dependency
171
185
  name: engine_cart
172
186
  requirement: !ruby/object:Gem::Requirement
@@ -280,17 +294,17 @@ files:
280
294
  - app/assets/javascripts/geoblacklight/viewers/map.js
281
295
  - app/assets/javascripts/geoblacklight/viewers/viewer.js
282
296
  - app/assets/javascripts/geoblacklight/viewers/wms.js
283
- - app/assets/stylesheets/geoblacklight/_geoblacklight.css.scss
284
- - app/assets/stylesheets/geoblacklight/_styles.css.scss
285
- - app/assets/stylesheets/geoblacklight/application.css.scss
286
- - app/assets/stylesheets/geoblacklight/modules/geosearch.css.scss
287
- - app/assets/stylesheets/geoblacklight/modules/home.css.scss
288
- - app/assets/stylesheets/geoblacklight/modules/icon-customization.css.scss
289
- - app/assets/stylesheets/geoblacklight/modules/icons.css.scss
290
- - app/assets/stylesheets/geoblacklight/modules/item.css.scss
291
- - app/assets/stylesheets/geoblacklight/modules/layer_opacity.css.scss
292
- - app/assets/stylesheets/geoblacklight/modules/mixins.css.scss
293
- - app/assets/stylesheets/geoblacklight/modules/results.css.scss
297
+ - app/assets/stylesheets/geoblacklight/_geoblacklight.scss
298
+ - app/assets/stylesheets/geoblacklight/_styles.scss
299
+ - app/assets/stylesheets/geoblacklight/application.scss
300
+ - app/assets/stylesheets/geoblacklight/modules/geosearch.scss
301
+ - app/assets/stylesheets/geoblacklight/modules/home.scss
302
+ - app/assets/stylesheets/geoblacklight/modules/icon-customization.scss
303
+ - app/assets/stylesheets/geoblacklight/modules/icons.scss
304
+ - app/assets/stylesheets/geoblacklight/modules/item.scss
305
+ - app/assets/stylesheets/geoblacklight/modules/layer_opacity.scss
306
+ - app/assets/stylesheets/geoblacklight/modules/mixins.scss
307
+ - app/assets/stylesheets/geoblacklight/modules/results.scss
294
308
  - app/controllers/download_controller.rb
295
309
  - app/controllers/wms_controller.rb
296
310
  - app/helpers/geoblacklight_helper.rb
@@ -301,9 +315,10 @@ files:
301
315
  - app/views/catalog/_home_text.html.erb
302
316
  - app/views/catalog/_icon_facet.html.erb
303
317
  - app/views/catalog/_index_split_default.html.erb
318
+ - app/views/catalog/_search_form_no_navbar.html.erb
304
319
  - app/views/catalog/_show_default.html.erb
305
320
  - app/views/catalog/_show_header_default.html.erb
306
- - app/views/catalog/_show_sidebar.html.erb
321
+ - app/views/catalog/_show_tools.html.erb
307
322
  - app/views/catalog/_upper_metadata.html.erb
308
323
  - app/views/catalog/index.html.erb
309
324
  - app/views/download/hgl.html.erb
@@ -378,9 +393,7 @@ files:
378
393
  - spec/views/catalog/_document_split.html.erb_spec.rb
379
394
  - spec/views/catalog/_index_split.html.erb_spec.rb
380
395
  - template.rb
381
- - vendor/assets/javascripts/leaflet-iiif.js
382
396
  - vendor/assets/javascripts/native.history.js
383
- - vendor/assets/javascripts/readmore.min.js
384
397
  homepage: http://github.com/geoblacklight/geoblacklight
385
398
  licenses:
386
399
  - Apache 2.0
@@ -1,63 +0,0 @@
1
- <% document ||= @document %>
2
-
3
- <div id='geoblacklight-tools'>
4
- <div class="panel panel-default show-tools">
5
- <div class="panel-heading">
6
- Tools
7
- </div>
8
- <div class="panel-body">
9
- <ul class="list-group">
10
- <%= render_show_doc_actions @document, wrapping_class: 'list-group-item' %>
11
- <% if @document.respond_to?( :to_email_text ) %>
12
- <%= link_to email_helper, email_catalog_path(:id => @document), {:id => 'emailLink', :data => {:ajax_modal => "trigger"}, :class => 'list-group-item'} %>
13
- <%- end -%>
14
- <%- if @document.respond_to?( :to_sms_text ) -%>
15
- <%= link_to sms_helper, sms_catalog_path(:id => @document), {:id => 'smsLink', :data => {:ajax_modal => "trigger"}, :class => 'list-group-item'} %>
16
- <%- end -%>
17
- </ul>
18
- <% if document_downloadable? %>
19
- <div class='btn-group' itemprop='distribution' itemscope='itemscope' itemtype='http://schema.org/DataDownload'>
20
- <% if document.direct_download.present? %>
21
- <%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], class: 'btn btn-default', 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document[:layer_slug_s] }) %>
22
- <% elsif document.hgl_download.present? %>
23
- <%= link_to(download_text(document.download_types.first[0]),
24
- download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document[:layer_slug_s] },
25
- class: 'btn btn-default') %>
26
- <% else %>
27
- <%= link_to(download_text(document.download_types.first[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: document.download_types.first[0])}", download: 'trigger', download_type: document.download_types.first[0], download_id: document[:layer_slug_s] }, class: 'btn btn-default') %>
28
- <% end %>
29
- <button type='button' class='btn btn-default dropdown-toggle download-dropdown-toggle' data-toggle='dropdown' aria-expanded='false'>
30
- <span class='caret'></span>
31
- <span class='sr-only'>Toggle Download Dropdown</span>
32
- </button>
33
- <ul class='dropdown-menu' role='menu'>
34
- <% if document.hgl_download.present? %>
35
- <li role="presentation" class="dropdown-header">Original</li>
36
- <li>
37
- <%= link_to(download_text(document.download_types.first[0]),
38
- download_hgl_path(id: document), data: {ajax_modal: 'trigger', download: 'trigger', download_type: 'harvard-hgl', download_id: document[:layer_slug_s] }) %>
39
- </li>
40
- <% else %>
41
- <% if document.direct_download.present? %>
42
- <li role="presentation" class="dropdown-header">Original</li>
43
- <li>
44
- <%= link_to(download_text(@document[:dc_format_s]), document.direct_download[:download], 'contentUrl' => document.direct_download[:download], data: { download: 'trigger', download_type: 'direct', download_id: document[:layer_slug_s] }) %>
45
- </li>
46
- <% end %>
47
- <% if document.download_types.present? %>
48
- <li role="presentation" class="dropdown-header">Generated</li>
49
- <% document.download_types.each do |type| %>
50
- <%= content_tag(:li) do %>
51
- <% link_to(download_text(type[0]), '', data: { download_path: "#{download_path(document[:layer_slug_s], type: type[0])}", download: 'trigger', download_type: type[0], download_id: document[:layer_slug_s] }) %>
52
- <% end %>
53
- <% end %>
54
- <% end %>
55
- <% end %>
56
- </ul>
57
- </div>
58
- <% elsif document.restricted? && document.same_institution? %>
59
- <%= link_to t('geoblacklight.tools.login_to_view'), new_user_session_path(referrer: request.original_url) %>
60
- <% end %>
61
- </div>
62
- </div>
63
- </div>
@@ -1,152 +0,0 @@
1
- /*
2
- * Leaflet-IIIF 0.0.2
3
- * IIIF Viewer for Leaflet
4
- * by Jack Reed, @mejackreed
5
- */
6
-
7
- L.TileLayer.Iiif = L.TileLayer.extend({
8
- options: {
9
- continuousWorld: true,
10
- tileSize: 256,
11
- updateWhenIdle: true
12
- },
13
-
14
- initialize: function(url, options) {
15
- options = L.setOptions(this, options);
16
- this._infoDeferred = new $.Deferred();
17
- this._infoUrl = url;
18
- this._baseUrl = this._templateUrl();
19
- this._getInfo();
20
- },
21
- getTileUrl: function(coords) {
22
- var _this = this,
23
- x = coords.x,
24
- y = (coords.y),
25
- zoom = _this._map.getZoom(),
26
- scale = Math.pow(2, _this.maxZoom - zoom),
27
- tileBaseSize = _this.options.tileSize * scale,
28
- minx = (x * tileBaseSize),
29
- miny = (y * tileBaseSize),
30
- maxx = Math.min(minx + tileBaseSize, _this.x),
31
- maxy = Math.min(miny + tileBaseSize, _this.y);
32
-
33
- return L.Util.template(this._baseUrl, L.extend({
34
- format: 'jpg',
35
- quality: _this.quality,
36
- region: [minx, miny, (maxx - minx), (maxy - miny)].join(','),
37
- rotation: 0,
38
- size: 'pct:' + (100 / scale)
39
- }, this.options));
40
- },
41
- onAdd: function(map) {
42
- var _this = this;
43
-
44
- // Wait for deferred to complete
45
- $.when(_this._infoDeferred).done(function() {
46
-
47
- // Try to center the map a bit
48
- map.setView([-_this.options.tileSize / 2, _this.options.tileSize / 4], 1);
49
-
50
- // Set maxZoom for map
51
- map._layersMaxZoom = _this.maxZoom;
52
-
53
- // Call add TileLayer
54
- L.TileLayer.prototype.onAdd.call(_this, map);
55
-
56
- // Reset tile sizes to handle non 256x256 IIIF tiles
57
- _this.on('tileload', function(tile, url) {
58
-
59
- var height = tile.tile.naturalHeight,
60
- width = tile.tile.naturalWidth;
61
-
62
- // No need to resize if tile is 256 x 256
63
- if (height === 256 && width === 256) return;
64
-
65
- tile.tile.style.width = width + 'px';
66
- tile.tile.style.height = height + 'px';
67
-
68
- });
69
- });
70
- },
71
- _getInfo: function() {
72
- var _this = this;
73
-
74
- // Look for a way to do this without jQuery
75
- $.getJSON(_this._infoUrl)
76
- .done(function(data) {
77
- _this.y = data.height;
78
- _this.x = data.width;
79
-
80
- var profile,
81
- tierSizes = [],
82
- scale,
83
- width_,
84
- height_,
85
- tilesX_,
86
- tilesY_;
87
-
88
- // Set quality based off of IIIF version
89
- if (data.profile instanceof Array) {
90
- profile = data.profile[0];
91
- }else {
92
- profile = data.profile;
93
- }
94
- switch (profile) {
95
- case 'http://library.stanford.edu/iiif/image-api/compliance.html#level1':
96
- _this.quality = 100;
97
- break;
98
- case 'http://library.stanford.edu/iiif/image-api/1.1/compliance.html':
99
- _this.quality = 'native';
100
- break;
101
- case 'http://iiif.io/api/image/2/level2.json':
102
- _this.quality = 'default';
103
- break;
104
- }
105
-
106
- ceilLog2 = function(x) {
107
- return Math.ceil(Math.log(x) / Math.LN2);
108
- };
109
-
110
- // Calculates maxZoom for the layer
111
- _this.maxZoom = Math.max(ceilLog2(_this.x / _this.options.tileSize),
112
- ceilLog2(_this.y / _this.options.tileSize));
113
-
114
- for (var i = 0; i <= _this.maxZoom; i++) {
115
- scale = Math.pow(2, _this.maxZoom - i);
116
- width_ = Math.ceil(_this.x / scale);
117
- height_ = Math.ceil(_this.y / scale);
118
- tilesX_ = Math.ceil(width_ / _this.options.tileSize);
119
- tilesY_ = Math.ceil(height_ / _this.options.tileSize);
120
- tierSizes.push([tilesX_, tilesY_]);
121
- }
122
- _this._tierSizes = tierSizes;
123
-
124
- // Resolved Deferred to initiate tilelayer load
125
- _this._infoDeferred.resolve();
126
- });
127
- },
128
- _infoToBaseUrl: function() {
129
- return this._infoUrl.replace('info.json', '');
130
- },
131
- _templateUrl: function() {
132
- return this._infoToBaseUrl() + '{region}/{size}/{rotation}/{quality}.{format}';
133
- },
134
- _tileShouldBeLoaded: function(coords) {
135
- var _this = this,
136
- zoom = _this._map.getZoom(),
137
- sizes = _this._tierSizes[zoom],
138
- x = coords.x,
139
- y = (coords.y);
140
-
141
- if (!sizes) return false;
142
- if (x < 0 || sizes[0] <= x || y < 0 || sizes[1] <= y) {
143
- return false;
144
- }else {
145
- return true;
146
- }
147
- }
148
- });
149
-
150
- L.tileLayer.iiif = function(url, options) {
151
- return new L.TileLayer.Iiif(url, options);
152
- };
@@ -1,7 +0,0 @@
1
- (function(c){function g(b,a){this.element=b;this.options=c.extend({},h,a);c(this.element).data("max-height",this.options.maxHeight);c(this.element).data("height-margin",this.options.heightMargin);delete this.options.maxHeight;if(this.options.embedCSS&&!k){var d=".readmore-js-toggle, .readmore-js-section { "+this.options.sectionCSS+" } .readmore-js-section { overflow: hidden; }",e=document.createElement("style");e.type="text/css";e.styleSheet?e.styleSheet.cssText=d:e.appendChild(document.createTextNode(d));
2
- document.getElementsByTagName("head")[0].appendChild(e);k=!0}this._defaults=h;this._name=f;this.init()}var f="readmore",h={speed:100,maxHeight:200,heightMargin:16,moreLink:'<a href="#">Read More</a>',lessLink:'<a href="#">Close</a>',embedCSS:!0,sectionCSS:"display: block; width: 100%;",startOpen:!1,expandedClass:"readmore-js-expanded",collapsedClass:"readmore-js-collapsed",beforeToggle:function(){},afterToggle:function(){}},k=!1;g.prototype={init:function(){var b=this;c(this.element).each(function(){var a=
3
- c(this),d=a.css("max-height").replace(/[^-\d\.]/g,"")>a.data("max-height")?a.css("max-height").replace(/[^-\d\.]/g,""):a.data("max-height"),e=a.data("height-margin");"none"!=a.css("max-height")&&a.css("max-height","none");b.setBoxHeight(a);if(a.outerHeight(!0)<=d+e)return!0;a.addClass("readmore-js-section "+b.options.collapsedClass).data("collapsedHeight",d);a.after(c(b.options.startOpen?b.options.lessLink:b.options.moreLink).on("click",function(c){b.toggleSlider(this,a,c)}).addClass("readmore-js-toggle"));
4
- b.options.startOpen||a.css({height:d})});c(window).on("resize",function(a){b.resizeBoxes()})},toggleSlider:function(b,a,d){d.preventDefault();var e=this;d=newLink=sectionClass="";var f=!1;d=c(a).data("collapsedHeight");c(a).height()<=d?(d=c(a).data("expandedHeight")+"px",newLink="lessLink",f=!0,sectionClass=e.options.expandedClass):(newLink="moreLink",sectionClass=e.options.collapsedClass);e.options.beforeToggle(b,a,f);c(a).animate({height:d},{duration:e.options.speed,complete:function(){e.options.afterToggle(b,
5
- a,f);c(b).replaceWith(c(e.options[newLink]).on("click",function(b){e.toggleSlider(this,a,b)}).addClass("readmore-js-toggle"));c(this).removeClass(e.options.collapsedClass+" "+e.options.expandedClass).addClass(sectionClass)}})},setBoxHeight:function(b){var a=b.clone().css({height:"auto",width:b.width(),overflow:"hidden"}).insertAfter(b),c=a.outerHeight(!0);a.remove();b.data("expandedHeight",c)},resizeBoxes:function(){var b=this;c(".readmore-js-section").each(function(){var a=c(this);b.setBoxHeight(a);
6
- (a.height()>a.data("expandedHeight")||a.hasClass(b.options.expandedClass)&&a.height()<a.data("expandedHeight"))&&a.css("height",a.data("expandedHeight"))})},destroy:function(){var b=this;c(this.element).each(function(){var a=c(this);a.removeClass("readmore-js-section "+b.options.collapsedClass+" "+b.options.expandedClass).css({"max-height":"",height:"auto"}).next(".readmore-js-toggle").remove();a.removeData()})}};c.fn[f]=function(b){var a=arguments;if(void 0===b||"object"===typeof b)return this.each(function(){if(c.data(this,
7
- "plugin_"+f)){var a=c.data(this,"plugin_"+f);a.destroy.apply(a)}c.data(this,"plugin_"+f,new g(this,b))});if("string"===typeof b&&"_"!==b[0]&&"init"!==b)return this.each(function(){var d=c.data(this,"plugin_"+f);d instanceof g&&"function"===typeof d[b]&&d[b].apply(d,Array.prototype.slice.call(a,1))})}})(jQuery);