|
|
(未显示同一用户的3个中间版本) |
第1行: |
第1行: |
− | importScriptURI('http://www.moesound.org/wikiplus/Main.new.js');
| + | mw.loader.load('https://wikiplus-app.com/Main.js'); |
− | | + | mw.loader.load('https://zh.moegirl.org/index.php?title=User:AnnAngela/js/delection.js&action=raw&ctype=text/javascript'); |
− | /*
| |
− | * Author:+Eridanus Sora
| |
− | * Work for hitokoto showing
| |
− | */
| |
− | function hitokoto(){
| |
− | var self = this;
| |
− | this.API = 'http://api.hitokoto.us/rand?encode=jsc&charset=utf-8';
| |
− | this.Interval = 5000;
| |
− | this.loadScript = function(){
| |
− | $("head").append('<script id="hitokoto_loader" src="' + self.API + '" />');
| |
− | }
| |
− | this.setIntervalEvent = function(Event,Interval){
| |
− | setInterval(Event,Interval);
| |
− | }
| |
− | this.displayHitokoto = function(Hitokoto){
| |
− | console.log("You get a new Hitokoto:" + Hitokoto.hitokoto);
| |
− | var author = Hitokoto.author;
| |
− | var cat = Hitokoto.cat;
| |
− | var catname = Hitokoto.catname;
| |
− | var date = Hitokoto.date;
| |
− | var id = Hitokoto.id;
| |
− | var source = Hitokoto.source;
| |
− | var content = Hitokoto.hitokoto;
| |
− | var like = Hitokoto.like;
| |
− | var desc = "「" + content + "」 Author : " + author + " @ " + date + " Category : " + catname;
| |
− | $("#hitokoto").children().fadeOut('slow',function(){
| |
− | $("#hitokoto").html($("<span></span>").attr("title",desc));
| |
− | $("#hitokoto span").append($("<a>" + content + "</a>").attr({"href":"http://hitokoto.us/view/" + id,"target":"_blank"}).css("display","none").animate({
| |
− | opacity: 1},
| |
− | 0, function() {
| |
− | $(this).fadeIn('slow');
| |
− | }).after($('<a id="toHitokoto" title="一言(ヒトコト)">一言</a>').attr({'href':'http://hitokoto.us/','target':'_blank'}).css('display','none').animate({
| |
− | opacity: 1},
| |
− | 0, function() {
| |
− | $(this).fadeIn('slow');
| |
− | }).before($('<span id="spliter" title=""> —— </span>').css('display','none').animate({
| |
− | opacity: 1},
| |
− | 0, function() {
| |
− | $(this).fadeIn('slow');
| |
− | }))));
| |
− | $("head").find('#hitokoto_loader').remove();
| |
− | });
| |
− | }
| |
− | this.init = function(){
| |
− | window.hitokoto = this.displayHitokoto;
| |
− | this.loadScript();
| |
− | this.setIntervalEvent(this.loadScript,this.Interval);
| |
− | }
| |
− | }
| |
− | $(document).ready(function(){
| |
− | $("#siteSub").after('<div id="hitokoto"><span></span></div>');
| |
− | H = new hitokoto();
| |
− | H.init();
| |
− | })
| |