Autoformatter applied on all js files
This commit is contained in:
1 parent
72c1017b20
commit
c627aedcf6
59 files changed
+9087
-10892
No files matched your search
+93
-107
@@ -1,140 +1,126 @@
|
||||
|
||||
function newDevTeam() {
|
||||
|
||||
function newDevTeam () {
|
||||
let thisObject = {
|
||||
container: undefined,
|
||||
draw: draw,
|
||||
getContainer: getContainer,
|
||||
initialize: initialize
|
||||
}
|
||||
|
||||
let thisObject = {
|
||||
container: undefined,
|
||||
draw: draw,
|
||||
getContainer: getContainer,
|
||||
initialize: initialize
|
||||
};
|
||||
let container = newContainer()
|
||||
container.initialize()
|
||||
thisObject.container = container
|
||||
|
||||
let container = newContainer();
|
||||
container.initialize();
|
||||
thisObject.container = container;
|
||||
thisObject.container.frame.width = 150
|
||||
thisObject.container.frame.height = BOTTOM_SPACE_HEIGHT
|
||||
|
||||
thisObject.container.frame.width = 150;
|
||||
thisObject.container.frame.height = BOTTOM_SPACE_HEIGHT;
|
||||
resize()
|
||||
|
||||
resize();
|
||||
container.isDraggeable = false
|
||||
container.isClickeable = true
|
||||
|
||||
container.isDraggeable = false;
|
||||
container.isClickeable = true;
|
||||
const NOT_FOUND = 'Team NOT FOUND'
|
||||
|
||||
const NOT_FOUND = "Team NOT FOUND";
|
||||
let sharedStatus
|
||||
let label = ''
|
||||
|
||||
let sharedStatus;
|
||||
let label = ""
|
||||
return thisObject
|
||||
|
||||
return thisObject;
|
||||
function initialize (pSharedStatus) {
|
||||
let sessionToken = window.localStorage.getItem('sessionToken')
|
||||
|
||||
function initialize(pSharedStatus) {
|
||||
|
||||
let sessionToken = window.localStorage.getItem('sessionToken');
|
||||
|
||||
if (sessionToken === null || sessionToken === "") {
|
||||
if (sessionToken === null || sessionToken === '') {
|
||||
/* not logged in */
|
||||
return;
|
||||
}
|
||||
|
||||
sharedStatus = pSharedStatus;
|
||||
|
||||
let storedTeams = window.localStorage.getItem('userTeams');
|
||||
|
||||
if (storedTeams === null || storedTeams === "[]" || storedTeams === "") {
|
||||
window.TEAMS = "";
|
||||
window.DEV_TEAM = "";
|
||||
label = NOT_FOUND;
|
||||
} else {
|
||||
storedTeams = JSON.parse(storedTeams)
|
||||
window.TEAMS = storedTeams;
|
||||
window.DEV_TEAM = storedTeams[sharedStatus.currentDevTeamIndex].slug;
|
||||
label = storedTeams[sharedStatus.currentDevTeamIndex].name;
|
||||
sharedStatus.eventHandler.raiseEvent("devTeam Changed");
|
||||
}
|
||||
|
||||
thisObject.container.eventHandler.listenToEvent("onMouseClick", onClick);
|
||||
|
||||
window.canvasApp.eventHandler.listenToEvent("Browser Resized", resize);
|
||||
return
|
||||
}
|
||||
|
||||
function resize() {
|
||||
sharedStatus = pSharedStatus
|
||||
|
||||
container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 0;
|
||||
container.frame.position.y = viewPort.visibleArea.bottomLeft.y;
|
||||
let storedTeams = window.localStorage.getItem('userTeams')
|
||||
|
||||
if (storedTeams === null || storedTeams === '[]' || storedTeams === '') {
|
||||
window.TEAMS = ''
|
||||
window.DEV_TEAM = ''
|
||||
label = NOT_FOUND
|
||||
} else {
|
||||
storedTeams = JSON.parse(storedTeams)
|
||||
window.TEAMS = storedTeams
|
||||
window.DEV_TEAM = storedTeams[sharedStatus.currentDevTeamIndex].slug
|
||||
label = storedTeams[sharedStatus.currentDevTeamIndex].name
|
||||
sharedStatus.eventHandler.raiseEvent('devTeam Changed')
|
||||
}
|
||||
|
||||
function onClick() {
|
||||
thisObject.container.eventHandler.listenToEvent('onMouseClick', onClick)
|
||||
|
||||
let sessionToken = window.localStorage.getItem('sessionToken');
|
||||
window.canvasApp.eventHandler.listenToEvent('Browser Resized', resize)
|
||||
}
|
||||
|
||||
if (sessionToken === null || sessionToken === "") {
|
||||
function resize () {
|
||||
container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 0
|
||||
container.frame.position.y = viewPort.visibleArea.bottomLeft.y
|
||||
}
|
||||
|
||||
function onClick () {
|
||||
let sessionToken = window.localStorage.getItem('sessionToken')
|
||||
|
||||
if (sessionToken === null || sessionToken === '') {
|
||||
/* not logged in */
|
||||
return;
|
||||
}
|
||||
|
||||
if (sharedStatus.currentDevTeamIndex + 1 === window.TEAMS.length) {
|
||||
|
||||
sharedStatus.currentDevTeamIndex = 0;
|
||||
window.DEV_TEAM = window.TEAMS[sharedStatus.currentDevTeamIndex].slug;
|
||||
label = window.TEAMS[sharedStatus.currentDevTeamIndex].name;
|
||||
sharedStatus.eventHandler.raiseEvent("devTeam Changed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sharedStatus.currentDevTeamIndex + 1 < window.TEAMS.length) {
|
||||
|
||||
sharedStatus.currentDevTeamIndex++;
|
||||
window.DEV_TEAM = window.TEAMS[sharedStatus.currentDevTeamIndex].slug;
|
||||
label = window.TEAMS[sharedStatus.currentDevTeamIndex].name;
|
||||
sharedStatus.eventHandler.raiseEvent("devTeam Changed");
|
||||
return;
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
function getContainer(point) {
|
||||
if (sharedStatus.currentDevTeamIndex + 1 === window.TEAMS.length) {
|
||||
sharedStatus.currentDevTeamIndex = 0
|
||||
window.DEV_TEAM = window.TEAMS[sharedStatus.currentDevTeamIndex].slug
|
||||
label = window.TEAMS[sharedStatus.currentDevTeamIndex].name
|
||||
sharedStatus.eventHandler.raiseEvent('devTeam Changed')
|
||||
return
|
||||
}
|
||||
|
||||
let container;
|
||||
if (sharedStatus.currentDevTeamIndex + 1 < window.TEAMS.length) {
|
||||
sharedStatus.currentDevTeamIndex++
|
||||
window.DEV_TEAM = window.TEAMS[sharedStatus.currentDevTeamIndex].slug
|
||||
label = window.TEAMS[sharedStatus.currentDevTeamIndex].name
|
||||
sharedStatus.eventHandler.raiseEvent('devTeam Changed')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
function getContainer (point) {
|
||||
let container
|
||||
|
||||
/* First we check if this point is inside this object UI. */
|
||||
|
||||
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
|
||||
|
||||
return this.container;
|
||||
|
||||
} else {
|
||||
|
||||
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
|
||||
return this.container
|
||||
} else {
|
||||
/* This point does not belong to this space. */
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
function draw() {
|
||||
function draw () {
|
||||
let sessionToken = window.localStorage.getItem('sessionToken')
|
||||
|
||||
let sessionToken = window.localStorage.getItem('sessionToken');
|
||||
|
||||
if (sessionToken === null || sessionToken === "") {
|
||||
if (sessionToken === null || sessionToken === '') {
|
||||
/* not logged in */
|
||||
return;
|
||||
}
|
||||
|
||||
thisObject.container.frame.draw(false, false);
|
||||
|
||||
let breakpointsHeight = 14;
|
||||
let fontSize = 12;
|
||||
|
||||
let point = {
|
||||
x: thisObject.container.frame.width / 2 - label.length / 2 * fontSize / 3,
|
||||
y: thisObject.container.frame.height / 2 + fontSize / 2 + breakpointsHeight
|
||||
};
|
||||
|
||||
point = thisObject.container.frame.frameThisPoint(point);
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY;
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)';
|
||||
browserCanvasContext.fillText(label, point.x, point.y);
|
||||
return
|
||||
}
|
||||
|
||||
thisObject.container.frame.draw(false, false)
|
||||
|
||||
let breakpointsHeight = 14
|
||||
let fontSize = 12
|
||||
|
||||
let point = {
|
||||
x: thisObject.container.frame.width / 2 - label.length / 2 * fontSize / 3,
|
||||
y: thisObject.container.frame.height / 2 + fontSize / 2 + breakpointsHeight
|
||||
}
|
||||
|
||||
point = thisObject.container.frame.frameThisPoint(point)
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
browserCanvasContext.fillText(label, point.x, point.y)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user