You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2017/11/30 08:46:44 UTC
openmeetings git commit: [OPENMEETINGS-1738] fabric.js version is
updated
Repository: openmeetings
Updated Branches:
refs/heads/4.0.x 1b44243e4 -> 1419d7808
[OPENMEETINGS-1738] fabric.js version is updated
Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/1419d780
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/1419d780
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/1419d780
Branch: refs/heads/4.0.x
Commit: 1419d78080a3b13e52c62f0a34234a9eb82d5129
Parents: 1b44243
Author: Maxim Solodovnik <so...@gmail.com>
Authored: Thu Nov 30 15:46:35 2017 +0700
Committer: Maxim Solodovnik <so...@gmail.com>
Committed: Thu Nov 30 15:46:35 2017 +0700
----------------------------------------------------------------------
.../site/resources/images/apache_feather.gif | Bin 4128 -> 0 bytes
.../apache/openmeetings/web/room/wb/fabric.js | 79 +++++++------------
2 files changed, 30 insertions(+), 49 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/1419d780/openmeetings-server/src/site/resources/images/apache_feather.gif
----------------------------------------------------------------------
diff --git a/openmeetings-server/src/site/resources/images/apache_feather.gif b/openmeetings-server/src/site/resources/images/apache_feather.gif
deleted file mode 100644
index 1a0c3e6..0000000
Binary files a/openmeetings-server/src/site/resources/images/apache_feather.gif and /dev/null differ
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/1419d780/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/fabric.js
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/fabric.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/fabric.js
index af55bf1..2e98007 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/fabric.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/fabric.js
@@ -2,7 +2,7 @@
/* build: `node build.js modules=ALL exclude=gestures,accessors minifier=uglifyjs` */
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
-var fabric = fabric || { version: '2.0.0-rc.1' };
+var fabric = fabric || { version: '2.0.0-rc.3' };
if (typeof exports !== 'undefined') {
exports.fabric = fabric;
}
@@ -20,6 +20,7 @@ else {
FetchExternalResources: ['img']
}
});
+ fabric.jsdomImplForWrapper = require('jsdom/lib/jsdom/living/generated/utils').implForWrapper;
fabric.window = fabric.document.defaultView;
DOMParser = require('xmldom').DOMParser;
}
@@ -8041,6 +8042,16 @@ fabric.ElementsParser.prototype.checkIfDone = function() {
*/
fabric.StaticCanvas.prototype.toJSON = fabric.StaticCanvas.prototype.toObject;
+ if (fabric.isLikelyNode) {
+ fabric.StaticCanvas.prototype.createPNGStream = function() {
+ var impl = fabric.jsdomImplForWrapper(this.lowerCanvasEl);
+ return impl && impl.createPNGStream();
+ };
+ fabric.StaticCanvas.prototype.createJPEGStream = function(opts) {
+ var impl = fabric.jsdomImplForWrapper(this.lowerCanvasEl);
+ return impl && impl.createJPEGStream(opts);
+ };
+ }
})();
@@ -19411,7 +19422,6 @@ fabric.util.object.extend(fabric.StaticCanvas.prototype, /** @lends fabric.Stati
'use strict';
-
/**
* Tests if webgl supports certain precision
* @param {WebGL} Canvas WebGL context to test on
@@ -19974,6 +19984,8 @@ fabric.Image.filters.BaseFilter = fabric.util.createClass(/** @lends fabric.Imag
* @param {String} vertexSource vertexShader source for compilation
*/
createProgram: function(gl, fragmentSource, vertexSource) {
+ fragmentSource = fragmentSource || this.fragmentSource;
+ vertexSource = vertexSource || this.vertexSource;
if (fabric.webGlPrecision !== 'highp'){
fragmentSource = fragmentSource.replace(
/precision highp float/g,
@@ -19981,23 +19993,23 @@ fabric.Image.filters.BaseFilter = fabric.util.createClass(/** @lends fabric.Imag
);
}
var vertexShader = gl.createShader(gl.VERTEX_SHADER);
- gl.shaderSource(vertexShader, vertexSource || this.vertexSource);
+ gl.shaderSource(vertexShader, vertexSource);
gl.compileShader(vertexShader);
if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
throw new Error(
// eslint-disable-next-line prefer-template
- 'Vertex shader compile error for "${this.type}": ' +
+ 'Vertex shader compile error for ' + this.type + ': ' +
gl.getShaderInfoLog(vertexShader)
);
}
var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
- gl.shaderSource(fragmentShader, fragmentSource || this.fragmentSource);
+ gl.shaderSource(fragmentShader, fragmentSource);
gl.compileShader(fragmentShader);
if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
throw new Error(
// eslint-disable-next-line prefer-template
- 'Fragment shader compile error for "${this.type}": ' +
+ 'Fragment shader compile error for ' + this.type + ': ' +
gl.getShaderInfoLog(fragmentShader)
);
}
@@ -20995,8 +21007,8 @@ fabric.Image.filters.BaseFilter.fromObject = function(object, callback) {
*/
retrieveShader: function(options) {
var cacheKey = this.type + '_' + this.mode;
- var shaderSource = this.fragmentSource[this.mode];
if (!options.programCache.hasOwnProperty(cacheKey)) {
+ var shaderSource = this.fragmentSource[this.mode];
options.programCache[cacheKey] = this.createProgram(options.context, shaderSource);
}
return options.programCache[cacheKey];
@@ -27328,57 +27340,27 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
},
/**
- * Removes characters selected by selection
- * @param {Event} e Event object
+ * Removes characters from start/end
+ * start/end ar per grapheme position in _text array.
+ *
+ * @param {Number} start
+ * @param {Number} end default to start + 1
*/
- removeChars: function(e) {
- if (this.selectionStart === this.selectionEnd) {
- this._removeCharsNearCursor(e);
- }
- else {
- this._removeCharsFromTo(this.selectionStart, this.selectionEnd);
+ removeChars: function(start, end) {
+ if (typeof end === 'undefined') {
+ end = start + 1;
}
-
+ this.removeStyleFromTo(start, end);
+ this._text.splice(start, end - start);
+ this.text = this._text.join('');
this.set('dirty', true);
- this.setSelectionEnd(this.selectionStart);
-
this._removeExtraneousStyles();
if (this._shouldClearDimensionCache()) {
this.initDimensions();
this.setCoords();
}
- this.canvas && this.canvas.requestRenderAll();
- this.fire('changed');
- this.canvas && this.canvas.fire('text:changed', { target: this });
},
- /**
- * @private
- * @param {Event} e Event object
- */
- _removeCharsNearCursor: function(e) {
- if (this.selectionStart === 0) {
- return;
- }
- if (e.metaKey) {
- // remove all till the start of current line
- var leftLineBoundary = this.findLineBoundaryLeft(this.selectionStart);
-
- this._removeCharsFromTo(leftLineBoundary, this.selectionStart);
- this.setSelectionStart(leftLineBoundary);
- }
- else if (e.altKey) {
- // remove all till the start of current word
- var leftWordBoundary = this.findWordBoundaryLeft(this.selectionStart);
-
- this._removeCharsFromTo(leftWordBoundary, this.selectionStart);
- this.setSelectionStart(leftWordBoundary);
- }
- else {
- this._removeSingleCharAndStyle(this.selectionStart);
- this.setSelectionStart(this.selectionStart - 1);
- }
- }
});
@@ -28049,4 +28031,3 @@ fabric.util.object.extend(fabric.IText.prototype, /** @lends fabric.IText.protot
});
})();
-