");
$places.html([
''
].join(' '));
return $places.html();
}
function injectCss() {
var css = [
// Lock button formatting
'.btn-lh {cursor:pointer;padding:1px 6px;height:22px;border:solid 1px #c1c1c1;margin-right:3px;}',
'.btn.btn-lh.btn-lh-selected {background-color:#6999ae;color:white}',
'.btn.btn-lh.btn-lh-selected:hover {color:white}',
'.btn.btn-lh.disabled {color:#909090;background-color:#f7f7f7;}',
'.btn.btn-lh.btn-lh-selected.disabled {color:white;background-color:#6999ae;}',
//Settings Panel
'#sidebar .controls-container.pie-controls-container {padding: 0px;}',
'.select2-choices {-webkit-animation-name: oldCategoryDetected; -webkit-animation-duration: 10s; -webkit-animation-iteration-count: 0; animation-name: oldCategoryDetected; animation-duration: 3s; animation-iteration-count: 0;}',
//'@keyframes oldCategoryDetected {0% {border-color:rgb(204, 204, 204); border-width:3px;} 50% {border-color:red; border-width:3px;} 100% {border-color:rgb(204, 204, 204); border-width:3px;}}',
//Image Dialog Enhancement
'.imgcon {position:relative; margin:0 auto;}',
'.imnav {color: #ffffff; margin:0 auto; opacity:0.7; display:none; position:absolute; top:0; left:0px; width:100%; height:89%;}',
'.imgcon:hover .imnav{display:inline-block;}',
'.control {float:left; height:100%; width:33%; opacity:0;}',
'.control:hover {opacity:0.7;}',
'.prim {width:15%; background:url("http://i59.tinypic.com/294s94i.gif")left center no-repeat;}',
'.zmim {width:70%;}',
'.neim {width:15%; background:url("http://i62.tinypic.com/2cqfqxf.gif")right center no-repeat;}',
//PSE
'.PSESelected {border: 3px solid #ee9900;}'
].join(' ');
$('').appendTo('head');
}
function injectCSSWithID(id, css){
$('').appendTo('head');
}
function loadSettings() {
var loadedSettings = $.parseJSON(localStorage.getItem("WMEPIE_Settings"));
var defaultSettings = {
ShowAreaPlaceSize: false,
ShowAreaPlaceSizeImperial: false,
ShowAreaPlaceSizeMetric: false,
ShowLockButtonsRPP: true,
NewPlacesList: W.Config.venues.categories.clone(),
EditRPPAfterCreated: false,
UseStreetFromClosestSeg: false,
UseCityFromClosestSeg: false,
ShowPlaceLocatorCrosshair: false,
PlaceZoom: 6,
DefaultLockLevel: 0,
CreateResidentialPlaceShortcut: "A+r",
CreateParkingLotShortcut: "A+p",
UseAltCity: false,
ShowSearchButton: false,
AddPlaceCategoriesButtons: false,
SkipPLR: false,
ShowParkingLotButton: false,
ShowPlaceNames: false,
ShowPlaceNamesPoint: false,
ShowPlaceNamesArea: false,
ShowPlaceNamesLock: false,
ShowCopyPlaceButton: false,
ShowExternalProviderTooltip: false,
ShowPlaceNamesPLA: false,
ClearDescription: true,
PlaceNameFontSize: "12",
PlaceNameFontOutlineWidth: 3,
PlaceNameFontBold: true,
PlaceNameFontColor: "#FFFFFF",
PlaceNameFontOutline: "#000000",
PlaceLocatorCrosshairProdPL: true,
MoveAddress: false,
MoveHNEntry: true,
PLNormalSpotWidth: 3.44,
PLAngledSpotWidth: 3,
ShowPLSpotEstimatorButton: false,
ShowNavPointClosestSegmentOnHover: true
};
settings = loadedSettings ? loadedSettings : defaultSettings;
for (var prop in defaultSettings) {
if (!settings.hasOwnProperty(prop))
settings[prop] = defaultSettings[prop];
}
if(settings.ShowAreaPlaceSizeImperial === false && settings.ShowAreaPlaceSizeMetric === false)
if(Waze.prefs.attributes.isImperial)
settings.ShowAreaPlaceSizeImperial = true;
else
settings.ShowAreaPlaceSizeMetric = true;
}
function saveSettings() {
if (localStorage) {
var localsettings = {
ShowAreaPlaceSize: settings.ShowAreaPlaceSize,
ShowAreaPlaceSizeImperial: settings.ShowAreaPlaceSizeImperial,
ShowAreaPlaceSizeMetric: settings.ShowAreaPlaceSizeMetric,
ShowLockButtonsRPP: settings.ShowLockButtonsRPP,
NewPlacesList: settings.NewPlacesList,
EditRPPAfterCreated: settings.EditRPPAfterCreated,
UseStreetFromClosestSeg: settings.UseStreetFromClosestSeg,
UseCityFromClosestSeg: settings.UseCityFromClosestSeg,
ShowPlaceLocatorCrosshair: settings.ShowPlaceLocatorCrosshair,
PlaceZoom: settings.PlaceZoom,
DefaultLockLevel: settings.DefaultLockLevel,
CreateResidentialPlaceShortcut: settings.CreateResidentialPlaceShortcut,
CreateParkingLotShortcut: settings.CreateParkingLotShortcut,
UseAltCity: settings.UseAltCity,
ShowSearchButton: settings.ShowSearchButton,
AddPlaceCategoriesButtons: settings.AddPlaceCategoriesButtons,
SkipPLR: settings.SkipPLR,
ShowParkingLotButton: settings.ShowParkingLotButton,
ShowPlaceNames: settings.ShowPlaceNames,
ShowPlaceNamesPoint: settings.ShowPlaceNamesPoint,
ShowPlaceNamesArea: settings.ShowPlaceNamesArea,
ShowPlaceNamesLock: settings.ShowPlaceNamesLock,
ShowCopyPlaceButton: settings.ShowCopyPlaceButton,
ShowExternalProviderTooltip: settings.ShowExternalProviderTooltip,
ShowPlaceNamesPLA: settings.ShowPlaceNamesPLA,
ClearDescription: settings.ClearDescription,
PlaceNameFontSize: settings.PlaceNameFontSize,
PlaceNameFontOutlineWidth: settings.PlaceNameFontOutlineWidth,
PlaceNameFontBold: settings.PlaceNameFontBold,
PlaceNameFontColor: settings.PlaceNameFontColor,
PlaceNameFontOutline: settings.PlaceNameFontOutline,
PlaceLocatorCrosshairProdPL: settings.PlaceLocatorCrosshairProdPL,
MoveAddress: settings.MoveAddress,
MoveHNEntry: settings.MoveHNEntry,
PLNormalSpotWidth: settings.PLNormalSpotWidth,
PLAngledSpotWidth: settings.PLAngledSpotWidth,
ShowPLSpotEstimatorButton: settings.ShowPLSpotEstimatorButton,
ShowNavPointClosestSegmentOnHover: settings.ShowNavPointClosestSegmentOnHover
};
for (var name in Waze.accelerators.Actions) {
var TempKeys = "";
if (Waze.accelerators.Actions[name].group == 'wmepie') {
if (Waze.accelerators.Actions[name].shortcut) {
if (Waze.accelerators.Actions[name].shortcut.altKey === true) {
TempKeys += 'A';
}
if (Waze.accelerators.Actions[name].shortcut.shiftKey === true) {
TempKeys += 'S';
}
if (Waze.accelerators.Actions[name].shortcut.ctrlKey === true) {
TempKeys += 'C';
}
if (TempKeys !== "") {
TempKeys += '+';
}
if (Waze.accelerators.Actions[name].shortcut.keyCode) {
TempKeys += Waze.accelerators.Actions[name].shortcut.keyCode;
}
} else {
TempKeys = "-1";
}
localsettings[name] = TempKeys;
}
}
localStorage.setItem("WMEPIE_Settings", JSON.stringify(localsettings));
}
}
function loadTranslations() {
setTranslations({
en: {
prefs: {
title: 'Place Interface Enhancements',
ShowAreaPlaceSize: 'Show area Place size',
ShowImperial: 'Show imperial',
ShowMetric: 'Show metric',
ShowRPPLockButtons: 'Show lock buttons for RPPs',
ShowRPPLockButtonsTitle: 'Displays lock level buttons for Residential Place Points',
ShowPlaceLocatorCrosshair: 'Show Place locator crosshair',
ShowPlaceLocatorCrosshairTitle: 'Centers the Place on screen and zooms to the defined level',
Zoom: 'Zoom',
ZoomTitle: 'The zoom level to use when centering on a Place',
ShowAddressSearch: 'Show search button next to address',
ShowAddressSearchTitle: "Show a magnifying glass next to the Place's address. Clicking this button will load the address into the search box",
ShowPlaceCategoryButtons: 'Add Place category buttons above the categories selection',
ShowPLAButton: 'Show parking lot button',
ShowPLAButtonTitle: "Starts creation mode for a Parking Lot Area Place and will set the name to match this Place\'s name when complete",
ShowCopyPlaceButton: 'Show copy Place button',
ShowCopyPlaceButtonTitle: 'Copies the selected Place to a new Place with identical settings',
ShowGPIDTooltip: 'Show External Provider tooltip',
ShowGPIDTooltipTitle: 'Displays a tooltip with the external provider information',
NewPlaces: 'New Places',
EditRPPAfterCreate: 'Edit RPP address after created',
EditRPPAfterCreateTitle: "Automatically opens the RPP address edit window and focuses on the House Number entry",
UseStreetFromClosestSegment: 'Use street name from closest segment',
UseStreetFromClosestSegmentTitle: "Pulls the street name from the closest visible segment and inserts into the new Place's address",
UseCityFromClosestSegment: 'Use city name from closest segment',
UseCityFromClosestSegmentTitle: "Pulls the city name from the closest visible segment and inserts into the new Place's address",
ClosestSegmentAltCity: 'When the primary is "No city" look for an alt city',
ClosestSegmentAltCityTitle: 'When the primary is \'No city\' try to find an alt street name with a city',
ClosestSegmentIgnorePLRUnnamedPR: "Ignore PLRs & unnamed PR when using closest segment's name and city",
ClosestSegmentIgnorePLRUnnamedPRTitle: "When looking for the closest segment, PLRs and unnamed PRs will be ignored",
LockLevel: 'Lock level',
LockLevelTitle: 'The lock level to set automatically when creating new Places',
MapChanges: 'Map Changes',
ShowPlaceNames: 'Show Place names',
ShowPlaceNamesTitle: '',
ShowPointNames: 'Show point names',
ShowPointNamesTitle: "Will display the Place's name below the Place point",
ShowAreaNames: 'Show area names',
ShowAreaNamesTitle: "Will display the Place's name in the middle of the Place area",
ShowLockLevel: 'Show lock level',
ShowLockLevelTitle: "Will display the Place's lock level in the middle of the Place area",
ShowPLAName: 'Show PLA name',
ShowPLANameTitle: '',
Item: 'Item',
PlaceMenuCustomization: "Place Menu Customization",
ClearDescription: "Show clear description button",
ClearDescriptionTitle: "Adds a clear button to the top right of the description entry that when clicked will clear all text in the entry field",
PropertiesPanel: "Properties Panel",
FontSize: "Font size",
FontColor: "Font color",
Bold: "Bold",
FontOutlineColor: "Font outline color",
FontOutlineWidth: "Font outline width",
ProdPL: "Force production PL",
MoveAddress: "Move address to top of panel",
MoveAddressTitle: "Moves the address editor to the top of the properties panel",
MoveHNEntry: "Move HN entry before street entry",
MoveHNEntryTitle: "Moves the House Number entry before the Street entry in the address editor",
ShowParkingSpaceEstimatorTool: "Show Parking Space Estimator tool",
ShowParkingSpaceEstimatorToolTitle: "Shows the button to launch the Parking Space Estimator tool",
PSEParkingSpaceEstimator: "Parking Space Estimator",
PSELayoutType: "Layout type",
PSE90degree: "90 degree",
PSEAngled: "Angled",
PSEEstimatedNumOfSpots: "Estimated # of spots: ",
PSESet: "Set",
PSESpotWidth: "Spot width (m)",
PSECal: "Cal",
PSEDraw90DegreeTitle: "Click to draw a line through an entire 90 degree parking space aisle. Double click to finish drawing and measure the spaces.",
PSEDrawAngledTitle: "Click to draw a line through an entire angled parking space aisle. Double click to finish drawing and measure the spaces.",
PSEShowPSEButton: "Show Parking Space Estimator tool button",
PSEShowPSEButtonTitle: "Shows the button to launch the Parking Space Estimator tool",
PSEDisplayButtonTitle: "Opens the Parking Space Estimator tool"
}
},
"es-419": {
prefs: {
title: 'Place Interface Enhancements',
ShowAreaPlaceSize: 'Mostrar tamaño del área',
ShowImperial: 'Sistema Imperial',
ShowMetric: 'Sistema Métrico',
ShowRPPLockButtons: 'Mostrar botones de bloqueo para RPPs',
ShowRPPLockButtonsTitle: 'Muestra los botones de nivel de bloqueo para lugares residenciales',
ShowPlaceLocatorCrosshair: 'Mostrar reticula localizadora del lugar',
ShowPlaceLocatorCrosshairTitle: 'Centra el lugar en la pantalla y acercamiento al nivel definido',
Zoom: 'Acercamiento',
ZoomTitle: 'Nivel de acercamiento a utilizar cuando se centra en un lugar',
ShowAddressSearch: 'Mostrar el botón de búsqueda junto a la dirección',
ShowAddressSearchTitle: "Muestra una lupa junto a la dirección del lugar. Al hacer clic en este botón, se cargará la dirección en la barra de búsqueda",
ShowPlaceCategoryButtons: 'Botones de categorías de lugares',
ShowPLAButton: 'Mostrar botón de PLAs',
ShowPLAButtonTitle: 'Inicia el modo de creación de un lugar del área de estacionamiento y establecerá el nombre del estacionamiento para que coincida con el nombre del lugar cuando se complete',
ShowCopyPlaceButton: 'Mostrar botón de copiado de lugar',
ShowCopyPlaceButtonTitle: 'Copia el lugar seleccionado en un lugar nuevo con configuraciones idénticas',
ShowGPIDTooltip: 'Mostrar información del proveedor externo',
ShowGPIDTooltipTitle: 'Muestra un texto con la información del proveedor externo',
NewPlaces: 'Nuevos lugares',
EditRPPAfterCreate: 'Editar la dirección del RPP una vez creada',
EditRPPAfterCreateTitle: "Automáticamente abre la ventana de edición en la dirección del lugar residencial y se enfoca en el campo de número de casa",
UseStreetFromClosestSegment: 'Utilizar el nombre de la calle del segmento más cercano',
UseStreetFromClosestSegmentTitle: "Extrae el nombre de la calle del segmento visible más cercano y lo agrega en la dirección del nuevo lugar",
UseCityFromClosestSegment: 'Usar el nombre de la ciudad del segmento más cercano',
UseCityFromClosestSegmentTitle: "Extrae el nombre de la ciudad del segmento visible más cercano y lo agrega en la dirección del nuevo lugar",
ClosestSegmentAltCity: 'Buscar una ciudad alternativa cuando la ciudad principal sea \'Ninguno\'',
ClosestSegmentAltCityTitle: 'Cuando la ciudad principal es "Ninguno" trata de encontrar un nombre de calle alternativo con una ciudad',
ClosestSegmentIgnorePLRUnnamedPR: "Ignorar los PLR y PR sin nombre cuando utilice el nombre y la ciudad del segmento más cercano",
ClosestSegmentIgnorePLRUnnamedPRTitle: "Ignorar segmentos de estacionamiento o privados al buscar el segmento mas cercano",
LockLevel: 'Nivel de bloqueo',
LockLevelTitle: 'El nivel de bloqueo para establecer automáticamente al crear nuevos lugares',
MapChanges: 'Cambios en el mapa',
ShowPlaceNames: 'Mostrar nombres de lugares',
ShowPlaceNamesTitle: '',
ShowPointNames: 'Mostrar nombres de punto',
ShowPointNamesTitle: "Muestra el nombre de lugares definidos como punto",
ShowAreaNames: 'Mostrar nombres de área',
ShowAreaNamesTitle: "Muestra el nombre de lugares definidos como área",
ShowLockLevel: 'Mostrar nivel de bloqueo',
ShowLockLevelTitle: "Muestra el nivel de bloqueo en el centro del lugar",
ShowPLAName: 'Mostrar nombre de PLA',
ShowPLANameTitle: 'Muestra el nombre de áreas de estacionamiento (PLAs)',
Item: 'Opción',
PlaceMenuCustomization: "Personalización del menú de lugares",
ClearDescription: "Mostrar botón de borrar descripción",
ClearDescriptionTitle: "Añade un botón de borrado en la parte superior derecha del campo de descripción que deja vacíos todos los campos",
PropertiesPanel: "Propiedades del panel",
FontSize: "Tamaño de letra",
FontColor: "Color de Letra",
Bold: "Negrita",
FontOutlineColor: "Color del contorno de la letra",
FontOutlineWidth: "Ancho del contorno de la letra",
ProdPL: "Forzar Permalink de producción",
MoveAddress: "Move address to top of panel",
MoveAddressTitle: "Moves the address editor to the top of the properties panel",
MoveHNEntry: "Move HN entry before street entry",
MoveHNEntryTitle: "Moves the House Number entry before the Street entry in the address editor",
ShowParkingSpaceEstimatorTool: "Show Parking Space Estimator tool",
ShowParkingSpaceEstimatorToolTitle: "Shows the button to launch the Parking Space Estimator tool",
PSEParkingSpaceEstimator: "Parking Space Estimator",
PSELayoutType: "Layout type",
PSE90degree: "90 degree",
PSEAngled: "Angled",
PSEEstimatedNumOfSpots: "Estimated # of spots: ",
PSESet: "Set",
PSESpotWidth: "Spot width (m)",
PSECal: "Cal",
PSEDraw90DegreeTitle: "Click to draw a line through an entire 90 degree parking space aisle. Double click to finish drawing and measure the spaces.",
PSEDrawAngledTitle: "Click to draw a line through an entire angled parking space aisle. Double click to finish drawing and measure the spaces.",
PSEShowPSEButton: "Show Parking Space Estimator tool button",
PSEShowPSEButtonTitle: "Shows the button to launch the Parking Space Estimator tool",
PSEDisplayButtonTitle: "Opens the Parking Space Estimator tool"
}
},
fr: {
prefs: {
title: 'Place Interface Enhancements',
ShowAreaPlaceSize: 'Afficher la tallie de la place',
ShowImperial: 'Afficher en imperial',
ShowMetric: 'Afficher en métrique',
ShowRPPLockButtons: 'Afficher les boutons de lock pour les résidentiels',
ShowRPPLockButtonsTitle: 'Affiche des boutons pour le niveau de verrouillage des lieux résidentiels',
ShowPlaceLocatorCrosshair: 'Afficher le repère de localisation du lieu',
ShowPlaceLocatorCrosshairTitle: "Centre le lieu à l'écran et zoome au niveau défini",
Zoom: 'Zoom',
ZoomTitle: "Niveau de zoom utilisé lorsqu'on se centre sur un lieu",
ShowAddressSearch: "Afficher icône de recherche à côté de l'adresse",
ShowAddressSearchTitle: "Affiche une loupe à côté de l'adresse du lieu. Cliquer ce bouton chargera l'adresse dans la barre de recherche",
ShowPlaceCategoryButtons: 'Ajouter des icônes de catégorie au dessus de la sélection de catégories',
ShowPLAButton: 'Afficher le bouton de création de parking',
ShowPLAButtonTitle: 'Démarre le mode création de parking pour tracer un parking qui aura le nom du lieu sélectionné',
ShowCopyPlaceButton: 'Afficher le bouton de clonage de lieu',
ShowCopyPlaceButtonTitle: 'Clone le lieu sélectionné en nouveau lieu avec les mêmes valeurs',
ShowGPIDTooltip: 'Afficher en infobulle le fournisseur externe',
ShowGPIDTooltipTitle: 'Affiche une infobulle avec les informations du fournisseur externe',
NewPlaces: 'Nouveaux Lieux',
EditRPPAfterCreate: "Editer l'adresse du résidentiel après création",
EditRPPAfterCreateTitle: "Ouvre automatiquement la zone d'édition de l'adresse du lieu résidentiel et se positionne sur la saisie du n° de rue",
UseStreetFromClosestSegment: 'Utiliser le nom de rue du segment le plus proche',
UseStreetFromClosestSegmentTitle: "Prend le nom de rue du segment visible le plus proche et l'insère dans l'adresse du nouveau lieu",
UseCityFromClosestSegment: 'Utiliser le nom de ville du segment le plus proche',
UseCityFromClosestSegmentTitle: "Prend le nom de ville du segment visible le plus proche et l'insère dans l'adresse du nouveau lieu",
ClosestSegmentAltCity: 'Lorsque le nom principal est «Hors ville» regarder le nom en alt',
ClosestSegmentAltCityTitle: 'Lorsque le nom principal est «Hors ville» essayer de trouver un nom de rue alternatif avec une ville',
ClosestSegmentIgnorePLRUnnamedPR: "Ignorer les parkings et voies privées non nommés",
ClosestSegmentIgnorePLRUnnamedPRTitle: "Lorsque le script regarde le nom du segment visible le plus proche, les parkings et voies privées non nommées seront ignorés",
LockLevel: 'Verrouillage ',
LockLevelTitle: 'Le niveau de verrouillage est appliqué automatiquement à la création du lieu',
MapChanges: 'Changements de carte',
ShowPlaceNames: 'Afficher le nom des lieux',
ShowPlaceNamesTitle: '',
ShowPointNames: 'Afficher le nom des lieux point',
ShowPointNamesTitle: "Affiche le nom du lieu sous le lieu point",
ShowAreaNames: 'Afficher le nom des lieux zone',
ShowAreaNamesTitle: "Affiche le nom du lieu au milieu du lieu zone",
ShowLockLevel: 'Afficher le niveau de verrouillage',
ShowLockLevelTitle: "Afficher le niveau de verrouillage du lieu au milieu du lieu zone",
ShowPLAName: 'Afficher le nom des parkings',
ShowPLANameTitle: 'Affiche le nom du parking au milieu du lieu zone',
Item: 'Option',
PlaceMenuCustomization: "Personnalisation du menu Lieu",
ClearDescription: "Afficher le bouton «Effacer description»",
ClearDescriptionTitle: "Ajoute un bouton «Effacer description» en haut à droite de l'entrée de description qui, lorsqu'il est cliqué, effacera tout le texte dans le champ de saisie",
PropertiesPanel: "Panneau des propriétés",
FontSize: "Font size",
FontColor: "Font color",
Bold: "Bold",
FontOutlineColor: "Font outline color",
FontOutlineWidth: "Font outline width",
ProdPL: "Force production PL",
MoveAddress: "Move address to top of panel",
MoveAddressTitle: "Moves the address editor to the top of the properties panel",
MoveHNEntry: "Move HN entry before street entry",
MoveHNEntryTitle: "Moves the House Number entry before the Street entry in the address editor",
ShowParkingSpaceEstimatorTool: "Show Parking Space Estimator tool",
ShowParkingSpaceEstimatorToolTitle: "Shows the button to launch the Parking Space Estimator tool",
PSEParkingSpaceEstimator: "Parking Space Estimator",
PSELayoutType: "Layout type",
PSE90degree: "90 degree",
PSEAngled: "Angled",
PSEEstimatedNumOfSpots: "Estimated # of spots: ",
PSESet: "Set",
PSESpotWidth: "Spot width (m)",
PSECal: "Cal",
PSEDraw90DegreeTitle: "Click to draw a line through an entire 90 degree parking space aisle. Double click to finish drawing and measure the spaces.",
PSEDrawAngledTitle: "Click to draw a line through an entire angled parking space aisle. Double click to finish drawing and measure the spaces.",
PSEShowPSEButton: "Show Parking Space Estimator tool button",
PSEShowPSEButtonTitle: "Shows the button to launch the Parking Space Estimator tool",
PSEDisplayButtonTitle: "Opens the Parking Space Estimator tool"
}
}
});
}
function setTranslations(translations) {
I18n.translations[I18n.currentLocale()].pie = translations.en;
for (var i = 0; i < Object.keys(translations).length; i++) {
var locale = Object.keys(translations)[i];
if (I18n.currentLocale() == locale) {
I18n.translations[locale].pie.prefs = translations[locale].prefs;
return;
}
}
}
function listPlaces(){
var category = "";
for(i=0; i