From d6021190753ddc9834ce2763373c592c258e37df Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Sun, 21 May 2017 21:30:25 +0200 Subject: Escape text input before sending to server Fixes #15. --- src/scripts/controllers/modes/object.ts | 4 ++-- src/scripts/controllers/modes/room.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/scripts/controllers/modes') diff --git a/src/scripts/controllers/modes/object.ts b/src/scripts/controllers/modes/object.ts index d974df7a..bc358d71 100644 --- a/src/scripts/controllers/modes/object.ts +++ b/src/scripts/controllers/modes/object.ts @@ -1,4 +1,4 @@ -import {AppMode, MapController, InteractionLevel} from "../mapcontroller"; +import {AppMode, InteractionLevel, MapController} from "../mapcontroller"; import {MapView} from "../../views/mapview"; import * as $ from "jquery"; @@ -88,7 +88,7 @@ export class ObjectModeController { public setupEventListeners() { // Handler for saving a new rack name $("#rack-name-save").on("click", () => { - this.currentRack.name = $("#rack-name-input").val(); + this.currentRack.name = $("#rack-name-input").text(); this.mapController.api.updateRack(this.mapView.simulation.id, this.mapView.currentDatacenter.id, this.mapController.roomModeController.currentRoom.id, this.mapController.objectModeController.currentObjectTile.id, this.currentRack).then( diff --git a/src/scripts/controllers/modes/room.ts b/src/scripts/controllers/modes/room.ts index 8a982ef1..dc7f4a41 100644 --- a/src/scripts/controllers/modes/room.ts +++ b/src/scripts/controllers/modes/room.ts @@ -1,5 +1,5 @@ import {Util} from "../../util"; -import {InteractionLevel, MapController, AppMode} from "../mapcontroller"; +import {AppMode, InteractionLevel, MapController} from "../mapcontroller"; import {MapView} from "../../views/mapview"; import * as $ from "jquery"; @@ -124,7 +124,7 @@ export class RoomModeController { // Handler for saving a new room name $("#room-name-save").on("click", () => { - this.currentRoom.name = $("#room-name-input").val(); + this.currentRoom.name = $("#room-name-input").text(); this.mapController.api.updateRoom(this.mapView.simulation.id, this.mapView.currentDatacenter.id, this.currentRoom).then(() => { this.mapView.roomTextLayer.draw(); -- cgit v1.2.3