-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·47 lines (41 loc) · 1.77 KB
/
build.sh
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
mkdir -p build/
cp jsPlumb/src/*.js build/
cp jsPlumb/lib/*.js build/
cd build
replace ';\(function\(\) {' ';(function(global) {' *.js
replace '^}\)\(\);' '})(typeof exports !== 'undefined' ? exports : this);'
replace '^\s*}\)\.call\(this\);' '})(typeof exports !== 'undefined' ? exports : this);'
replace 'window\.' 'global.'
replace 'root = this' 'root = global';
replace '_ju = jsPlumbUtil' '_ju = global.jsPlumbUtil'
replace 'jsPlumbUtil\.' 'global.jsPlumbUtil.'
replace '\sjsPlumbAdapter' ' global.jsPlumbAdapter'
replace '\sjsPlumb\.' ' global.jsPlumb.'
replace '\sjsPlumbInstance\.' ' global.jsPlumbInstance.'
replace '(jsPlumbInstance\.' '(global.jsPlumbInstance.'
replace '!jsPlumb' '!global.jsPlumb'
replace '\(jsPlumb\.' '(global.jsPlumb.'
replace '\[jsPlumb\.' '[global.jsPlumb.'
replace ' == null' ' === null'
replace ' != null' ' !== null'
replace 'e== null' ' === null'
replace 'OverlayCapableJsPlumbUIComponent' 'global.OverlayCapableJsPlumbUIComponent'
replace 'jsPlumbInstance.prototype' 'global.jsPlumbInstance.prototype'
replace 'global.global' 'global'
# replace compat bit
replace -m '^.*AMD(.|\n)*AMD.*-\s+$' 'global.jsPlumb = new global.jsPlumbInstance(); global.jsPlumb.getInstance = function(_defaults) { var j = new global.jsPlumbInstance(_defaults); j.init(); return j; };'
replace 'global\.OverlayCapableJsPlumbUIComponent = global\.OverlayCapableJsPlumbUIComponent' 'OverlayCapableJsPlumbUIComponent = global.OverlayCapableJsPlumbUIComponent'
cat \
jsBezier-0.6.js biltong*.js \
mottle*.js katavorio*.js \
util.js browser-util.js \
dom-adapter.js jsPlumb.js \
endpoint.js connection.js \
anchors.js defaults.js \
base-library-adapter.js \
connectors-flowchart.js \
connectors-statemachine.js \
connectors-bezier.js \
renderers-svg.js \
> ../index.js
cd ../