fire: Switched to plugin-bundle
This commit is contained in:
parent
9907fb371c
commit
79f27d2efa
18 changed files with 1123 additions and 238 deletions
|
@ -7,93 +7,24 @@
|
|||
<body>
|
||||
<div id="svg"></div>
|
||||
<script type="text/javascript" src="freesewing.js"></script>
|
||||
<script type="text/javascript" src="tmp/cutonfold.js"></script>
|
||||
<script type="text/javascript" src="tmp/grainline.js"></script>
|
||||
<script type="text/javascript" src="tmp/dimension.js"></script>
|
||||
<script type="text/javascript" src="tmp/logo.js"></script>
|
||||
<script type="text/javascript" src="tmp/title.js"></script>
|
||||
<script type="text/javascript" src="bundle.js"></script>
|
||||
<script type="text/javascript" src="dist/browser.js"></script>
|
||||
<script type="text/javascript" src="tmp/theme.js"></script>
|
||||
<script type="text/javascript" src="tmp/designer.js"></script>
|
||||
<script type="text/javascript" src="tmp/debug.js"></script>
|
||||
<script type="text/javascript" src="tmp/models.js"></script>
|
||||
<script type="text/javascript" src="tmp/validate.js"></script>
|
||||
<script type="text/javascript" src="tmp/antmantest.js"></script>
|
||||
<script>
|
||||
var debug = {
|
||||
name: 'debug',
|
||||
hooks: {
|
||||
debug: function (next, d='',e='',b='',u='',g='') {
|
||||
console.log('%cDebug', 'color: #dd69dd; font-weight: bold', d,e,b,u,g);
|
||||
next();
|
||||
}
|
||||
}
|
||||
};
|
||||
var pattern = freesewing.patterns.brian
|
||||
.with(debug)
|
||||
.with(freesewing.plugins.debug)
|
||||
.with(freesewing.plugins.theme)
|
||||
//.with(freesewing.plugins.designer)
|
||||
/*
|
||||
pattern.on('preSample', function(next) {
|
||||
console.log('preSample hook');
|
||||
next();
|
||||
});
|
||||
.with(freesewing.plugins.designer)
|
||||
.with(freesewing.plugins.validate)
|
||||
;
|
||||
|
||||
pattern.on('postSample', function(next) {
|
||||
console.log('postSample hook');
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('preDraft', function(next) {
|
||||
console.log('preDraft hook', JSON.parse(JSON.stringify(this)));
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('postDraft', function(next) {
|
||||
console.log('postDraft hook', JSON.parse(JSON.stringify(this)));
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('preRender', function(next) {
|
||||
console.log('preRender hook', this);
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('postRender', function(next) {
|
||||
console.log('postRender hook', this);
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('preDraft', function(next) {
|
||||
console.log('%cpreDraft hook', 'color: red', this);
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('postDraft', function(next) {
|
||||
console.log('%cpostDraft hook', 'color: red', this);
|
||||
next();
|
||||
});
|
||||
|
||||
pattern.on('insertText', function(next) {
|
||||
console.log('%cinsertText hook', 'color: red', this.text);
|
||||
this.text = this.text.toUpperCase();
|
||||
next();
|
||||
});
|
||||
*/
|
||||
pattern.on('preDraft', function(next) {
|
||||
console.log('%cpreDraft hook', 'color: red', this);
|
||||
for(let m in this.config.measurements) {
|
||||
let measurement = this.config.measurements[m];
|
||||
if(!this.context.settings.measurements[measurement]) {
|
||||
this.debug('Missing measurement:', measurement);
|
||||
this.debug('All measurements:', this.settings.measurements);
|
||||
throw `Missing measurement: ${measurement}`;
|
||||
}
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
//pattern.settings.paperless = true;
|
||||
|
||||
pattern.settings.measurements = freesewing.models.men.manSize36;
|
||||
pattern.settings.paperless = true;
|
||||
pattern.settings.measurements = freesewing.models.men.manSize36;
|
||||
|
||||
pattern.settings.sa = 10;
|
||||
pattern.settings.units = 'metric';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue