Commit b9a86427 authored by Carsten  Rose's avatar Carsten Rose

Merge branch 'b9329-annotations' into 'master'

B9329 annotations

See merge request !185
parents 6c009759 a7af9c89
Pipeline #2504 passed with stages
in 2 minutes and 35 seconds
......@@ -47,6 +47,7 @@ composer.lock
/Documentation-develop/plantuml
/extension/vendor
/extension/Documentation/_make
/extension/Resources/Public/Css
/extension/Resources/Public/fonts
/extension/Resources/Public/JavaScript
......@@ -57,3 +58,5 @@ composer.lock
/qfq.flowchart.dia.autosave
/support
/vendor
/javascript/src/.vscode
\ No newline at end of file
......@@ -27,12 +27,12 @@ snapshot:
paths:
- build/
script:
- make VERSION=$VERSION phpunit_snapshot
- chmod a+r qfq_$VERSION_*.zip
- echo "qfq_$VERSION_*.zip qfq_${VERSION}_${RELDATE}-${CI_BUILD_REF_NAME}.zip"
- mv qfq_$VERSION_*.zip qfq_${VERSION}_${RELDATE}-${CI_BUILD_REF_NAME}.zip
- scp qfq_$VERSION_*.zip w16:qfq/snapshots/
- mv qfq_$VERSION_*.zip build/qfq.zip
- make VERSION=${VERSION} phpunit_snapshot
- chmod a+r qfq_${VERSION}_*.zip
- echo "mv qfq_${VERSION}_*.zip qfq_${VERSION}_${RELDATE}-${CI_BUILD_REF_NAME}.zip"
- mv qfq_${VERSION}_*.zip qfq_${VERSION}_${RELDATE}-${CI_BUILD_REF_NAME}.zip
- scp qfq_${VERSION}_*.zip w16:qfq/snapshots/
- mv qfq_${VERSION}_*.zip build/qfq.zip
release:
stage: build
......@@ -43,10 +43,10 @@ release:
paths:
- build/
script:
- make VERSION=$VERSION phpunit_release
- chmod a+r qfq_$VERSION_*.zip
- scp qfq_$VERSION_*.zip w16:qfq/releases/
- mv qfq_$VERSION_*.zip build/qfq.zip
- make VERSION=${VERSION} phpunit_release
- chmod a+r qfq_${VERSION}_*.zip
- scp qfq_${VERSION}_*.zip w16:qfq/releases/
- mv qfq_${VERSION}_*.zip build/qfq.zip
selenium:
stage: selenium
......
......@@ -39,7 +39,6 @@ $(function (n) {
this.panning = false;
this.userText = "";
this.moveMode = false;
this.canvasOriginalHeight = 0;
this.isZoomMode = false;
this.drawRectangleMode = false;
this.drawTextBoxMode = false;
......@@ -285,7 +284,7 @@ $(function (n) {
if (inputField) {
this.outputField = $("#" + inputField);
}
this.getMeta(this.backgroundImage, function(width, height) { that.prepareStaticCanvas(width, height); } );
this.getMeta(this.backgroundImage, function(width, height) { that.prepareCanvas(width, height, true); } );
} else if (editImage) {
this.outputField = $("#" + inputField);
this.imageOutput = $("#" + imageOutput);
......@@ -295,7 +294,7 @@ $(function (n) {
} else {
this.outputField = $("#" + inputField);
this.generateControls();
this.getMeta(this.backgroundImage, function(width, height) { that.prepareCanvas(width, height);});
this.getMeta(this.backgroundImage, function(width, height) { that.prepareCanvas(width, height, false);});
}
//localStorage.clear();
};
......@@ -322,9 +321,9 @@ $(function (n) {
this.emojiContainer = emojiContainer;
};
n.Fabric.prototype.prepareCanvas = function (width, height) {
n.Fabric.prototype.prepareCanvas = function (width, height, isReadOnly) {
var that = this;
this.generateCanvas(width, height);
this.generateCanvas(width, height, isReadOnly);
if (this.outputField.val()) {
var fabricJSON = this.prepareJSON(this.outputField.val());
this.history.put(fabricJSON);
......@@ -332,13 +331,15 @@ $(function (n) {
this.firstLoad = true;
that.setBackground();
that.resizeCanvas();
that.setBrush();
if(!isReadOnly) { that.setBrush(); }
that.canvas.renderAll();
that.userChangePossible = true;
});
} else {
that.setBackground();
that.setBrush();
if(!isReadOnly) {
that.setBackground();
that.setBrush();
}
that.canvas.renderAll();
that.userChangePossible = true;
this.history.put(this.canvas.toJSON());
......@@ -399,40 +400,6 @@ $(function (n) {
});
};
n.Fabric.prototype.prepareStaticCanvas = function(width, height) {
console.log("prepareStaticCanvas");
var that = this;
this.generateStaticCanvas(width, height);
if (this.outputField.val()) {
fabricJSON = this.outputField.val();
} else if (this.fabricJSON) {
fabricJSON = this.fabricJSON;
}
if (fabricJSON) {
this.canvas.loadFromJSON(fabricJSON, function() {
that.firstLoad = true;
that.setBackground();
that.resizeCanvas();
that.canvas.renderAll();
});
} else {
this.setBackground();
this.canvas.renderAll();
}
};
n.Fabric.prototype.generateStaticCanvas = function(width, height) {
var canvas = document.createElement('canvas');
var that = this;
var ratio = height / width;
canvas.width = this.parentElement.innerWidth();
canvas.height = canvas.width * ratio;
this.parentElement.append(canvas);
this.canvas = this.__canvas = new fabric.StaticCanvas(canvas);
this.parentElement.on("click", function(e) { that.toggleObjects(); });
$(window).resize(function() { that.resizeCanvas(); });
};
n.Fabric.prototype.getMeta = function(url, callback) {
var img = new Image();
img.src = url;
......@@ -449,20 +416,25 @@ $(function (n) {
this.canvas.renderAll();
};
n.Fabric.prototype.generateCanvas = function(width, height) {
n.Fabric.prototype.generateCanvas = function(width, height, isReadOnly) {
var canvas = document.createElement('canvas');
canvas.setAttribute('draggable', true);
var that = this;
canvas.id = "c1";
var ratio = height / width;
canvas.width = this.parentElement.innerWidth();
canvas.height = canvas.width * ratio;
this.parentElement.append(canvas);
this.canvas = this.__canvas = new fabric.Canvas(canvas, {
isDrawingMode: true,
stateful: true,
enableRetinaScaling: true
});
if(isReadOnly) {
this.canvas = this.__canvas = new fabric.StaticCanvas(canvas, {
enableRetinaScaling: true
});
} else {
this.canvas = this.__canvas = new fabric.Canvas(canvas, {
isDrawingMode: true,
stateful: true,
enableRetinaScaling: true
});
}
this.canvas.on('mouse:up', function (e) { that.defaultMouseUpEvent(e) });
this.canvas.on('mouse:down', function (e) { that.defaultMouseDownEvent(e) });
this.canvas.on('mouse:move', function (e) { that.defaultMouseMoveEvent(e) });
......@@ -1174,4 +1146,4 @@ $(function (n) {
});
};
}(QfqNS));
\ No newline at end of file
}(QfqNS));
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment