Full code cleanup

This commit is contained in:
Pieter Vander Vennet 2022-01-26 21:40:38 +01:00
parent 3a4a2a2016
commit fa971ffbbf
300 changed files with 16352 additions and 19284 deletions

View file

@ -70,15 +70,15 @@ export default class NoteCommentElement extends Combine {
}
public static addCommentTo(txt: string, tags: UIEventSource<any>, state: {osmConnection: OsmConnection}){
public static addCommentTo(txt: string, tags: UIEventSource<any>, state: { osmConnection: OsmConnection }) {
const comments: any[] = JSON.parse(tags.data["comments"])
const username = state.osmConnection.userDetails.data.name
var urlRegex = /(https?:\/\/[^\s]+)/g;
const html = txt.replace(urlRegex, function(url) {
const html = txt.replace(urlRegex, function (url) {
return '<a href="' + url + '">' + url + '</a>';
})
comments.push({
"date": new Date().toISOString(),
"uid": state.osmConnection.userDetails.data.uid,
@ -91,5 +91,5 @@ export default class NoteCommentElement extends Combine {
tags.data["comments"] = JSON.stringify(comments)
tags.ping()
}
}