// ==UserScript== // @name ThreadsAtributesEditingTool // @name:ru Инструмент изменения атрибутов в нитках // @version 2.3.2 // @description The script allows you to bulk edit the attributes of embarcation and disembarcation at stops in the thread // @description:ru Скрипт позволяет осуществлять групповое редактирование атрибутов посадки и высадки у остановок в нитках транспорта // @author Nikita Yushkov // @match https://n.maps.yandex.ru/* // @namespace https://greasyfork.org/users/199854 // @downloadURL https://update.greasyfork.icu/scripts/370854/ThreadsAtributesEditingTool.user.js // @updateURL https://update.greasyfork.icu/scripts/370854/ThreadsAtributesEditingTool.meta.js // ==/UserScript== (function() { var body = []; var a = []; window.onload = function(){ var Interval = setInterval(function(){if(!((document.getElementsByClassName('nk-logo-view__img nk-logo-view__img_color_white')[0] === null) || (document.getElementsByClassName('nk-suggest_width_available')[0] === undefined)))f0();},10); function f0(){clearInterval(Interval); body = document.getElementsByTagName('body'); if (document.getElementById('sk') === null){body[0].insertAdjacentHTML('beforeEnd','');} if (document.getElementById('but') === null){body[0].insertAdjacentHTML('beforeEnd','Атрибуты в нитках');} a = document.getElementsByClassName('nk-transport-thread-stop-editor-view__stop'); document.getElementById('but').onclick = f1;} } function f1(){ if((a[0] === null) || (a[0] === undefined))alert('Остановки не найдены'); else{document.getElementById('but').parentNode.removeChild(document.getElementById('but')); body[0].insertAdjacentHTML('beforeEnd','
Изменение атрибутов в нитке
Начальная ост.
Конечная ост.

Нет посадки

Нет высадки

ВыйтиИзменить атрибуты
');document.getElementById('ex').onclick = f2; document.getElementById('jdi').onclick = f3; document.getElementById('th1').onkeypress=function(e){ if(e.keyCode==13){ f3(); } }; document.getElementById('th2').onkeypress=function(e){ if(e.keyCode==13){ f3(); } }; var th3 = document.getElementsByName('th3'); for (var i = 0; iАтрибуты в нитках'); document.getElementById('but').onclick = f1; }; function f3(){ var v = []; v[0] = parseInt(document.getElementById('th1').value); v[1] = parseInt(document.getElementById('th2').value); if (!((a[0] === null) || (a[0] === undefined))) {if(!((v[0] > v[1]) || (v[0] === undefined) || (v[1] === undefined) || (v[0] === null) || (v[1] === null) || (v[0] <= 0) || (v[1] > a.length) || (isNaN(v[0])) || (isNaN(v[1])))){ var r = document.getElementsByName('th3'); for(var i = 0; i < 2; i++){ if(r[i].checked){ v[2] = parseInt(r[i].value); break; } } document.getElementById('okoshko').parentNode.removeChild(document.getElementById('okoshko')); for(var i = v[0]-1; i < v[1]; i++ ){ var p = a[i].getElementsByClassName('nk-action_action_toggle-advanced-mode'); p[0].click(); var b = a[i].getElementsByClassName('nk-checkbox__box'); b[v[2]].click(); p[0].click(); } body[0].insertAdjacentHTML('beforeEnd','Атрибуты в нитках'); document.getElementById('but').onclick = f1; }else {alert("Атрибуты заполнены некорректно. Попробуйте ещё раз."); document.getElementById('ex').onclick = f2; document.getElementById('jdi').onclick = f3; document.getElementById('th1').onkeypress=function(e){ if(e.keyCode==13){ f3(); } }; document.getElementById('th2').onkeypress=function(e){ if(e.keyCode==13){ f3(); } }; var th3 = document.getElementsByName('th3'); for (var i = 0; iАтрибуты в нитках'); document.getElementById('but').onclick = f1;}} })();