forked from MapComplete/MapComplete
More work on OpeningHours picker
This commit is contained in:
parent
4cce18f818
commit
0714327d66
11 changed files with 397 additions and 25 deletions
|
@ -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',
|
||||
|
|
|
@ -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 '"'
|
||||
* 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, '"')
|
||||
.replace(/&/g, "&");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue