Nota: Después de publicar, quizás necesite actualizar la caché de su navegador para ver los cambios.
- Firefox/Safari: Mantenga presionada la tecla Shift mientras pulsa el botón Actualizar, o presiona Ctrl+F5 o Ctrl+R (⌘+R en Mac)
- Google Chrome: presione Ctrl+Shift+R (⌘+Shift+R en Mac)
- Edge: mantenga presionada Ctrl mientras pulsa Actualizar, o presione Ctrl+F5
//<nowiki> /** Listing Editor Configuration 2024-12-28 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: { 'Llegar': 'station', // go 'Desplazarse': 'public transport', // go 'Ver': 'monument', // see 'Hacer': 'sports', // do 'Comprar': 'shop', // buy 'Comer': 'restaurant', // eat 'Beber': 'bar', // drink 'Beber_y_salir': 'bar', // drink and night life // dummy line (de) // eat and sleep 'Dormir': 'hotel', // sleep 'Educación': 'education', // education 'Empleo': 'administration', // work 'Seguridad': 'administration', // security 'Salud': 'health', // health 'Oficina': '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: [ '#Regiones', '#Otros_destinos', '#Ciudades', '#Islas' ], // names of the listing templates TEMPLATES: { listing: [ 'listado', 'vCard', 'listing', 'ver', 'hacer', 'comprar', 'comer', 'evento', 'beber', 'dormir' ], marker: [ 'marker', 'marcador' ] }, // Aliases for vCard or Marker parameters // see: https://es.wikivoyage.org/wiki/M%C3%B3dulo:VCard/i18n PARAM_ALIASES: { address: [ 'dirección' ], 'address-lang': [ 'dirección_lenguaje' ], 'address-local': [ 'dirección_local' ], before: [ 'bandera' ], checkin: [ 'hora_entrada' ], checkout: [ 'hora_salida' ], comment: [ 'comentario' ], description: [ 'descripción', 'content' ], directions: [ 'indicaciones' ], group: [ 'grupo' ], hours: [ 'horario' ], image: [ 'imagen' ], lat: [ 'latitud', 'coord' ], long: [ 'longitud', 'lon', 'long' ], 'map-group': ['mapa-grupo'], mobile: [ 'móvil' ], name: [ 'nombre' ], 'name-latin': [ 'nombre-latin' ], 'name-local': [ 'nombre-local' ], 'name-map': [ 'nombre-mapa' ], payment: [ 'pago' ], phone: [ 'tlf', 'teléfono' ], price: [ 'precio' ], subtype: [ 'subtypes', 'estrellas' ], tollfree: [ 'tlf_gratuito' ], twitter: [ 'twitter', 'x' ], type: [ 'tipo', '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: { intlCurrencies: [ '€', '$', '£', '¥', '₩', '&nbsp;' ], contentChars: [ 'Ñ', 'á', 'é', 'í', 'ñ', 'ó', 'ú', 'ü', '¡', '¿', '“', '’', '–', '—', '…', '·', '&nbsp;', '&#x202F;' ], spaceBeforeCurrencies: true, spaceAfterCallingCodes: true, yes: [ 'y', 'yes', 's', 'si', 'sí', 'true' ], no: [ 'n', 'no', 'false' ], from: 'desde %s', fromTo: '%s–%s', to: 'hasta %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: true, CopyToTypeAliases: true, // 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 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: 'P2397' }, // type: {}, subtype: { p: [ 'P912', 'P2012', 'P2846', 'P2848', 'P5023', 'P10290' ], label: 'Features', 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>