- Автор темы
- #1
Вот сам скрипт:
Код:
var loading_text = Args.loading_text || "Читаем сообщения";
var ok_text = Args.ok_text || "Все прочитано.";
document.getElementById("content").innerHTML = loading_text+".";
function read(){
document.getElementById("content").innerHTML = loading_text+"..";
vk._api("execute",{code:"\
var i = 12,x;\
while(i > 0){\
x = API.messages.getDialogs({unread:1,count:200})[email protected]@.id;\
if(!x.length)return 0;\
API.messages.markAsRead({message_ids:x});\
i = i - 1;\
}\
var x = API.messages.getDialogs({unread:1});\
return x.length;\
"},function (r){
if(r.response === 0)return (document.getElementById("content").innerHTML = ok_text);
document.getElementById("content").innerHTML = loading_text+"...";
read();
});
}
read();
Код:
var loading_text = Args.loading_text || "Читаем сообщения";
var ok_text = Args.ok_text || "Все прочитано.";
document.getElementById("content").innerHTML = loading_text+".";
function read(){
document.getElementById("content").innerHTML = loading_text+"..";
vk._api("execute",{code:"\
var i = 12,x;\
while(i > 0){\
x = API.messages.getDialogs({unread:1,count:200})[email protected]@.id;\
if(!x.length)return 0;\
API.messages.markAsRead({message_ids:x});\
i = i - 1;\
}\
var x = API.messages.getDialogs({unread:1});\
return x.length;\
"},function (r){
if(r.response === 0)return (document.getElementById("content").innerHTML = ok_text);
document.getElementById("content").innerHTML = loading_text+"...";
read();
});
}
read();