Skip to content

Commit

Permalink
Remove parking lot brand code (not in WME anymore)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Freese committed Aug 27, 2024
1 parent b26b512 commit 74c5b61
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions WME-Place-Harmonizer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name WME Place Harmonizer Beta
// @namespace WazeUSA
// @version 2024.08.18.000
// @version 2024.08.27.000
// @description Harmonizes, formats, and locks a selected place
// @author WMEPH Development Group
// @include /^https:\/\/(www|beta)\.waze\.com\/(?!user\/)(.{2,6}\/)?editor\/?.*$/
Expand Down Expand Up @@ -4961,22 +4961,17 @@ id="WMEPH-zipAltNameAdd"autocomplete="off" style="font-size:0.85em;width:65px;pa

static isWhitelisted(args) {
return super.isWhitelisted(args)
|| (args.venue.isParkingLot() && !this.#venueHasOperator(args.venue))
|| PRIMARY_CATS_TO_FLAG_GREEN_MISSING_PHONE_URL.includes(args.categories[0])
|| ANY_CATS_TO_FLAG_GREEN_MISSING_PHONE_URL.some(category => args.categories.includes(category));
}

static venueIsFlaggable(args) {
return !args.url?.trim().length
&& (!args.venue.isParkingLot()
|| (args.venue.isParkingLot() && (REGIONS_THAT_WANT_PLA_PHONE_URL.includes(args.region) || this.#venueHasOperator(args.venue))))
|| (args.venue.isParkingLot() && REGIONS_THAT_WANT_PLA_PHONE_URL.includes(args.region)))
&& !PRIMARY_CATS_TO_IGNORE_MISSING_PHONE_URL.includes(args.categories[0]);
}

static #venueHasOperator(venue) {
return venue.attributes.brand && W.model.categoryBrands.PARKING_LOT.includes(venue.attributes.brand);
}

static #getTextbox() {
return $(`#${Flag.UrlMissing.#TEXTBOX_ID}`);
}
Expand Down Expand Up @@ -5072,8 +5067,7 @@ id="WMEPH-zipAltNameAdd"autocomplete="off" style="font-size:0.85em;width:65px;pa
noBannerAssemble = true;

static isWhitelisted(args) {
return (args.venue.isParkingLot() && !Flag.PhoneMissing.#venueHasOperator(args.venue))
|| super.isWhitelisted(args)
return super.isWhitelisted(args)
|| PRIMARY_CATS_TO_FLAG_GREEN_MISSING_PHONE_URL.includes(args.categories[0])
|| ANY_CATS_TO_FLAG_GREEN_MISSING_PHONE_URL.some(category => args.categories.includes(category));
}
Expand All @@ -5082,14 +5076,10 @@ id="WMEPH-zipAltNameAdd"autocomplete="off" style="font-size:0.85em;width:65px;pa
return !args.phone
&& !FlagBase.currentFlags.hasFlag(Flag.AddRecommendedPhone)
&& (!args.venue.isParkingLot()
|| (args.venue.isParkingLot() && (REGIONS_THAT_WANT_PLA_PHONE_URL.includes(args.region) || this.#venueHasOperator(args.venue))))
|| (args.venue.isParkingLot() && REGIONS_THAT_WANT_PLA_PHONE_URL.includes(args.region)))
&& !PRIMARY_CATS_TO_IGNORE_MISSING_PHONE_URL.includes(args.categories[0]);
}

static #venueHasOperator(venue) {
return venue.attributes.brand && W.model.categoryBrands.PARKING_LOT.includes(venue.attributes.brand);
}

action() {
const newPhone = normalizePhone($('#WMEPH-PhoneAdd').val(), this.args.outputPhoneFormat);
if (newPhone === BAD_PHONE || !newPhone) {
Expand Down Expand Up @@ -10329,7 +10319,7 @@ id="WMEPH-zipAltNameAdd"autocomplete="off" style="font-size:0.85em;width:65px;pa
function waitForReady() {
return new Promise(resolve => {
function loop() {
if (typeof W === 'object' && W.userscripts?.state.isReady && WazeWrap?.Ready && W.model.categoryBrands.PARKING_LOT) {
if (typeof W === 'object' && W.userscripts?.state.isReady && WazeWrap?.Ready) {
resolve();
} else {
setTimeout(loop, 100);
Expand Down

0 comments on commit 74c5b61

Please sign in to comment.