Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use enhancedTextSelection of pdfjs #534

Merged
merged 1 commit into from
Sep 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/directives/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,14 @@ export default function(app) {
container: this.element[0],
textContent: this.textContent,
viewport,
enhanceTextSelection: true,
});

// wait for renderTask
await this.renderTask;

this.renderTask.expandTextDivs(true);

// normalize the DOM subtree of the rendered page
// (otherwise serialized ranges may be based on different DOM states)
this.element[0].normalize();
Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ gulp.task('vendor', [], function() {
var mathjax = gulp.src(mathjaxSrc, {base: mathjaxBase})
.pipe(gulp.dest(buildDir + '/assets/mathjax'));

var pdfjs = gulp.src('jspm_packages/github/mozilla/[email protected].389/build/pdf.worker.js')
var pdfjs = gulp.src('jspm_packages/github/mozilla/[email protected].415/build/pdf.worker.js')
.pipe(dev ? gutil.noop() : streamify(uglify({
// disable compression, otherwise pdf rendering fails!
// see https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#minified
Expand Down
3 changes: 2 additions & 1 deletion jspm.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ SystemJS.config({
"kramed": "npm:[email protected]",
"leaflet": "github:Leaflet/[email protected]",
"lodash": "npm:[email protected]",
"mozilla/pdfjs-dist": "github:mozilla/[email protected]",
"os": "github:jspm/[email protected]",
"paperhive-sources": "npm:[email protected]",
"path": "github:jspm/[email protected]",
"pdfjs-dist": "github:mozilla/[email protected].389",
"pdfjs-dist": "github:mozilla/[email protected].415",
"process": "github:jspm/[email protected]",
"rangy": "github:timdown/[email protected]",
"readline": "github:jspm/[email protected]",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"angular-sanitize": "github:angular/bower-angular-sanitize@^1.5.8",
"jquery": "npm:jquery@^3.1.0",
"lodash": "npm:lodash@^4.15.0",
"mozilla/pdfjs-dist": "github:mozilla/pdfjs-dist@^1.5.415",
"paperhive-sources": "npm:paperhive-sources@^4.0.2",
"pdfjs-dist": "github:mozilla/pdfjs-dist@^1.5.389",
"rangy": "github:timdown/rangy-release@^1.3.0",
Expand Down Expand Up @@ -188,7 +189,7 @@
}
}
},
"github:mozilla/[email protected].389": {
"github:mozilla/[email protected].415": {
"meta": {
"web/compatibility.js": {
"format": "global"
Expand Down