WME UR Comments (Stable)

This script is for replying to user requests the goal is to speed up and simplify the process. Thanks to Chat Jumper and URO+!

目前为 2014-12-06 提交的版本。查看 最新版本

// ==UserScript==
// @name           WME UR Comments (Stable)

// @description    This script is for replying to user requests the goal is to speed up and simplify the process. Thanks to Chat Jumper and URO+!
// @namespace      [email protected]
// @grant          none
// @grant          GM_info
// @version        0.4.2
// @match          https://editor-beta.waze.com/*editor/*
// @match          https://www.waze.com/*editor/*
// @author         Rick Zabel '2014
// @license        MIT/BSD/X11
// ==/UserScript==



window.URCommentVersion = "0.4.2";
window.URCommentUpdateMessage = "yes"; // yes alert the user, no has a silent update.

window.URCommentVersionUpdateNotes = "UR Comments has been updated to " + URCommentVersion;
//window.URCommentVersionUpdateNotes = window.URCommentVersionUpdateNotes + "\r\n" + "Welcome new users!";
//window.URCommentVersionUpdateNotes = window.URCommentVersionUpdateNotes + "\r\n" + "Be sure to check out the options at the bottom of the UR Comment Tab. Each item has a tooltip describing the item";
//window.URCommentVersionUpdateNotes = window.URCommentVersionUpdateNotes + "\r\n" + "When a comment is clicked my script will find and add some scripting to the UR's send button, then after the send button is clicked it will trigger the option.";
//window.URCommentVersionUpdateNotes = window.URCommentVersionUpdateNotes + "\r\n" + "New feature is the ability to have your own custom comment list. The custom list is kind of a work around but if you edit the list carefully it should work great and not be over written when I release new versions of this script. Instructions and the link to the custom list are in the list drop down under the custom list";
window.URCommentVersionUpdateNotes = window.URCommentVersionUpdateNotes + "\r\n" + "There has been a couple requests from a few of you for auto zoom when doing the 4 day reminders with the map links. I have added a work around to get this functionality to work with the current way I am handling URs. Please be aware that I took a guess for the time delays between clicking show on in the UR and then zooming back out a bit and then grabbing the map location for the URL. What what works on my computer might not work on another or a slower internet connection. I also took a guess at what zoom level will work for most URs if you find that it is repeatedly way off let me know. Because of this I am not auto enabling this option like I have the others in the past. If you choose to test this option please copy paste the URL it creates back into your browser to verify that it is working correctly before sending bad links to the users. I would also verify many many many links, I have tested it at least 20 times in firefox and chrome and it appears to be working well enough that I am sending it to you all to beta test.";
//window.URCommentVersionUpdateNotes = window.URCommentVersionUpdateNotes + "\r\n" + "Change log:";
window.URCommentVersionUpdateNotes = window.URCommentVersionUpdateNotes + "\n" + "";

window.URCommentVersionUpdateNotes = window.URCommentVersionUpdateNotes + "\r\n" + "As usual let me know if there are any issues -RickZabel";

/* Changelog
 * 0.4.1 added AlanOfTheBerg  
 * 0.4.0 added HavanaDay 
 * 0.3.9 There has been a couple requests from a few of you for auto zoom when doing the 4 day reminders with the map links. I have added a work around to get this functionality to work with the current way I am handling URs. Please be aware that I took a guess for the time delays between clicking show on in the UR and then zooming back out a bit and then grabbing the map location for the URL. What what works on my computer might not work on another or a slower internet connection. I also took a guess at what zoom level will work for most URs if you find that it is repeatedly way off let me know. Because of this I am not auto enabling this option like I have the others in the past. If you choose to test this option please copy paste the URL it creates back into your browser to verify that it is working correctly before sending bad links to the users. I would also verify many many many links, I have tested it at least 20 times in firefox and chrome and it appears to be working well enough that I am sending it to you all to beta test.

 I also added label tags to the options so the text is now click-able
 * 0.3.8 added comment "Problem appears corrected." and moved zoom to the top of the script
 * 0.3.7 made the version update message wait until after the tab is loaded hopefully this will stop other scripts from throwing errors on page load when the version message is displayed. added a way for silent version to be applied. added beta tester "MojaveCactusMonkey"
 * 0.3.6fixed an error with case sensitivity n solved and not identified
 * missing comma causing syntax error
 * 0.3.3 - SuperMedic collaboration 
	replaced a bunch of JavaScript with jQuery the result is a noticeable speed boost.
	changed zoom out and other code improvements thanks to SuperMedic
	added comments for airports, area /parks, signal bug.
	moved valid route up the list
	changed Chicago Alleys to Alley Interference
	Wrong Driving Direction wording updated
	added a confirmation box to changing of comment lists so you don't loose unsaved edits.
	made the uro tags check exit the loop after not finding a tag so you do not get 100 alerts in a row!
	changed CSS for the way the comment tab and comments are added to fix a bug where selected segments stole the links
	changed the way i click WazeControlSave
	change the way i found the send button
	started to write the event handlers into the main functions
	alert unknown beta testers to pm me
	added Manual Refresh to the comment list
	added a new option to auto switch to the UR-comments tab on page load
 * 0.3.2 - I Tweaked the 7 day filter so now if the requester was the last person to comment these will not show up under the 7 day close. they do show up as New Requests / UR Replies. I also added a check for URO+ tags now if they no longer exist or were renamed we will be notified. I also hard coded uro's "Don't apply state/age filters to tagged URs" to be enabled.
 * 0.3.0 - There was a problem with the auto clicking of the solved option.
 * 0.2.9 - Changed the text color of the comments depending on their UR status. I also removed a section of code that was preventing right clicking
 * 0.2.8 - reworded tooltips added new comments.
 * 0.2.7 - On slow connections this script would close the UR before the comment was able to post, I added in a check that repeats its self every 500 milliseconds until the comment text area goes back to being empty.
 * 0.2.6 - added an URO option to only show the editors URS, made all the settings be enabled on first time running the script, added a zoom out button, added some checks to the 4-day reminder map zoom level for the link, changed font sizes, added headings,
 * 0.2.5 - 4 day tooltip wording changes
 * 0.2.4 - When we request more information from users Waze has the UR layer off on the link they send, so I changed the 4 day reminder message to include a link to the UR with the UR layer turned on. NOTE the 4 day reminder link will be taken from your current map view and zoom. So center the pin and set a zoom that makes sense before clicking 4 day reminder comment and try to only show one pin. I changed the way the options interact, broke apart auto close and auto reload. I also added a check on the URO presets to see if URO is installed. I think I fixed the bug that was keeping URComments from showing up some of the time.
 * 0.2.2 - bug fixes for firefox
 * 0.2.1 - added ability to have custom lists and preset lists
 * 0.2.0 - added new options for auto clicking ur status and auto saving after clicking stauts
 * 0.1.16 - URO+ added a new tag and zoom out after send
 * 0.1.15 - URO+ changed one of the tags for min replies changed to match
 * 0.1.14 - attempting to fix a bug in firefox and chrome each handles pub vars differently
 * 0.1.13 - Added a user setting for adding reply Instructions to the 4 day follow up
 * 0.1.11 - Added  version number to notifications
 * 0.1.1 - Added new version notifications
 * 0.1.0 - Close and Reloads the map if the following events happen, request has to be open, cicked any ur comment on the UrCommnet tab, then clicked send. this will force URO+ to reapply it's filter
 * 0.0.92 - added comment for clearing TTS Cache
 * 0.0.91 - changed generic error wording from can to would
 * 0.0.9 - Now working in FireFox
 * 0.0.8 - changed the code to look for the user tab instead of the buggy chat window before loading the ur comment tab
 * 0.0.8 - changed the code to look for the user tab instead of the buggy chat window before loading the ur comment tab
 * 0.0.7 - added code to set preset filters in URO+ (new / ur replies, 4day followup, 7 day close, URO clear ur filters)
 * 0.0.6 - rewrote majority of the code to pull comments out of an array and reuseable functions to generate the list / mouse clicks. also changed all instances of "rickzabelcomments" to "URComments"
 * 0.0.5 - added tool tips with the text of that comment
 * 0.0.4 - added Valid Route
 * 0.0.3 - added HawkeyGoals slightly edited Ur-comments
 * 0.0.2 - initial version
 */


/* Wishlist 
 *
 * /my own
 add <label> tags to check boxes
 figure out whay  set zoom fx isnt working in other fx
 remove alert from zoom out
 add check box for 4 day zoom in
 add notes to custom file about \n\n for new paragraph and
 Currently the title of the reminder comment must be "4 day Follow-Up". All the comments UR Status must use "Open", "Solved", or "NotIdentified". but all other titles and comments can be made custom.
 
 HavanaDay request autoclicking send 
 
 
 * change myArray to something unique
 * make the comments after the break have all the different ur "types" in the order they show up in when submitting urs.
 * make windows strings for each comment list and a holder for the comments so we dont have to reload the page to switch lists
 * add a 10 day uro preset that ignores "only my own option".
 * look into changing the presets to have text boxes for custom days (this might not work well with overlap between presets)
 * change mouse cursor on uro presets
 * change mouse curson on comment links
 *
 * work on getting the text not to wrap with SeekingSerenity's maximizer script
 * add peachez list
 * review my comment list errors with no text and wrong driving directions are the same. i might aadd auto fill in option and i would need a comment that matches the ur category
 *
 * /users
 * alanoftheberg change 7th day to 8th day to give user the full 7th day
 *
	24 hour warning was sent at 7 days find URs at 8 days
	check "Hide URs less than days old" "8" days old

	if you only want your own 
	check "no" for "With comments from me?"
	or possibly instead check "no" for "If last comment made by me"

	check "yes" on "If last comment made by UR reporter?"
	check "With less than" and put in "1" comments
	check "Last comment more than"  "1" days ago
 */
 
 
 
	/* need comments for each of these types
	var def_names = [];
	def_names[6] = "Incorrect turn";
	def_names[7] = "Incorrect address";
	def_names[8] = "Incorrect route";
	def_names[9] = "Missing roundabout";
	def_names[10] = "General error";
	def_names[11] = "Turn not allowed";
	def_names[12] = "Incorrect junction";
	def_names[13] = "Missing bridge overpass";
	def_names[14] = "Wrong driving direction";
	def_names[15] = "Missing Exit";
	def_names[16] = "Missing Road";
	def_names[18] = "Missing Landmark";
	def_names[19] = "Blocked Road";
	def_names[21] = "Missing Street Name";
	def_names[22] = "Incorrect Street Prefix or Suffix";
	*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
//the list of window vars
window.DotsString = "1"; 
	
window.BoilerPlateCreatorsArray = ["rickzabel",
    "DwarfLord",
    "Custom"
];
//get the SelectedBoilerPlateCreator
window.SelectedBoilerPlateCreator = localStorage.getItem('BoilerPlateCreators');

//alert(SelectedBoilerPlateCreator);
if (SelectedBoilerPlateCreator === "" || SelectedBoilerPlateCreator === null) {
     SelectedBoilerPlateCreator = "rickzabel";
    localStorage.setItem('BoilerPlateCreators', SelectedBoilerPlateCreator);
}
//set global comment var and array
//this is the array used to store the ur comments the format is name, comment, name, comment...

//comment arrays should follow the format
// "Title",     * is what will show up in the ur comment tab
// "comment",   * is the comment that will be sent to the user currently 
// "URStatus"   * this is action to take when the option "Auto Click Open, Solved, Not Identified" is on. after clicking send it will click one of those choices. usage is. "Open", or "Solved",or "NotIdentified",

/////////////////////////////////////



function URComments_bootstrap() {

    if (SelectedBoilerPlateCreator === "rickzabel") {

	/*

	"Problem appears corrected.",
	"Just a reminder: The problem appears corrected. Please let us know if you are continuing to have the issue. If there are no updates  we will close this report in a few days. Thanks! ",
	"Open",
	
	*/

        //rickzabel's list
        window.myArray = ["Errors with no descriptive text",
            "Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!",
            "Open",
            "4 day Follow-Up",
            "Just a reminder: We haven't received a response on your report. If we don't hear back from you we'll have to infer everything is okay and close the report. Thanks!",
            "Open",
            "7th day With No Response",
            "The problem was unclear and volunteers didn't receive a response. As you travel, please feel welcome to report any map issues you encounter. Thanks!",
            "NotIdentified",
            "Fixed",
            "Thanks to your report we've found and fixed a problem with the map. The fix should reach handheld devices within a week, but on rare occasions it can take closer to two weeks. ",
            "Solved",
			"Valid Route",
            "We reviewed the issue and did not find any map errors. It looks like Waze had a valid route. If you feel yours is correct keep driving that way. If it is indeed faster Waze will learn from your drives and route you and others the faster route. Thanks!",
            "Solved",
            "Thanks for the reply",
            "Thank you for the reply this request will be closed. As you travel, please feel welcome to report any map issues you encounter.",
            "Solved",
            "No further communication received.",
            "No further communication was received, this request will now be closed. As you travel, please feel welcome to report any map issues you encounter. Thanks!",
            "Solved",
            "No further communication received.",
            "No further communication was received, this request will now be closed. As you travel, please feel welcome to report any map issues you encounter. Thanks!",
            "NotIdentified",
            "Address fishing",
            "Waze does not tell us your starting or ending destinations. Would you tell us the address you are having problems with as you entered it into Waze?",
            "Open",
			"Problem appears corrected",
			"Just a reminder: The problem appears to be corrected. Please let us know if you are continuing to have the issue. If we do not hear from you in a few days we will close this report. Thanks!",
			"Open",			
            "<br>",
            "",
            "",
			"Missing Exit",
            "Would you please let us know what exit you believe is missing? Thanks!",
            "Open",
            "Turn Not Allowed",
            "Would you please let us know what turn was not, or should not be, allowed and the street names at the intersection? Thanks!",
            "Open",
            "Wrong Driving Direction",
            "Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!",
            "Open",
            "User Followed Waze's route",
            "It appears that you ended up going the route Waze suggested, what was the problem you were having? Would you tell us your destination as you entered it into Waze? Thanks!",
            "Open",              
            "Alley Interference",
            "Waze doesn't tell volunteer editors where you were going, although it was probably adjacent to the alley. If you would, please supply your destination as you entered it into Waze it may be helpful in correcting the route. Thanks!",
            "Open",
            "Road Closed",
            "Would you please let us know the following, what road is closed; between which intersections is this road closed; do you know how long this road is scheduled to be closed? Thanks!",
            "Open",
			"Area Entrances (Airport, amusement,  parks)",
			"We have had problems with Google pins being placed in the center of a large landmarks. Delete your previous search and do a new search for the location. Go to the bottom of the auto fill list to see more results and make sure you pick the Waze search engine. ",
			"Open",
            "48 Hour Reply",
            "Please allow 48 hours for changes to be reflected in the live map.",
            "Open",
            "Clear Saved Locations",
            "You should remove the location from your favorites and recent searches and then re-search for the location to update the result.",
            "Open",
            "Clear TTS Cache",
            "If you continue to have this problem you will need to clear your Text to Speech cache. Go to navigation screen and type cc@tts in search field and hit search. You should get a pop up message that the TTS file has been cleared. It will take a few days for the file to build back up with all the spoken street names.",
            "Open",
            "Address - Incorrect Position",
            "Thank you for your report. Would you please let us know what address you're reporting the problem with? You can also use the Report -> Places feature in Waze to mark the location. It is helpful that after taking a picture, if you move near the location your marking to save the place. Also, please do not submit pictures containing faces, license plates, or similar personal details. Thanks!",
            "Open",
            "Address - Missing from Map",
            "Thank you for your report. Would you please let us know where the address you're reporting is? The live map doesn't have all the street numbers for that street and Waze is interpolating in error. You can also use the Report -> Places feature in Waze to mark the location. It is helpful that after taking a picture, if you move near the location you’re marking to save the place. Also, please do not submit pictures containing faces, license plates, or similar personal details. Thanks!",
            "Open",
            "Address - Search Results Bad",
            "Thank you for your report. The search feature retrieves results from a number of locations, including Google. Scrolling to the bottom the Navigate screen, you'll see more results for 'name.' Select that and Waze will list locations Around You. From there, you can also select results from other search engines.",
            "Open",
            "Detours / Odd-Routing",
            "We can't find anything in the map to explain route Waze gave you. Waze wants to save you time every way it can and sometimes it suggests complex detours just to shave a few seconds off your trip. Waze may recommend a detour even after the traffic has cleared up because: it doesn't know yet, other Wazers may have reported a temporary street closure, or daily traffic patterns. In any event, we are very sorry to say that the volunteer map editors can't be much help here. Thanks!",
            "NotIdentified",
            "House Number Adjustment",
            "I've forced Waze to re-register the house number for your destination. I believe this should correct your issue. Please allow 48 hours for changes to be reflected in the live map. If the location is in your saved searches or favorites, please remove them and search for them again to pick up the change in the live map. Please let me know if you continue to experience the problem. Thanks!",
            "Open",
            "Missing Bridges or Roads",
            "The roads here have been pretty thoroughly mapped and we volunteers can't see anything missing that should ordinarily be there. Waze probably simply chose not to show you the feature in question. When moving at highway speeds, Waze deliberately chooses not to display some nearby features to avoid cluttering the screen. If you are certain a feature is missing from the map, please reply and tell us as much as possible about it. Thanks!",
            "Open",
            "Road Closure Request - Temporary",
            "How long is the road going to be closed? For closures of only a few days, we volunteer map editors can't be much help. It takes at least that long for our edits to make it to devices! When you encounter short-term road closures in the future, please use the Report->Closure feature in the Waze app. If this is a long-term closure please respond and let us know as much as you can. Thanks!",
            "Open",
            "Traffic - Stale Information",
            "Volunteer map editors can't do anything about Waze's traffic reporting. Waze relies on data from people using Waze to assess traffic. In the case of a fresh accident or slowdown, Waze may not yet have any data on the situation. Once Waze has detected a traffic situation, it can remember it for awhile, sometimes long after the situation changes.",
            "NotIdentified",
            "Traffic - Jams ",
            "To report traffic jam conditions, please use the Report -> Traffic Jam options in the Waze app. This will tell Waze about the problem in real-time. Traffic Jam reports can help route you and other Wazers around traffic problems.",
            "NotIdentified",
			"Signal Avoidance Bug",
			"I do not see any issues with the current turn restrictions in the area. This appears to be part of the known signal avoidance bug. Waze's developers are working on a fix for the issue but we do not have an ETA. Please feel free to take the turn until the issue is resolved. Thanks!",
			"NotIdentified",
			"Manual Refresh",
			"You can try a manual refresh by going to Settings > Advanced > Data transfer > refresh maps.",
			"Open"
	        ];
        window.ReplyInstructions = 'To reply to this request go to the following link and click the map pin, then click on the conversation button.';
        //end rickzabel's list

    } else if (SelectedBoilerPlateCreator === "hawkeygoal") {
        //Hawkeygoal's list
        window.myArray = ["Closed - Unclear",
            "The problem was unclear and volunteers didn't receive a response. Please feel welcome to report any map issues you encounter. Thanks!",
            "NotIdentified",
            "Closed - OK",
            "We haven't received a response and are inferring that all is well. Please feel welcome to report any map issues you encounter. Thanks!",
            "NotIdentified",
            "Reminder",
            "Just a reminder: We haven't received a response on your report. If we don't hear back from you we'll have to infer there is no continuing need for the report and close the report in a few days. Thanks!",
            "Open",
            "General Error",
            "We don't have enough information to act. Would you please provide more detail on the problem you're reporting? Thanks!",
            "Open",
            "Incorrect Junction",
            "Would you please let us know what was in error? At what intersection? Thanks!",
            "Open",
            "Missing Exit",
            "Would you please let us know what exit you believe is missing? Thanks!",
            "Open",
            "Missing Road",
            "Would you please let us know what road you believe is missing? Thanks!",
            "Open",
            "Turn Not Allowed / Missing Turn",
            "Would you please let us know what turn was not, or should not be, allowed? At what intersection? Thanks!",
            "Open",
            "Turn Not Allowed / Missing Turn - Closed Road (wording doesnt work..)",
            "",
            "Open",
            "Wrong Driving Directions",
            "Waze doesn't tell volunteer editors where you were going. Would you please let us know what went wrong with the route Waze gave you? it is helpful if you can include your destination as you entered it too. Thanks!",
            "Open",
            "Chicago - Alley Issue",
            "Waze doesn't tell volunteer editors where you were going, although it was probably adjacent to the alley. If you would, please supply your destination as you entered it into Waze it may be helpful in correcting the route. Thanks!",
            "Open",
            "Fixed",
            "We reviewed the issue and updated the map. Please allow 48 hours for changes to be reflected in the live map (rarely up to two weeks). Thanks!",
            "Solved"
        ];
        window.ReplyInstructions = 'To reply to this request go to the following link and click the map pin, then click on the conversation button.';

    } else if (SelectedBoilerPlateCreator === "DwarfLord") {
        //DwarfLord's list
        window.myArray = ["General Error",
            "Volunteer responding to your general error map-issue report. Waze gives us volunteers very little to go on and we're stumped. What was wrong with the map? Can you provide any detail? Please respond using the Waze app, emails don't work with the reporting system. (Open to any editor)",
            "Open",
            "Wrong Driving Direction",
            "Volunteer responding to your wrong driving direction map-issue report. Waze gives us volunteers very little to go on; we don't even know where you were going! What went wrong with the route Waze gave you? Can you tell us your destination as you entered it into Waze? Please respond using the Waze app, emails don't work with the reporting system. (Open to any editor)",
            "Open",
            "Incorrect Junction",
            "Volunteer responding to your incorrect junction map-issue report. Waze gives us volunteers very little to go on. What junction was incorrect? What was incorrect about it? Please respond using the Waze app, emails don't work with the reporting system. (Open to any editor)",
            "Open",
            "Turn Not Allowed",
            "Volunteer responding to your turn not allowed map-issue report. Waze gives us volunteers very little to go on. What turn was not allowed? At what intersection? Please respond using the Waze app, emails don't work with the reporting system. (Open to any editor)",
            "Open",
            "Fixed",
            "Volunteer responding to your report of a map issue. Thanks to your report we've found and fixed a problem with the map. The fix should reach handheld devices within a week, but on rare occasions it can take closer to two weeks. Cheers!",
            "Solved",
            "No response",
            "No response and problem unclear, the volunteers will close this one out, but please feel welcome to submit map issues in the future if you encounter errors in the map. Cheers!",
            "NotIdentified",
            "Pronunciation",
            "Volunteer responding to your report of poor pronunciation by Waze text-to-speech (TTS). Unfortunately even the seniormost volunteers have little influence on the TTS system, and none of us can alter how any one street name is pronounced. I understand the frustration and I sympathize. Sorry not to be more help. Cheers!",
            "Open",
            "The Waze 180",
            "Volunteer responding to your report of a map issue. When you ask for a route immediately after waking up Waze, it has to guess what direction you are pointed. If it guesses wrong, it may give you an awkward route to avoid any illegal U-turns (I call this the Waze 180). When Waze offers you a route that starts off the wrong way, please drive a little in the direction you are pointed and then ask for the route again. This gives Waze a chance to know which way you are pointed and offer you a more suitable route. If you are sure this was not the problem, please respond using the Waze app (emails don't work with the reporting system) otherwise we'll close out this report in a few days. Cheers! (Open to any editor)",
            "Open",
            "Google fu (easy)",
            "Volunteer responding to your report of a map issue. The problem was caused by inaccurate data provided by Google (Waze gets most of its address locations from Google). We asked Google to fix its database and they accepted the request. Please allow at least three days for the fix to go live. Then -- and this is important! -- please remove the destination from your Waze app's navigation history and/or favorites list and wait at least a few minutes before adding it back. This will update your device's position data for this address so you don't go to the old (wrong) position. Cheers!",
            "Open",
            "Google fu (difficult)",
            "Volunteer responding to your report of a map issue. The problem is caused by inaccurate data provided by Google (Waze gets most of its address locations from Google). We have asked Google to fix its database but we have no control over how fast Google will respond. It is usually days, but it can be weeks or even months. We'll leave this report open in the meantime. Cheers!",
            "Open",
            "Google FAIL, how to use Waze",
            "Volunteer responding to your report of a map issue. The problem is caused by inaccurate data provided by Google (Waze gets most of its destination locations from Google). In this case, unfortunately, we cannot persuade Google to change its database (this often happens with large areas such as parks and airports, or with high-profile locations). You can however use the Waze database to reach the destination. First, remove any instances of the destination from your recents and favorites lists. Then search again, but when you enter your search terms, DO NOT SELECT ANY OF THE IMMEDIATELY-OFFERED ITEMS, EVEN IF YOU SEE A PERFECT MATCH! Instead, scroll to the bottom of the menu and select More results for.... You will be given the opportunity to choose a search engine under Other search engines. Choose Waze and select your destination. This is cumbersome and we volunteers don't like it any more than you do, but it works, and once the correct information is in your recents and/or favorites lists you should not need to repeat the process. Cheers!",
            "Open",
            "Bogus GPS",
            "Volunteer responding to your report of a map issue. It looks like your GPS position information was awfully inaccurate. Bad GPS position data can cause all sorts of problems. Waze may think you are on some other road and give you bogus directions to get you back to the road you're already on. There's nothing we volunteer map editors can do about this, but in the future, please try ensuring that your handheld device has as clear a view of the sky as possible so it will get the most accuracy out of the GPS satellite signals. Cheers!",
            "Open",
            "Still tracking stale route",
            "Volunteer responding to your report of a map issue. It looks like you departed from Waze's recommended route and followed a new route. If the new route is physically close to the recommended route -- for example, if Waze recommends a frontage road but you decide to remain on the highway next to it, or vice versa -- Waze can't easily tell that you're on a different track. It will continue giving you routing instructions appropriate for the old route. These instructions won't make any sense because you aren't on that route any more. There's nothing we volunteer map editors can do about this; GPS isn't perfect and Waze has to make educated guesses about what road you're on. When there are multiple possibilities it assumes you are on its suggested route. If that's a bad assumption the driving instructions can go wrong. Sorry not to be more help. Cheers!",
            "Open",
            "Stale or bogus traffic indications/routing",
            "Volunteer responding to your report of a map issue involving wrong traffic indications. We volunteer map editors can't do anything about Waze's traffic reporting, but I can explain what may have happened. Waze relies on data from people using Waze to assess traffic. In the case of a fresh accident or slowdown, Waze may not yet have any data on the situation and route you into it because it doesn't know. Then, when Waze thinks it has detected a traffic situation, it can remember it for awhile, sometimes long after the situation changes. Also, slow-moving Wazers can confuse Waze into incorrectly detecting heavy traffic (this is why one should never run Waze while walking or biking along roads). Sorry we volunteers can't be more help with this. Cheers!",
            "Open",
            "Waited forever to make Waze's recommended left turn",
            "Volunteer responding. I would hate it too if Waze asked me to make a left turn through heavy traffic! Unfortunately there's nothing we volunteer map editors can do. If we disable the left turn, then others who want that route during off-peak hours will complain. The good news is that your long wait did not go unnoticed. Waze keeps track of how long it takes to make a turn. Thanks to your experience, other drivers are less likely to be routed this way during peak traffic hours. Cheers!",
            "Open",
            "Unexplained detour",
            "Volunteer responding. I can't find anything in the map to explain the apparent detour Waze gave you. Waze may have thought there was traffic, or a daily pattern of traffic at that time, on the simplest route. Or maybe Waze was not yet familiar enough with the alternate route to know that it might not be faster. Waze wants to save you time every way it can and sometimes it suggests complex detours to shave a few seconds off your trip. Waze may recommend a detour even after the traffic has cleared up, because it doesn't know yet. Or, other Wazers may have reported a temporary street closure in the area. In any event we volunteer map editors can't find anything wrong with the map itself. Cheers!",
            "Open",
            "Unexplained NON-detour",
            "Volunteer responding. Waze is indeed aware of the alternate route to bypass traffic. It routed you on a more typical path at that time because it thought, at that moment, that it would be faster to go that way. We volunteer map editors can't do anything about Waze's traffic detection and routing algorithms, but we have checked that the map itself does look OK. Cheers!",
            "Open",
            "missing road and missing bridge overpass reports",
            "Volunteer responding to your report of a missing road or bridge overpass. The drivable roads along this highway have been pretty thoroughly mapped and we can't see anything missing that should ordinarily be there. Probably Waze simply chose not to show you the road in question; when moving at highway speeds, Waze deliberately chooses not to display many nearby roads to avoid cluttering the screen. If you are certain a road is missing from the map, please respond using the Waze app (emails don't work with the reporting system) and provide details! Otherwise we'll close out this report in a few days. Cheers! (Open to any editor)",
            "Open",
            "Short-term closure reported as a map issue",
            "Volunteer responding to your report regarding a temporary closure. How long will the road be closed? If it is only for a few days or less, we volunteer map editors can't be much help. It takes at least that long for our edits to make it to handheld devices! When you encounter short-term road closures in the future, please use the Report->Closure feature in the Waze app (you used Report->Map issue to file this report). If this is a long-term closure please respond using the app (emails don't work with the reporting system) and let us know as much as you can. Otherwise we'll close out this report in a few days. Cheers! (Open to any editor)",
            "Open",
            "Map-Issue field to enter navigation destination",
            "Volunteer responding to your map-issue report in which you described the problem as an address. Did you mean to enter the address as a navigation destination? If there is a problem with the address please respond using the Waze app (emails don't work with the reporting system) and explain what went wrong. Otherwise we'll assume this was an accident and close out this report in a few days. Cheers! (Open to any editor)",
            "Open",
            "No hablo muy bien el Español", "Lo siento, estamos voluntarios solamente para mantener las mapas. No hablamos muy bien el Español y no podemos ayudar con el aplicación.(Regrets, we are volunteers only for maintaining the maps. We don't speak Spanish well and we can't help with the application.)",
            "NotIdentified",
            "NO THRU TRAFFIC",
            "Volunteer responding. Confusingly, the private road Waze type does not mean it is a private road. It is just a flag that Waze should prohibit thru traffic. You are completely right, this is a public road! But at both ends it is posted RESIDENTIAL ONLY - NO THRU TRAFFIC. For better or worse Waze, like most folks, can't fight city hall and must respect the signs. The good news is that the Waze route is only a suggestion. You are free to drive on this street as it is indeed a public road. Once you are there, Waze will automatically recalculate your route. Cheers!",
            "Open",
            "Possible routing bug",
            "Volunteer responding. The snippet of data Waze provided us along with your report does suggest inexplicable routing. I've checked everywhere I can think of and unfortunately I can't find anything wrong with the map. But, Waze is currently working on an issue with speed detection for different turns out of an intersection. In rare instances this issue can lead Waze to suggest non-ideal routes, usually involving one or more U-turns or loops. We volunteers have no way to know if your experience resulted from this issue, but as there's nothing I can find on the map I'll close this report as not identified. I sure wish I could be more help but that's what's going on.",
            "NotIdentified",
            "We can't do U-turns",
            "Volunteer responding to the map issue you reported involving U-turns. Waze does consider U-turns when preparing a route for you, but unfortunately the app cannot yet give voice instructions for U-turns. This omission could make it hard for drivers to follow Waze's suggested route when U-turns are involved. To avoid routing drivers in a way that will lack critical voice instructions, the Waze volunteer editing community has decided to disable nearly all U-turns, including this one, until such time as Waze fully supports U-turns. We know that Waze is very aware of this issue but we do not have a schedule for when they might address it. I sure wish I could be more help but that's what's going on. Cheers!",
            "Solved",
            "We can't do continue straight (usually a followup response)",
            "That behaviour has happened to me too and I agree it is disconcerting. Unfortunately at this time the Waze app has no ability to provide a continue straight instruction. We can often persuade it to say keep left or keep right, but we can't make it say keep going. In this situation, where all you needed to do was continue straight ahead with no turns, I'm afraid I don't see any way to improve the driving instructions. Waze continues to work on their app and their routing engine and it's very possible they will support a continue on instruction in the future, but for now we volunteer editors can't improve situations like this. Sorry not to be more help!",
            "Solved"
        ];
        window.ReplyInstructions = 'To reply to this request go to the following link and click the map pin, then click on the conversation button.';

        //custom list from external list
    } else if (SelectedBoilerPlateCreator === "Custom") {

        if (window.UrcommentsCustomArray) {
            //found custom list
            window.myArray = UrcommentsCustomArray;
            window.ReplyInstructions = UrcommentsCustomReplyInstructions;

        } else {
            window.myArray = ["Custom List not be found you can find the custom list and instructions at <a href=https://gf.qytechs.cn/en/scripts/6236-wme-ur-comments-custom-list>https://gf.qytechs.cn/en/scripts/6236-wme-ur-comments-custom-list</a> ",
                " ",
                " "
            ];
            window.ReplyInstructions = 'To reply to this request go to the following link and click the map pin, then click on the conversation button.';
        }
    }


	
    console.log("URComments - Start of bootstrap");

    var bGreasemonkeyServiceDefined = false;

    try {
        var ver = window.navigator.appVersion.match(/Chrome\/(.*?) /)[1];
    } catch (err) {
        var ver = null;
    }
    if (null !== ver) {
        var itschrome = true;
        ///ver = "27.0.1438.7"; // last old working version
        // example: 32.0.1700.107
        // [0] - major versin
        // [2] - minor version
        ver = ver.split(".");
        ver[0] = parseInt(ver[0]);
        ver[2] = parseInt(ver[2]);
        if (ver[0] > 27) {
            var newmethod = true;
        } else if (ver[0] == 27) {
            if (ver[2] <= 1438) {
                var newmethod = false;
            } else {
                var newmethod = true;
            }
        } else {
            var newmethod = false;
        }
    } else {
        var itschrome = false;
        var newmethod = false;
    }

    try {
        // Firefox tells that "Components" is deprecated
        if ("object" === typeof Components.interfaces.gmIGreasemonkeyService) {
            bGreasemonkeyServiceDefined = true;
        }
    } catch (err) {};

    try {
        if ("object" === typeof GM_info) {
            bGreasemonkeyServiceDefined = true;
        }
    } catch (err) {};


    if ("undefined" === typeof unsafeWindow || !bGreasemonkeyServiceDefined) {
        try {
            unsafeWindow = (function() {
                var dummyElem = document.createElement('p');
                dummyElem.setAttribute('onclick', 'return window;');
                return dummyElem.onclick();
            })();
        } catch (err) {
            //Ignore.
        }
    }

    /* FIX IT !!!! */
    var itschrome = true;
    var newmethod = true;
    var bGreasemonkeyServiceDefined = false;

    //And check again for new chrome, and no tamper(grease)monkey
    if (itschrome && newmethod && !bGreasemonkeyServiceDefined) {
        //use "dirty" but effective method with injection to document
        var DLscript = document.createElement("script");
        DLscript.textContent = 'unsafeWindow=window; \n' + // need this for compatibility
            URComments_init.toString() + ' \n' +
            'URComments_init();';
        DLscript.setAttribute("type", "application/javascript");
        document.body.appendChild(DLscript);
        document.body.removeChild(DLscript);
    } else {
        /* begin running the code! */
        console.log("URComments end of boot strap");
        URComments_init();
        ///setTimeout(URComments_init,200);
    }
}

function URComments_init() {
    console.log("URComments - Start init 1");

    URComments = {
        last: new Array(),
        isLast: false,
        isLSsupported: false,
        zoom: false
    };

    URComments.init = function() {
          
		//expand the UR textarea so we can verfiy what comment we clicked on. special thanks to SeekingSerenity 
        var g = $('<style type="text/css">.ur-comment-list .comment-list { bottom: 200px !important; } .ur-comment-list .new-comment-form textarea { height: 140px !important; } .ur-comment-list .new-comment-form { height: 200px !important; }</style>');
        $("head").append(g);  

		//i have to fix the hide show buttons so it doesn't look like a Waze bug
		//then auto expand the UR comment area
		//var g = $('<style type="text/css">.conversation-container { display: block !important; } </style>');
		//var g = $('<style type="text/css">.conversation-container { display: block; } </style>');
		//$("head").append(g); 
		//comment-view-shown
		
        //console.log("URComments init 2");
        console.log("URComments - Start adding the URComments's tab");
        //add comments tab
        var b = $('<li> <a href="#sidepanel-Comments" data-toggle="tab" id="CommentsTab">UrComments</a> </li> ');
        //i had to switch to first() becuase someone was reusing the nav tabs in another script and this would cause my tab to go inside theirs!
        $("h2 + ul.nav-tabs").first().append(b);
        
        //add the content to the comments tab
        //Comment tab header
        var c = $('<div class="tab-pane" id="sidepanel-Comments" style="font-size: 14px;> <div id="test" class="result-list-container"><p class="URComments" style="font-size: 12px;"><b>UR Comments Version ' + URCommentVersion + ' </b> <br><a id="URCommentZoomOutButton" class="URComments" style="float:none;color:#000000;font-size: 12px;" Title="Zoom all the way out.">Zoom Out</a></p></div></div><br><br>');
        //i had to switch to first() becuase someone was reusing the nav tabs in another script and this would cause my tab to go inside theirs
        $("h2 + ul.nav-tabs + .tab-content").append(c);
		
		//ZoomOutButton
        //d = $('<div style="margin:1px;"><a id="URCommentZoomOutButton" class="URComments" style="float:none;color:#000000;font-size: 12px;" Title="Zoom all the way out.">Zoom Out</a></div>');
        //$("#sidepanel-Comments").append(d);
        //create the callback function
		$("#URCommentZoomOutButton").click(URCommentSetZoom(0));
		//$("#URCommentZoomOutButton").click();
		
		//Waze.map.setCenter(Waze.map.getCenter(),5)
		
		
		
        //URO+ Preset filters
        console.log("URComments - Start adding URO preset filters to the comment tab");
        //uro preset header
        var d = $('<div style="margin:1px;" title="This is a list of saved settings for URO+ that will help you find URs of a certian type."><b>URO+ Presets</b></div>');
        $("#sidepanel-Comments").append(d);

		/*
		//test
        var d = $('<div style="margin:1px;"><a id="URCommenttest" class="URComments" style="float:none;color:#000000;font-size: 12px;" Title="test">test</a></div>');
        //d.click (URComments.comment1);
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#URCommenttest").click(TagAllNoCommentURs('a'));
		*/
		
        //URO+ new ur
        var d = $('<div style="margin:1px;"><a id="URCommentURONEW" class="URComments" style="float:none;color:#000000;font-size: 12px;" Title="Use URO+ to only show new requests or UR replies">URO+ New Requests /  UR Replies</a></div>');
		$("#sidepanel-Comments").append(d);
		$("#URCommentURONEW").click(URCommentUROClearClicked('UroShowNew'));
		
        //show no responses for 4 days
        d = $('<div style="margin:1px;"><a id="URCommentURO4DayFollowUp" class="URComments" data="UroShowNew"style="float:none;color:#000000;font-size: 12px;" Title="Use URO+ to only show URs that need a 4 day follow up">URO+ 4 Day Follow Up</a></div>');
        //d.click (URComments.comment1);
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#URCommentURO4DayFollowUp").click(URCommentUROClearClicked('URO4DayFollowUp'));
		
        //show no responses for 7 days needs closing
        d = $('<div style="margin:1px;"><a id="URCommentURO7DayClose" class="URComments" style="float:none;color:#000000;font-size: 12px;" Title="Use URO+ to only show URs that are older then 7days and need to be closed">URO+ 7 Day Close</a></div>');
        //d.click (URComments.comment1);
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#URCommentURO7DayClose").click(URCommentUROClearClicked('URO7DayClose'));
		
        //URO+ clear
        d = $('<div style="margin:1px;"><a id="URCommentUROclearUROFiltrs" class="URComments" style="float:none;color:#000000;font-size: 12px;" Title="Clear URO+ UR Filters">URO+ Clear UR Filters</a></div>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#URCommentUROclearUROFiltrs").click(URCommentUROClearClicked('UROclearUROFiltrs'));
		
        //the predefined presets only show comments that the current user has commented on
        d = $('<input type="checkbox" id="URCommentUROOnlyMyUR" Title="Show URs with comments from me." style="margin:0px 0px 0px; vertical-align: middle;font-size: 12px;"></input><font style="font-size: 12px;"> Only My URs</font><br><br>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#URCommentUROOnlyMyUR").click(OnlyMyUR);
		

        /*
        UroShowNew
        URO4DayFollowUp
        URO7DayClose
        UROclearUROFiltrs
  
        $('.myCheckbox').prop('checked', true);
        $('.myCheckbox').prop('checked', false);
        */

        //start generating the comment list and mouse click handlers
        console.log("URComments - Start adding comments to the comment tab");
        //comments setup

        //comments header
        var d = $('<div style="margin:1px;"><b>UR Comments</b></div>');
        $("#sidepanel-Comments").append(d);

        //CurrentIndex is used to keep count of total arrays pairs which is used on the div's id tags
        var CurrentIndex = 1;
        console.log("URComments - Create Div 1");

        
        //2E5C8A for Open? blue
        //996633 not ident brown
        //339933 solved green
        
        var colorrr= "CC0000";
        //go over the array and generate divs
        for (var i = 0; i < myArray.length; i = i + 3) {
            console.log("URComments - Create div for - " + myArray[i] + " " + myArray[i + 2]);
			
			// make the UrStatus care about case alert(("TEST1234test").toLowerCase())
			var URStatus = (myArray[i + 2]).toLowerCase();
            
			if(URStatus === "open"){
               colorrr= "#000000";
            } else if(URStatus === "solved"){
               colorrr= "#008F00";
            } else if(URStatus === "notidentified"){
               colorrr= "#E68A00";
            } else {
               colorrr= "#CC0000";
               //not defined and that is a problem
            }
            
            d = $('<div style="margin:1px;font-size: 12px;"><a id="URComments-comment' + CurrentIndex + '" class="URComments" style="float:none;color:'+ colorrr +'" Title="Action: ' + URStatus + '; Comment: ' + myArray[i + 1] + ' ">' + myArray[i] + '</a></div>');
            $("#sidepanel-Comments").append(d);

            console.log("URComments - Create callback for - " + 'URComments-comment' + CurrentIndex);
            //create the callback function in order to pass text we need to pass it trough 2 even handlers (attempting to bring this down to one)
			//$("#URComments-comment" + CurrentIndex).click(PostURComment(myArray[i], myArray[i + 1], URStatus));
			$("#URComments-comment" + CurrentIndex).click(AutoZoomIN(myArray[i], myArray[i + 1], URStatus));
			
            //inc the CurrentIndex
            CurrentIndex++;
        }

        //script comment options

		//options css
        var g = $('<style type="text/css">#sidepanel-Comments label { margin:0px 0px 0px; vertical-align: middle;font-size: 12px;}</style>');
        $("head").append(g);  
		
		
        //Options header
        var d = $('<br><div style="margin:1px;"><b>Options</b></div>');
        $("#sidepanel-Comments").append(d);
		
		/*
        //ZoomOutButton
        d = $('<div style="margin:1px;"><a id="URCommentZoomOutButton" class="URComments" style="float:none;color:#000000;font-size: 12px;" Title="Zoom all the way out.">Zoom Out</a></div>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#URCommentZoomOutButton").click(URCommentSetZoom(0));
		*/
		// style="margin:0px 0px 0px; vertical-align: middle;font-size: 12px;"
		
		
        //add reply Instructions to the 4 day Follow-Up
        d = $('<label Title="Adds Reply Instructions to each 4 day reply including a link to the user request with the UR layer enabled. (The link Waze sends doesn’t have the layers enabled and people have a hard time figuring it out) NOTE the 4 day reminder link will be taken from your current map view and zoom. So center the pin and set a zoom that makes sense also try to only show one pin before clicking 4 day reminder comment!"><input type="checkbox" id="UrCommentAddReplyInstructions"> Add Instructions to the 4 day Follow Up</input></label><br>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#UrCommentAddReplyInstructions").click(AddReplyInstructions);
		
		//auto zoom in for the 4 day Follow-Ups
        d = $('<label Title="Try to auto zoom in when doing the Ur reminders links"><input type="checkbox" id="UrCommentReminderZoomIn"> Auto Zoom In For Follow-Ups</input></label><br>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#UrCommentReminderZoomIn").click(ReminderZoomIn);

        //Auto Click open solved not Identified 
        d = $('<label Title="Suppress the message about recent pending questions to the reporter and then depending on the choice set for that comment Clicks Open, Solved, Not Identified."><input type="checkbox" id="URCommentAutoClickURStatus" style="margin:0px 0px 0px; vertical-align: middle;font-size: 12px;"> Auto Click Open, Solved, Not Identified</input></label><br>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#URCommentAutoClickURStatus").click(AutoClickURStatus);
		
        //UrCommentSaveAfterComment
        d = $('<label Title="If Auto Click Open, Solved, Not Identified is also checked, this option will click the save button after clicking on a UR-Comment and then the send button."><input type="checkbox" id="UrCommentSaveAfterComment"> Auto Save UR After Comment</input></label><br>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#UrCommentSaveAfterComment").click(SaveAfterComment);
		
        //auto close after sending comment replies
        d = $('<label Title="For the user requests that do not require saving this will close the user request after clicking on a UR-Comment and then the send button."><input type="checkbox" id="UrCommentAutoCloseComment"> Auto Close Comment</input></label><br>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#UrCommentAutoCloseComment").click(AutoCloseComment);
		
        //auto reload map after sending comment replies
        d = $('<label Title="Reloads the map after clicking on a UR-Comment and then send button. This forces URO+ to re-apply the chosen URO filters. Currently this does not apply to any messages that get saved. Since saving automatically reloads the map."><input type="checkbox" id="UrCommentAutoReloadAfterComment"> Auto Reload map After Comment</input></label><br>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#UrCommentAutoReloadAfterComment").click(AutoReloadAfterComment);
		
        //zoom out map after sending comment replies
        d = $('<label Title="Zooms the map all the way out after clicking on a UR-Comment then clicking send."><input type="checkbox" id="UrCommentZoomOutAfterComment"> Auto Zoom Out After Comment</input></label><br>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#UrCommentZoomOutAfterComment").click(ZoomOutAfterComment);
		
		//Auto switch to the UR-Comments tab after page load
        d = $('<label Title="Auto switch to the UR-Comments tab after page load"><input type="checkbox" id="UrCommentAutoSwitchToURCommentsTab"> Auto switch to the UR-Comments tab</input></label><br>');
        $("#sidepanel-Comments").append(d);
        //create the callback function
		$("#UrCommentAutoSwitchToURCommentsTab").click(AutoSwitchToURCommentsTab);
		

        //UR-Comments tab is loaded load options to last state
		//here we also check to see if the options have ever been set (new user) if not we enable them all on script load
		//enabling them will trigger a click of the option which will cause the option to be saved

        //OnlyMyUR have the predefined pre-sets only show comments that the current user has commented on
        if (localStorage.getItem('OnlyMyUR') == "yes" || !localStorage.getItem('OnlyMyUR')) {
            //alert("YES");
    		$("#URCommentUROOnlyMyUR").trigger('click');
        }

        //post reply Instructions to comments
        if (localStorage.getItem('AddReplyInstructions') == "yes" || !localStorage.getItem('AddReplyInstructions')) {
            //alert("YES");
    		$("#UrCommentAddReplyInstructions").trigger('click');
        }

		//UrCommentAutoCloseComment
        if (localStorage.getItem('UrCommentAutoCloseComment') == "yes" || !localStorage.getItem('UrCommentAutoCloseComment')) {
            //alert("YES");
    		$("#UrCommentAutoCloseComment").trigger('click');
        }
		
		//AutoReloadAfterComment
        if (localStorage.getItem('AutoReloadAfterComment') == "yes" || !localStorage.getItem('AutoReloadAfterComment')) {
            //alert("YES");
    		$("#UrCommentAutoReloadAfterComment").trigger('click');
        }
		
		
		//ReminderZoomIn
        //if (localStorage.getItem('ReminderZoomIn') == "yes" || !localStorage.getItem('ReminderZoomIn')) {
		
		//currently do not auto enable as a new feature
		if (localStorage.getItem('ReminderZoomIn') == "yes") {
            //alert("YES");
    		$("#UrCommentReminderZoomIn").trigger('click');
        }
		
		
        // UR-COmments load and set settings and check boxes  
        if (localStorage.getItem('AutoClickURStatus') == "yes" || !localStorage.getItem('AutoClickURStatus')) {
            //alert("YES");
			$("#URCommentAutoClickURStatus").trigger('click');
        }

        //UrCommentSaveAfterComment
        if (localStorage.getItem('SaveAfterComment') == "yes" || !localStorage.getItem('SaveAfterComment')) {
            //alert("YES");
			$("#UrCommentSaveAfterComment").trigger('click');
        }

        //AutoZoomOutAfterComment
        if (localStorage.getItem('ZoomOutAfterComment') == "yes" || !localStorage.getItem('ZoomOutAfterComment')) {
            //alert("YES");
			$("#UrCommentZoomOutAfterComment").trigger('click');
        }

		//AutoSwitchToURCommentsTab
        if (localStorage.getItem('AutoSwitchToURCommentsTab') == "yes" || !localStorage.getItem('AutoSwitchToURCommentsTab')) {
            //alert("YES");
			$("#UrCommentAutoSwitchToURCommentsTab").trigger('click');
        }
		
		
        //go over  BoilerPlateCreatorsArray and generate the select   
        d = '<font style="font-size: 12px;">Comment List <select id="BoilerPlateCreators" style="font-size 12px; title"Comments lists that are built into the script with support for a custom list. If you would like your comment list built into the this script or have suggestions on mine please contact me at rickzabel @waze or @gmail">';
        for (var i = 0; i < BoilerPlateCreatorsArray.length; i = i + 1) {
            console.log("URComments - make div for - " + BoilerPlateCreatorsArray[i]);
            //var d = $('<div style="margin:1px;"><a id="URComments-comment' + i + '" class="URComments" style="float:none;color:#000000" Title="123">' + BoilerPlateCreatorsArray[ i ] + '</a></div>');  
            d = d + '<option style="font-size 12px;" value="' + BoilerPlateCreatorsArray[i] + '">' + BoilerPlateCreatorsArray[i] + '</option>';
            console.log("URComments - BoilerPlateCreatorsArray " + BoilerPlateCreatorsArray[i]);
        }
        d = d + "</select> </font><br>";
        $("#sidepanel-Comments").append(d);
        //create call back for the select
		$("#BoilerPlateCreators").change(BoilerPlateCreatorsFunction);

        //set the users BoilerPlateCreators choice in the select   
        var SelectedBoilerPlateCreator = localStorage.getItem('BoilerPlateCreators');
        $("#BoilerPlateCreators").val(SelectedBoilerPlateCreator);
        //end getting boilerplatecreators

		//check to see if the option to auto switch to the UR-Comments tab is enabled
		if (UrCommentAutoSwitchToURCommentsTab.checked) {
			//make UR Comments tab active
			$('#CommentsTab').trigger('click');
		}
        console.log("URComments - Tab Complete");
		
		if (window.URCommentUpdateMessage === "yes") {
			//alert the user in  URComment version updates
			if (localStorage.getItem('URCommentVersion') === window.URCommentVersion) {
				console.log("URComments Version - " + window.URCommentVersion);
			} else {
				alert(window.URCommentVersionUpdateNotes);
				localStorage.setItem('URCommentVersion', window.URCommentVersion);
			}
		}
		
		
		
		//lets auto look for the an open ur here then switch to the comments tab
		//setTimeout(SwitchToURComments, 1000);
	
    };
	
	
	SwitchToURComments = function() {
		return function() {
		console.log("URComments  - Looking for ur tab");
		if (UrCommentAutoSwitchToURCommentsTab.checked) {
			//make UR Comments tab active
			$('#CommentsTab').trigger('click');
		}
		
	
		setTimeout(URComments.SwitchToURComments, 1000);
		};
	};
	
	
	
	
	
	
	
	
	TagAllNoCommentURs = function(a) {
		//this is where auto open next ur is going to be right now it is a collection of tests
	
		return function() {
		
		
		
		
		
		//testing auto getting urs 
		//alert(urid);
		//https://www.waze.com/editor/?zoom=5&lat=41.701116&lon=-88.234631&mapUpdateRequest=3961111&env=usa#
		//https://www.waze.com/editor/?zoom=5&mapUpdateRequest=&env=usa#
		//https://www.waze.com/editor/?zoom=5&mapUpdateRequest=3916638&env=usa# //works

		//test finding stuff
		//console.log("urc" + $(".layer-togglers .reload-button").length);
	  
		//clicks the comment send btn
		//$('.new-comment-form .new-comment-text + .btn-default').trigger('click');
	  
		//clicks the comment send btn
		//$('#chat-toggle .toggle').trigger('click');
		
		//alert( $( "#update-request-panel h1").html() );
		//moves text
		//$( "#update-request-panel .problem-description" ).prepend( '<article class="solution"><h2>Type: </h2>' + $( "#update-request-panel h1").html() + '</article>' );
	 
		console.log('URComments:TagAllNoCommentURs');
		/*
		function onScreen(obj){
			if (obj.geometry){
				return(Waze.map.getExtent().intersectsBounds(obj.geometry.getBounds()));    
			}    
			return(false);  
		}
		*/

		
		/*
		var urcount = 0
		var idList = [];
		var vcomments = "";
		for (var urID in W.model.mapUpdateRequests.objects){
			urcount++;
			
			if(W.model.updateRequestSessions.objects[urID] == null) idList.push(urID);
			
			var nComments = W.model.updateRequestSessions.objects[urID].comments.length;
			//if(nComments == 0) return false;

			for(var cidx=0; cidx<nComments; cidx++){
				vcomments = vcomments + W.model.updateRequestSessions.objects[urID].comments[cidx].userID;
			}
			
			console.log("urc - " + urcount + " - "  + urID + " - " +  vcomments );
			vcomments = "";
		}
		if(idList.length > 0){
			uroAddLog('grabbing updateRequestSessions with IDs '+idList);
			W.model.updateRequestSessions.get(idList);
		}
		*/
		
		
		/*
		var urcount = 0
		for (var urID in W.model.mapUpdateRequests.objects){
		urcount++;
		
		var cur_x = W.model.mapUpdateRequests.objects.attributes.geometry.x;
		var cur_y = W.model.mapUpdateRequests.objects.attributes.geometry.y;
		
		console.log("urc - " + urcount + " - "  + urID + " - "  + cur_x + " - "  + cur_y);
		}
		*/
	   
		/*
			Object.forEach(Waze.model.mapUpdateRequests.objects, function(k, v){
			//if (v.type == "mapUpdateRequest" && onScreen(v) && v.attributes.description == null){ 
			if (v.type == "mapUpdateRequest" && onScreen(v)){ 
				console.log('URc 1: on screen = ' + v.attributes.id);
				
				urSessionURL = 'https://www.waze.com/Descartes-live/app/MapProblems/UpdateRequests?ids=' + v.attributes.id;
				//"/Descartes-live/app/MapProblems/UpdateRequests/Comment"
				
				$.ajax({
					dataType: "json",
					url: urSessionURL,
					success: function(json) {
						try {
							console.log('URc 2: ' + v.attributes.id );
							var urDetail = json.updateRequestSessions.objects[0];
							if(urDetail.comments.length==0){
								console.log('URc 3: no comments for id ' + v.attributes.id + '. Adding comment.');
								//Waze.model.updateRequestSessions.objects[v.attributes.id].addComment("Waze did not send us enough information to fix your request. Would you please let us know what went wrong with the route Waze gave you? Would you tell us your destination as you entered it into Waze? Thanks!");	
								Waze.model.updateRequestSessions.objects[v.attributes.id].open
								and
								Waze.model.updateRequestSessions.objects[v.attributes.id].state
								
								Waze.model.updateRequestSessions.objects[v.attributes.id].addComment("Write this text directly into the UR without opening the UR in the editor");	
							}
						} 					
						catch(e) {
							console.log('URc 4: no UR information available');
						}
						alert("paused - " + v.attributes.id);
					}
				});
				console.log('URc 5: has comment = ' + v.attributes.id);
			} 
			
		}); 
		*/
		
		};
	};
	

	CheckBetaTesters = function() {
		if(BetaaTestersCheckCount >= 5) { 
		//email list 
		/*
		aeroseek
		Bigbear3764
		Confedyank
		hawkeygoal
		mike0723
		SeekingSerenity
		t0cableguy
		SuperMedic
		orbitc
		davielde
		dolphinwave
		randyboy
		MojaveCactusMonkey
		HavanaDay 
		AlanOfTheBerg
		KB_Steveo
		karlcr9911 
		*/
			
			BetaTesters = ["rickzabel",
							"aeroseek",
							"Bigbear3764",
							"Confedyank",
							"hawkeygoal",
							"mike0723",
							"SeekingSerenity",
							"t0cableguy",
							"SuperMedic",
							"orbitc",
							"davielde ",
							"dolphinwave",
							"randyboy",
							"AlanoftheBerg",
							"driving79",
							"MojaveCactusMonkey",
							"HavanaDay",
							"AlanOfTheBerg",
							"KB_Steveo",
							"karlcr9911" 
							];

			if ($.inArray($( "#user-info strong").html(), BetaTesters) >= 0) {
				//alert($( "#user-info strong").html() );
			} else {
				alert($( "#user-info strong").html() + " UR Comments is currently in beta testing. When I add or change features I send out email to all users informing them of the changes." + "\n" + "Please pm me at rickzabel and let me know you are using this script and I will gladly add you to the list!" );
			}
			BetaaTestersCheckCount = 0;
		}
		//console.log("URComments  - BetaaTestersCheckCount:   " + BetaaTestersCheckCount);
		BetaaTestersCheckCount = BetaaTestersCheckCount + 1;
		
	};
	
    //use this to save what choice is made in the list and then reload the page to change lists
    BoilerPlateCreatorsFunction = function() {
   
		//eventually make this replace innerhtml of the comments tab so we dont have to reload the page
		//.innerHTML
				
		 r = confirm("Ur-Comments you have chosen " + BoilerPlateCreators.value + "'s list. The page now must be reloaded to repopulate the UR-Comment tab");
		//this is where we reuse the r var this makes the nested ifs much more simple
		if (r === true) {
			//save the selection
			localStorage.setItem('BoilerPlateCreators', BoilerPlateCreators.value);
			//this will reload the page
			location.reload();
		} else {
			$("#BoilerPlateCreators").val(localStorage.getItem('BoilerPlateCreators'));
		}
    };
	
	//////////////////////////////////////////////////////////////
	//the state of the check boxes or drop downs has changed: code
	//////////////////////////////////////////////////////////////
	
    OnlyMyUR = function() {
        //try to save the state of the check box
        if (URCommentUROOnlyMyUR.checked) {
            localStorage.setItem('OnlyMyUR', 'yes');
            //alert("yes");
        } else {
            localStorage.setItem('OnlyMyUR', 'no');
            //alert("no");
        }
        
		//only show my ur 'OnlyMyUR' 
        if (URCommentUROOnlyMyUR.checked && !_cbHideAnyComments.checked) {
			$("#_cbHideAnyComments").trigger('click');

        } else if (!URCommentUROOnlyMyUR.checked && _cbHideAnyComments.checked) {
			$("#_cbHideAnyComments").trigger('click');
        }

    };

    AutoClickURStatus = function() {
        //try to save the state of the check box
        if (URCommentAutoClickURStatus.checked) {
            localStorage.setItem('AutoClickURStatus', 'yes');
            //alert("yes");
        } else {
            localStorage.setItem('AutoClickURStatus', 'no');
            //alert("no");

            //turn off save after send
            if (!URCommentAutoClickURStatus.checked && UrCommentSaveAfterComment.checked) {
				$('#UrCommentSaveAfterComment').prop('checked', false);
                localStorage.setItem('SaveAfterComment', 'no');
            }
        }
    };

    SaveAfterComment = function() {
        //try to save the state of the check box
        if (UrCommentSaveAfterComment.checked) {
            localStorage.setItem('SaveAfterComment', 'yes');
            //alert("yes");
        } else {
            localStorage.setItem('SaveAfterComment', 'no');
            //alert("no");
        }
        //alert ( localStorage.getItem('AutoClickURStatus') ); 

        //when save if on turn on auto click status
        if (UrCommentSaveAfterComment.checked && !URCommentAutoClickURStatus.checked) {
			$('#URCommentAutoClickURStatus').prop('checked', true);
            localStorage.setItem('AutoClickURStatus', 'yes');
        }
    };

    AutoCloseComment = function() {
        //try to save the state of the check box
        if (UrCommentAutoCloseComment.checked) {
            localStorage.setItem('UrCommentAutoCloseComment', 'yes');
            //alert("yes");
        } else {
            localStorage.setItem('UrCommentAutoCloseComment', 'no');
            //alert("no");
        }
        //alert ( localStorage.getItem('UrCommentAutoCloseComment') ); 
    };

    // UrCommentAutoReloadAfterComment
    AutoReloadAfterComment = function() {
        // UrCommentAutoReloadAfterComment
        //try to save the state of the check box
        if (UrCommentAutoReloadAfterComment.checked) {
            localStorage.setItem('AutoReloadAfterComment', 'yes');
            //alert("yes");
        } else {
            localStorage.setItem('AutoReloadAfterComment', 'no');
            //alert("no");
        }
     };

    ZoomOutAfterComment = function() {
		// UrCommentAutoReloadAfterComment
		 //try to save the state of the check box
        if (UrCommentZoomOutAfterComment.checked) {
            localStorage.setItem('ZoomOutAfterComment', 'yes');
            //alert("yes");
        } else {
            localStorage.setItem('ZoomOutAfterComment', 'no');
            //alert("no");
        }
    };

    AddReplyInstructions = function() {
        //add reply instructions to replies
        //try to save the state of the check box
        if (UrCommentAddReplyInstructions.checked) {
            localStorage.setItem('AddReplyInstructions', 'yes');
            //alert(" AddReplyInstructions yes");
        } else {
            localStorage.setItem('AddReplyInstructions', 'no');
            //alert("AddReplyInstructions no");
        }

		if (UrCommentReminderZoomIn.checked && !UrCommentAddReplyInstructions.checked) {
			$('#UrCommentReminderZoomIn').prop('checked', false);
			localStorage.setItem('ReminderZoomIn', 'no');
		}

	};

	
	ReminderZoomIn = function() {
        //add reply instructions to replies
        //try to save the state of the check box
        if (UrCommentReminderZoomIn.checked) {
            localStorage.setItem('ReminderZoomIn', 'yes');
            //alert(" ReminderZoomIn yes");
        } else {
            localStorage.setItem('ReminderZoomIn', 'no');
            //alert("ReminderZoomIn no");
        }
		
		if (UrCommentReminderZoomIn.checked && !UrCommentAddReplyInstructions.checked) {
			$('#UrCommentAddReplyInstructions').prop('checked', true);
			localStorage.setItem('AddReplyInstructions', 'yes');
		}
		
    };
	
	 AutoSwitchToURCommentsTab = function() {
		// AutoSwitchToURCommentsTab
		 //try to save the state of the check box
        if (UrCommentAutoSwitchToURCommentsTab.checked) {
            localStorage.setItem('AutoSwitchToURCommentsTab', 'yes');
            //alert("yes");
        } else {
            localStorage.setItem('AutoSwitchToURCommentsTab', 'no');
            //alert("no");
        }
    };
	
	////////////////////////////////////////////////////
	//end of check boxes or drop downs has change code
	////////////////////////////////////////////////////

    function URCommentSendBtnClicked(Title, URStatus) {
     		
		//waze is weird and after clicking send button the close button had to be refound, which takes a few seconds for the new close button to be drawn
		// so we wait 1500 milliseconds before looking for the close button
		//since we are passing vars to the next function we have to pass this to handler function so it doesn't happen on click
				
		//the above is still true but what i have found is that it sometimes takes a while from clicking send to the comment actually posting. there was time when i closed the comment before it actually posted and it would have to be redone. so added a check and a timeout and recheck if the textarea isn't empty. afterwards we can re-grab and click the close button
			
		//grab the close button to compare to later
		window.CloseButtonHolder = $(".problem-panel-navigation button.close-button");
		
		return function() {	
			//check to see if the comments went trough before saving or closing the comment 
            if ($(".new-comment-text").val() !== "") {
                console.log('URComments - the send button was clicked, Waiting for the comment to send. ' + DotsString);
				window.DotsString++;
                setTimeout(URCommentSendBtnClicked(Title, URStatus), 10);
            } else {
				console.log('URComments - the send button was clicked, jumping to CloseDelayHack2');
				window.DotsString = "1";
                CloseDelayHack2(Title, URStatus);
            }
       };	
    }
	
    function CloseDelayHack2(Title, URStatus) {
        console.log("URComments - CloseDelayhack2 " + Title + " " + URStatus);
  
		//check if we have the old or the new close button 
		if (window.CloseButtonHolder == $(".problem-panel-navigation button.close-button")){
			console.log("URComments - old close button searching for new");
			//old button jump back into this function 500 ms later
			setTimeout(CloseDelayHack2(Title, URStatus), 500);
		} else {
			console.log("URComments - new close button");
			//wrap the code in the finding of the new close button

			//now that we found the new close button and send was clicked

			//lets check if we should click close or save
			//when clicking save you dont need to click close
			if (URStatus === "solved" || URStatus === "notidentified") {
				console.log("URComments - CloseDelayhack2 Solved or NotIdentified- Clicking Save");
				//this clicks the waze save btn
				if (URCommentAutoClickURStatus.checked === true && UrCommentSaveAfterComment.checked === true) {
					//click save
				   $('#toolbar #edit-buttons .WazeControlSave').trigger('click');
				}

			} else {
				//when not saving you have to click close.
				console.log("URComments - CloseDelayhack2 since we are not saving click the close button");
				if (UrCommentAutoCloseComment.checked) {
					console.log("URComments - CloseDelayhack2 auto close option checked");
					$(".problem-panel-navigation button.close-button").trigger('click');
					//since saving above reloads the map we need this reload only to happen when we dont click save
					//auto reload map for non save urs
					if (UrCommentAutoReloadAfterComment.checked) {
						setTimeout(URCommentAutoReloadMapOnComment, 500);
					}
				}
			}
			
			console.log("URComments - end of saving or closing comment");
		}
    }


    URCommentSetZoom = function(a) {
	
	//this sets the map zoom; 0 is all the way out; 10 is all the way in but next to useless (the map and sat views disappear);
	//the closest zoom that shows the sat and map is zoom 9
		return function() {
			//alert(a);
			Waze.map.setCenter(Waze.map.getCenter(),a);
		};
    };

    function URCommentAutoReloadMapOnComment() {
        //waze together with URO is buggy i have to close the comment window before reloading the map or the pin ends up getting stuck on for all URO filters and it takes a page reload to fix it.
        // to get URO to rescan urs that have been commented on you have to reload the map this also causes URO to hide the ones that no longer fit the current URO filters like when using my pre-sets
		
		//click the reload button for the map
		$(".layer-togglers .reload-button").trigger('click');
    }


    URcommentConfirmToConsole = function(a) {
	    //over ride the default action of the standard confirm by writing confirm to a new function nconfirm, making a 'fake' confirm and then restoring confirm by copying the nconfirm back over confirm!
        (function() {
            nconfirm = window.confirm;
            Type = {
                native: 'native',
                custom: 'custom'
            };
        })();

        /**
         * Factory method for calling confirm().
         * It will be call a native confirm() or a custom redefined confirm() by a Type param.
         * This definition need for IE
         */
        (function(proxy) {

            proxy.confirm = function() {
                var message = (!arguments[0]) ? 'null' : arguments[0];
                var type = (!arguments[1]) ? '' : arguments[1];

                if (type && type == 'native') {
                    nconfirm(message);
                } else {
					//return true;
                    console.log('URComment confirm redirected to console: ' + message);
					return true;
                }
            };
        })(this);
    };

    URcommentRestoreConfirmToConfirm = function(a) {
		 //restore the normal action of confirm by writing nconfirm to back over confirm, so the site is able to send user messages outside of my script!
        (function() {
            window.confirm = nconfirm;
            Type = {
                native: 'native',
                custom: 'custom'
            };
        })();
    };

	
/////////////////////////////////////////////////////////////////////////////
////
//// a comment link was clicked start the UR trickle down code
////
/////////////////////////////////////////////////////////////////////////////
	
	AutoZoomIN = function(Title, Comment, URStatus) {
		return function() {
			
			if(UrCommentReminderZoomIn.checked === true && Title === "4 day Follow-Up"){
				//playing with autozoom here
				//click the show button in the ur
				$("#update-request-panel .zoom-to-ur-button").trigger('click');	
				//wait a duration
				setTimeout(AutoZoomIN2(Title, Comment, URStatus), 10);
			} else {
			//alert("else");
				//PostURComment(Title, Comment, URStatus)
				setTimeout(PostURComment(Title, Comment, URStatus), 0);
			}
			
			
		};
	};	
	
	AutoZoomIN2 = function(Title, Comment, URStatus) {
		return function() {
			//set the map out a few zoom levels
			
			//Waze.map.setCenter(Waze.map.getCenter(),5);
			setTimeout(URCommentSetZoom(5), 0);
			
			//wait a duration
			setTimeout(PostURComment(Title, Comment, URStatus), 10);
		};
	};
	
	
	

    PostURComment = function(Title, Comment, URStatus) {
		// the user clicked on a comment link
		
		return function() {
			//run the beta testers check every comment clicked
			CheckBetaTesters();

			console.log("URComments - attaching to send button " + Title + " - " + Comment  + " - " +  URStatus);
			
			//add event listener that runs most of the options
			$('.new-comment-form .new-comment-text + .btn-default').click(URCommentSendBtnClicked(Title, URStatus));
			
			//zoom out option - if the user option is set to reload map after posting a comment reply
			if (UrCommentZoomOutAfterComment.checked === true) {
				console.log("URComments - attaching map zoom out to send");
				$('.new-comment-form .new-comment-text + .btn-default').click(URCommentSetZoom(0));
			}
		
			//check if the comment text area is present if not alert the user to open a UR
			if ($(".new-comment-text")[0]) {

				//check to see if we are doing a "4 day Follow-Up" with the map link option turned on if not treat this comment as any other 
				if (UrCommentAddReplyInstructions.checked === true && Title === "4 day Follow-Up") {
					
					//reply instructions + map link
					var href = $('.WazeControlPermalink a').attr('href');
					var lon = getQueryString(href, 'lon');
					var lat = getQueryString(href, 'lat');
					var zoom = parseInt(getQueryString(href, 'zoom'));
					var layers = "&layers=1797"; //this should have on; sat maps, roads, user requests, edit area, live editors
					//zoom = zoom > 5 ? 17 : zoom + 12;
					// https://www.waze.com/livemap?lon=-40.94918&lat=-18.56958&zoom=7
					//alert(mapsUrl);	

					//wrap the zoom level in logic to confirm that we are not zoomed way out on accident
					// set the confirm to false so we can reuse the varible
					var r = false;
					//zoom 4 seems like the furthest out we would ever need to send a link to
					if (zoom > 3) {
						r = true;
					} else {
						
						//promt the user
						var r = confirm("UR Comments!\nThe map's zoom level is at " + zoom + " are you sure you want to send the user a link to the map with this zoom level? Remember to center the pin in your map window before clicking 4-day reminder.");

					}
					//this is where we reuse the r var this makes the nested ifs much more simple
					if (r === true) {
						var mapsUrl = 'https://www.waze.com/editor/?' + lon + '&lat=' + lat + layers + '&zoom=' + zoom;
						console.log('URComments - ReplyInstructions - ' + ReplyInstructions + mapsUrl);
						$(".new-comment-text").val(Comment + "\r\n\r\n" + ReplyInstructions + "\r\n" + mapsUrl);
					} else {
						//user chose no lets clear the text area just in case there was 4 day from before
						$(".new-comment-text").val("");
					}

				} else {
					//comment only, wasnt a "4 day Follow-Up" with map option enabled so just apply the comment 
					console.log('URComment - comment only ' + Title + ' - ' + Comment);
					$(".new-comment-text").val(Comment);
				}

				if (URCommentAutoClickURStatus.checked === true) {

					//redirect confirm function to our own holder function so we can restore it later  on
					URcommentConfirmToConsole();
					

					//alert(URStatus);
					// all ower case checks we are doring the status to lower before passing the urstatus on
					//click the ur status options (Not identified solved, open)
					if (URStatus == "notidentified") {
						//click Not identified 
						$("#state-1").trigger('click');
					} else if (URStatus == "solved") {
						//click solved
						$("#state-0").trigger('click');				
					} else {
						//click back on open just encase the wrong reply was clicked previously
						$("#state--1").trigger('click');			
					}

					//restores confirm function so other site messages come up!
					URcommentRestoreConfirmToConfirm();

				}

			} else {
				//we were unable to find an open UR
				alert("Can not find the comment box! In order for this scrip to work you need to have a user request open");
			}
		};
    };
	//end of PostURComment

	//this is part of the script that gets the maps position for the 4 day reminder map link
    function getQueryString(link, name) {
        var pos = link.indexOf(name + '=') + name.length + 1;
        var len = link.substr(pos).indexOf('&');
        if (-1 == len) len = link.substr(pos).length;
        return link.substr(pos, len);
    }


	
	
	
	
	
/////////////////////////////////////////////////////////////
////
//// on startuup keep checking the site to see if the me tab is loaded
////
/////////////////////////////////////////////////////////////	
	
    URComments.startcode = function() {
        // Check if WME is loaded, if not, waiting a moment and checks again. if yes init URComments
        try {
            //look for the me tab instead if the buggy chat room!           
			var element = $("#user-details");
            console.log("URComments - Found user-details window");
            if (typeof element !== "undefined" && element.value !== '') {
                URComments.init();
            } else {
                setTimeout(URComments.startcode, 2000);
            }
        } catch (err) {
            console.log("URComments - " + err);
            if (err === "TypeError: element is null" || err === "TypeError: element is null") {
                setTimeout(URComments.startcode, 2000);
            }
            setTimeout(URComments.startcode, 2000);
        }
    };
    //setTimeout(URComments.startcode, 2000);
    URComments.startcode();
}
setTimeout(URComments_bootstrap, 2000);

//test by passing the bootstrap
//currently we have the comment arrays in the bootstrap
//setTimeout(URComments_init, 2000);





/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
////
////    URO Preset Filters
////   
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


/* here is the current URO presets

URO+ New Requests / UR Replies
	checked "If last comment made by UR reporter?" Yes
	checked "Don't apply state/age filters to tagged URs"
	
URO+ 4 Day Follow Up
	checked with less than 1 comments
	checked with more than 1 comments
	checked last comment less than 4 days old
	checked last comment more than 6 days old
	checked "Don't apply state/age filters to tagged URs"
	
URO+ 7 Day Close	
		checked "If last comment made by UR reporter?" Yes
		checked with less than 1 comments
		checked last comment less than 7 days old
		checked "Don't apply state/age filters to tagged URs"
*/

//URO+ these are the tags of all of the items URO uses to filter URs
window.URCommentUROCheckboxesArray = ["_cbFilterWazeAuto",
            "_cbFilterIncorrectTurn",
            "_cbFilterIncorrectAddress",
            "_cbFilterIncorrectRoute",
            "_cbFilterMissingRoundabout",
            "_cbFilterGeneralError",
            "_cbFilterTurnNotAllowed",
            "_cbFilterIncorrectJunction",
            "_cbFilterMissingBridgeOverpass",
            "_cbFilterWrongDrivingDirection",
            "_cbFilterMissingExit",
            "_cbFilterMissingRoad",
            "_cbFilterBlockedRoad",
            "_cbFilterMissingLandmark",
            "_cbFilterUndefined",
            "_cbFilterCryosphere",
            "_cbFilterRoadworks",
            "_cbFilterConstruction",
            "_cbFilterClosure",
            "_cbFilterEvent",
            "_cbFilterNote",
            "_cbInvertURFilter",
            "_cbFilterOpenUR",
            "_cbFilterClosedUR",
            "_cbFilterSolved",
            "_cbFilterUnidentified",
            "_cbEnableMinAgeFilter",
            "_cbEnableMaxAgeFilter",
            "_cbURDescriptionMustBePresent",
            "_cbURDescriptionMustBeAbsent",
            "_cbEnableKeywordMustBePresent",
            "_cbEnableKeywordMustBeAbsent",
            "_cbCaseInsensitive",
            "_cbHideMyComments",
            "_cbHideAnyComments",
            "_cbHideIfLastCommenter",
            "_cbHideIfNotLastCommenter",
            "_cbHideIfReporterLastCommenter",
            "_cbHideIfReporterNotLastCommenter",
            "_cbEnableMinCommentsFilter",
            "_cbEnableMaxCommentsFilter",
            "_cbHideMyFollowed",
            "_cbHideMyUnfollowed",
            "_cbEnableCommentAgeFilter2",
            "_cbEnableCommentAgeFilter",
            "_cbNoFilterForTaggedURs"

 ];
 
/* event handler incorporation 11-29-2014
window.URCommentUROClicked = function(a) {
    return function() {
        URCommentUROClearClicked(a);
    };
};
*/
window.URCommentUROClearClicked = function(a) {
    //alert(a);
	return function() {
		if ($("#sidepanel-uroverview").length) {
			//alert("test");

			console.log("URComments - URO clear");
			//this is the array used to store the URO id tags

		   

			//go over the array and clear all of the URO+ check boxes
			for (URCommentsIndex = 0; URCommentsIndex < URCommentUROCheckboxesArray.length; URCommentsIndex = URCommentsIndex + 1) {
			
			
			//if ($(document.getElementById(URCommentUROCheckboxesArray[URCommentsIndex])).length <= 0){
			//if ($(document.getElementById(URCommentUROCheckboxesArray[URCommentsIndex])).length <= 0){
			if ($('#' + URCommentUROCheckboxesArray[URCommentsIndex]).length <= 0){
				alert("URComments - there was an error finding URO's tag " + URCommentUROCheckboxesArray[URCommentsIndex]);
				 return false;
			}
			
			/*
			  if (!URCommentAutoClickURStatus.checked && UrCommentSaveAfterComment.checked) {
					// $(document.getElementById("UrCommentSaveAfterComment")).trigger('click');
					//document.getElementById("UrCommentSaveAfterComment").checked = false;
					$('#UrCommentSaveAfterComment').prop('checked', false);
					localStorage.setItem('SaveAfterComment', 'no');
				}
				*/
			
				//document.getElementById(URCommentUROCheckboxesArray[ URCommentsIndex ]).trigger('click');
				//if ($(document.getElementById(URCommentUROCheckboxesArray[URCommentsIndex])).is(":checked")) {
				if ($('#' + URCommentUROCheckboxesArray[URCommentsIndex]).is(":checked")) {
					//clicks the checkbox by if the checkbox is checked
					//$(document.getElementById(URCommentUROCheckboxesArray[URCommentsIndex])).trigger('click');
					 $('#' + URCommentUROCheckboxesArray[URCommentsIndex]).trigger('click');
				} else {
					//click check box if checkbox in unchecked
					//$(document.getElementById(URCommentUROCheckboxesArray[ URCommentsIndex ])).trigger('click');
				}
			}

			//on clearing uro+ clear the check box for only showing editors urs
			if (a === "UROclearUROFiltrs" && URCommentUROOnlyMyUR.checked) {
				//URCommentUROOnlyMyUR.checked
				//$(document.getElementById("URCommentUROOnlyMyUR")).trigger('click');
				$('#URCommentUROOnlyMyUR').trigger('click');
			}
			
			// make it so uro+ doesnt filter tagged urs [NOTE]...
			//$(document.getElementById("_cbNoFilterForTaggedURs")).trigger('click');
			$('#_cbNoFilterForTaggedURs').trigger('click');
			
			
			
			
			/*  
			UroShowNew
			URO4DayFollowUp
			URO7DayClose
			UROclearUROFiltrs
			*/

			//set the different filters here      
			if (a == "UROclearUROFiltrs") {
				//alert("URO+ UR filters hav been cleared");
			} else {

				if (a == 'UroShowNew') {
					console.log("URComments - URO show new");
					//alert("new");
					//set URO+ max user comments to zero
					//document.getElementById('_inputFilterMaxComments').value = '0';
					//check the box for more than # comments
					//$(document.getElementById("_cbEnableMaxCommentsFilter")).trigger('click');
					//set URO+ max user comments to zero

					//check the box for last user comments
					//$(document.getElementById("_cbHideIfReporterNotLastCommenter")).trigger('click');
					$('#_cbHideIfReporterNotLastCommenter').trigger('click');
				}

				if (a == "URO4DayFollowUp") {
					console.log("URComments - URO 4 day");
					/*
					document.getElementById('_inputFilterMinComments').value = '1';
					$(document.getElementById("_cbEnableMinCommentsFilter")).trigger('click');

					document.getElementById('_inputFilterMaxComments').value = '1';
					$(document.getElementById("_cbEnableMaxCommentsFilter")).trigger('click');

					document.getElementById('_inputFilterCommentDays2').value = '4';
					$(document.getElementById("_cbEnableCommentAgeFilter2")).trigger('click');

					document.getElementById('_inputFilterCommentDays').value = '6';
					$(document.getElementById("_cbEnableCommentAgeFilter")).trigger('click');
					*/
				
					$('#_inputFilterMinComments').val(1);
					$('#_cbEnableMinCommentsFilter').trigger('click');

					$('#_inputFilterMaxComments').val(1);
					$('#_cbEnableMaxCommentsFilter').trigger('click');

					$('#_inputFilterCommentDays2').val(4);
					$('#_cbEnableCommentAgeFilter2').trigger('click');

					$('#_inputFilterCommentDays').val(6);
					$('#_cbEnableCommentAgeFilter').trigger('click');

				}

				if (a == "URO7DayClose") {
					console.log("URComments - URO 7 day");
					/*
					document.getElementById('_inputFilterMinComments').value = '1';
					$(document.getElementById("_cbEnableMinCommentsFilter")).trigger('click');

					document.getElementById('_inputFilterCommentDays2').value = '7';
					$(document.getElementById("_cbEnableCommentAgeFilter2")).trigger('click');

					$(document.getElementById("_cbHideIfReporterLastCommenter")).trigger('click');
					*/
					
					$('#_inputFilterMinComments').val(1);
					$('#_cbEnableMinCommentsFilter').trigger('click');

					$('#_inputFilterCommentDays2').val(7);
					$('#_cbEnableCommentAgeFilter2').trigger('click');

					$('#_cbHideIfReporterLastCommenter').trigger('click');
			 
				}


				if (URCommentUROOnlyMyUR.checked) {
					// _cbHideIfReporterNotLastCommenter
					//$(document.getElementById("_cbHideAnyComments")).trigger('click');
					$("#_cbHideAnyComments").trigger('click');
				}


			}
		} else {
			alert("UR Overview Plus (URO+) needs to be installed to use these URO Presets.");
		}
	};
};
window.BetaaTestersCheckCount =  0;
//i think this is an old function that can be deleted, it was incorporated into the uro clean func and was only used for testing

/*
URCommentURONewClicked = function() {
    console.log("URComments - URCommentURONewClicked");
    document.getElementById("_cbFilterWazeAuto").checked = true;
    element.attributeName = 'value';
};
*/

//Notes


/*
        //$(document).ready(function() {
        $('#WazeMap').mousedown(function(event) {
            switch (event.which) {
                case 1:
                    //alert('Left mouse button pressed');
                    break;
                case 2:
                    //;alert('Middle mouse button pressed');
                    break;
                case 3:
                    alert('Right mouse button pressed');
                    break;
                default:
                    break;

            }
            //alert("test");
        });
        //});
		*/






//$('.new-comment-form button[type="submit"]').click(function() { alert('clicked');}) grabs your button and alerts clicked if you want to get out of the DOM traversal


//this is how you set the select in a drop down after it is filled
// $("#BoilerPlateCreators").val("vectorspace");

//jquery checkbox
//$('.myCheckbox').prop('checked', true);
//$('.myCheckbox').prop('checked', false);


/*
//change the tag data of an element by class
var x = document.getElementsByClassName("slider");
//alert( x.length );
//go trough all of the eletemnts that match the requested class
for(var i = 0, j=x.length; i<j; i++){
    
    var btnHtml = (0 + " - " + x[i].innerHTML);
    alert (btnHtml);
    
    //this if doent matach the slider type but i am leaving it for future documentation
    if(btnHtml.indexOf("<span>Close</span>") > -1) {
        
        //change the tag data of an element by class
        //x[i].style.top = "125px";
        
    }
}
*/

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址