warclight 0.1.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.
- checksums.yaml +7 -0
- data/.eslintrc +12 -0
- data/.gitignore +19 -0
- data/.rspec +2 -0
- data/.rubocop.yml +66 -0
- data/.solr_wrapper +5 -0
- data/.travis.yml +31 -0
- data/CONTRIBUTING.md +53 -0
- data/Gemfile +42 -0
- data/LICENSE.txt +11 -0
- data/README.md +79 -0
- data/Rakefile +16 -0
- data/app/assets/images/blacklight/compact.svg +25 -0
- data/app/assets/images/blacklight/logo.png +0 -0
- data/app/assets/javascripts/warclight/oembed_viewer.js +39 -0
- data/app/assets/javascripts/warclight/warclight.js +4 -0
- data/app/assets/stylesheets/warclight/application.scss +1 -0
- data/app/assets/stylesheets/warclight/warclight.scss +1 -0
- data/app/controllers/concerns/warclight/field_config_helpers.rb +11 -0
- data/app/helpers/warclight/application_helper.rb +8 -0
- data/app/jobs/warclight/application_job.rb +6 -0
- data/app/models/concerns/warclight/catalog.rb +8 -0
- data/app/models/concerns/warclight/search_behavior.rb +9 -0
- data/app/models/concerns/warclight/solr_document.rb +9 -0
- data/app/views/layouts/warclight/application.html.erb +14 -0
- data/bin/rails +14 -0
- data/config/routes.rb +4 -0
- data/lib/generators/warclight/install_generator.rb +55 -0
- data/lib/generators/warclight/templates/catalog_controller.rb +129 -0
- data/lib/generators/warclight/templates/warclight.js +2 -0
- data/lib/generators/warclight/templates/warclight.scss +3 -0
- data/lib/generators/warclight/update_generator.rb +22 -0
- data/lib/warclight.rb +7 -0
- data/lib/warclight/engine.rb +105 -0
- data/lib/warclight/version.rb +5 -0
- data/package.json +24 -0
- data/solr/conf/elevate.xml +42 -0
- data/solr/conf/lang/contractions_ca.txt +8 -0
- data/solr/conf/lang/contractions_fr.txt +15 -0
- data/solr/conf/lang/contractions_ga.txt +5 -0
- data/solr/conf/lang/contractions_it.txt +23 -0
- data/solr/conf/lang/hyphenations_ga.txt +5 -0
- data/solr/conf/lang/stemdict_nl.txt +6 -0
- data/solr/conf/lang/stoptags_ja.txt +420 -0
- data/solr/conf/lang/stopwords_ar.txt +125 -0
- data/solr/conf/lang/stopwords_bg.txt +193 -0
- data/solr/conf/lang/stopwords_ca.txt +220 -0
- data/solr/conf/lang/stopwords_cz.txt +172 -0
- data/solr/conf/lang/stopwords_da.txt +110 -0
- data/solr/conf/lang/stopwords_de.txt +294 -0
- data/solr/conf/lang/stopwords_el.txt +78 -0
- data/solr/conf/lang/stopwords_en.txt +54 -0
- data/solr/conf/lang/stopwords_es.txt +356 -0
- data/solr/conf/lang/stopwords_eu.txt +99 -0
- data/solr/conf/lang/stopwords_fa.txt +313 -0
- data/solr/conf/lang/stopwords_fi.txt +97 -0
- data/solr/conf/lang/stopwords_fr.txt +186 -0
- data/solr/conf/lang/stopwords_ga.txt +110 -0
- data/solr/conf/lang/stopwords_gl.txt +161 -0
- data/solr/conf/lang/stopwords_hi.txt +235 -0
- data/solr/conf/lang/stopwords_hu.txt +211 -0
- data/solr/conf/lang/stopwords_hy.txt +46 -0
- data/solr/conf/lang/stopwords_id.txt +359 -0
- data/solr/conf/lang/stopwords_it.txt +303 -0
- data/solr/conf/lang/stopwords_ja.txt +127 -0
- data/solr/conf/lang/stopwords_lv.txt +172 -0
- data/solr/conf/lang/stopwords_nl.txt +119 -0
- data/solr/conf/lang/stopwords_no.txt +194 -0
- data/solr/conf/lang/stopwords_pt.txt +253 -0
- data/solr/conf/lang/stopwords_ro.txt +233 -0
- data/solr/conf/lang/stopwords_ru.txt +243 -0
- data/solr/conf/lang/stopwords_sv.txt +133 -0
- data/solr/conf/lang/stopwords_th.txt +119 -0
- data/solr/conf/lang/stopwords_tr.txt +212 -0
- data/solr/conf/lang/userdict_ja.txt +29 -0
- data/solr/conf/managed-schema +1045 -0
- data/solr/conf/params.json +20 -0
- data/solr/conf/protwords.txt +21 -0
- data/solr/conf/schema.xml +350 -0
- data/solr/conf/solrconfig.xml +1361 -0
- data/solr/conf/stopwords.txt +14 -0
- data/solr/conf/synonyms.txt +29 -0
- data/tasks/warclight.rake +61 -0
- data/template.rb +15 -0
- data/vendor/assets/javascripts/responsiveTruncator.js +69 -0
- data/vendor/assets/javascripts/stickyfill.js +480 -0
- data/warclight.gemspec +38 -0
- metadata +312 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: a490a534549e6f25e2ec78306e1d9e1fba105b9a
|
|
4
|
+
data.tar.gz: 5af34c38dfcc2e36232cfeeb8bf860b960da0f04
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 72004ef5451f292f2c2f5689de959ce09a39b0c939bf8e0e6979a09a74379a263eaadb9d9a73b0b3ae3482fbda05fd74721957eaf25765f90654a1c9fc37e248
|
|
7
|
+
data.tar.gz: b0c5cd52cca6f885ede22fd0bd28df60b7f3989bf83121e39c85b95fdab9980566d0fd6c668b384f6d2c6788f4408e6c54ca4ba3e9f3f05510eec8ce3052af4d
|
data/.eslintrc
ADDED
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
require: rubocop-rspec
|
|
2
|
+
|
|
3
|
+
AllCops:
|
|
4
|
+
Exclude:
|
|
5
|
+
- '.internal_test_app/**/*'
|
|
6
|
+
- 'bin/**/*'
|
|
7
|
+
- 'db/**/*'
|
|
8
|
+
- 'lib/generators/warclight/templates/**/*'
|
|
9
|
+
- 'vendor/**/*'
|
|
10
|
+
TargetRubyVersion: 2.4
|
|
11
|
+
DisplayCopNames: true
|
|
12
|
+
|
|
13
|
+
Rails:
|
|
14
|
+
Enabled: true
|
|
15
|
+
|
|
16
|
+
Metrics/LineLength:
|
|
17
|
+
Max: 120
|
|
18
|
+
Exclude:
|
|
19
|
+
- 'Gemfile'
|
|
20
|
+
- 'lib/warclight/custom_document.rb' # XPaths get long
|
|
21
|
+
- 'lib/warclight/custom_component.rb' # XPaths get long
|
|
22
|
+
|
|
23
|
+
Metrics/ModuleLength:
|
|
24
|
+
Max: 120
|
|
25
|
+
|
|
26
|
+
Metrics/ClassLength:
|
|
27
|
+
Max: 120
|
|
28
|
+
|
|
29
|
+
Metrics/BlockLength:
|
|
30
|
+
Exclude:
|
|
31
|
+
- !ruby/regexp /\.rake$/
|
|
32
|
+
- 'warclight.gemspec'
|
|
33
|
+
- 'spec/**/*'
|
|
34
|
+
- 'lib/warclight/custom_document.rb'
|
|
35
|
+
|
|
36
|
+
Metrics/MethodLength:
|
|
37
|
+
Exclude:
|
|
38
|
+
- 'lib/warclight/custom_document.rb' # warclight_field_definitions too long
|
|
39
|
+
|
|
40
|
+
Performance/RegexpMatch:
|
|
41
|
+
Enabled: false
|
|
42
|
+
|
|
43
|
+
Rails/OutputSafety:
|
|
44
|
+
Exclude:
|
|
45
|
+
- 'app/controllers/concerns/warclight/field_config_helpers.rb' # html_safe needs to be called to mimic BL JOIN behavior
|
|
46
|
+
|
|
47
|
+
RSpec/ExampleLength:
|
|
48
|
+
Enabled: false
|
|
49
|
+
|
|
50
|
+
RSpec/FilePath:
|
|
51
|
+
Exclude:
|
|
52
|
+
- 'spec/lib/warclight/viewers/oembed_spec.rb' # Default file path is o_embed, and that looks weird
|
|
53
|
+
|
|
54
|
+
RSpec/MultipleExpectations:
|
|
55
|
+
Enabled: false
|
|
56
|
+
|
|
57
|
+
RSpec/NestedGroups:
|
|
58
|
+
Max: 4
|
|
59
|
+
|
|
60
|
+
Style/Documentation:
|
|
61
|
+
Exclude:
|
|
62
|
+
- 'spec/**/*'
|
|
63
|
+
- 'lib/warclight.rb'
|
|
64
|
+
|
|
65
|
+
Bundler/DuplicatedGem:
|
|
66
|
+
Enabled: false
|
data/.solr_wrapper
ADDED
data/.travis.yml
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
sudo: false
|
|
2
|
+
language: ruby
|
|
3
|
+
notifications:
|
|
4
|
+
email: false
|
|
5
|
+
rvm:
|
|
6
|
+
- 2.4.1
|
|
7
|
+
jdk:
|
|
8
|
+
- oraclejdk8
|
|
9
|
+
|
|
10
|
+
# Update to phantomjs 2.1.1 to fix issues with < 2
|
|
11
|
+
# See https://github.com/travis-ci/travis-ci/issues/3225#issuecomment-177592725
|
|
12
|
+
# and https://github.com/travis-ci/travis-ci/issues/3225#issuecomment-200965782
|
|
13
|
+
cache:
|
|
14
|
+
bundler: true
|
|
15
|
+
directories:
|
|
16
|
+
- "travis_phantomjs"
|
|
17
|
+
|
|
18
|
+
before_install:
|
|
19
|
+
- "phantomjs --version"
|
|
20
|
+
- "export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH"
|
|
21
|
+
- "phantomjs --version"
|
|
22
|
+
- "if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
|
|
23
|
+
- "if [ $(phantomjs --version) != '2.1.1' ]; then wget https://assets.membergetmember.co/software/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; fi"
|
|
24
|
+
- "if [ $(phantomjs --version) != '2.1.1' ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
|
|
25
|
+
- "hash -r"
|
|
26
|
+
- "phantomjs --version"
|
|
27
|
+
|
|
28
|
+
notifications:
|
|
29
|
+
email: false
|
|
30
|
+
slack:
|
|
31
|
+
secure: 1iYPmf/YSm31fZTPiM4OxG/Ii9H8J1eE/jNN0eCnA4wYPGh3SaoeCw9GpsnGWZ4wSuXUdRmGn5s5BFfTCp1RVcjJSo2TZnhhdIAavWlhmgnrdInQdXfZNfTKE7xCCAW+rW4pjrZZorEAGTYPNXV39AyNDMUsGF0sAnjM56ODXa93Xy+1+enIP95Pprxnqk2usxOlsLoQkVthMTFGgche5W1yEqY/rZxyIl3Q0YacVZpEzmPwsFG/Vgq7Vl8iLNcDzngNYeGmmomlR9WOw/DyHSag6FDb2AE1crXlx7yrBsbSo0sFKmDaJvjJrIDY2wkq/M75vMPwiOjzXVcXE1Tj1+LzJ1fbjEaEIoXwLGXtnSUC2u96je0iJSeudTLc2J7ah6vdec4H/tUPjXv9QLbKrP5xQlFItaks4J8DHVNUe22vVyFg6VVs5ZBkOqzwLH0Bj12vRKlW+P7xDF0mKYZRqigLeTqWJEpMRozlBycUXpdCxL2JVbzDd6q57mq67YPhVo5HNIlBfPt8nYlfx1gXJeyMj/cBu3sQSXsKXff6h+wjLUFsSO1il95BulrpRFO8THGOIJHsJlwgE11c+/3DZCU/lHYMY+XfS6qhoDWgKqhDl/8wie/THtaWX+VOEDxRdCES1GTn2x+R/jN6wp02zBPGsTASDCY0UXwQXv3ENB4=
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Welcome!
|
|
2
|
+
|
|
3
|
+
If you are reading this document then you are interested in contributing Warclight. All contributions are welcome: use-cases, documentation, code, ptatches, bug reports, feature requests, etc. You do not need to be a programmer to speak up!
|
|
4
|
+
|
|
5
|
+
### Use cases
|
|
6
|
+
|
|
7
|
+
If you would like to submit a use case for Warclight, please submit and issue [here](https://github.com/archivesunleashed/warclight/issues/new), and begin the issue title with "Use Case:".
|
|
8
|
+
|
|
9
|
+
### Documentation
|
|
10
|
+
|
|
11
|
+
You can contribute documentation in two different ways. One way is to create an issue [here](https://github.com/archivesunleashed/warclight/issues/new) and begin the issue title with "Documentation:".
|
|
12
|
+
|
|
13
|
+
### Request a new feature
|
|
14
|
+
|
|
15
|
+
To request a new feature you should [open an issue](https://github.com/archivesunleashed/warclight/issues/new) or create a use case as described above (see _use case_ section above), and summarize the desired functionality. Begin the issue title with "Enhancement:".
|
|
16
|
+
|
|
17
|
+
### Report a bug
|
|
18
|
+
|
|
19
|
+
To report a bug you should [open an issue](https://github.com/archivesunleashed/warclight/issues/new) that summarizes the bug, and begin the issue title with "Bug".
|
|
20
|
+
|
|
21
|
+
In order to help us understand and fix the bug it would be great if you could provide us with:
|
|
22
|
+
|
|
23
|
+
1. The steps to reproduce the bug. This includes information about e.g. The Warclight version you were using.
|
|
24
|
+
2. The expected behavior.
|
|
25
|
+
3. The actual, incorrect behavior.
|
|
26
|
+
|
|
27
|
+
Feel free to search the issue queue for existing issues (aka tickets) that already describe the problem; if there is such a ticket please add your information as a comment.
|
|
28
|
+
|
|
29
|
+
### Contribute code
|
|
30
|
+
|
|
31
|
+
_If you are interested in contributing code to Warclight but do not know where to begin:_
|
|
32
|
+
|
|
33
|
+
In this case you should [browse open issues](https://github.com/archivesunleashed/warclight/issues).
|
|
34
|
+
|
|
35
|
+
Contributions to Warclight codebase should be sent as GitHub pull requests. See section _Create a pull request_ below for details. If there is any problem with the pull request we can work through it using the commenting features of GitHub.
|
|
36
|
+
|
|
37
|
+
* For _small patches_, feel free to submit pull requests directly for those patches.
|
|
38
|
+
* For _larger code contributions_, please use the following process. The idea behind this process is to prevent any wasted work and catch design issues early on.
|
|
39
|
+
|
|
40
|
+
1. [Open an issue](https://github.com/archivesunleashed/warclight/issues), if a similar issue does not exist already. If a similar issue does exist, then you may consider participating in the work on the existing issue.
|
|
41
|
+
2. Comment on the issue with your plan for implementing the issue. Explain what pieces of the codebase you are going to touch and how everything is going to fit together.
|
|
42
|
+
3. The Warclight committers will work with you on the design to make sure you are on the right track.
|
|
43
|
+
4. Implement your issue, create a pull request (see below), and iterate from there.
|
|
44
|
+
|
|
45
|
+
### Create a pull request
|
|
46
|
+
|
|
47
|
+
Take a look at [Creating a pull request](https://help.github.com/articles/creating-a-pull-request). In a nutshell you need to:
|
|
48
|
+
|
|
49
|
+
1. [Fork](https://help.github.com/articles/fork-a-repo) the Warclight GitHub repository at [https://github.com/archivesunleashed/warclight](https://github.com/archivesleashed/warclight) to your personal GitHub account.
|
|
50
|
+
2. Commit any changes to your fork.
|
|
51
|
+
3. Send a [pull request](https://help.github.com/articles/creating-a-pull-request) to Warclight GitHub repository that you forked in step 1. If your pull request is related to an existing issue -- for instance, because you reported a [bug/issue](https://github.com/archivesunleashed/aut/issues) earlier -- prefix the title of your pull request with the corresponding issue number (e.g. `issue-123: ...`). Please also include a reference to the issue in the description of the pull. This can be done by using '#' plus the issue number like so '#123', also try to pick an appropriate name for the branch in which you're issuing the pull request from.
|
|
52
|
+
|
|
53
|
+
You may want to read [Syncing a fork](https://help.github.com/articles/syncing-a-fork) for instructions on how to keep your fork up to date with the latest changes of the upstream (official) `aut` repository.
|
data/Gemfile
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
|
+
|
|
5
|
+
gem 'codecov', require: false, group: :test
|
|
6
|
+
|
|
7
|
+
# Declare your gem's dependencies in warclight.gemspec.
|
|
8
|
+
gemspec
|
|
9
|
+
# BEGIN ENGINE_CART BLOCK
|
|
10
|
+
# engine_cart: 1.1.0
|
|
11
|
+
# engine_cart stanza: 0.10.0
|
|
12
|
+
# the below comes from engine_cart, a gem used to test this Rails engine gem in the context of a Rails app.
|
|
13
|
+
file = File.expand_path('Gemfile', ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path('.internal_test_app', File.dirname(__FILE__)))
|
|
14
|
+
if File.exist?(file)
|
|
15
|
+
begin
|
|
16
|
+
eval_gemfile file
|
|
17
|
+
rescue Bundler::GemfileError => e
|
|
18
|
+
Bundler.ui.warn '[EngineCart] Skipping Rails application dependencies:'
|
|
19
|
+
Bundler.ui.warn e.message
|
|
20
|
+
end
|
|
21
|
+
else
|
|
22
|
+
Bundler.ui.warn "[EngineCart] Unable to find test application dependencies in #{file}, using placeholder dependencies"
|
|
23
|
+
|
|
24
|
+
if ENV['RAILS_VERSION']
|
|
25
|
+
if ENV['RAILS_VERSION'] == 'edge'
|
|
26
|
+
gem 'rails', github: 'rails/rails'
|
|
27
|
+
ENV['ENGINE_CART_RAILS_OPTIONS'] = '--edge --skip-turbolinks'
|
|
28
|
+
else
|
|
29
|
+
gem 'rails', ENV['RAILS_VERSION']
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
case ENV['RAILS_VERSION']
|
|
34
|
+
when /^4.2/
|
|
35
|
+
gem 'coffee-rails', '~> 4.1.0'
|
|
36
|
+
gem 'responders', '~> 2.0'
|
|
37
|
+
gem 'sass-rails', '>= 5.0'
|
|
38
|
+
when /^4.[01]/
|
|
39
|
+
gem 'sass-rails', '< 5.0'
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
# END ENGINE_CART BLOCK
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
2
|
+
you may not use this file except in compliance with the License.
|
|
3
|
+
You may obtain a copy of the License at
|
|
4
|
+
|
|
5
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
See the License for the specific language governing permissions and
|
|
11
|
+
limitations under the License.
|
data/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Warclight
|
|
2
|
+
[](https://travis-ci.org/archivesunleashed/warclight)
|
|
3
|
+
[](./CONTRIBUTING.md)
|
|
4
|
+
[](./LICENSE.txt)
|
|
5
|
+
[](https://codecov.io/gh/archivesunleashed/warclight)
|
|
6
|
+
|
|
7
|
+
A Rails engine supporting the discovery of web archives.
|
|
8
|
+
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
* [Ruby](https://www.ruby-lang.org/en/) 2.2 or later
|
|
12
|
+
* [Rails](http://rubyonrails.org) 5.1.2 or later
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Add this line to your application's Gemfile:
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
gem 'warclight'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
And then execute:
|
|
23
|
+
```bash
|
|
24
|
+
$ bundle
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or install it yourself as:
|
|
28
|
+
```bash
|
|
29
|
+
$ gem install warclight
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
Warclight is designed to work with web archive data that is indexed via the UK Web Archive's [webarchive-discovery](webarchive-discovery) project.
|
|
35
|
+
|
|
36
|
+
## Development
|
|
37
|
+
|
|
38
|
+
Warclight development uses [`solr_wrapper`](https://rubygems.org/gems/solr_wrapper/versions/0.18.1) and [`engine_cart`](https://rubygems.org/gems/engine_cart) to host development instances of Solr and Rails server on your local machine.
|
|
39
|
+
|
|
40
|
+
### Run the test suite
|
|
41
|
+
|
|
42
|
+
Ensure Solr and Rails are _not_ running (ports 8983 and 3000 respectively), then:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
$ bundle exec rake
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Run a development server
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
$ bundle exec rake warclight:server
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Then visit http://localhost:3000. It will also start a Solr instance on port 8983.
|
|
55
|
+
|
|
56
|
+
### Run a console
|
|
57
|
+
|
|
58
|
+
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
59
|
+
|
|
60
|
+
### Release a new version of the gem
|
|
61
|
+
|
|
62
|
+
To release a new version:
|
|
63
|
+
|
|
64
|
+
1. Update the version number in `lib/warclight/version.rb`
|
|
65
|
+
2. Run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, build the gem file (e.g., `gem build warclight.gemspec`) and push the `.gem` file to [rubygems.org](https://rubygems.org) (e.g., `gem push warclight-x.y.z.gem`).
|
|
66
|
+
|
|
67
|
+
## Contributing
|
|
68
|
+
|
|
69
|
+
[Bug reports](https://github.com/archivesunleashed/warclight/issues) and [pull requests](https://github.com/archivesunleashed/warclight/pulls) are welcome on WarcLight -- see [CONTRIBUTING.md](https://github.com/archivesunleashed/warclight/blob/master/CONTRIBUTING.md) for details.
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
The gem is available as open source under the terms of the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
|
74
|
+
|
|
75
|
+
## Acknowledgments
|
|
76
|
+
|
|
77
|
+
This work is primarily supported by the [Andrew W. Mellon Foundation](https://uwaterloo.ca/arts/news/multidisciplinary-project-will-help-historians-unlock). Any opinions, findings, and conclusions or recommendations expressed are those of the researchers and do not necessarily reflect the views of the sponsors.
|
|
78
|
+
|
|
79
|
+
This project drew inspiration from the [Arclight](https://github.com/sul-dlss/arclight), and would like to thank those creators and contributors.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'bundler/gem_tasks'
|
|
4
|
+
require 'rspec/core/rake_task'
|
|
5
|
+
|
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
|
7
|
+
|
|
8
|
+
require 'rubocop/rake_task'
|
|
9
|
+
RuboCop::RakeTask.new(:rubocop)
|
|
10
|
+
|
|
11
|
+
Dir.glob('./tasks/*.rake').each { |f| load f }
|
|
12
|
+
Dir.glob('./lib/tasks/*.rake').each { |f| load f }
|
|
13
|
+
|
|
14
|
+
require 'engine_cart/rake_task'
|
|
15
|
+
|
|
16
|
+
task default: %i[rubocop eslint ci]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<!-- Generator: Sketch 44.1 (41455) - http://www.bohemiancoding.com/sketch -->
|
|
4
|
+
<title>Compact</title>
|
|
5
|
+
<desc>Created with Sketch.</desc>
|
|
6
|
+
<defs></defs>
|
|
7
|
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
|
|
8
|
+
<g id="Compact" stroke="#000000">
|
|
9
|
+
<path d="M1.43885093,2.44444444 L6.83349609,2.44444444" id="Line"></path>
|
|
10
|
+
<path d="M1.43885093,4.44444444 L6.83349609,4.44444444" id="Line"></path>
|
|
11
|
+
<path d="M1.43885093,6.44444444 L6.83349609,6.44444444" id="Line"></path>
|
|
12
|
+
<path d="M1.43885093,8.44444444 L6.83349609,8.44444444" id="Line"></path>
|
|
13
|
+
<path d="M1.43885093,10.4444444 L6.83349609,10.4444444" id="Line"></path>
|
|
14
|
+
<path d="M1.43885093,12.4444444 L6.83349609,12.4444444" id="Line"></path>
|
|
15
|
+
<path d="M1.43885093,14.4444444 L6.83349609,14.4444444" id="Line"></path>
|
|
16
|
+
<path d="M9.43885093,2.44444444 L14.8334961,2.44444444" id="Line"></path>
|
|
17
|
+
<path d="M9.43885093,4.44444444 L14.8334961,4.44444444" id="Line"></path>
|
|
18
|
+
<path d="M9.43885093,6.44444444 L14.8334961,6.44444444" id="Line"></path>
|
|
19
|
+
<path d="M9.43885093,8.44444444 L14.8334961,8.44444444" id="Line"></path>
|
|
20
|
+
<path d="M9.43885093,10.4444444 L14.8334961,10.4444444" id="Line"></path>
|
|
21
|
+
<path d="M9.43885093,12.4444444 L14.8334961,12.4444444" id="Line"></path>
|
|
22
|
+
<path d="M9.43885093,14.4444444 L14.8334961,14.4444444" id="Line"></path>
|
|
23
|
+
</g>
|
|
24
|
+
</g>
|
|
25
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Blacklight.onLoad(function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
var onlineContentTabSelector = '[data-arclight-online-content-tab="true"]';
|
|
4
|
+
var oEmbedViewerSelector = '[data-arclight-oembed="true"]';
|
|
5
|
+
|
|
6
|
+
$(onlineContentTabSelector).on('shown.bs.tab', function() {
|
|
7
|
+
var $viewerElements = $(oEmbedViewerSelector);
|
|
8
|
+
if($viewerElements.length === 0) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
$viewerElements.each(function (i, element) {
|
|
13
|
+
var $el = $(element);
|
|
14
|
+
var data = $el.data();
|
|
15
|
+
var resourceUrl = data.arclightOembedUrl;
|
|
16
|
+
$.ajax({
|
|
17
|
+
url: resourceUrl,
|
|
18
|
+
dataType: 'html'
|
|
19
|
+
}).done(function (response) {
|
|
20
|
+
var links = $('<div>' + response.match(/<link .*>/g).join('') + '</div>'); // Parse out link elements so image assets are not loaded
|
|
21
|
+
var oEmbedEndPoint = links.find('link[rel="alternate"][type="application/json+oembed"]').prop('href');
|
|
22
|
+
|
|
23
|
+
if(!oEmbedEndPoint || oEmbedEndPoint.length === 0) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
$.ajax({
|
|
28
|
+
url: oEmbedEndPoint
|
|
29
|
+
}).done(function (oEmbedResponse) {
|
|
30
|
+
if(oEmbedResponse.html) {
|
|
31
|
+
$el.hide()
|
|
32
|
+
.html(oEmbedResponse.html)
|
|
33
|
+
.fadeIn(500);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Warclight application scss */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* warclight specific scss */
|