Volafile Unremover

Preserves messages and files auto-removed by Volafile and prevents navigation to front page on room closure

当前为 2020-05-26 提交的版本,查看 最新版本

// ==UserScript==
// @name Volafile Unremover
// @author Arnold François Lecherche and a Vola anon named Adonis
// @namespace gf.qytechs.cn
// @icon https://volafile.org/favicon.ico
// @version 1.02
// @description Preserves messages and files auto-removed by Volafile and prevents navigation to front page on room closure
// @include http://volafile.org/*
// @include http://*.volafile.org/*
// @include https://volafile.org/*
// @include https://*.volafile.org/*
// @grant none
// @run-at document-end
// @copyright 2020 Arnold François Lecherche
// ==/UserScript==
(function (w, d, e, v, c) {
  'use strict';
  function removeMessages(t) {
    var obj = ['messages', 'queued_messages'], i = obj.length, msg, j;
    while (i--) {
      msg = e.chat[obj[i]];
      j = msg.length;
      while (j--) if (t.msgIds.indexOf(msg[j].data.id) !== -1) msg[j].elem.style.opacity = '.4';
    }
  }
  function delete_file(t) {
    var file = e.filelist.files_by_id[t];
    file.dom.fileElement.style.opacity = '.2';
    file.dom.fileElement.getElementsByTagName('a')[0].style.textDecoration = 'line-through';
    c.showMessage('YourMom', 'File deleted: ' + file.name + ' [' + JSON.stringify(file.tags) + ']', {'dontsave': true, 'staff': true});
  }
  function navigate(e) {
    alert('intercepted autonavigation to "' + e + '"');
  }
  v.removeMessages = removeMessages;
  v.delete_file = delete_file;
  e.connection.navigate = navigate;
  c.showMessage('Script', 'vola message and file removal indicator loaded', {'dontsave': true, 'staff': true});
})(window, document, window.RoomInstance.extensions, window.RoomInstance.extensions.connection._events, window.Room.prototype._extensions.connection.prototype.room.extensions.chat);

QingJ © 2025

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