User:Darthmelak/common.js

jQuery(function ($) {   var regex = /^.*\s?lat\s+(\d+\.?\d?),\s+lon\s+(\d+\.?\d?)\s?.*$/m    $('[style*="relative"] [style*="absolute"], .map-container .dot').each(function  { var dash = this.title.indexOf('-') var text = this.title.substr(0, dash != -1 ? dash : undefined) if (dash == -1) { console.log(this.title) var m = regex.exec(this.title) if (m) { text = m[1] + ' ' + m[2] }		}       var $el = $(' ').css({		position: 'absolute',		backgroundColor: 'rgba(0, 0, 0, .6)',		color: '#ffffff',		fontSize: '11px',		lineHeight: 1,		padding: '1px',		marginTop: '12px',		whiteSpace: 'nowrap',		transform: 'translateX(-40%)',		textAlign: 'center',	}).text(text) $el.prependTo(this) }) });