Skip to content

Commit

Permalink
not really sure why all this happened
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Apr 3, 2024
1 parent fb89494 commit f4898fb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
9 changes: 8 additions & 1 deletion client/src/cordova/android/import_messages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ const XML_STRING_ID_PROPERTY = '@name';
const XML_TEXT_CONTENT = '#';

function escapeXmlCharacters(str) {
return str.replace(/"/g, '\\"').replace(/'/g, "\\'").replace(/</g, '\\<').replace(/>/g, '\\>;').replace(/&/g, '\\&').replace(/\//g, "\\\\");
// TODO: This is not a safe way to escape XML characters. We should do it properly.
return str
.replace(/"/g, '\\"')
.replace(/'/g, "\\'")
.replace(/</g, '\\<')
.replace(/>/g, '\\>;')
.replace(/&/g, '\\&')
.replace(/\//g, "\\\\");
}

function getNativeLocale(locale) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/www/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

const path = require('path');

module.exports = async function (config) {
module.exports = async function(config) {
const testConfig = await import('./webpack_test.mjs');

config.set({
Expand Down
20 changes: 11 additions & 9 deletions client/src/www/ui_components/add-server-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ Polymer({
<paper-dialog id="serverDetectedSheet" with-backdrop no-cancel-on-outside-click>
<div class="vertical-margin">
<div class="title">[[localize('server-access-key-detected')]]</div>
<div class="faded">[[localize('server-detected')]]</div>
<div class="faded">
[[localize('server-detected')]]
</div>
<div class="shadow vertical-margin">
<paper-input value="[[accessKey]]" no-label-float="" disabled="">
<iron-icon icon="communication:vpn-key" slot="suffix"></iron-icon>
Expand Down Expand Up @@ -227,7 +229,7 @@ Polymer({
},
},

ready: function () {
ready: function() {
this.$.serverDetectedSheet.addEventListener('opened-changed', this._openChanged.bind(this));
this.$.addServerSheet.addEventListener('opened-changed', this._openChanged.bind(this));
// Workaround for --paper-input-container-input-[focus|invalid] not getting applied.
Expand All @@ -236,7 +238,7 @@ Polymer({
this.$.accessKeyInput.addEventListener('invalid-changed', this._inputInvalidChanged.bind(this));
},

openAddServerSheet: function () {
openAddServerSheet: function() {
this.$.serverDetectedSheet.close();
this.$.addServerSheet.open();
},
Expand All @@ -247,16 +249,16 @@ Polymer({
this.$.serverDetectedSheet.open();
},

isAddingServer: function () {
isAddingServer: function() {
return this.$.serverDetectedSheet.opened;
},

close: function () {
close: function() {
this.$.addServerSheet.close();
this.$.serverDetectedSheet.close();
},

_accessKeyChanged: function () {
_accessKeyChanged: function() {
// Use debounce to detect when the user has stopped typing.
this.debounce(
'accessKeyChanged',
Expand All @@ -267,7 +269,7 @@ Polymer({
);
},

_addServerFromInput: function () {
_addServerFromInput: function() {
var accessKeyInput = this.$.accessKeyInput;
if (!this.accessKey || this.accessKey === '') {
accessKeyInput.invalid = false;
Expand All @@ -278,12 +280,12 @@ Polymer({
}
},

_addDetectedServer: function () {
_addDetectedServer: function() {
this.fire('AddServerRequested', {accessKey: this.accessKey});
this.close();
},

_ignoreDetectedServer: function () {
_ignoreDetectedServer: function() {
this.fire('IgnoreServerRequested', {accessKey: this.accessKey});
this.close();
},
Expand Down
2 changes: 1 addition & 1 deletion client/src/www/ui_components/privacy-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Polymer({
rootPath: String,
},

_privacyTermsAcked: function () {
_privacyTermsAcked: function() {
this.fire('PrivacyTermsAcked');
},
});
10 changes: 5 additions & 5 deletions client/src/www/ui_components/user-comms-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Polymer({
<div id="title" class="highlight">[[localize(titleLocalizationKey)]]</div>
<div id="detail">[[localize(detailLocalizationKey)]]</div>
<div id="buttons">
<a hidden$="[[_shouldHideLink()]]" href$="[[linkUrl]]">
<a hidden\$="[[_shouldHideLink()]]" href\$="[[linkUrl]]">
<paper-button>[[localize(linkTextLocalizationKey)]]</paper-button>
</a>
<paper-button class="highlight" on-tap="_dismiss"
Expand Down Expand Up @@ -132,22 +132,22 @@ Polymer({
fireEventOnHide: String,
},

show: function () {
show: function() {
this.$.wrapper.classList.add('active');
},

hide: function () {
hide: function() {
this.$.wrapper.classList.remove('active');
},

_dismiss: function () {
_dismiss: function() {
this.hide();
if (!!this.fireEventOnHide) {
this.fire(this.fireEventOnHide);
}
},

_shouldHideLink: function () {
_shouldHideLink: function() {
return !this.linkUrl;
},
});

0 comments on commit f4898fb

Please sign in to comment.