imported>=海豚= |
imported>=海豚= |
| 第120行: |
第120行: |
|
| |
|
| $(function(){ | | $(function(){ |
| // 小头像放大镜
| |
| setTimeout(function(){
| |
| $('.userlink-avatar').hover(function(){
| |
| var imgUrl = $(this).find('.userlink-avatar-small:first').attr('src')
| |
| var container = $('<div id="userHeadMagnifier" style="display:inline-block; padding:10px; background:white; border:1px black solid; position:absolute; top:-139px; left:-135px;">')
| |
| .append('<img src="' + imgUrl + '" width="128">')
| |
|
| |
| $(this).css('position', 'relative').append(container)
| |
| }, function(){
| |
| $(this).css('position', 'static').find('#userHeadMagnifier').remove()
| |
| })
| |
| }, 1000)
| |
|
| |
| // 阻止复制时添加版权信息
| |
| $('#mw-content-text').off('copy')
| |
| | | |
| // tab键改为输出2个空格 | | // tab键改为输出2个空格 |
| 第240行: |
第225行: |
| }) | | }) |
|
| |
|
| // 搜索引擎代替方案
| |
| /*
| |
| $(function(){
| |
| var input = $('#searchInput').attr('placeholder', '搜索萌娘百科')
| |
| $('#searchButton').off().on('click', function() {
| |
| var keyword = input.val();
| |
| if (!keyword) window.alert('请输入关键词后再行搜索!');
| |
| else {
| |
| var self = $(this),
| |
| check_url = 'https://hmoegirl.com/' + keyword,
| |
| open_url = 'https://www.bing.com/search?q=' + encodeURIComponent(keyword) + '+site%3Azh.hmoegirl.com&ie=UTF-8';
| |
| self[0].disabled = true;
| |
| self.data({
| |
| 'background-image': self.css('background-image'),
| |
| 'background-size': self.css('background-size')
| |
| });
| |
| self.css({
| |
| 'background-image': 'url(https://static.mengniang.org/common/d/d1/Windows_10_loading.gif)',
| |
| 'background-size': '80%'
| |
| });
| |
| $.ajax({
| |
| url: check_url,
| |
| type: 'HEAD',
| |
| success: function(_, __, response) {
| |
| if (response.status < 400) location.href = check_url;
| |
| else this.error();
| |
| },
| |
| error: function() {
| |
| location.href = open_url
| |
| },
| |
| complete: function() {
| |
| self[0].disabled = false;
| |
| self.css(self.data());
| |
| }
| |
| });
| |
| }
| |
| return false;
| |
| });
| |
| })
| |
| */
| |
| mw.loader.load('https://common.wjghj.cn/js/InPageEdit-v2');
| |
| /* | | /* |
| 这是一个保存编辑内容的小插件,载入后将在“显示更改”按钮后生成一个“还原备份”按钮。 | | 这是一个保存编辑内容的小插件,载入后将在“显示更改”按钮后生成一个“还原备份”按钮。 |
| 第329行: |
第273行: |
| }) | | }) |
|
| |
|
| /** 方便上传相册缺少的图片 **/
| | mw.loader.load('https://common.wjghj.cn/js/InPageEdit-v2'); |
| $('.gallery .thumb').prepend(function () {
| |
| var galleryfile = $(this).text();
| |
| if (galleryfile == '') {
| |
| return;
| |
| } else {
| |
| $(this).html('<a href="https://www.hmoegirl.org/index.php?title=Special:Upload&wpDestFile='+galleryfile+'" class="new" target="_blank">点击上传<br/>' + galleryfile + '</a>')
| |
| }
| |
| });
| |
| mw.loader.load(['ext.gadget.Twinkle']);
| |