More work on OpeningHours picker

This commit is contained in:
Pieter Vander Vennet 2020-09-30 22:22:58 +02:00
parent 4cce18f818
commit 0714327d66
11 changed files with 397 additions and 25 deletions

View file

@ -88,13 +88,13 @@ export class ChangesetHandler {
layout : Layout,
continuation: (changesetId: string) => void) {
const commentExtra = layout.changesetMessage !== undefined? " - "+layout.changesetMessage : "";
const commentExtra = layout.changesetMessage !== undefined ? " - " + layout.changesetMessage : "";
let surveySource = "";
if(State.state.currentGPSLocation.data !== undefined){
if (State.state.currentGPSLocation.data !== undefined) {
surveySource = '<tag k="source" v="survey"/>'
}
this.auth.xhr({
method: 'PUT',
path: '/api/0.6/changeset/create',

View file

@ -1,4 +1,5 @@
import * as $ from "jquery"
import {Utils} from "../../Utils";
export abstract class OsmObject {
@ -40,16 +41,6 @@ export abstract class OsmObject {
abstract SaveExtraData(element);
/**
* Replaces all '"' (double quotes) by '&quot;'
* Bugfix where names containing '"' were not uploaded, such as '"Het Zwin" nature reserve'
* @param string
* @constructor
*/
private static Escape(string: string) {
return string.replace(/"/g, '&quot;')
.replace(/&/g, "&amp;");
}
/**
* Generates the changeset-XML for tags
@ -60,7 +51,7 @@ export abstract class OsmObject {
for (const key in this.tags) {
const v = this.tags[key];
if (v !== "") {
tags += ' <tag k="' + OsmObject.Escape(key) + '" v="' + OsmObject.Escape(this.tags[key]) + '"/>\n'
tags += ' <tag k="' + Utils.EncodeXmlValue(key) + '" v="' + Utils.EncodeXmlValue(this.tags[key]) + '"/>\n'
}
}
return tags;