View difference between Paste ID: rcy2FmX8 and kK6J84zN
SHOW: | | - or go back to the newest paste.
1
// ==UserScript==
2
// @name           padoru padoru
3
// @version        2.0
4
// @icon           https://i.fiery.me/FwdBW.gif
5
// @namespace      *
6
// @include        http://iichan.hk/*
7
// @include        http://*.iichan.hk/*
8
// @include        https://iichan.hk/*
9
// @include        https://*.iichan.hk/*
10-
if(document.location.href.indexOf("/b/") != -1) 
10+
11-
{
11+
12-
  var images = 
12+
function animateChibi(event){
13-
  [
13+
    var element = event.target;
14-
    "https://iichan.hk/b/src/1608906546551.gif", // Chiyo
14+
15-
    "https://iichan.hk/b/src/1608906567342.gif", // Cirno
15+
    if(typeof(element.src) != 'undefined' && element.hasAttribute('framesRunning')) {
16-
    "https://iichan.hk/b/src/1608906584705.gif", // CT
16+
        switch(element.src) {
17-
    "https://iichan.hk/b/src/1608906603810.gif"  // Hurma
17+
            case element.getAttribute('framesStill'): 
18-
  ];
18+
                element.src = element.getAttribute('framesRunning');
19-
  var form = document.getElementById("postform");
19+
                break;
20-
  var newTable = document.createElement("table");
20+
            case element.getAttribute('framesRunning'):
21-
	var innerHtml = "<tbody><tr>";
21+
                element.src = element.getAttribute('framesStill');
22-
  for (var i=0; i<images.length; i++) 
22+
                break;
23-
  {
23+
        }
24-
    innerHtml += "<td><img src='"+images[i]+"'/></td>";
24+
    }
25-
  }
25+
}
26-
  newTable.innerHTML = innerHtml+"</tr></tbody>";
26+
27-
  form.appendChild(newTable);
27+
function init(){
28-
}
28+
    if(document.location.href.indexOf("/b/") != -1) 
29
    {
30
      /* https://safe.fiery.me/a/LsiVxjLH
31
         originally from http://iichan.hk/b/res/5090803.html
32
      */
33
      var still = 
34
      [
35
        "https://i.fiery.me/FwdBW.gif", /* Chiyo */
36
        "https://i.fiery.me/oMEz2.gif", /* Cirno */
37
        "https://i.fiery.me/gKGjW.gif", /* CT */
38
        "https://i.fiery.me/dXMA7.gif"  /* Hurma */
39
      ];
40
    
41
      var running = 
42
      [
43
        "https://i.fiery.me/9LOei.gif", /* Chiyo */
44
        "https://i.fiery.me/bbVeY.gif", /* Cirno */
45
        "https://i.fiery.me/0mW4T.gif", /* CT */
46
        "https://i.fiery.me/cTvHf.gif"  /* Hurma */
47
      ];
48
      
49
      var form = document.getElementById("postform");
50
      if(!form) return;
51
      if(document.getElementById("chibisTable")) return;
52
      
53
      var newTable = document.createElement("table");
54
      newTable.setAttribute('id', 'chibisTable');
55
      
56
      var innerHtml = "<tbody><tr>";
57
      for (var i=0; i < still.length; i++) 
58
      {
59
        innerHtml += '\
60
            <td> \
61
                <img \
62
                    style="cursor: pointer;" \
63
                    onclick="animateChibi(event);" \
64
                    framesStill="' + still[i] + '" \
65
                    framesRunning="' + running[i] + '" \
66
                    src="' + still[i] + '" \
67
                 ></img> \
68
             </td>';
69
      }
70
      newTable.innerHTML = innerHtml + "</tr></tbody>";
71
      form.appendChild(newTable);
72
    }
73
}
74
75
init();
76
77
78