");
for(var i=0;i" + (i+1) + "");
}
return $lockLevels.html();
}
function attachRPPLockButtonHandlers(){
$('#pieRPPLockButtonsContainer').remove();
W.selectionManager.events.register("selectionchanged", null, addLockButtons);
W.model.actionManager.events.register("afterundoaction",null, addLockButtons);
W.model.actionManager.events.register("afterclearactions",null, addLockButtons);
W.model.actionManager.events.register("afteraction",null, addLockButtons);
}
function attachPlaceSizeHandlers(){
W.selectionManager.events.register("selectionchanged", null, updatePlaceSizeDisplay);
W.model.actionManager.events.register("afteraction",null, updatePlaceSizeDisplay);
W.model.actionManager.events.register("afterundoaction",null, updatePlaceSizeDisplay);
W.model.actionManager.events.register("afterclearactions",null, updatePlaceSizeDisplay);
W.model.actionManager.events.register("noActions",null, noActions);
updatePlaceSizeDisplay();
}
function removePlaceSizeHandlers(){
W.selectionManager.events.unregister("selectionchanged", null, updatePlaceSizeDisplay);
W.model.actionManager.events.unregister("afteraction",null, updatePlaceSizeDisplay);
W.model.actionManager.events.unregister("afterundoaction",null, updatePlaceSizeDisplay);
W.model.actionManager.events.unregister("afterclearactions",null, updatePlaceSizeDisplay);
W.model.actionManager.events.unregister("noActions",null, noActions);
}
var currLinkClass = []; //We have to keep track of the current status in case the user toggled the linking due to the panel getting rebuilt after every action
function ShowNavPointLink(){
$('#pieNavLink').remove();
return;
if(W.selectionManager.selectedItems.length > 0){
if(W.selectionManager.selectedItems[0].model.type === "venue" && W.selectionManager.selectedItems[0].model.isPoint()){
if(currLinkClass.length == 0 || currLinkClass[0] != W.selectionManager.selectedItems[0].model.attributes.id){ //First time this place has been selected
currLinkClass[0] = W.selectionManager.selectedItems[0].model.attributes.id;
currLinkClass[1] = (settings.NavLink ? "fa fa-link fa-lg" : "fa fa-chain-broken fa-lg");
}
var $NavLink;
if(W.selectionManager.selectedItems[0].model.attributes.categories.contains("RESIDENCE_HOME")){
$NavLink = $('
');
$('#landmark-edit-general > form > div:nth-child(2) > i').after($PlaceCopyButton);
$('#pieCopyPlaceButton').click(function(){
var PlaceObject = require("Waze/Feature/Vector/Landmark");
var AddPlace = require("Waze/Action/AddLandmark");
var NewPlace = new PlaceObject();
var oldPlace = W.selectionManager.selectedItems[0].model;
NewPlace.attributes.name = oldPlace.attributes.name + " (copy)";
NewPlace.attributes.phone = oldPlace.attributes.phone;
NewPlace.attributes.url = oldPlace.attributes.url;
NewPlace.attributes.categories = oldPlace.attributes.categories.clone();
NewPlace.attributes.aliases = oldPlace.attributes.aliases.clone();
NewPlace.attributes.description = oldPlace.attributes.description;
NewPlace.attributes.houseNumber = oldPlace.attributes.houseNumber;
NewPlace.attributes.lockRank = oldPlace.attributes.lockRank;
NewPlace.attributes.geometry = oldPlace.attributes.geometry.clone();
if(oldPlace.attributes.geometry.toString().match(/^POLYGON/)){
var convertedCoords;
for(var i=0; i 0){
if(W.selectionManager.selectedItems[0].model.type === "venue"){
var $search = $('');
$('.address-edit-view').parent().parent().find('.control-label').attr("style", "display:inline");
$('.address-edit').before($search);
$('#pieSearchButton').click(function(){
var address = $('.full-address')[0].innerHTML;
var noCity = I18n.translations[I18n.currentLocale()].edit.address.no_city;
var noStreet = I18n.translations[I18n.currentLocale()].edit.address.no_street;
address = address.replace(noCity + ",","");
if(address !== I18n.translations[I18n.currentLocale()].edit.landmark.no_address)
$('.search-query')[0].value = address;
});
}
}
}
function ShowClearDescription(){
$('#landmark-edit-general textarea').parent().append('');
$('#landmark-edit-general textarea').parent().css('position', 'relative');
$('.clearButton').click(function(){
W.model.actionManager.add(new UpdateObject( W.selectionManager.selectedItems[0].model, { description: "" }));
});
}
function MoveAddress(){
if(W.selectionManager.selectedItems.length > 0)
if(W.selectionManager.selectedItems[0].model.type === "venue")
$('#landmark-edit-general').prepend($('.address-edit.side-panel-section'));
}
function MoveHNEntry(){
if(W.selectionManager.selectedItems.length > 0)
if(W.selectionManager.selectedItems[0].model.type === "venue")
$('.full-address').click(function(){
$('.street-name').parent().parent().before($('.house-number').parent().parent());
});
}
function AddPlaceCategoriesButtons(){
$('#piePlaceCategoriesButtonsContainer').remove();
if(W.selectionManager.selectedItems.length > 0){
if(W.selectionManager.selectedItems[0].model.type === "venue"){
var $container = $('
',{id:'piePlaceCategoriesButtonsContainer', style:'white-space: nowrap;'});
var categoryOptions = $('[id^=pieItem]');
var $button = $('
',{id:'btnPlaceCatClear', title:'Clear current categories', style:'display:inline-block; cursor:pointer'}).click(function() { onPlaceCategoriesButtonsClick(this.id); });
$button.append('');
$container.append($button);
for(var i=0;i',{ class:'pie-'+icon, id:divid, title:name.replace('&', '&'), style:'display:inline-block; cursor:pointer', 'data-category':categoryOptions[i].value}).click(function() { onPlaceCategoriesButtonsClick(this.id); });
$button.append('');
$container.append($button);
}
}
}
$('.categories.controls').before($container);
}
}
function onPlaceCategoriesButtonsClick(buttonid){
if(buttonid === "btnPlaceCatClear"){
var blankCategories = []; //W.selectionManager.selectedItems[0].model.attributes.categories.clone();
//console.log(blankCategories.length);
//blankCategories.splice(0, blankCategories.length);
//console.log(blankCategories);
W.model.actionManager.add(new UpdateObject(W.selectionManager.selectedItems[0].model, { categories: blankCategories }));
}
else{
var newCategories = W.selectionManager.selectedItems[0].model.attributes.categories.clone();
//console.log($('#'+buttonid)[0].getAttribute("data-category"));
newCategories.push($('#'+buttonid)[0].getAttribute("data-category"));
W.model.actionManager.add(new UpdateObject(W.selectionManager.selectedItems[0].model, {categories: newCategories}));
}
}
function CenterOnPlace(venue, zoom){
var centroid = venue.geometry.getCentroid();
W.map.setCenter([centroid.x, centroid.y], zoom);
}
function isChecked(checkboxId) {
return $('#' + checkboxId).is(':checked');
}
function setChecked(checkboxId, checked) {
$('#' + checkboxId).prop('checked', checked);
}
function noActions(){
setTimeout(updatePlaceSizeDisplay, 100 ); //have to put in a delay for when the user uses undo to clear all actions - WME updates on top of my changes otherwise.
}
function updatePlaceSizeDisplay(){
var count = W.selectionManager.selectedItems.length;
var metersArea = 0;
var bold = false;
if(count === 1){
var venue = W.selectionManager.selectedItems[0];
var isArea = venue.geometry.toString().match(/^POLYGON/);
//var isPoint = venue.geometry.toString().match(/^POINT/);
if(venue.model.type === "venue" && isArea){
if($('#AreaSize'))
$('#AreaSize').remove();
metersArea = W.selectionManager.selectedItems[0].model.geometry.getGeodesicArea(W.map.getProjectionObject());
if(metersArea > 0 && isArea){
var ftArea = Math.round(metersArea * 10.76391 *100)/100;
var list = $('#landmark-edit-general > ul')[0];
var newList = document.createElement("UL");
newList.id = "AreaSize";
var newItem = document.createElement("LI");
if(isChecked("_cbShowAreaPlaceSizeMetric")){
newItem.innerHTML = "Area: " + metersArea.toFixed(2) + " m2";
newList.appendChild(newItem);
}
if(isChecked("_cbShowAreaPlaceSizeImperial")){
newItem = document.createElement("LI");
newItem.innerHTML = "Area: " + ftArea.toFixed(2) + " ft2";
newList.appendChild(newItem);
}
if(metersArea < 500){
newItem = document.createElement("LI");
newItem.innerHTML = "Places smaller than 500 m2/5382 ft2 will not show in the client";
newList.appendChild(newItem);
}
if(metersArea > 20000){
newItem = document.createElement("LI");
newItem.innerHTML = "Places larger than 20000 m2/215278.2 ft2 will always show in the client";
newList.appendChild(newItem);
}
if(list.before != null)
list.before(newList);
else{
var parent = $('#landmark-edit-general > ul')[0].parentNode;
parent.insertBefore(newList,$('#landmark-edit-general > ul')[0]);
}
$('#AreaSize').addClass("list-unstyled");
$('#AreaSize').addClass("additional-attributes");
}
}
}
}
//Using the same display for lock buttons as ClickSaver (with permission from MapoMatic) - thanks MoM!
function addLockButtons() {
if(W.selectionManager.selectedItems.length > 0){
var item = W.selectionManager.selectedItems[0];
var isRPP = item.model.type === "venue" && item.model.isResidential(); //(item.model.type === "venue" && item.model.attributes.residential === true);
if(isRPP){
var attr = item.model.attributes;
var autoRank = attr.rank;
var manualRank = attr.lockRank;
var firstManualRank = manualRank;
var userRank = WazeWrap.User.Rank() - 1;
var maxAutoRank = autoRank;
var disabled = false;
var $div = $('#pieRPPLockButtonsContainer');
$div.remove();
$div = $('
',{id:'pieRPPLockButtonsContainer',style:'margin-bottom:5px;'});
$div.append('');
var $controls = $('
', {class:'waze-radio-container'});
var btnInfos = [];
for(var iBtn=0;iBtn<=6;iBtn++){btnInfos.push({r:iBtn,val:iBtn});}
btnInfos.forEach(function(btnInfo){
var selected = (btnInfo.val == manualRank);
disabled = userRank < btnInfo.val;
if (btnInfo.val !== 6) {
$controls.append(
$(``)
.click(function() {
if((userRank >= parseInt($(this).attr('value'))) && (btnInfo.r < 6)) {
W.model.actionManager.add(new UpdateObject(item.model,{lockRank:(parseInt($(this).attr('value')))}));
addLockButtons();
}
})
);
}
});
$div.append($controls);
$('#landmark-edit-general > form.attributes-form.side-panel-section').after($div);
}
}
}
var getPermalink = function(currPl) {
var adjustedPL = currPl.substr(currPl.lastIndexOf('editor')).replace(/&[^&]*Filter=[^&]*|&s=(\d+)/ig,'');
var lon = adjustedPL.match(/lon=(-?\d+\.\d+)/)[1];
var lat = adjustedPL.match(/lat=(-?\d+\.\d+)/)[1];
var zoom = adjustedPL.match(/zoom=\d+/)[0];
var centroid = W.selectionManager.selectedItems[0].model.geometry.getCentroid();
adjustedPL = adjustedPL.replace(lon, WazeWrap.Geometry.ConvertTo4326(centroid.x,centroid.y).lon);
adjustedPL = adjustedPL.replace(lat, WazeWrap.Geometry.ConvertTo4326(centroid.x,centroid.y).lat);
adjustedPL = adjustedPL.replace(zoom, "zoom="+settings.PlaceZoom);
if(settings.PlaceLocatorCrosshairProdPL)
return 'https://www.waze.com/' + adjustedPL;
else
return location.origin + '/' + adjustedPL;
};
var copyToClipboard = function(str) {
var $temp = $('');
$('body').append($temp);
$temp.val(str).select();
document.execCommand('copy');
$temp.remove();
};
function buildItemList(itemNumber){
var $places = $("
");
$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;}',
//hijacking new WME Place icons
'.pie-car-services {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: -29px -63px; width: 14px; height: 13px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { .pie-car-services {background-image: url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'.pie-transportation {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: -56px -63px; width: 12px; height: 12px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-transportation {background-image: url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png);background-size: 99px 87px; } }',
'.pie-professional-and-public {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: 0px -76px; width: 13px; height: 11px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-professional-and-public {background-image:url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'.pie-shopping-and-services {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: -88px 0px; width: 11px; height: 13px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-shopping-and-services {background-image:url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'.pie-food-and-drink {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: -65px 0px; width: 13px; height: 16px; } @mediait-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-food-and-drink {background-image:ditor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'.pie-culture-and-entertainement {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: -30px -37px; width: 16px; height: 14px; }edia (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-culture-and-entertainement {background-image:ditor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'.pie-other {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: 0px -63px; width: 15px; height: 13px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-other {background-image:url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'.pie-lodging {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: -20px -52px; width: 17px; height: 10px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-lodging {background-image:url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'.pie-outdoors {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: 0px -52px; width: 20px; height: 11px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-outdoors {background-image:url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'.pie-natural-features {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: -16px -21px; width: 17px; height: 15px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-natural-features {background-image:url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'.pie-parking-lot {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: -65px -48px; width: 13px; height: 13px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-parking-lot {background-image:url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'.pie-residential {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: -15px -37px; width: 15px; height: 14px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {.pie-residential {background-image:url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }',
'#edit-buttons .residential .item-icon::after {background-image: url(//editor-assets.waze.com/beta/img/toolbar022c8e4d1f16c3825705364ff337bf1b.png); background-position: -15px -37px; width: 15px; height: 14px; } @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {#edit-buttons .residential .item-icon::after {background-image: url(//editor-assets.waze.com/beta/img/toolbar@2xcd8b2ab08e978d00eeee7817e1a0edda.png); background-size: 99px 87px; } }'
].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: false,
PLNormalSpotWidth: 3.44,
PLAngledSpotWidth: 3,
ShowPLSpotEstimatorButton: false,
ShowNavPointClosestSegmentOnHover: true,
ShowClosestSegmentSelected: false,
NavLink: false,
ToggleAreaPlacesShortcut: 'CS+a',
EnableGLE: 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(W.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,
ShowClosestSegmentSelected: settings.ShowClosestSegmentSelected,
NavLink: settings.NavLink,
ToggleAreaPlacesShortcut: settings.ToggleAreaPlacesShortcut,
EnableGLE: settings.EnableGLE
};
for (var name in W.accelerators.Actions) {
var TempKeys = "";
if (W.accelerators.Actions[name].group == 'wmepie') {
if (W.accelerators.Actions[name].shortcut) {
if (W.accelerators.Actions[name].shortcut.altKey === true) {
TempKeys += 'A';
}
if (W.accelerators.Actions[name].shortcut.shiftKey === true) {
TempKeys += 'S';
}
if (W.accelerators.Actions[name].shortcut.ctrlKey === true) {
TempKeys += 'C';
}
if (TempKeys !== "") {
TempKeys += '+';
}
if (W.accelerators.Actions[name].shortcut.keyCode) {
TempKeys += W.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",
ShowNavPointClosestSegmentOnHover: "Display the nav point and closest segment line on hover",
ShowClosestSegmentSelected: "Display a line from the nav point to the point on the closest segment",
NavLink: "Link nav point",
NavLinkTitle: "Enables the nav point link on all point Places. When linked, the nav point will move to the location of the point Place when the Place is moved",
EnableGLE: "Enable Google Link Enhancer",
EnableGLETitle: "Highlights closed Google links in red, linked Google POIs > 400m from the Waze Place in teal, invalid Google links in magenta, Google POIs linked multiple times in yellow, already linked POI in gray (autocomplete menu)"
},
filter: {
PlaceFilterPanel: 'Place Filtering',
filter: 'Filter',
Hide: 'Hide',
Show: 'Show only'
},
hoursParser: {
defaultText: 'Paste Hours Here',
AddHours: 'Add hours',
AddHoursTitle: 'Add pasted hours to existing',
ReplaceHours: 'Replace all hours',
ReplaceHoursTitle: 'Replace existing hours with pasted hours',
errorSameOpenClose: 'Same open and close times detected',
errorOverlappingHours: 'Overlapping hours detected',
errorCannotParse: 'Unable to parse the provided hours'
},
GLE:{
closedPlace: 'Google indicates this place is permanently closed.\nVerify with other sources or your editor community before deleting.',
multiLinked: 'Linked more than once already. Please find and remove multiple links.',
linkedToThisPlace: 'Already linked to this place',
linkedNearby: 'Already linked to a nearby place',
linkedToXPlaces: 'This is linked to {0} places',
badLink: 'Invalid Google link. Please remove it.',
tooFar: 'The Google linked place is more than {0} meters from the Waze place. Please verify the link is correct.'
}
},
"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",
ShowNavPointClosestSegmentOnHover: "Display the nav point and closest segment line on hover",
ShowClosestSegmentSelected: "Display a line from the nav point to the point on the closest segment",
NavLink: "Link nav point",
NavLinkTitle: "Enables the nav point link on all point Places. When linked, the nav point will move to the location of the point Place when the Place is moved",
EnableGLE: "Habilitar mejoras en links de Google",
EnableGLETitle: "Resalta los GPIDs a lugares cerrados en rojo, GPIDs a mas de 400m del lugar en Waze en verde azulado, GPIDs no válidos en magenta, GPIDs vinculados varias veces en amarillo, GPIDs ya vinculados en gris (menú de autocompletar)"
},
filter: {
PlaceFilterPanel: 'Place Filtering',
filter: 'Filter',
Hide: 'Hide',
Show: 'Show only'
},
hoursParser: {
defaultText: 'Paste Hours Here',
AddHours: 'Add hours',
AddHoursTitle: 'Add pasted hours to existing',
ReplaceHours: 'Replace all hours',
ReplaceHoursTitle: 'Replace existing hours with pasted hours',
errorSameOpenClose: 'Same open and close times detected',
errorOverlappingHours: 'Overlapping hours detected',
errorCannotParse: 'Unable to parse the provided hours'
},
GLE:{
closedPlace: 'Google indica que este lugar está permanentemente cerrado. Verifica con otras fuentes o tu comunidad de edición antes de eliminar.',
multiLinked: 'Vinculado más de una vez. Encuentra y elimina enlaces múltiples.',
linkedToThisPlace: 'Ya vinculado a este lugar',
linkedNearby: 'Ya vinculado a un lugar cercano',
linkedToXPlaces: 'Esto está vinculado a {0} lugares',
badLink: 'Enlace de Google no válido. Por favor elimínalo.',
tooFar: 'El lugar vinculado a Google está a más de {0} metros del lugar de Waze. Verifica que el enlace sea correcto.'
}
},
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: "Taille de police",
FontColor: "Couleur de police",
Bold: "Gras",
FontOutlineColor: "Couleur surlignage police",
FontOutlineWidth: "Épaisseur surlignage police",
ProdPL: "Force production PL",
MoveAddress: "Déplacer l'adresse en haut du panneau",
MoveAddressTitle: "Déplace l'édition d'adresse en haut du panneau de propritétés",
MoveHNEntry: "Placer n° de rue avant nom de rue",
MoveHNEntryTitle: "Place l'édition du numéro de rue avant le nom de la rue dans l'éditeur d'adresse",
ShowParkingSpaceEstimatorTool: "Afficher le simulateur de places de stationnement",
ShowParkingSpaceEstimatorToolTitle: "Affiche un bouton pour lancer le simulateur de places de stationnement",
PSEParkingSpaceEstimator: "Simulateur places de stationnement",
PSELayoutType: "Emplacements:",
PSE90degree: "A 90 degrés",
PSEAngled: "Inclinés",
PSEEstimatedNumOfSpots: "Nombre estimé de places: ",
PSESet: "Set",
PSESpotWidth: "Largeur place (m)",
PSECal: "Cal",
PSEDraw90DegreeTitle: "Cliquez pour dessiner une ligne passant à travers les emplacements de parking à 90°. Double-cliquez pour terminer le tracé et mesurer les espaces.",
PSEDrawAngledTitle: "Cliquez pour dessiner une ligne passant à travers les emplacements de parking inclinés. Double-cliquez pour terminer le tracé et mesurer les espaces.",
PSEShowPSEButton: "Afficher le simulateur de places de stationnement",
PSEShowPSEButtonTitle: "Affiche un bouton pour lancer le simulateur de places de stationnement",
PSEDisplayButtonTitle: "Ouvre le simulateur de places de stationnement",
ShowNavPointClosestSegmentOnHover: "Affiche une ligne entre le point d'entrée et le segment le plus proche",
ShowClosestSegmentSelected: "Display a line from the nav point to the point on the closest segment",
NavLink: "Link nav point",
NavLinkTitle: "Enables the nav point link on all point Places. When linked, the nav point will move to the location of the point Place when the Place is moved",
EnableGLE: "Enable Google Link Enhancer",
EnableGLETitle: "Highlights closed Google links in red, linked Google POIs > 400m from the Waze Place in teal, invalid Google links in magenta, Google POIs linked multiple times in yellow, already linked POI in gray (autocomplete menu)"
},
filter: {
PlaceFilterPanel: 'Place Filtering',
filter: 'Filter',
Hide: 'Hide',
Show: 'Show only'
},
hoursParser: {
defaultText: 'Paste Hours Here',
AddHours: 'Add hours',
AddHoursTitle: 'Add pasted hours to existing',
ReplaceHours: 'Replace all hours',
ReplaceHoursTitle: 'Replace existing hours with pasted hours',
errorSameOpenClose: 'Same open and close times detected',
errorOverlappingHours: 'Overlapping hours detected',
errorCannotParse: 'Unable to parse the provided hours'
},
GLE:{
closedPlace: 'Google indicates this place is permanently closed.\nVerify with other sources or your editor community before deleting.',
multiLinked: 'Linked more than once already. Please find and remove multiple links.',
linkedToThisPlace: 'Already linked to this place',
linkedNearby: 'Already linked to a nearby place',
linkedToXPlaces: 'This is linked to {0} places',
badLink: 'Invalid Google link. Please remove it.',
tooFar: 'The Google linked place is more than {0} meters from the Waze place. Please verify the link is correct.'
}
}
});
}
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
");
$('#detailsWrap').append("
");
var dataID = $('#detailsWrap').parent().find('img')[0].src;
dataID = /_(.+)/g.exec(dataID)[1];
$('#DeleteFromImageDialog').click(function(){
$('div[data-id="' + dataID + '"] button.image-delete-button').click();
$('.venue-image-dialog').find('.close').click();
});
//Image dialog navigation arrows
if(W.selectionManager.selectedItems[0].model.attributes.images.length > 1){
let thisImageIndex;
let PlaceImages = W.selectionManager.selectedItems[0].model.attributes.images;
for(let i=0; i