Hinweis: Leere nach dem Veröffentlichen den Browser-Cache, um die Änderungen sehen zu können.
- Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
- Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
- Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
//<nowiki> /** Listing Editor Configuration 2025-03-13 Original authors: - ausgehe, torty3 Additional contributors: - Andyrom75, Wrh2, RolandUnger, Jdlrobson Documentation and version history: - https://de.wikivoyage.org/wiki/Wikivoyage:Gadget-ListingEditorMain.js License: GPL-2.0+, CC-by-sa 3.0 */ /* eslint-disable mediawiki/class-doc */ ( function() { 'use strict'; var EditorConfig = function() { const SYSTEM = { listingEditor: 'ListingEditor' }; // namespace prefixes available at the local wiki, // used for regular expressions const NAMESPACES = { file: '[Ff]ile|[Ii]mage|[Dd]atei|[Bb]ild', // de // '[Ff]ile|[Ii]mage', // en // '[Ff]ile|[Ii]mage|[Aa]rchivo|[Ii]magen', // es category: '[Cc]ategory|[Kk]ategorie' // de // '[Cc]ategory' // en // '[Cc]ategory|[Cc]ategoría' // es }; // regular expressions for form input fields const REGEX = { name: /^([^\[\]\|\*]+|\[\[[^\[\]\|\*]+\]\]|\[\[[^\[\]\|]+\|[^\[\]\|\*]+\]\])$/, url: /^(https?:\/\/|\/\/)(\d{1,3}(\.\d{1,3}){0,3}|([^.\/:;<=>?\\@|\s\x00-\x2C\x7F]+\.)+[^.\/:;<=>?\\@|\d\s\x00-\x2C\x7F]{2,10}(:\d+)?)(\/?|\/[-A-Za-z0-9_.,~%+&:;#*?!=()@\/\x80-\xFF]*)$/, // protocol: (https?:\/\/|\/\/) // domain: (\d{1,3}(\.\d{1,3}){0,3}|([^.\/:;<=>?\\@|\s\x00-\x2C\x7F]+\.)+[^.\/:;<=>?\\@|\d\s\x00-\x2C\x7F]{2,10}(:\d+)?) // residual: (\/?|\/[-A-Za-z0-9_.,~%+&:;#*?!=()@\/\x80-\xFF]*) // not considered: logins like login:password@, IPv6 addresses; will be added if necessary phone: /^(\+[1-9]|[\d\(])([\dA-Z \-\(\)\.]+[\dA-Z ])(( ([Ee][Xx][Tt]\.? |[Aa][Pp][Pp]\.? |x)\d+)?)( *\([^\)]+\))?$/, email: /^[^@^\(^\)\s]+@[^@^\(^\)\s]+\.[^@^\(^\)\s]+( *\([^\)]+\))?$/, skype: /^[a-z][a-z0-9\.,\-_]{5,31}(\?(add|call|chat|sendfile|userinfo|voicemail))?( *\([^\)]+\))?$/, facebook: /^(https:\/\/www\.facebook\.com\/.+|(?!.*\.(?:com|net))[a-z\d.]{5,}|[-.\w\d]+\-\d+)$/i, flickr: /^(https:\/\/www\.flickr\.com\/.+|\d{5,11}@N\d{2})$/, instagram:/^(https:\/\/www\.instagram\.com\/.+|explore\/locations\/[1-9]\d{0,15}|[0-9a-z_][0-9a-z._]{0,28}[0-9a-z_])$/, tiktok: /^(https:\/\/www\.tiktok\.com\/@.+|[0-9A-Za-z_][0-9A-Za-z_.]{1,23})$/i, twitter: /^(https:\/\/twitter\.com\/.+|[0-9a-z_]{1,15})$/i, youtube: /^(https:\/\/www\.youtube\.com\/.+|UC[-_0-9A-Za-z]{21}[AQgw]|@[A-Za-z0-9_\-\.]{3,30})$/, image: new RegExp( '^(?!(' + NAMESPACES.file + '):)' + '.+\.(tif|tiff|gif|png|jpg|jpeg|jpe|webp|xcf|ogg|ogv|svg|pdf|stl|djvu|webm|mpg|mpeg)$', 'i' ), commonscat: new RegExp( '^(?!(' + NAMESPACES.category + '):)' + '.+$', 'i' ), zoom: /^1?[0-9]$/, mapgroup: /^[A-Za-z][A-Za-z0-9]*$/, lastedit: /^((20\d{2}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01]))|((0?[1-9]|[12][0-9]|3[01])\.(0?[1-9]|1[012])\.20\d{2}))$/ }; const SEPARATORS = { sep: ',|;| and | or | und | oder ', skypeSep: ';| and | or | und | oder ' }; var Config = { // -------------------------------------------------------------------- // STRINGS AND DEFINITIONS DEPENDING ON WIKI LANGUAGE // TRANSLATE THE FOLLOWING BASED ON THE WIKIVOYAGE LANGUAGE IN USE // -------------------------------------------------------------------- // SECTION_TO_DEFAULT_TYPE and DISALLOW_ADD_LISTING_IF_PRESENT are // only used to add edit buttons to page-map section headers SECTION_TO_DEFAULT_TYPE: { 'Anreise': 'station', // go 'Mobilität': 'public transport', // go 'Sehenswürdigkeiten': 'monument', // see 'Aktivitäten': 'sports', // do 'Einkaufen': 'shop', // buy 'Küche': 'restaurant', // eat 'Nachtleben': 'bar', // drink // dummy line (es) // drink and night life 'Küche_und_Unterkunft': 'hotel', // eat and sleep 'Unterkunft': 'hotel', // sleep 'Lernen': 'education', // education 'Arbeiten': 'administration', // work 'Sicherheit': 'administration', // security 'Gesundheit': 'health', // health 'Praktische_Hinweise': 'office' // practicalities }, // If any of these patterns are present on a page then no 'add listing' // buttons will be added to the page DISALLOW_ADD_LISTING_IF_PRESENT: [ '#Orte', '#Weitere_Ziele', '#St.C3.A4dte', '#Regionen', '#Inseln', '#print-districts' ], // names of the listing templates TEMPLATES: { listing: [ 'vCard', 'listing', 'buy', 'do', 'drink', 'eat', 'event', 'see', 'sleep' ], marker: [ 'Marker' ] }, // Aliases for vCard or Marker parameters // see: https://de.wikivoyage.org/wiki/Module:VCard/i18n PARAM_ALIASES: { description: [ 'content' ], lat: [ 'latitude', 'coord' ], long: [ 'lon', 'longitude' ], 'name-latin': [ 'name-roman' ], subtype: [ 'subtypes' ], twitter: [ 'x' ], type: [ 'types' ] }, // Type dependent hide / show HIDE_AND_SHOW: { sleep: { hide: [], // 'div_hours'; needed for campsites etc. show: ['div_checkin', 'div_checkout'] }, 'default': { hide: ['div_checkin', 'div_checkout'], show: [] // 'div_hours' } }, // hideDivIfEmpty: id of a <div> in the EDITOR_FORM_HTML for this // element that should be hidden if the corresponding template // parameter has no value. For example, lastedit. hideDivIfEmpty: {}, // keepIt: Include the parameter in the wiki template syntax that // is saved to the article if the parameter has no value. For // example, the "description" tag is not included by default. keepIt: { description: 1 }, // newline: Append a newline after the parameter in the listing // template syntax when the article is saved. newline: {}, COORD_LETTERS: { N: { factor: 1, dir: 'lat' }, S: { factor: -1, dir: 'lat' }, E: { factor: 1, dir: 'long' }, W: { factor: -1, dir: 'long' }, O: { factor: 1, dir: 'long' } // German Ost = East }, MISC: { helpPage: '//de.wikivoyage.org/wiki/Help:Erstellen_einer_VCard', helpPageMarker: '//de.wikivoyage.org/wiki/Help:Erstellen_einer_VCard', intlCurrencies: [ '€', '$', '£', '¥', '₩', '&#x202F;' ], contentChars: [ 'Ä', 'Ö', 'Ü', 'ä', 'ö', 'ü', 'ß', 'ç', 'ñ', '„', '“', '‚', '‘', '’', '–', '—', '…', '·', '&nbsp;', '&#x202F;' ], spaceBeforeCurrencies: true, spaceAfterCallingCodes: true, editTags: 'listingeditor', // editTags: null, // set null if not existent // see [[Special:Tags]], https://www.mediawiki.org/wiki/API:Edit yes: [ 'y', 'yes', 'j', 'ja' ], no: [ 'n', 'no', 'nein' ], from: 'ab %s', fromTo: '%s–%s', to: 'bis %s' }, // ----------------------- Stop translation here ----------------------- // -------------------------------------------------------------------- // CONFIGURE THE FOLLOWING BASED ON WIKIVOYAGE COMMUNITY PREFERENCES // -------------------------------------------------------------------- OPTIONS: { // in pixels, otherwise available space MaxDialogWidth: 1200, // Set the following flag to false if the listing editor should // strip away any listing template parameters that are not // explicitly configured in the TEMPLATES parameter arrays. AllowUnrecognizedParameters: true, // write empty parameters to listing template text inlineFormat: true, // present a complete or reduced parameters set at opening expanded: true, CopyToAliases: false, CopyToTypeAliases: false, // handle punctuation marks at string end withoutPunctuation: [ 'address', 'address-local', 'alt', 'checkin', 'checkout', 'comment', 'hours', 'payment', 'price' ], // vCard default auto mode defaultAuto: true, // proposed maximum description length contentLimit: 1000 }, INPUT_COLUMNS: { listing: [ [ 'name', 'alt', 'comment', 'url', 'address', 'directions', 'lat', 'long', 'phone', 'tollfree', 'mobile', 'fax', 'email', 'skype', 'facebook', 'flickr', 'instagram', 'tiktok', 'twitter', 'youtube' ], [ 'type', 'group', 'subtype', 'show', 'wikidata-label', 'auto', 'hours', 'checkin', 'checkout', 'price', 'payment', 'image', 'commonscat', 'zoom', 'map-group', 'before', 'name-local', 'name-latin', 'address-local', 'directions-local' ] ], marker: [ [ 'name', 'name-map', 'alt', 'url', 'lat', 'long', 'name-local', 'name-latin' ], [ 'type', 'group', 'show', 'wikidata-label', 'image', 'commonscat', 'zoom', 'map-group' ] ] }, SECONDARY_PARAMS: { alt: 1, comment: 1, tollfree: 1, mobile: 1, fax: 1, skype: 1, flickr: 1, tiktok: 1, twitter: 1, youtube: 1, group: 1, show: 1, auto: 1, commonscat: 1, zoom: 1, 'map-group': 1, before: 1, 'name-local': 1, 'name-latin': 1, 'address-local': 1, 'directions-local': 1 }, SHOW_OPTIONS: { listing: { all: 1, coord: 1, none: 1, poi: 1, copy: 1, inline: 1, // only listing noairport: 1, noperiod: 1, // only listing nositelinks: 1, nosocialmedia: 1, // only listing nosubtype: 1, // only listing nowdsubtype: 1, // only listing outdent: 1, // only listing symbol: 1, wikilink: 1, }, marker: { all: 1, coord: 1, none: 1, poi: 1, copy: 1, noairport: 1, noname: 1, // only marker nositelinks: 1, socialmedia: 1, // only marker symbol: 1, wikilink: 1, } }, // lastedit is set if the following parameters were changed PARAMETERS_FOR_LASTEDIT: { hours: 1, checkin: 1, checkout: 1, price: 1 }, // The following variables should usually not be changed /** Wikidata claim definitions for parameters type: property type like label, monolingual, coordinate, contact, email, subtype, hours, id, au, youtube, empty: string value (i.e. default type), id: string value of an id like Q1234567, au: quantity consisting of amount and unit, which: wiki / local: monolingual text by wiki or local language, p: property or set of properties, max: maximum count of results, default = 1, result: table or string (default), table: placeholder for qualifier objects, '' means not yet present (default) */ WIKIDATA_CLAIMS: { name: { type: 'label', which: 'wiki' }, 'name-local':{ type: 'label', which: 'local' }, url: { p: 'P856' }, address: { p: 'P6375', type: 'monolingual', which: 'wiki', max: 10 }, 'address-local': { p: 'P6375', type: 'monolingual', which: 'local', max: 10 }, directions: { p: 'P2795', type: 'monolingual', which: 'wiki', max: 10 }, 'directions-local': { p: 'P2795', type: 'monolingual', which: 'local', max: 10 }, lat: { p: 'P625', type: 'coordinate', which: 'latitude' }, long: { p: 'P625', type: 'coordinate', which: 'longitude' }, phone: { p: 'P1329', type: 'contact', max: 5 }, fax: { p: 'P2900', type: 'contact', max: 3 }, email: { p: 'P968', type: 'email', max: 5 }, skype: { p: 'P2893' }, facebook: { p: 'P2013' }, flickr: { p: 'P3267' }, instagram: { p: 'P2003' }, tiktok: { p: 'P7085' }, twitter: { p: 'P2002' }, youtube: { p: [ 'P11245', 'P2397' ], type: 'youtube' }, // type: {}, subtype: { p: [ 'P912', 'P2012', 'P2846', 'P2848', 'P5023', 'P10290' ], type: 'subtype', table: '', result: 'table', max: 50 }, hours: { p: 'P3025', type: 'hours', max: 5 }, checkin: { p: 'P8745', type: 'id' }, checkout: { p: 'P8746', type: 'id' }, price: { p: 'P2555', type: 'au', max: 5 }, payment: { p: 'P2851', type: 'id', max: 10 }, image: { p: 'P18' }, commonscat: { p: 'P373' } }, // property aliases PROPERTIES: { quantity: 'P1114', minimumAge: 'P2899', maximumAge: 'P4135', dayOpen: 'P3027', dayClosed: 'P3028', hourOpen: 'P8626', hourClosed: 'P8627' }, // properties to be used for comments for contacts, fees, and hours COMMENTS: { contact: [ 'P366', 'P518', 'P642', 'P1001', 'P1559', 'P106' ], fee: [ 'P5314', 'P518', 'P6001', 'P1264', 'P585', 'P2899', 'P4135', 'P642'], hours: [ 'P8626', 'P8627', 'P3027', 'P3028' ] }, // social media and url link formatters LINK_FORMATTERS: { facebook: 'https://www.facebook.com/$1', flickr: 'https://www.flickr.com/photos/$1', instagram: 'https://www.instagram.com/$1/', tiktok: 'https://www.tiktok.com/@$1', twitter: 'https://twitter.com/$1', youtube: 'https://www.youtube.com/channel/$1', youtubeAlias: 'https://www.youtube.com/$1', url: '$1' }, // Options for jQuery plugin Chosen CHOSEN_OPTIONS: { width: '100%', rtl: $( 'html' ).prop( 'dir' ) === 'rtl', allow_single_deselect: true, disable_search_threshold: 5 }, // regex: regular expression // m: error-message key // sep: separators for value list REGEX_FIELDS: { name: { regex: REGEX.name, m: 'validationName' }, url: { regex: REGEX.url, m: 'validationUrl' }, phone: { regex: REGEX.phone, m: 'validationPhone', sep: SEPARATORS.sep }, mobile: { regex: REGEX.phone, m: 'validationMobile', sep: SEPARATORS.sep }, tollfree: { regex: REGEX.phone, m: 'validationTollfree', sep: SEPARATORS.sep }, fax: { regex: REGEX.phone, m: 'validationFax', sep: SEPARATORS.sep }, email: { regex: REGEX.email, m: 'validationEmail', sep: SEPARATORS.sep }, skype: { regex: REGEX.skype, m: 'validationSkype', sep: SEPARATORS.skypeSep }, facebook: { regex: REGEX.facebook, m: 'validationFacebook' }, flickr: { regex: REGEX.flickr, m: 'validationFlickr' }, instagram: { regex: REGEX.instagram, m: 'validationInstagram' }, tiktok: { regex: REGEX.tiktok, m: 'validationTiktok' }, twitter: { regex: REGEX.twitter, m: 'validationTwitter' }, youtube: { regex: REGEX.youtube, m: 'validationYoutube' }, image: { regex: REGEX.image, m: 'validationImage' }, commonscat: { regex: REGEX.commonscat, m: 'validationCategory' }, zoom: { regex: REGEX.zoom, m: 'validationZoom' }, 'map-group': { regex: REGEX.mapgroup, m: 'validationMapGroup' }, lastedit: { regex: REGEX.lastedit, m: 'validationLastEdit' } } }; function init() { window[ SYSTEM.listingEditor ].Config = Config; } return { init }; } (); $( EditorConfig.init ); } () ); //</nowiki>