-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3d939a3
Showing
430 changed files
with
73,286 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.bundle/ | ||
log/*.log | ||
pkg/ | ||
test/dummy/db/*.sqlite3 | ||
test/dummy/db/*.sqlite3-journal | ||
test/dummy/log/*.log | ||
test/dummy/tmp/ | ||
test/dummy/.sass-cache | ||
|
||
/test/sandbox/* | ||
!/test/sandbox/.gitkeep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Declare your gem's dependencies in pdfjs_viewer.gemspec. | ||
# Bundler will treat runtime dependencies like base dependencies, and | ||
# development dependencies will be added by default to the :development group. | ||
gemspec | ||
|
||
# Declare any dependencies that are still in development here instead of in | ||
# your gemspec. These might include edge Rails or gems from your path or | ||
# Git. Remember to move these dependencies to your gemspec before releasing | ||
# your gem to rubygems.org. | ||
|
||
# To use a debugger | ||
# gem 'byebug', group: [:development, :test] | ||
|
||
group :test do | ||
gem 'capybara', '>= 2.1' | ||
gem 'poltergeist', '~> 1.5' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
pdfjs_viewer-rails (0.0.1) | ||
rails (~> 4.2.0) | ||
sass-rails (~> 5.0) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
actionmailer (4.2.0) | ||
actionpack (= 4.2.0) | ||
actionview (= 4.2.0) | ||
activejob (= 4.2.0) | ||
mail (~> 2.5, >= 2.5.4) | ||
rails-dom-testing (~> 1.0, >= 1.0.5) | ||
actionpack (4.2.0) | ||
actionview (= 4.2.0) | ||
activesupport (= 4.2.0) | ||
rack (~> 1.6.0) | ||
rack-test (~> 0.6.2) | ||
rails-dom-testing (~> 1.0, >= 1.0.5) | ||
rails-html-sanitizer (~> 1.0, >= 1.0.1) | ||
actionview (4.2.0) | ||
activesupport (= 4.2.0) | ||
builder (~> 3.1) | ||
erubis (~> 2.7.0) | ||
rails-dom-testing (~> 1.0, >= 1.0.5) | ||
rails-html-sanitizer (~> 1.0, >= 1.0.1) | ||
activejob (4.2.0) | ||
activesupport (= 4.2.0) | ||
globalid (>= 0.3.0) | ||
activemodel (4.2.0) | ||
activesupport (= 4.2.0) | ||
builder (~> 3.1) | ||
activerecord (4.2.0) | ||
activemodel (= 4.2.0) | ||
activesupport (= 4.2.0) | ||
arel (~> 6.0) | ||
activesupport (4.2.0) | ||
i18n (~> 0.7) | ||
json (~> 1.7, >= 1.7.7) | ||
minitest (~> 5.1) | ||
thread_safe (~> 0.3, >= 0.3.4) | ||
tzinfo (~> 1.1) | ||
arel (6.0.0) | ||
builder (3.2.2) | ||
capybara (2.4.4) | ||
mime-types (>= 1.16) | ||
nokogiri (>= 1.3.3) | ||
rack (>= 1.0.0) | ||
rack-test (>= 0.5.4) | ||
xpath (~> 2.0) | ||
cliver (0.3.2) | ||
erubis (2.7.0) | ||
globalid (0.3.3) | ||
activesupport (>= 4.1.0) | ||
hike (1.2.3) | ||
i18n (0.7.0) | ||
json (1.8.2) | ||
loofah (2.0.1) | ||
nokogiri (>= 1.5.9) | ||
mail (2.6.3) | ||
mime-types (>= 1.16, < 3) | ||
mime-types (2.4.3) | ||
mini_portile (0.6.2) | ||
minitest (5.5.1) | ||
multi_json (1.10.1) | ||
nokogiri (1.6.6.2) | ||
mini_portile (~> 0.6.0) | ||
poltergeist (1.6.0) | ||
capybara (~> 2.1) | ||
cliver (~> 0.3.1) | ||
multi_json (~> 1.0) | ||
websocket-driver (>= 0.2.0) | ||
rack (1.6.0) | ||
rack-test (0.6.3) | ||
rack (>= 1.0) | ||
rails (4.2.0) | ||
actionmailer (= 4.2.0) | ||
actionpack (= 4.2.0) | ||
actionview (= 4.2.0) | ||
activejob (= 4.2.0) | ||
activemodel (= 4.2.0) | ||
activerecord (= 4.2.0) | ||
activesupport (= 4.2.0) | ||
bundler (>= 1.3.0, < 2.0) | ||
railties (= 4.2.0) | ||
sprockets-rails | ||
rails-deprecated_sanitizer (1.0.3) | ||
activesupport (>= 4.2.0.alpha) | ||
rails-dom-testing (1.0.5) | ||
activesupport (>= 4.2.0.beta, < 5.0) | ||
nokogiri (~> 1.6.0) | ||
rails-deprecated_sanitizer (>= 1.0.1) | ||
rails-html-sanitizer (1.0.1) | ||
loofah (~> 2.0) | ||
railties (4.2.0) | ||
actionpack (= 4.2.0) | ||
activesupport (= 4.2.0) | ||
rake (>= 0.8.7) | ||
thor (>= 0.18.1, < 2.0) | ||
rake (10.4.2) | ||
sass (3.4.12) | ||
sass-rails (5.0.1) | ||
railties (>= 4.0.0, < 5.0) | ||
sass (~> 3.1) | ||
sprockets (>= 2.8, < 4.0) | ||
sprockets-rails (>= 2.0, < 4.0) | ||
tilt (~> 1.1) | ||
sprockets (2.12.3) | ||
hike (~> 1.2) | ||
multi_json (~> 1.0) | ||
rack (~> 1.0) | ||
tilt (~> 1.1, != 1.3.0) | ||
sprockets-rails (2.2.4) | ||
actionpack (>= 3.0) | ||
activesupport (>= 3.0) | ||
sprockets (>= 2.8, < 4.0) | ||
sqlite3 (1.3.10) | ||
thor (0.19.1) | ||
thread_safe (0.3.4) | ||
tilt (1.4.1) | ||
tzinfo (1.2.2) | ||
thread_safe (~> 0.1) | ||
websocket-driver (0.5.1) | ||
websocket-extensions (>= 0.1.0) | ||
websocket-extensions (0.1.1) | ||
xpath (2.0.0) | ||
nokogiri (~> 1.3) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
capybara (>= 2.1) | ||
pdfjs_viewer-rails! | ||
poltergeist (~> 1.5) | ||
sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright 2015 Yves Senn | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# pdfjs_viewer-rails | ||
|
||
## Installation | ||
|
||
Add this line to your application's Gemfile: | ||
|
||
```ruby | ||
gem 'pdfjs_viewer-rails' | ||
``` | ||
|
||
*Note: pdfjs_viewer-rails is still in early development. Please report if you encounter any issues along the way.* | ||
|
||
## Viewer Styles | ||
|
||
This gem ships with two viewer styles: | ||
|
||
**full** | ||
|
||
<p align="center"> | ||
<img | ||
src="https://raw.githubusercontent.com/senny/pdfjs_viewer-rails/master/doc/files/viewer_full.png" | ||
alt="full style"/> | ||
</p> | ||
|
||
**minimal** | ||
|
||
<p align="center"> | ||
<img | ||
src="https://raw.githubusercontent.com/senny/pdfjs_viewer-rails/master/doc/files/viewer_minimal.png" | ||
alt="minimal style"/> | ||
</p> | ||
|
||
## Usage | ||
|
||
### Using the mountable Engine | ||
|
||
The mountable engine makes it extremely simple to integrate the PDF.js viewer | ||
into your application: | ||
|
||
*config/routes.rb* | ||
```ruby | ||
mount PdfjsViewer::Rails::Engine => "/pdfjs", as: 'pdfjs' | ||
``` | ||
|
||
Now you can use a link in your templates to open up the viewer: | ||
|
||
```erb | ||
<%= link_to "display using the full viewer", pdfjs.full_path(file: "/sample.pdf") %> | ||
<%= link_to "display using the minimal viewer", pdfjs.minimal_path(file: "/sample.pdf") %> | ||
``` | ||
|
||
### Using the helper | ||
|
||
If your integration scenario is more complex you may want to consider using the | ||
`pdfjs_viewer` helper. This allows you to embed the viewer into a container like | ||
an iframe. | ||
|
||
```erb | ||
<%= pdfjs_viewer pdf_url: "/sample.pdf", style: :full %> | ||
<%= pdfjs_viewer pdf_url: "/sample.pdf", style: :minimal %> | ||
``` | ||
|
||
NOTE: The helper will render a full HTML document and should not be used in a layout. | ||
|
||
## Development | ||
|
||
Tests can be executed with: | ||
|
||
``` | ||
$ bundle exec rake | ||
``` | ||
|
||
This will render the sample.pdf using phantomjs and save screenshots into `test/sandbox`. | ||
|
||
## License | ||
|
||
pdfjs_viewer-rails is released under the [MIT License](http://www.opensource.org/licenses/MIT). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
begin | ||
require 'bundler/setup' | ||
rescue LoadError | ||
puts 'You must `gem install bundler` and `bundle install` to run rake tasks' | ||
end | ||
|
||
require 'rdoc/task' | ||
|
||
RDoc::Task.new(:rdoc) do |rdoc| | ||
rdoc.rdoc_dir = 'rdoc' | ||
rdoc.title = 'PdfjsViewer' | ||
rdoc.options << '--line-numbers' | ||
rdoc.rdoc_files.include('README.rdoc') | ||
rdoc.rdoc_files.include('lib/**/*.rb') | ||
end | ||
|
||
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) | ||
load 'rails/tasks/engine.rake' | ||
|
||
|
||
load 'rails/tasks/statistics.rake' | ||
|
||
|
||
|
||
Bundler::GemHelper.install_tasks | ||
|
||
require 'rake/testtask' | ||
|
||
Rake::TestTask.new(:test) do |t| | ||
t.libs << 'lib' | ||
t.libs << 'test' | ||
t.pattern = 'test/**/*_test.rb' | ||
t.verbose = false | ||
end | ||
|
||
|
||
task default: :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This is a manifest file that'll be compiled into application.js, which will include all the files | ||
// listed below. | ||
// | ||
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | ||
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. | ||
// | ||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | ||
// compiled file. | ||
// | ||
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details | ||
// about supported directives. | ||
// | ||
//= require pdfjs_viewer/pdfjs/compatibility | ||
//= require pdfjs_viewer/pdfjs/pdf.combined | ||
//= require pdfjs_viewer/pdfjs/l10n | ||
//= require pdfjs_viewer/viewer |
Oops, something went wrong.