Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib
This commit is contained in:
commit
4d6d2f1df0
6853
dist/iwmlib.3rdparty.js
vendored
6853
dist/iwmlib.3rdparty.js
vendored
File diff suppressed because it is too large
Load Diff
2
dist/iwmlib.3rdparty.min.js
vendored
2
dist/iwmlib.3rdparty.min.js
vendored
File diff suppressed because one or more lines are too long
52
dist/iwmlib.js
vendored
52
dist/iwmlib.js
vendored
@ -608,19 +608,6 @@
|
||||
|
||||
static toLine(event) {
|
||||
return `${event.type} #${event.target.id} ${event.clientX} ${event.clientY}`
|
||||
let result = event.type;
|
||||
let selector = this.selector(event.target);
|
||||
result += ' selector: ' + selector;
|
||||
if (event.target != document.querySelector(selector)) console.log('Cannot resolve', selector);
|
||||
let keys = ['layerX', 'layerY', 'pageX', 'pageY', 'clientX', 'clientY'];
|
||||
for (let key of keys) {
|
||||
try {
|
||||
result += ' ' + key + ':' + event[key];
|
||||
} catch (e) {
|
||||
console.log('Invalid key: ' + key);
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
static compareExtractedWithSimulated() {
|
||||
@ -2640,25 +2627,6 @@
|
||||
result[id] = this.getPosition(event);
|
||||
break
|
||||
}
|
||||
// case 'TouchEvent':
|
||||
// // Needs to be observed: Perhaps changedTouches are all we need. If so
|
||||
// // we can remove the touchEventKey default parameter
|
||||
// if (touchEventKey == 'all') {
|
||||
// for(let t of event.targetTouches) {
|
||||
// result[t.identifier.toString()] = this.getPosition(t)
|
||||
// }
|
||||
// for(let t of event.changedTouches) {
|
||||
// result[t.identifier.toString()] = this.getPosition(t)
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// for(let t of event.changedTouches) {
|
||||
// result[t.identifier.toString()] = this.getPosition(t)
|
||||
// }
|
||||
// }
|
||||
// break
|
||||
default:
|
||||
break
|
||||
}
|
||||
return result
|
||||
}
|
||||
@ -5754,8 +5722,6 @@
|
||||
let bottom = parseFloat(this.element.style.bottom);
|
||||
this.element.style.bottom = bottom - delta.y + 'px';
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
//console.log("onResize", this.onResize)
|
||||
if (this.onResize) {
|
||||
@ -6178,8 +6144,6 @@
|
||||
x = bbRight;
|
||||
if (!this.useEventPosWithBoundingBox) y = (bbTop + bbBottom) / 2;
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@ -6235,8 +6199,6 @@
|
||||
x += this.notchSize * 2;
|
||||
x += this.posOffset;
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
this.placeOrigin(x, y);
|
||||
}
|
||||
@ -11101,20 +11063,6 @@
|
||||
}
|
||||
|
||||
speak() {
|
||||
/**
|
||||
* This is a little bit ugly, but imho the most elegant of all dirty solutions.
|
||||
*
|
||||
5ht * Within the plugins we have no knowledge of other cards and such. But must differentiate the
|
||||
* clicks by their corresponding owner. The SpeechUtterance just takes a text and has no knowledge
|
||||
* about the node that is currently read to the user.
|
||||
*
|
||||
* This means, that we can identify same text, but not differentiate same text on different nodes.
|
||||
* To account for that, we add the node to the speechSynthesis object (#benefitsOfJavaScript) and
|
||||
* have access to the node, by - let's say - expanding the functionality of the SpeechSynthesis object.
|
||||
*
|
||||
* SO -17.07.19
|
||||
*/
|
||||
|
||||
this._updateText();
|
||||
}
|
||||
|
||||
|
99
dist/iwmlib.pixi.js
vendored
99
dist/iwmlib.pixi.js
vendored
@ -1335,19 +1335,6 @@
|
||||
|
||||
static toLine(event) {
|
||||
return `${event.type} #${event.target.id} ${event.clientX} ${event.clientY}`
|
||||
let result = event.type;
|
||||
let selector = this.selector(event.target);
|
||||
result += ' selector: ' + selector;
|
||||
if (event.target != document.querySelector(selector)) console.log('Cannot resolve', selector);
|
||||
let keys = ['layerX', 'layerY', 'pageX', 'pageY', 'clientX', 'clientY'];
|
||||
for (let key of keys) {
|
||||
try {
|
||||
result += ' ' + key + ':' + event[key];
|
||||
} catch (e) {
|
||||
console.log('Invalid key: ' + key);
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
static compareExtractedWithSimulated() {
|
||||
@ -6185,25 +6172,6 @@
|
||||
result[id] = this.getPosition(event);
|
||||
break
|
||||
}
|
||||
// case 'TouchEvent':
|
||||
// // Needs to be observed: Perhaps changedTouches are all we need. If so
|
||||
// // we can remove the touchEventKey default parameter
|
||||
// if (touchEventKey == 'all') {
|
||||
// for(let t of event.targetTouches) {
|
||||
// result[t.identifier.toString()] = this.getPosition(t)
|
||||
// }
|
||||
// for(let t of event.changedTouches) {
|
||||
// result[t.identifier.toString()] = this.getPosition(t)
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// for(let t of event.changedTouches) {
|
||||
// result[t.identifier.toString()] = this.getPosition(t)
|
||||
// }
|
||||
// }
|
||||
// break
|
||||
default:
|
||||
break
|
||||
}
|
||||
return result
|
||||
}
|
||||
@ -16997,7 +16965,7 @@
|
||||
let interactionManager = this.renderer.plugins.interaction;
|
||||
|
||||
let displayObject = interactionManager.hitTest(local, this);
|
||||
if (displayObject != null) {
|
||||
|
||||
if (displayObject.dontBlockScatter && displayObject.parent != null) {
|
||||
displayObject = interactionManager.hitTest(local, displayObject.parent);
|
||||
}
|
||||
@ -17006,6 +16974,7 @@
|
||||
if (this.claimEvents) event.claimedByScatter = this.hitScatter;
|
||||
}
|
||||
|
||||
|
||||
return this.hitScatter
|
||||
}
|
||||
}
|
||||
@ -18299,7 +18268,7 @@
|
||||
|
||||
let containerCenter;
|
||||
if (this.frame) {
|
||||
containerCenter = this.getFrame().localCenter;
|
||||
containerCenter = this.getFrame().center;
|
||||
} else {
|
||||
containerCenter = {
|
||||
x: this.image.parent.width / 2,
|
||||
@ -19104,6 +19073,7 @@
|
||||
this.drawEndHandler = new EventHandler('onDrawEnd', { listeners: onDrawEnd });
|
||||
this._points = null;
|
||||
this._position = null;
|
||||
this.map = null;
|
||||
}
|
||||
|
||||
clone() {
|
||||
@ -19169,6 +19139,7 @@
|
||||
* Called by the containing geo layer, when the map changes.
|
||||
*/
|
||||
adaptTo(map) {
|
||||
this.map = map;
|
||||
this._points = this._adaptCoordinates(map);
|
||||
this._updatePosition();
|
||||
this.draw();
|
||||
@ -19211,6 +19182,19 @@
|
||||
this._layer = layer;
|
||||
}
|
||||
|
||||
// get map() {
|
||||
// if (
|
||||
// this.graphics.layer &&
|
||||
// (this.graphics.layer instanceof GeoLayer || this.graphics.layer instanceof MapLayer)
|
||||
// ) {
|
||||
// return this.graphics.layer.map
|
||||
// } else return null
|
||||
// }
|
||||
|
||||
setLayer(layer) {
|
||||
this._layer = layer;
|
||||
}
|
||||
|
||||
get map() {
|
||||
let map = null;
|
||||
if (this.mapLayer) {
|
||||
@ -19615,7 +19599,7 @@
|
||||
}
|
||||
|
||||
class MapList {
|
||||
constructor(active = null, maps = {}) {
|
||||
constructor(active, maps) {
|
||||
this.maps = maps;
|
||||
this.active = active;
|
||||
|
||||
@ -19656,16 +19640,6 @@
|
||||
return map
|
||||
}
|
||||
|
||||
clone() {
|
||||
let maps = {};
|
||||
|
||||
for (let name of Object.keys(this.maps)) {
|
||||
maps[name] = this.maps[name].clone();
|
||||
}
|
||||
|
||||
return new MapList(this.active, maps)
|
||||
}
|
||||
|
||||
add(key, map) {
|
||||
if (this.maps[key] != null) consol.warn('Key already in mapList. The existing key was overwritten.');
|
||||
map.name = key;
|
||||
@ -19673,14 +19647,15 @@
|
||||
}
|
||||
|
||||
get map() {
|
||||
return this.maps && this.maps[this.active] ? this.maps[this.active] : null
|
||||
console.log(this.maps, this.active);
|
||||
return this.maps[this.active]
|
||||
}
|
||||
|
||||
next() {
|
||||
let keys = Object.keys(this.maps);
|
||||
let idx = keys.indexOf(this.active);
|
||||
|
||||
let next = idx + 1 < keys.length ? keys[idx + 1] : keys[0];
|
||||
let next = idx + 1 < key.length ? keys[idx + 1] : keys[0];
|
||||
console.log(keys, idx, next);
|
||||
return next
|
||||
}
|
||||
@ -19828,19 +19803,6 @@
|
||||
} else console.warn('Tried to remove layer that was not set.', this, layer);
|
||||
}
|
||||
|
||||
remove(graphics) {
|
||||
if (graphics instanceof GeoGraphics) {
|
||||
let index = this.geographics.indexOf(geographics);
|
||||
if (index != -1) {
|
||||
this.displayObject.removeChild(geographics);
|
||||
} else {
|
||||
console.error('Could not remove geographics from geolayer.', this, geographics);
|
||||
}
|
||||
} else {
|
||||
this.displayObject.removeChild(graphics);
|
||||
}
|
||||
}
|
||||
|
||||
set parent(parent) {
|
||||
this._parent = parent;
|
||||
}
|
||||
@ -19907,7 +19869,7 @@
|
||||
mapList,
|
||||
scatterContainer,
|
||||
displayObject,
|
||||
{ onTransform = null, onChange = null, focus = null, zoom = null, viewport = null } = {}
|
||||
{ onTransform = null, onChange = null, focus = null, zoom = null, viewport = null, mapList = null } = {}
|
||||
) {
|
||||
super(displayObject);
|
||||
|
||||
@ -19928,16 +19890,12 @@
|
||||
});
|
||||
|
||||
this.mapList = mapList;
|
||||
this._map = null;
|
||||
|
||||
// //TODO Implement error handling here.
|
||||
// this.maps = maps
|
||||
// if (opts.map) this.placeMap(opts.map)
|
||||
this.dynamicElements = new Map();
|
||||
|
||||
// Binds the transformed callback beforehand.
|
||||
this.transformed = this.transformed.bind(this);
|
||||
|
||||
this.changeMap(mapList.active);
|
||||
}
|
||||
|
||||
adapt() {
|
||||
@ -19987,10 +19945,10 @@
|
||||
/* map ,
|
||||
useScatterAsContainer = true // If set to false, the normal container is used. This is necessary when using submaps and the container need to be a RigidContainer.*/
|
||||
) {
|
||||
console.log('Change map to: ', name);
|
||||
if (map instanceof GeoMap) {
|
||||
console.log('Change map to: ', map);
|
||||
let oldMap = this.map;
|
||||
|
||||
this.mapList.select(name);
|
||||
if (oldMap) oldMap.unload();
|
||||
|
||||
if (oldMap) {
|
||||
oldMap.unload();
|
||||
@ -20005,7 +19963,7 @@
|
||||
console.log(this, this.scatterContainer);
|
||||
this.scatterContainer.addChild(map.image);
|
||||
|
||||
this.mapview.apply(map);
|
||||
this.mapview.apply(this.map);
|
||||
map.image.addChild(this.displayObject);
|
||||
|
||||
// A geolayer's displayObject is on the parent layer.
|
||||
@ -20371,6 +20329,7 @@
|
||||
}
|
||||
|
||||
get map() {
|
||||
console.log(this.mapList);
|
||||
return this.mapList.map
|
||||
}
|
||||
|
||||
|
2158
package-lock.json
generated
2158
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -34,12 +34,12 @@
|
||||
"fs-extra": "^8.0.1",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-prettier": "^2.2.0",
|
||||
"gulp-prettier": "^2.3.0",
|
||||
"gulp-rename": "^1.4.0",
|
||||
"gulp-replace": "^1.0.0",
|
||||
"gulp-uglify": "^3.0.2",
|
||||
"htmlhint": "^0.11.0",
|
||||
"prettier": "^1.18.2",
|
||||
"prettier": "^1.19.1",
|
||||
"puppeteer": "^1.20.0",
|
||||
"stylelint": "^11.1.1",
|
||||
"stylelint-config-standard": "^19.0.0"
|
||||
@ -54,7 +54,7 @@
|
||||
"pixi-particles": "^4.2.0",
|
||||
"pixi-projection": "^0.3.5",
|
||||
"pixi-viewport": "^4.3.3",
|
||||
"pixi.js": "^5.1.5",
|
||||
"pixi.js": "^5.2.0",
|
||||
"propagating-hammerjs": "^1.4.7"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user