2018-07-26 07:18:21 +00:00
|
|
|
import style from "./lib/style";
|
2018-08-07 16:50:10 +02:00
|
|
|
import { version, name } from "../package.json";
|
2018-07-22 18:54:58 +02:00
|
|
|
|
2018-07-26 07:18:21 +00:00
|
|
|
export default {
|
2018-08-07 16:50:10 +02:00
|
|
|
name: name,
|
|
|
|
version: version,
|
2018-07-22 18:54:58 +02:00
|
|
|
hooks: {
|
|
|
|
preRenderSvg: function(next) {
|
2018-07-26 07:18:21 +00:00
|
|
|
this.attributes.add("freesewing:plugin-title", version);
|
2018-07-22 18:54:58 +02:00
|
|
|
this.style += style;
|
|
|
|
next();
|
|
|
|
}
|
2018-07-26 07:18:21 +00:00
|
|
|
},
|
|
|
|
macros: {
|
2018-08-05 13:09:09 +02:00
|
|
|
title: function(so) {
|
2018-08-07 16:50:10 +02:00
|
|
|
let overwrite = true;
|
|
|
|
if (so.append) overwrite = false;
|
|
|
|
so.at
|
|
|
|
.attr("data-text", so.nr, overwrite)
|
|
|
|
.attr("data-text-class", "title-nr note fill-note");
|
2018-07-26 07:18:21 +00:00
|
|
|
this.points.titleName = so.at
|
|
|
|
.shift(-90, 13)
|
2018-08-07 16:50:10 +02:00
|
|
|
.attr("data-text", so.title)
|
2018-07-26 07:18:21 +00:00
|
|
|
.attr("data-text-class", "title-name");
|
|
|
|
this.points.titlePattern = so.at
|
|
|
|
.shift(-90, 20)
|
|
|
|
.attr(
|
|
|
|
"data-text",
|
|
|
|
this.context.config.name + " v" + this.context.config.version
|
|
|
|
)
|
|
|
|
.attr("data-text-class", "title-pattern fill-note");
|
2018-07-22 18:54:58 +02:00
|
|
|
}
|
|
|
|
}
|
2018-07-26 07:18:21 +00:00
|
|
|
};
|