您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Hỗ trợ thêm tính năng trên VNZ
当前为
// ==UserScript== // @name ABPVN VNZ-toolkit // @namespace ABPVN // @author Hoàng Rio // @description Hỗ trợ thêm tính năng trên VNZ // @icon http://i.imgur.com/vAI2Rxd.png // @include http://www.vn-zoom.com/f* // @include http://www.vn-zoom.com/newreply.php* // @require https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js // @version 1.2 // @grant none // ==/UserScript== String.prototype.ismatch = function (regex){ return this.match(regex)!==null; }; var img_count=0; function VNZ_img_view(){ $(document).ready(function (){ $('head').append('<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.css" type="text/css" media="screen" />'); $('.content img').each(function (){ if(!$(this).attr('src').ismatch("http://www.vn-zoom.com")){ this.onclick= function () {}; $(this).wrap('<a class="abpvn" title="'+$(this).attr("src")+'" rel="group" href="'+$(this).attr("src")+'"></a>'); } }); $("a.abpvn").fancybox({ 'padding' : '0', 'type' : 'image', 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'speedIn' : 300, 'speedOut' : 200, 'overlayShow' : true, 'hideOnOverlayClick': true, 'overlayOpacity': 0.2, helpers : { overlay : { css : { 'z-index': '0' } } } }); }); } function VNZ_toolkit_option(){ } $.VNZ_tookit_upload=function(file){ var fd=new FormData(); fd.append('file_up',file); $.ajax({ xhr: function() { var xhr = new window.XMLHttpRequest(); xhr.upload.addEventListener("progress", function(e) { if (e.lengthComputable) { var percentValue =Math.round((e.loaded / e.total) * 100) + '%'; } }, false); xhr.addEventListener("progress", function(e) { if (e.lengthComputable) { var percentValue =Math.round((e.loaded / e.total) * 100) + '%'; } }, false); return xhr; }, type: 'POST', crossDomain: true, url: 'https://www.webanh.tk/ajax?act=upload&from=vnz', data: fd, processData: false, contentType: false, success:function(data){ $('.cke_source').val($('.cke_source').val()+'\n'+data.bbcode); console.log(data.bbcode); img_count--; $('#VNZ_img_count').html("Đang tải lên "+img_count+" ảnh"); if(img_count===0){ $(".VNZ_img_qUpload").attr('src','https://www.webanh.tk/css/images/upload.png'); $('.VNZ_img_qUpload').attr('title','Upload ảnh nhanh lên webanh.tk'); $("#VNZ_img_count").hide(); $('img.VNZ_img_qUpload').bind('click',function(){ $('#VNZ_img_up').trigger("click"); }); } }, error: function(xhr,status,error){ /*if(status=='error'){ $('#progress-'+index+'').attr('class','error'); $('#progress-'+index+'').attr('style','width: 100%'); $('#progress-'+index+'').attr('title',status); }*/ alert("Lỗi kết nối"); } }); //console.log(error); }; function VNZ_img_qUpload(){ var VNZ_img_up=function (element){ $(element).append('<span id="ABPVN_VNZ" class="cke_toolbar"><span class="cke_toolgroup" style="width: 20px; height: 20px; border-radius: 50%; border: 2px green solid;"><img title="Upload ảnh nhanh lên webanh.tk" class="VNZ_img_qUpload cke_button" style="width: 20px; height: 20px; border-radius: 50%" src="https://www.webanh.tk/css/images/upload.png"></img><input type="file" id="VNZ_img_up" name="VNZ_img_up" accept="image/*" multiple="true" style="display: none"/></span></span><span class="cke_button" id="VNZ_img_count" style="display: none; color: white; background-color: black;"></span>'); $('img.VNZ_img_qUpload').bind('click',function(){ $('#VNZ_img_up').trigger("click"); }); $('#VNZ_img_up').change(function(e){ $(".VNZ_img_qUpload").attr('src','https://www.webanh.tk/css/images/loading.gif'); $('.VNZ_img_qUpload').attr('title','Đang upload'); var acceptext=['jpg','png','gif','bmp','svg','ico']; var files=$(this).prop('files'); for(var i=0;i<files.length;i++){ var filenames=$.map(files, function(val) { return val.name; }); var fileext=filenames[i].substr( (filenames[i].lastIndexOf('.') +1) ); fileext=fileext.toLowerCase(); if($.inArray(fileext,acceptext)!=-1){ filenames[i]=filenames[i].replace("C:\\fakepath\\",""); console.log(filenames[i]); $('#VNZ_img_count').show(); $('#VNZ_img_count').html("Đang tải lên "+files.length+" ảnh"); img_count=files.length; $.VNZ_tookit_upload(files[i]); $('img.VNZ_img_qUpload').unbind('click'); } } }); }; $(window).load(function(){ VNZ_img_up('.cke_toolbox'); }); $('a.editpost').click(function (){ setTimeout(function(){ VNZ_img_up('#cke_top_vB_Editor_QE_1_editor div.cke_toolbox'); VNZ_img_up('#cke_top_vB_Editor_QE_2_editor div.cke_toolbox'); VNZ_img_up('#cke_top_vB_Editor_QE_3_editor div.cke_toolbox'); },1500); }); console.log("VNZ_img_qUpload fired"); } (function (){ VNZ_img_view(); VNZ_img_qUpload(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址