WME Validator NC Localization Test

This script localizes WME Validator for United States. You also need main package (WME Validator) installed.

目前為 2014-10-24 提交的版本,檢視 最新版本

// ==UserScript==
// @name                WME Validator NC Localization Test
// @version             1.1.7
// @description         This script localizes WME Validator for United States. You also need main package (WME Validator) installed.
// @match               https://editor-beta.waze.com/*editor/*
// @match               https://www.waze.com/*editor/*
// @grant               none
// @run-at              document-start
// @namespace https://greasyfork.org/users/6285
// ==/UserScript==
//
/*
  See Settings->About->Available checks for complete list of checks and their params.

  Examples:

  Enable #170 "Lowercase street name" but allow lowercase "exit" and "to":
    "170.enabled": true,
    "170.params": {
        "regexp": "/^((exit|to) )?[a-z]/",
    "},

  Enable #130 "Custom check" to find a dot in street names, but allow dots at Ramps:
    "130.enabled": true,
    "130.params": {
        "titleEN": "Street name with a dot",
        "problemEN": "There is a dot in the street name (excluding Ramps)",
        "solutionEN": "Expand the abbreviation or remove the dot",
        "template": "${type}:${street}",
        "regexp": "D/^[^4][0-9]?:.*\\./",
    },
    *Note: use D at the beginning of RegExp to enable debugging on JS console.
    *Note: do not forget to escape backslashes in strings, i.e. use "\\" instead of "\".
*/

window.WME_Validator_United_States = {
  ".country": "United States",
  ".codeISO": "US",
  ".author": "s18slider",
  ".updated": "2014-10-23",
  ".link": "TODO: ",
  "130.enabled": true,
  "130.params": {
    "titleEN": "Wrong name on state highway",
    "problemEN": "All state highways should be named NC- in North Carolina",
    "solutionEN": "Change name to NC-XX",
    "template": "${state}:##${street}##${altStreet[0]}##${altStreet[1]}##${altStreet[2]}##${altStreet[3]}##${altStreet[4]}##${altStreet[5]}##${altStreet[6]}##${altStreet[7]}##${altStreet[8]}##${altStreet[9]}",
    "regexp": "/^North Carolina:.*##(State Hwy|SR-|SH-)/"
  },
  "130.solutionLink": "W:North_Carolina#Roads",
  "131.enabled": true,
  "131.params": {
    "titleEN": "Wrong road type",
    "problemEN": "All US Highways should be at least Major Highway (except BUS, SPUR, LOOP)",
    "solutionEN": "Change the road type to Major Highway",
    "template": "${typeRank}##${street}##${altStreet[0]}##${altStreet[1]}##${altStreet[2]}##${altStreet[3]}##${altStreet[4]}##${altStreet[5]}##${altStreet[6]}##${altStreet[7]}##${altStreet[8]}##${altStreet[9]}",
    "regexp": "/^[1-9](?![245]).*##(US Hwy|US-)[^#]*(?!BUS|SPUR|LOOP)/i"
  },
  "131.solutionLink": "W:Road_types/USA#Major_Highway",
  "132.enabled": true,
  "132.params": {
    "titleEN": "Wrong road type",
    "problemEN": "All State Highways should be at least Minor Highway type (except BUS, SPUR, LOOP)",
    "solutionEN": "Change the road type to Minor Highway",
    "template": "${typeRank}##${street}##${altStreet[0]}##${altStreet[1]}##${altStreet[2]}##${altStreet[3]}##${altStreet[4]}##${altStreet[5]}##${altStreet[6]}##${altStreet[7]}##${altStreet[8]}##${altStreet[9]}",
    "regexp": "/^[1-9](?![2-5]).*##(State Hwy|SR-|SH-|NC-)[^#]*(?!BUS|SPUR|LOOP)/i"
  },
  "133.enabled": true,
  "133.params": {
    "titleEN": "Business Abbreviated Wrong",
    "problemEN": "Business Highways should be abbreviated at Bus instead of BUS",
    "solutionEN": "Change Highway abbreviation from Bus to BUS",
    "template": "${street}",
    "regexp": "/!?[0-9] Bus?/"
  },
  "150.enabled": true,
  "150.params": {
  // {number} minimum lock level
  "n": 5,
  },
  "151.enabled": true,
  "151.params": {
  // {number} minimum lock level
  "n": 3,
  },
  "152.enabled": true,
  "152.params": {
  // {number} minimum lock level
  "n": 2,
  },
  "153.enabled": true,
  "153.params": {
    // {number} minimum lock level
    "n": 3,
  },
  "154.enabled": false,
  "154.params": {
  // {number} minimum lock level
  "n": 2,
  },
};