WME-Force-Data

When Wazes data does not load this will move the map an unnoticeable amount forcing waze to load in the data

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name                WME-Force-Data
// @namespace           https://greasyfork.org/en/users/5920-rickzabel
// @description         When Wazes data does not load this will move the map an unnoticeable amount forcing waze to load in the data
// @include             https://www.waze.com/editor/*
// @include             https://www.waze.com/*/editor/*
// @include             https://editor-beta.waze.com/*
// @version             0.1.1
// @grant               none
// @copyright           2015 rickzabel
// ==/UserScript==
//---------------------------------------------------------------------------------------
(function() {
	var ForecedDataRunOnLoad = "no";
	
    function bootstrap_WMEForceWazeData() {
        if (typeof($) === 'function') {
            console.info('WME-Force-Data: Jquery Loaded');
            window.window.setInterval(WMEForceWazeData_CheckAndMove, 2000);
        } else {
            console.info('WME-Force-Data: no Jquery');
            setTimeout(bootstrap_WMEForceWazeData, 1000);
        }
    }

    function WMEForceWazeData_CheckAndMove() {
        try {
            var UserID = Waze.loginManager.getLoggedInUser().id; //editor's id number
            var UserLevel = W.model.users.objects[UserID].rank + 1; //editor's rank	

			/*if($('#welcome-popup > div > div.login > div.login-form > form > input.form-control.password').val() !== null){
				$('#welcome-popup > div > div.login > div.login-form > form > input.form-control.password').click();
				$('#welcome-popup > div > div.login > div.login-form > form > div.form-action > button').click();
			}
			*/
			
			
        } catch (err) {
			
           // if ((Object.keys(W.model.updateRequestSessions.objects).length === 0 || ForecedDataRunOnLoad = "no") && !$('#welcome-popup > div > div.login > div.login-form > form > input.form-control.password')) {
                console.info('WME-Force-Data: Waze\'s data is missing attempting a map move to force data into loading.');
                WMEForceWazeData_ShowWMEMessage('WME-Force-Data: Waze\'s data is missing attempting a map move to force data into loading.', 5000);
                var CurrentLocation = Waze.map.getCenter();
                CurrentLocation.lat = CurrentLocation.lat - 0.0000001;
                Waze.map.setCenter(CurrentLocation, W.map.mapState.mapLocation.zoom);
				ForecedDataRunOnLoad = "yes";
            //}
        }
    }

    function WMEForceWazeData_ShowWMEMessage(message, delay) {
        var dateNow = new Date();
        var TrickRemove = dateNow.getTime();
        var width = message.length * 10;
        var c = '<div id="WMEForceWazeDataMapNote' + TrickRemove + '" style="width: ' + width + 'px; font-size: 15px; font-weight: bold; margin-left: auto; margin-right: auto; background-color: orange;"><center><b>' + message + '</b></center></div>';
        $("#toolbar").append(c);
        $("#WMEForceWazeDataMapNote" + TrickRemove).show().delay(delay).queue(function(n) {
            $(this).remove();
            n();
        });

    };

    setTimeout(bootstrap_WMEForceWazeData, 1000);
})();