WME RickZabelComments

This script is for replying to UR comments with a single click. Based off Chat Jumper and URO+

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

// ==UserScript==
// @name			WME RickZabelComments
// @description		This script is for replying to UR comments with a single click. Based off Chat Jumper and URO+
// @namespace		[email protected]
// @grant			none
// @grant			GM_info
// @version			0.0.3
// @match			https://editor-beta.waze.com/*editor/*
// @match			https://www.waze.com/*editor/*
// @author			Rick Zabel '2014
// @license			MIT/BSD/X11
// ==/UserScript==


/* Changelog
 * 0.0.3 - added HawkeyGoals slightly edited Ur-commetns 
 * 0.0.2 - initial version
 */


function RickZabelComments_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 {
        if ("object" === typeof Components.interfaces.gmIGreasemonkeyService)  // Firefox tells that "Components" is deprecated
        {
            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
            RickZabelComments_init.toString()+' \n'+
            'RickZabelComments_init();';
        DLscript.setAttribute("type", "application/javascript");
        document.body.appendChild(DLscript);    
        document.body.removeChild(DLscript); 
    } else {
        /* begin running the code! */
        console.log("RickZabelComments end of boot strap");      
        RickZabelComments_init(); 
        ///setTimeout(RickZabelComments_init,200);
    } 
}

function RickZabelComments_init() {
    
    RickZabelComments =  { 
        last: new Array(),
        isLast: false,
        isLSsupported: false,
        zoom: false
    };
    
    RickZabelComments.init = function() {
        
        console.log("RickZabelComments init");
        
        //add comments tab
        var b = $('<li> <a data-toggle="tab" href="#sidepanel-Comments">UR-Comments</a> </li> ');
        $(".nav-tabs").append(b);
        
        
        //add content to the comments tab
        
        //Comment tab header
        var c = $('<div class="tab-pane" id="sidepanel-Comments"> <div class="result-list-container"><p class="message"><b>This script is used for replying to UR requests.</b></p></div></div><br><br>');
        $(".tab-content").append(c);
        
        //Errors
        var d = $('<div style="margin:5px;"><a id="RickZabelComments-comment1" class="RickZabelComments" style="float:none;color:#000000">Errors with no descriptive text</a></div>');  
        d.click (RickZabelComments.comment1);
        $("#sidepanel-Comments").append(d);
        
        //4 day Follow-Up
        var  e = $('<div style="margin:5px;"><a id="RickZabelComments-comment2" class="RickZabelComments" style="float:none;color:#000000">4 day Follow-Up</a></div>');  
        e.click (RickZabelComments.comment2);
        $("#sidepanel-Comments").append(e);
        
        //7th day No Response/Close
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment3" class="RickZabelComments" style="float:none;color:#000000">7th day No Response/Close</a></div>');  
        e.click (RickZabelComments.comment3);
        $("#sidepanel-Comments").append(e);      
        
        //Fixed
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment4" class="RickZabelComments" style="float:none;color:#000000">Fixed</a></div>');  
        e.click (RickZabelComments.comment4);
        $("#sidepanel-Comments").append(e);           
        
        //Missing Exit
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment5" class="RickZabelComments" style="float:none;color:#000000">Missing Exit</a></div>');  
        e.click (RickZabelComments.comment5);
        $("#sidepanel-Comments").append(e);       
        
        //Turn Not Allowed
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment6" class="RickZabelComments" style="float:none;color:#000000">Turn Not Allowed</a></div>');  
        e.click (RickZabelComments.comment6);
        $("#sidepanel-Comments").append(e);    
        
        //Wrong Driving Directions
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment7" class="RickZabelComments" style="float:none;color:#000000">Wrong Driving Directions</a></div>');  
        e.click (RickZabelComments.comment7);
        $("#sidepanel-Comments").append(e);   
        
        //Chicago Alleys
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment8" class="RickZabelComments" style="float:none;color:#000000">Chicago Alleys</a></div>');  
        e.click (RickZabelComments.comment8);
        $("#sidepanel-Comments").append(e);   	
        
        //Road Closed
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment9" class="RickZabelComments" style="float:none;color:#000000">Road Closed</a></div>');  
        e.click (RickZabelComments.comment9);
        $("#sidepanel-Comments").append(e);   			
        
        //48 Hour Reply
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment10" class="RickZabelComments" style="float:none;color:#000000">48 Hour Reply</a></div>');  
        e.click (RickZabelComments.comment10);
        $("#sidepanel-Comments").append(e);   
        
        //Clear Saved Locations
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment11" class="RickZabelComments" style="float:none;color:#000000">Clear Saved Locations</a></div>');  
        e.click (RickZabelComments.comment11);
        $("#sidepanel-Comments").append(e);   
        
        //Address - Incorrect Position
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment12" class="RickZabelComments" style="float:none;color:#000000">Address - Incorrect Position</a></div>');  
        e.click (RickZabelComments.comment12);
        $("#sidepanel-Comments").append(e);   
        
        //Address - Missing from Map
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment13" class="RickZabelComments" style="float:none;color:#000000">Address - Missing from Map</a></div>');  
        e.click (RickZabelComments.comment13);
        $("#sidepanel-Comments").append(e);   
        
        //Address - Search Results Bad
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment14" class="RickZabelComments" style="float:none;color:#000000">Address - Search Results Bad</a></div>');  
        e.click (RickZabelComments.comment14);
        $("#sidepanel-Comments").append(e);   
        
        //Detours / Odd-Routing
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment15" class="RickZabelComments" style="float:none;color:#000000">Detours / Odd-Routing</a></div>');  
        e.click (RickZabelComments.comment15);
        $("#sidepanel-Comments").append(e);   
        
        //House Number Adjustment
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment16" class="RickZabelComments" style="float:none;color:#000000">House Number Adjustment</a></div>');  
        e.click (RickZabelComments.comment16);
        $("#sidepanel-Comments").append(e);   
        
        //Missing Roads / Roads Not Displaying
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment17" class="RickZabelComments" style="float:none;color:#000000">Missing Roads / Roads Not Displaying</a></div>');  
        e.click (RickZabelComments.comment17);
        $("#sidepanel-Comments").append(e);   
        
        //Road Closure Request - Temporary
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment18" class="RickZabelComments" style="float:none;color:#000000">Road Closure Request - Temporary</a></div>');  
        e.click (RickZabelComments.comment18);
        $("#sidepanel-Comments").append(e);   
        
        //Traffic - Stale Information
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment19" class="RickZabelComments" style="float:none;color:#000000">Traffic - Stale Information</a></div>');  
        e.click (RickZabelComments.comment19);
        $("#sidepanel-Comments").append(e);   
        
        //Traffic - Jams 
        var e = $('<div style="margin:5px;"><a id="RickZabelComments-comment20" class="RickZabelComments" style="float:none;color:#000000">Traffic - Jams </a></div>');  
        e.click (RickZabelComments.comment20);
        $("#sidepanel-Comments").append(e);   		
        
        
        console.log("RickZabelComments Tab Added");  
    }                    
    
    
    RickZabelComments.comment1 = function() {
        console.log("RickZabelComments comment1");
        
        if ($(".new-comment-text")[0]){  
            
            //Errors.
            var content = "Would you provide more information about the problem you reported here? Thanks!";
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
        
    }   
    
    RickZabelComments.comment2 = function() {
        console.log("RickZabelComments comment2")
        if ($(".new-comment-text")[0]){  
            
            //Follow-Up
            var content = "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!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
        
    }
    
    RickZabelComments.comment3 = function() {
        console.log("RickZabelComments comment3")
        if ($(".new-comment-text")[0]){  
            
            //7th day No Response/Close
            var content = "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!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
        
    }
    
    RickZabelComments.comment4 = function() {
        console.log("RickZabelComments comment4")
        
        if ($(".new-comment-text")[0]){  
            
            //Fixed
            var content = "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.";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
        
    }
    
    RickZabelComments.comment5 = function() {
        console.log("RickZabelComments comment5")
        
        if ($(".new-comment-text")[0]){  
            
            //Missing Exit Report
            var content = "Would you please let us know what exit you believe is missing? Thanks!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }    
    }
    
    RickZabelComments.comment6 = function() {
        console.log("RickZabelComments comment6")
        
        if ($(".new-comment-text")[0]){  
            
            //Turn Not Allowed
            var content = "Would you please let us know what turn was not, or should not be, allowed and the street names at the intersection? Thanks!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment7 = function() {
        console.log("RickZabelComments comment7")
        
        if ($(".new-comment-text")[0]){  
            
            //Wrong Driving Directions
            var content = "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!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment8 = function() {
        console.log("RickZabelComments comment8")
        
        if ($(".new-comment-text")[0]){  
            
            //Chicago Alleys
            var content = "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!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment9 = function() {
        console.log("RickZabelComments comment9")
        
        if ($(".new-comment-text")[0]){  
            
            //Road Closed
            var content = "Would you please let us know the following, what road is closed; between which intersections is this road closed; and how long is this road is scheduled to be closed? Thanks!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment10 = function() {
        console.log("RickZabelComments comment10")
        
        if ($(".new-comment-text")[0]){  
            
            //48 Hour Reply
            var content = "Please allow 48 hours for changes to be reflected in the live map.";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment11 = function() {
        console.log("RickZabelComments comment11")
        
        if ($(".new-comment-text")[0]){  
            
            //Clear Saved Locations
            var content = "You should remove the location from your favorites and recent searches and then re-search for the location to update the result.";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment12 = function() {
        console.log("RickZabelComments comment12")
        
        if ($(".new-comment-text")[0]){  
            
            //Address - Incorrect Position
            var content = "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!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment13 = function() {
        console.log("RickZabelComments comment13")
        
        if ($(".new-comment-text")[0]){  
            
            //Address - Missing from Map
            var content = "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!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
            
        }
    }
    
    RickZabelComments.comment14 = function() {
        console.log("RickZabelComments comment14")
        
        if ($(".new-comment-text")[0]){  
            
            //Address - Search Results Bad
            var content = "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 will 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.";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment15 = function() {
        console.log("RickZabelComments comment15")
        
        if ($(".new-comment-text")[0]){  
            
            //Detours / Odd-Routing
            var content = "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!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment16 = function() {
        console.log("RickZabelComments comment16")
        
        if ($(".new-comment-text")[0]){  
            
            //House Number Adjustment
            var content = "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!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment17 = function() {
        console.log("RickZabelComments comment17")
        
        if ($(".new-comment-text")[0]){  
            
            //Missing Roads / Roads Not Displaying
            var content = "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 road in question. When moving at highway speeds, Waze deliberately chooses not to display some nearby roads to avoid cluttering the screen. If you are certain a road is missing from the map, please reply and tell us as much as possible about the missing road. Thanks!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment18 = function() {
        console.log("RickZabelComments comment18")
        
        if ($(".new-comment-text")[0]){  
            
            //Road Closure Request - Temporary
            var content = "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!";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment19 = function() {
        console.log("RickZabelComments comment19")
        
        if ($(".new-comment-text")[0]){  
            
            //Traffic - Stale Information
            var content = "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.";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    RickZabelComments.comment20 = function() {
        console.log("RickZabelComments comment20")
        
        if ($(".new-comment-text")[0]){  
            
            //Traffic - Jams 
            var content = "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.";
            
            $(".new-comment-text").val(content);
        } else {
            alert("Can not find the comment box!");
        }
    }
    
    
    RickZabelComments.startcode = function () {
        
        
        // Check if WME is loaded, if not, waiting a moment and checks again. if yes init RickZabelComments
        try {
            if ("undefined" != typeof unsafeWindow.W.model.chat.rooms._events.listeners.add[0].obj.userPresenters[unsafeWindow.Waze.model.loginManager.user.id] ) {
                //check for the comment area
                //  if ($(".new-comment-text")[0]){  
                //console.log("RickZabelComments To Add Comment Tab");
                RickZabelComments.init()
            } else {
                setTimeout(RickZabelComments.startcode, 200);
            }
        } catch(err) {
            setTimeout(RickZabelComments.startcode, 200);
        }
        
    }
    
    //setTimeout(RickZabelComments.startcode, 5000);
    RickZabelComments.startcode();
}
//setTimeout(RickZabelComments_bootstrap(), 5000);
RickZabelComments_bootstrap();

QingJ © 2025

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