UserScript name Webhost DEL Orders author Render description Webhost d

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// ==UserScript==
// @name Webhost DEL Orders
// @author Render
// @description Webhost delete orders
// @version 1.3
// @namespace
// @include https://bp.webhost1.ru/*
// @include https://bp.webhost1.org/*
// ==/UserScript==
function removeDuplicateElement(arrayName)
{
var newArray=new Array();
label:for(var i=0; i<arrayName.length;i++ )
{
for(var j=0; j<newArray.length;j++ )
{
if(newArray[j]==arrayName[i])
continue label;
}
newArray[newArray.length] = arrayName[i];
}
return newArray;
}
var run = 1;
var fot = document.getElementById("foot");
fot.addEventListener('click', function() { var run = 0; del(run); }, false);
function del(run) {
if(document.URL.indexOf("a_orders") != -1 && run == 0) {
//found
if(confirm('Начать удаление заказов?')) {
var link = document.getElementsByClassName("d");
for (var i in removeDuplicateElement(link)) {
rlink = link.item(i);
setTimeout("window.open('"+rlink.getAttribute('href')+"', '_blank')", i*2000);
}}
run = 1;
} else { return false; run = 1; }
}