-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.js
71 lines (49 loc) · 1.65 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
'use strict';
var Funnel = require('broccoli-funnel');
var mergeTrees = require('broccoli-merge-trees');
module.exports = {
name: 'ember-pdfjs',
treeFor: function(/* tree? */) {
var trees = [];
trees.push(this._super.treeFor.apply(this, arguments));
var PDFJS = new Funnel('bower_components/pdfjs-dist/build',{
srcDir: '/',
include: ['pdf.js','pdf.worker.js'],
destDir: '/'
});
trees.push(PDFJS);
var PDFJSExtras = new Funnel('bower_components/pdfjs-dist/web',{
srcDir: '/',
include: ['compatibility.js'],
destDir: '/assets'
});
trees.push(PDFJSExtras)
var PDFJSCmaps = new Funnel('bower_components/pdfjs-dist/cmaps',{
srcDir: '/',
include: ['**/*.bcmap'],
destDir: '/assets/web/cmaps'
});
trees.push(PDFJSCmaps);
return mergeTrees(trees);
},
treeForPublic: function(tree) {
var trees = [];
trees.push(this._super.treeForPublic.apply(this, arguments));
var publicFiles = new Funnel(tree, {
srcDir: '/',
include: ['test.pdf'],
destDir: '/assets'
});
trees.push(publicFiles);
return mergeTrees(trees);
},
included: function(app, parentAddon) {
this._super.included.apply(this, arguments);
var target = (parentAddon || app);
target.import(target.bowerDirectory + '/pdfjs-dist/build/pdf.js');
target.import(target.bowerDirectory + '/pdfjs-dist/build/pdf.worker.js');
target.import(target.bowerDirectory + '/pdfjs-dist/web/pdf_viewer.css');
target.import(target.bowerDirectory + '/pdfjs-dist/web/pdf_viewer.js');
target.import('vendor/ember-pdfjs.css');
}
}