started implementing new page feature
This commit is contained in:
parent
24601c2c6c
commit
3d44b680c4
@ -379,6 +379,11 @@ $(document).ready(function () {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// add page
|
||||||
|
$("#addPageBtn").click(function () {
|
||||||
|
whiteboard.addPage();
|
||||||
|
});
|
||||||
|
|
||||||
// upload json containing steps
|
// upload json containing steps
|
||||||
$("#uploadJsonBtn").click(function () {
|
$("#uploadJsonBtn").click(function () {
|
||||||
$("#myFile").click();
|
$("#myFile").click();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
var whiteboard = {
|
var whiteboard = {
|
||||||
isMultiTouch: false,
|
isMultiTouch: false,
|
||||||
|
pages: 1,
|
||||||
canvas: null,
|
canvas: null,
|
||||||
ctx: null,
|
ctx: null,
|
||||||
drawcolor: "black",
|
drawcolor: "black",
|
||||||
@ -70,15 +71,15 @@ var whiteboard = {
|
|||||||
.append(_this.textContainer)
|
.append(_this.textContainer)
|
||||||
.append(_this.mouseOverlay);
|
.append(_this.mouseOverlay);
|
||||||
this.canvas = $("#whiteboardCanvas")[0];
|
this.canvas = $("#whiteboardCanvas")[0];
|
||||||
this.canvas.height = $(window).height();
|
|
||||||
this.canvas.width = $(window).width();
|
this.canvas.width = $(window).width();
|
||||||
|
this.canvas.height = $(window).height() * pages;
|
||||||
this.ctx = this.canvas.getContext("2d");
|
this.ctx = this.canvas.getContext("2d");
|
||||||
this.oldGCO = this.ctx.globalCompositeOperation;
|
this.oldGCO = this.ctx.globalCompositeOperation;
|
||||||
|
|
||||||
$(window).resize(function () { //Handle resize
|
$(window).resize(function () { //Handle resize
|
||||||
var dbCp = JSON.parse(JSON.stringify(_this.drawBuffer)); //Copy the buffer
|
var dbCp = JSON.parse(JSON.stringify(_this.drawBuffer)); //Copy the buffer
|
||||||
_this.canvas.width = $(window).width();
|
_this.canvas.width = $(window).width();
|
||||||
_this.canvas.height = $(window).height(); //Set new canvas height
|
_this.canvas.height = $(window).height() * pages; //Set new canvas height
|
||||||
_this.drawBuffer = [];
|
_this.drawBuffer = [];
|
||||||
_this.loadData(dbCp); //draw old content in
|
_this.loadData(dbCp); //draw old content in
|
||||||
});
|
});
|
||||||
@ -622,6 +623,10 @@ var whiteboard = {
|
|||||||
_this.drawBuffer = [];
|
_this.drawBuffer = [];
|
||||||
_this.drawId = 0;
|
_this.drawId = 0;
|
||||||
},
|
},
|
||||||
|
addPage: function () {
|
||||||
|
pages += 1;
|
||||||
|
|
||||||
|
},
|
||||||
setStrokeThickness(thickness) {
|
setStrokeThickness(thickness) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
_this.thickness = thickness;
|
_this.thickness = thickness;
|
||||||
|
Loading…
Reference in New Issue
Block a user