sis.img.slideshow

slide show

Tính đến 10-10-2018. Xem phiên bản mới nhất.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        sis.img.slideshow
// @description slide show
// @namespace   zhang
// @include     http://www.sexinsex.net/bbs/viewthread.php?*
// @include     http://www.sexinsex.net/bbs/thread*.html
// @include     http://www.sis001.com/forum/viewthread.php?*
// @include     http://www.sis001.com/forum/thread*.html
// @version     2
// @grant       none
// ==/UserScript==
function preventDefault(e) {
  e.preventDefault();
}

function toggle_slideshow(e) {
  //console.dir(e);
  var message = e.currentTarget; //.parentElement;
  if (message.className.indexOf('slideshow') < 0) {
    message.className = message.className + ' slideshow';
  } else {
    message.className = message.className.replace(' slideshow', '');
  }
  e.preventDefault();
  //console.log(message);
}

function slideshow_on(e) {
  //console.log(e.type, e.target);
  //console.dir(e);
  var message = e.target; //.parentElement;
  if (message.className.indexOf('slideshow') < 0) {
    message.className = message.className + ' slideshow';
  } else {
    message.className = message.className.replace(' slideshow', '');
  }
  //console.log(message);
}

var messages = document.querySelectorAll('.t_msgfont');
console.log(messages.length);
for (var i = 0; i < messages.length; i++) {
  var message = messages[i];
  message.addEventListener('mousedown', preventDefault);
  message.addEventListener('dblclick', toggle_slideshow);
  var images = message.querySelectorAll('img');
  console.log(message.id+" has "+images.length+" images.");
	for (var j = 0; j < images.length; j++) {
    var image = images[j];
    image.removeAttribute("onclick");
  }
}

document.onclick = undefined;