Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
Former-commit-id: a3e3b528d87dd8ebaabbddee4a5225907c8cdacc
  • Loading branch information
funige committed Nov 16, 2018
1 parent 7fefd5a commit 5270c98
Show file tree
Hide file tree
Showing 18 changed files with 248 additions and 58 deletions.
Binary file added Design/ViewerButtons.psd
Binary file not shown.
Binary file added Design/viewer-minus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Design/viewer-play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Design/viewer-plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Design/viewer-rewind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Design/viewer-stop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 30 additions & 6 deletions neo/assets/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,31 @@ Neo.ActionManager = function() {
this._pause = false;
this._seek = 0;
this._mark = 0;
this._speed = 3;
}

this._speedTable = [-1, 0, 1, 11];
this._speed = parseInt(Neo.config.speed || 0);
this._speedMode = this.generateSpeedTable();
};

Neo.ActionManager.prototype.generateSpeedTable = function() {
var speed = this._speed;
var mode = 0;

if (speed < 0) {
mode = 0;

} else if (speed == 0) {
mode = 1;

} else if (speed <= 10) {
mode = 2;

} else {
mode = 3;
}
this._speedTable[mode] = speed;
return mode;
};

Neo.ActionManager.prototype.step = function() {
if (!Neo.animation) return;
Expand All @@ -25,23 +48,23 @@ Neo.ActionManager.prototype.step = function() {
}
this._items.push([]);
this._head++;
}
};

Neo.ActionManager.prototype.back = function() {
if (!Neo.animation) return;

if (this._head > 0) {
this._head--;
}
}
};

Neo.ActionManager.prototype.forward = function() {
if (!Neo.animation) return;

if (this._head < this._items.length) {
this._head++;
}
}
};

