aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-04-18 21:48:40 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-04-18 21:48:40 -0700
commit04a92f0fbae8cee0e88b56e736a6c4178d39ca35 (patch)
tree724bd348f6433a78e4a781807da53f348a6cc584 /web
parentecde88443393ac77b133d2682fef3885f859818e (diff)
downloadtrackermap-web-04a92f0fbae8cee0e88b56e736a6c4178d39ca35.tar.gz
trackermap-web-04a92f0fbae8cee0e88b56e736a6c4178d39ca35.tar.bz2
trackermap-web-04a92f0fbae8cee0e88b56e736a6c4178d39ca35.zip
Unescape all text fields (fix #4283)
Diffstat (limited to 'web')
-rw-r--r--web/app/view/UnescapedTextAreaField.js29
-rw-r--r--web/app/view/UnescapedTextField.js29
-rw-r--r--web/app/view/dialog/Attribute.js5
-rw-r--r--web/app/view/dialog/Calendar.js5
-rw-r--r--web/app/view/dialog/ComputedAttribute.js14
-rw-r--r--web/app/view/dialog/Device.js13
-rw-r--r--web/app/view/dialog/Driver.js8
-rw-r--r--web/app/view/dialog/Geofence.js7
-rw-r--r--web/app/view/dialog/Group.js5
-rw-r--r--web/app/view/dialog/Maintenance.js5
-rw-r--r--web/app/view/dialog/SavedCommand.js5
-rw-r--r--web/app/view/dialog/Server.js15
-rw-r--r--web/app/view/dialog/User.js13
13 files changed, 107 insertions, 46 deletions
diff --git a/web/app/view/UnescapedTextAreaField.js b/web/app/view/UnescapedTextAreaField.js
new file mode 100644
index 00000000..0eeaf938
--- /dev/null
+++ b/web/app/view/UnescapedTextAreaField.js
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2019 Anton Tananaev (anton@traccar.org)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+Ext.define('Traccar.view.UnescapedTextAreaField', {
+ extend: 'Ext.form.field.TextArea',
+ xtype: 'unescapedTextAreaField',
+
+ initComponent: function() {
+ this.callParent();
+ this.on('change', this.onValueChange);
+ },
+
+ onValueChange: function (field, newValue) {
+ field.setValue(Ext.String.htmlDecode(newValue));
+ }
+});
diff --git a/web/app/view/UnescapedTextField.js b/web/app/view/UnescapedTextField.js
new file mode 100644
index 00000000..334b0682
--- /dev/null
+++ b/web/app/view/UnescapedTextField.js
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2019 Anton Tananaev (anton@traccar.org)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+Ext.define('Traccar.view.UnescapedTextField', {
+ extend: 'Ext.form.field.Text',
+ xtype: 'unescapedTextField',
+
+ initComponent: function() {
+ this.callParent();
+ this.on('change', this.onValueChange);
+ },
+
+ onValueChange: function (field, newValue) {
+ field.setValue(Ext.String.htmlDecode(newValue));
+ }
+});
diff --git a/web/app/view/dialog/Attribute.js b/web/app/view/dialog/Attribute.js
index 2a458977..a85cad05 100644
--- a/web/app/view/dialog/Attribute.js
+++ b/web/app/view/dialog/Attribute.js
@@ -21,7 +21,8 @@ Ext.define('Traccar.view.dialog.Attribute', {
requires: [
'Traccar.view.dialog.AttributeController',
'Traccar.view.ColorPicker',
- 'Traccar.view.CustomNumberField'
+ 'Traccar.view.CustomNumberField',
+ 'Traccar.view.UnescapedTextField'
],
controller: 'attribute',
@@ -33,7 +34,7 @@ Ext.define('Traccar.view.dialog.Attribute', {
validitychange: 'onValidityChange'
},
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
reference: 'nameTextField',
name: 'name',
allowBlank: false,
diff --git a/web/app/view/dialog/Calendar.js b/web/app/view/dialog/Calendar.js
index 9880d4e6..5f00a8be 100644
--- a/web/app/view/dialog/Calendar.js
+++ b/web/app/view/dialog/Calendar.js
@@ -20,7 +20,8 @@ Ext.define('Traccar.view.dialog.Calendar', {
extend: 'Traccar.view.dialog.BaseEdit',
requires: [
- 'Traccar.view.dialog.CalendarController'
+ 'Traccar.view.dialog.CalendarController',
+ 'Traccar.view.UnescapedTextField'
],
controller: 'calendar',
@@ -32,7 +33,7 @@ Ext.define('Traccar.view.dialog.Calendar', {
xtype: 'fieldset',
title: Strings.sharedRequired,
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'name',
fieldLabel: Strings.sharedName,
allowBlank: false
diff --git a/web/app/view/dialog/ComputedAttribute.js b/web/app/view/dialog/ComputedAttribute.js
index 22cfb829..adae7f7b 100644
--- a/web/app/view/dialog/ComputedAttribute.js
+++ b/web/app/view/dialog/ComputedAttribute.js
@@ -20,7 +20,9 @@ Ext.define('Traccar.view.dialog.ComputedAttribute', {
extend: 'Traccar.view.dialog.BaseEdit',
requires: [
- 'Traccar.view.dialog.ComputedAttributeController'
+ 'Traccar.view.dialog.ComputedAttributeController',
+ 'Traccar.view.UnescapedTextField',
+ 'Traccar.view.UnescapedTextAreaField'
],
controller: 'computedAttribute',
@@ -28,14 +30,8 @@ Ext.define('Traccar.view.dialog.ComputedAttribute', {
items: {
xtype: 'form',
- listeners: {
- afterrender: function (view) {
- var field = view.up('panel').lookupReference('expressionField');
- field.setValue(Ext.String.htmlDecode(field.getValue()));
- }
- },
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'description',
fieldLabel: Strings.sharedDescription
}, {
@@ -49,7 +45,7 @@ Ext.define('Traccar.view.dialog.ComputedAttribute', {
change: 'onAttributeChange'
}
}, {
- xtype: 'textareafield',
+ xtype: 'unescapedTextAreaField',
reference: 'expressionField',
name: 'expression',
fieldLabel: Strings.sharedExpression,
diff --git a/web/app/view/dialog/Device.js b/web/app/view/dialog/Device.js
index 50a5e79c..60a8f716 100644
--- a/web/app/view/dialog/Device.js
+++ b/web/app/view/dialog/Device.js
@@ -20,7 +20,8 @@ Ext.define('Traccar.view.dialog.Device', {
requires: [
'Traccar.view.ClearableComboBox',
- 'Traccar.view.dialog.DeviceController'
+ 'Traccar.view.dialog.DeviceController',
+ 'Traccar.view.UnescapedTextField'
],
controller: 'device',
@@ -32,12 +33,12 @@ Ext.define('Traccar.view.dialog.Device', {
xtype: 'fieldset',
title: Strings.sharedRequired,
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'name',
fieldLabel: Strings.sharedName,
allowBlank: false
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'uniqueId',
fieldLabel: Strings.deviceIdentifier,
allowBlank: false
@@ -56,15 +57,15 @@ Ext.define('Traccar.view.dialog.Device', {
displayField: 'name',
valueField: 'id'
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'phone',
fieldLabel: Strings.sharedPhone
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'model',
fieldLabel: Strings.deviceModel
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'contact',
fieldLabel: Strings.deviceContact
}, {
diff --git a/web/app/view/dialog/Driver.js b/web/app/view/dialog/Driver.js
index b67e182d..9b1c17b5 100644
--- a/web/app/view/dialog/Driver.js
+++ b/web/app/view/dialog/Driver.js
@@ -19,6 +19,10 @@
Ext.define('Traccar.view.dialog.Driver', {
extend: 'Traccar.view.dialog.BaseEdit',
+ requires: [
+ 'Traccar.view.UnescapedTextField'
+ ],
+
title: Strings.sharedDriver,
items: {
@@ -27,12 +31,12 @@ Ext.define('Traccar.view.dialog.Driver', {
xtype: 'fieldset',
title: Strings.sharedRequired,
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'name',
fieldLabel: Strings.sharedName,
allowBlank: false
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'uniqueId',
fieldLabel: Strings.deviceIdentifier,
allowBlank: false
diff --git a/web/app/view/dialog/Geofence.js b/web/app/view/dialog/Geofence.js
index 65c32c04..1e22cd7b 100644
--- a/web/app/view/dialog/Geofence.js
+++ b/web/app/view/dialog/Geofence.js
@@ -20,7 +20,8 @@ Ext.define('Traccar.view.dialog.Geofence', {
requires: [
'Traccar.view.ClearableComboBox',
- 'Traccar.view.dialog.GeofenceController'
+ 'Traccar.view.dialog.GeofenceController',
+ 'Traccar.view.UnescapedTextField'
],
controller: 'geofence',
@@ -32,7 +33,7 @@ Ext.define('Traccar.view.dialog.Geofence', {
xtype: 'fieldset',
title: Strings.sharedRequired,
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'name',
fieldLabel: Strings.sharedName
}]
@@ -42,7 +43,7 @@ Ext.define('Traccar.view.dialog.Geofence', {
collapsible: true,
collapsed: true,
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'description',
fieldLabel: Strings.sharedDescription
}, {
diff --git a/web/app/view/dialog/Group.js b/web/app/view/dialog/Group.js
index 805b422c..61ca193d 100644
--- a/web/app/view/dialog/Group.js
+++ b/web/app/view/dialog/Group.js
@@ -19,7 +19,8 @@ Ext.define('Traccar.view.dialog.Group', {
extend: 'Traccar.view.dialog.BaseEdit',
requires: [
- 'Traccar.view.ClearableComboBox'
+ 'Traccar.view.ClearableComboBox',
+ 'Traccar.view.UnescapedTextField'
],
title: Strings.groupDialog,
@@ -30,7 +31,7 @@ Ext.define('Traccar.view.dialog.Group', {
xtype: 'fieldset',
title: Strings.sharedRequired,
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'name',
fieldLabel: Strings.sharedName,
allowBlank: false
diff --git a/web/app/view/dialog/Maintenance.js b/web/app/view/dialog/Maintenance.js
index 5705278f..d844d259 100644
--- a/web/app/view/dialog/Maintenance.js
+++ b/web/app/view/dialog/Maintenance.js
@@ -21,7 +21,8 @@ Ext.define('Traccar.view.dialog.Maintenance', {
requires: [
'Traccar.view.dialog.MaintenanceController',
- 'Traccar.view.CustomNumberField'
+ 'Traccar.view.CustomNumberField',
+ 'Traccar.view.UnescapedTextField'
],
controller: 'maintenance',
@@ -37,7 +38,7 @@ Ext.define('Traccar.view.dialog.Maintenance', {
xtype: 'fieldset',
title: Strings.sharedRequired,
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'name',
fieldLabel: Strings.sharedName,
allowBlank: false
diff --git a/web/app/view/dialog/SavedCommand.js b/web/app/view/dialog/SavedCommand.js
index a7693871..b1aeae73 100644
--- a/web/app/view/dialog/SavedCommand.js
+++ b/web/app/view/dialog/SavedCommand.js
@@ -19,7 +19,8 @@ Ext.define('Traccar.view.dialog.SavedCommand', {
extend: 'Traccar.view.dialog.BaseEdit',
requires: [
- 'Traccar.view.dialog.SavedCommandController'
+ 'Traccar.view.dialog.SavedCommandController',
+ 'Traccar.view.UnescapedTextField'
],
controller: 'savedCommand',
@@ -34,7 +35,7 @@ Ext.define('Traccar.view.dialog.SavedCommand', {
xtype: 'fieldset',
title: Strings.sharedRequired,
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'description',
fieldLabel: Strings.sharedDescription
}, {
diff --git a/web/app/view/dialog/Server.js b/web/app/view/dialog/Server.js
index 8ff83992..c9729ccf 100644
--- a/web/app/view/dialog/Server.js
+++ b/web/app/view/dialog/Server.js
@@ -20,7 +20,8 @@ Ext.define('Traccar.view.dialog.Server', {
requires: [
'Traccar.view.ClearableComboBox',
- 'Traccar.view.dialog.MapPickerController'
+ 'Traccar.view.dialog.MapPickerController',
+ 'Traccar.view.UnescapedTextField'
],
controller: 'mapPicker',
@@ -28,12 +29,6 @@ Ext.define('Traccar.view.dialog.Server', {
items: {
xtype: 'form',
- listeners: {
- afterrender: function (view) {
- var field = view.up('panel').lookupReference('mapUrlField');
- field.setValue(Ext.String.htmlDecode(field.getValue()));
- }
- },
items: [{
xtype: 'fieldset',
title: Strings.sharedPreferences,
@@ -45,11 +40,11 @@ Ext.define('Traccar.view.dialog.Server', {
displayField: 'name',
valueField: 'key'
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'bingKey',
fieldLabel: Strings.mapBingKey
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
reference: 'mapUrlField',
name: 'mapUrl',
fieldLabel: Strings.mapCustom
@@ -90,7 +85,7 @@ Ext.define('Traccar.view.dialog.Server', {
displayField: 'name',
valueField: 'key'
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'poiLayer',
fieldLabel: Strings.mapPoiLayer
}]
diff --git a/web/app/view/dialog/User.js b/web/app/view/dialog/User.js
index 86f91672..917f110c 100644
--- a/web/app/view/dialog/User.js
+++ b/web/app/view/dialog/User.js
@@ -20,7 +20,8 @@ Ext.define('Traccar.view.dialog.User', {
requires: [
'Traccar.view.ClearableComboBox',
- 'Traccar.view.dialog.UserController'
+ 'Traccar.view.dialog.UserController',
+ 'Traccar.view.UnescapedTextField'
],
controller: 'user',
@@ -32,11 +33,11 @@ Ext.define('Traccar.view.dialog.User', {
xtype: 'fieldset',
title: Strings.sharedRequired,
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'name',
fieldLabel: Strings.sharedName
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'email',
fieldLabel: Strings.userEmail,
allowBlank: false
@@ -53,7 +54,7 @@ Ext.define('Traccar.view.dialog.User', {
collapsible: true,
collapsed: true,
items: [{
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'phone',
fieldLabel: Strings.sharedPhone
}, {
@@ -94,7 +95,7 @@ Ext.define('Traccar.view.dialog.User', {
displayField: 'name',
valueField: 'key'
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'poiLayer',
fieldLabel: Strings.mapPoiLayer
}]
@@ -164,7 +165,7 @@ Ext.define('Traccar.view.dialog.User', {
disabled: true,
reference: 'userLimitField'
}, {
- xtype: 'textfield',
+ xtype: 'unescapedTextField',
name: 'token',
reference: 'tokenField',
fieldLabel: Strings.userToken,