Neo.ActionManager.prototype.push = function() {
if (!Neo.animation) return;
Expand Down Expand Up @@ -756,7 +779,8 @@ Neo.startViewer = function() {
Neo.painter.onrewind();
}
new Neo.ViewerButton().init("viewerSpeed").onmouseup = function() {
console.log('speed');
Neo.painter.onspeed();
this.update();
};
new Neo.ViewerButton().init("viewerPlus").onmouseup = function() {
new Neo.ZoomPlusCommand(Neo.painter).execute();
Expand Down
3 changes: 1 addition & 2 deletions neo/assets/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ document.addEventListener("DOMContentLoaded", function() {

var Neo = function() {};

Neo.version = "1.4.11";
Neo.version = "1.4.12";
Neo.painter;
Neo.fullScreen = false;
Neo.uploaded = false;
Expand Down Expand Up @@ -683,7 +683,6 @@ Neo.resizeCanvas = function() {
height = Math.floor(height / 2) * 2;

if (Neo.viewer) {
console.log(canvasWidth, canvasHeight, width, height);
width = canvasWidth;
height = canvasHeight;
}
Expand Down
8 changes: 8 additions & 0 deletions neo/assets/painter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2578,6 +2578,14 @@ Neo.Painter.prototype.onstop = function() {
this._actionMgr._pause = true;
};

Neo.Painter.prototype.onspeed = function() {
var mgr = Neo.painter._actionMgr;
var mode = (mgr._speedMode + 1) % 4;
mgr._speedMode = mode;
mgr._speed = mgr._speedTable[mode];
console.log('speed=', mgr._speed);
};

Neo.Painter.prototype.setCurrent = function(item) {
var color = this._currentColor;
var mask = this._currentMask;
Expand Down
13 changes: 10 additions & 3 deletions neo/assets/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -1275,13 +1275,20 @@ Neo.ViewerButton.prototype.init = function(name, params) {
}.bind(this);

} else {
var speedString = Neo.translate(Neo.ViewerButton.speedStrings[1]);
this.element.innerHTML = "<div>" + speedString + "</div>";
this.element.innerHTML += "<canvas width=24 height=24></canvas>"
this.element.innerHTML = "<div></div><canvas width=24 height=24></canvas>"
this.update();
}
return this;
};

Neo.ViewerButton.prototype.update = function() {
if (this.name == "viewerSpeed") {
var mode = Neo.painter._actionMgr._speedMode;
var speedString = Neo.translate(Neo.ViewerButton.speedStrings[mode]);
this.element.children[0].innerHTML = "<div>" + speedString + "</div>";
}
};

Neo.ViewerButton.minus = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEX/////HgA/G9hMAAAAAXRSTlMAQObYZgAAABFJREFUCNdjYMAG5H+AEDYAADOnAi81ABEKAAAAAElFTkSuQmCC";

Neo.ViewerButton.plus = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX/////HgD/HgAvnCBAAAAAAnRSTlMAAHaTzTgAAAAfSURBVAjXY2BAA0wTMAimVasaIARj2FQHCIGkBAUAAGm3CXHeKF1tAAAAAElFTkSuQmCC";
Expand Down
File renamed without changes.
60 changes: 49 additions & 11 deletions neo/dist/PaintBBS-1.4.11.js → neo/dist/PaintBBS-1.4.12.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ document.addEventListener("DOMContentLoaded", function() {

var Neo = function() {};

Neo.version = "1.4.11";
Neo.version = "1.4.12";
Neo.painter;
Neo.fullScreen = false;
Neo.uploaded = false;
Expand Down Expand Up @@ -683,7 +683,6 @@ Neo.resizeCanvas = function() {
height = Math.floor(height / 2) * 2;

if (Neo.viewer) {
console.log(canvasWidth, canvasHeight, width, height);
width = canvasWidth;
height = canvasHeight;
}
Expand Down Expand Up @@ -3780,6 +3779,14 @@ Neo.Painter.prototype.onstop = function() {
this._actionMgr._pause = true;
};

Neo.Painter.prototype.onspeed = function() {
var mgr = Neo.painter._actionMgr;
var mode = (mgr._speedMode + 1) % 4;
mgr._speedMode = mode;
mgr._speed = mgr._speedTable[mode];
console.log('speed=', mgr._speed);
};

Neo.Painter.prototype.setCurrent = function(item) {
var color = this._currentColor;
var mask = this._currentMask;
Expand Down Expand Up @@ -5219,8 +5226,31 @@ Neo.ActionManager = function() {
this._pause = false;
this._seek = 0;
this._mark = 0;
this._speed = 3;
}

this._speedTable = [-1, 0, 1, 11];
this._speed = parseInt(Neo.config.speed || 0);
this._speedMode = this.generateSpeedTable();
};

Neo.ActionManager.prototype.generateSpeedTable = function() {
var speed = this._speed;
var mode = 0;

if (speed < 0) {
mode = 0;

} else if (speed == 0) {
mode = 1;

} else if (speed <= 10) {
mode = 2;

} else {
mode = 3;
}
this._speedTable[mode] = speed;
return mode;
};

Neo.ActionManager.prototype.step = function() {
if (!Neo.animation) return;
Expand All @@ -5230,23 +5260,23 @@ Neo.ActionManager.prototype.step = function() {
}
this._items.push([]);
this._head++;
}
};

Neo.ActionManager.prototype.back = function() {
if (!Neo.animation) return;

if (this._head > 0) {
this._head--;
}
}
};

Neo.ActionManager.prototype.forward = function() {
if (!Neo.animation) return;

if (this._head < this._items.length) {
this._head++;
}
}
};

Neo.ActionManager.prototype.push = function() {
if (!Neo.animation) return;
Expand Down Expand Up @@ -5961,7 +5991,8 @@ Neo.startViewer = function() {
Neo.painter.onrewind();
}
new Neo.ViewerButton().init("viewerSpeed").onmouseup = function() {
console.log('speed');
Neo.painter.onspeed();
this.update();
};
new Neo.ViewerButton().init("viewerPlus").onmouseup = function() {
new Neo.ZoomPlusCommand(Neo.painter).execute();
Expand Down Expand Up @@ -7340,13 +7371,20 @@ Neo.ViewerButton.prototype.init = function(name, params) {
}.bind(this);

} else {
var speedString = Neo.translate(Neo.ViewerButton.speedStrings[1]);
this.element.innerHTML = "<div>" + speedString + "</div>";
this.element.innerHTML += "<canvas width=24 height=24></canvas>"
this.element.innerHTML = "<div></div><canvas width=24 height=24></canvas>"
this.update();
}
return this;
};

Neo.ViewerButton.prototype.update = function() {
if (this.name == "viewerSpeed") {
var mode = Neo.painter._actionMgr._speedMode;
var speedString = Neo.translate(Neo.ViewerButton.speedStrings[mode]);
this.element.children[0].innerHTML = "<div>" + speedString + "</div>";
}
};

Neo.ViewerButton.minus = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEX/////HgA/G9hMAAAAAXRSTlMAQObYZgAAABFJREFUCNdjYMAG5H+AEDYAADOnAi81ABEKAAAAAElFTkSuQmCC";

Neo.ViewerButton.plus = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX/////HgD/HgAvnCBAAAAAAnRSTlMAAHaTzTgAAAAfSURBVAjXY2BAA0wTMAimVasaIARj2FQHCIGkBAUAAGm3CXHeKF1tAAAAAElFTkSuQmCC";
Expand Down
60 changes: 49 additions & 11 deletions neo/dist/neo.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ document.addEventListener("DOMContentLoaded", function() {

var Neo = function() {};

Neo.version = "1.4.11";
Neo.version = "1.4.12";
Neo.painter;
Neo.fullScreen = false;
Neo.uploaded = false;
Expand Down Expand Up @@ -683,7 +683,6 @@ Neo.resizeCanvas = function() {
height = Math.floor(height / 2) * 2;

if (Neo.viewer) {
console.log(canvasWidth, canvasHeight, width, height);
width = canvasWidth;
height = canvasHeight;
}
Expand Down Expand Up @@ -3780,6 +3779,14 @@ Neo.Painter.prototype.onstop = function() {
this._actionMgr._pause = true;
};

Neo.Painter.prototype.onspeed = function() {
var mgr = Neo.painter._actionMgr;
var mode = (mgr._speedMode + 1) % 4;
mgr._speedMode = mode;
mgr._speed = mgr._speedTable[mode];
console.log('speed=', mgr._speed);
};

Neo.Painter.prototype.setCurrent = function(item) {
var color = this._currentColor;
var mask = this._currentMask;
Expand Down Expand Up @@ -5219,8 +5226,31 @@ Neo.ActionManager = function() {
this._pause = false;
this._seek = 0;
this._mark = 0;
this._speed = 3;
}

this._speedTable = [-1, 0, 1, 11];
this._speed = parseInt(Neo.config.speed || 0);
this._speedMode = this.generateSpeedTable();
};

Neo.ActionManager.prototype.generateSpeedTable = function() {
var speed = this._speed;
var mode = 0;

if (speed < 0) {
mode = 0;

} else if (speed == 0) {
mode = 1;

} else if (speed <= 10) {
mode = 2;

} else {
mode = 3;
}
this._speedTable[mode] = speed;
return mode;
};

Neo.ActionManager.prototype.step = function() {
if (!Neo.animation) return;
Expand All @@ -5230,23 +5260,23 @@ Neo.ActionManager.prototype.step = function() {
}
this._items.push([]);
this._head++;
}
};

Neo.ActionManager.prototype.back = function() {
if (!Neo.animation) return;

if (this._head > 0) {
this._head--;
}
}
};

Neo.ActionManager.prototype.forward = function() {
if (!Neo.animation) return;

if (this._head < this._items.length) {
this._head++;
}
}
};

Neo.ActionManager.prototype.push = function() {
if (!Neo.animation) return;
Expand Down Expand Up @@ -5961,7 +5991,8 @@ Neo.startViewer = function() {
Neo.painter.onrewind();
}
new Neo.ViewerButton().init("viewerSpeed").onmouseup = function() {
console.log('speed');
Neo.painter.onspeed();
this.update();
};
new Neo.ViewerButton().init("viewerPlus").onmouseup = function() {
new Neo.ZoomPlusCommand(Neo.painter).execute();
Expand Down Expand Up @@ -7340,13 +7371,20 @@ Neo.ViewerButton.prototype.init = function(name, params) {
}.bind(this);

} else {
var speedString = Neo.translate(Neo.ViewerButton.speedStrings[1]);
this.element.innerHTML = "<div>" + speedString + "</div>";
this.element.innerHTML += "<canvas width=24 height=24></canvas>"
this.element.innerHTML = "<div></div><canvas width=24 height=24></canvas>"
this.update();
}
return this;
};

Neo.ViewerButton.prototype.update = function() {
if (this.name == "viewerSpeed") {
var mode = Neo.painter._actionMgr._speedMode;
var speedString = Neo.translate(Neo.ViewerButton.speedStrings[mode]);
this.element.children[0].innerHTML = "<div>" + speedString + "</div>";
}
};

Neo.ViewerButton.minus = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEX/////HgA/G9hMAAAAAXRSTlMAQObYZgAAABFJREFUCNdjYMAG5H+AEDYAADOnAi81ABEKAAAAAElFTkSuQmCC";

Neo.ViewerButton.plus = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAgMAAABinRfyAAAACVBMVEX/////HgD/HgAvnCBAAAAAAnRSTlMAAHaTzTgAAAAfSURBVAjXY2BAA0wTMAimVasaIARj2FQHCIGkBAUAAGm3CXHeKF1tAAAAAElFTkSuQmCC";
Expand Down
2 changes: 1 addition & 1 deletion neo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PaintBBS",
"version": "1.4.11",
"version": "1.4.12",
"main": "main.js",
"scripts": {
"hello": "echo 'hello'"
Expand Down
File renamed without changes.
Loading

0 comments on commit 5270c98

Please sign in to comment.