Greasy Fork

Greasy Fork is available in English.

微信编辑器爆破

无视微信编辑器VIP限制,可以使用VIP排版(135,96,365,wxeditor,主编,壹伴)

当前为 2024-09-23 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         微信编辑器爆破
// @namespace    http://greasyfork.icu/users/734068
// @home-url	 http://greasyfork.icu/zh-CN/scripts/421126
// @version      1.11
// @description  无视微信编辑器VIP限制,可以使用VIP排版(135,96,365,wxeditor,主编,壹伴)
// @author       Yim @ [email protected]
// @match        *://*.135editor.com/*
// @match        *://www.135editor.com/js/ueditor/dialogs/135editor/imgstyle.html*
// @match        *://bj.96weixin.com/*
// @match        *://www.wxeditor.com/*
// @match        *://www.zhubian.com/*
// @match        *://yibanbianji.com/*
// @match        *://www.365editor.com/*
// @match        https://mp.weixin.qq.com/cgi-bin/appmsg*
// @match        *://*.yibanbianji.com/*
// @match        *://www.xmyeditor.com/*
// @run-at 		 document-end
// @grant    	 unsafeWindow
// @require		 https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';
    // Your code here...
	let setting={
		item:null,
        type:1,
	};
    var lists=[];
	function init(){
		var host = window.location.host;
		if(host.search(/www.135editor.com/)>=0) init135();
        if(host.search(/bj.96weixin.com/)>=0) init96();
        if(host.search(/www.wxeditor.com/)>=0) initYD();
        if(host.search(/www.zhubian.com/)>=0) initZB();
		if(host.search(/yibanbianji.com/)>=0) initYB();
        if(host.search(/weixin.qq.com/)>=0) initWXYB();
        if(host.search(/www.xmyeditor.com/)>=0) initXMY2();
        if(host.search(/www.365editor.com/)>=0) init365();
	}
	function addStyle(cssText) {
		let a = document.createElement('style');
		a.textContent = cssText;
		let doc = document.head || document.documentElement;
		doc.appendChild(a);
	}
	function init135(){
		 $('<div class="ym_wx_plus_btn">强势插入</div>').appendTo('body').on('click',function(){
			if(!setting.item) return false;
			var h;
			var ue = unsafeWindow.top.UE.getEditor('WxMsgContent');
            if(setting.type==1){
				h = setting.item.find('._135editor').html();
			}else if(setting.type==2){
				h = setting.item.html();
				unsafeWindow.window.top.$("#preview_modal_").hide();
			}
			if(h) ue.setContent(h, true);
		});
        $("body").on('mousemove',function(event){
			var mouseX = event.pageX,mouseY = event.pageY;
            var ele,x1,x2,y1,y2;
            if($(event.target).attr("id")=="template-modal"){
                ele = $(event.target);
                y1 = ele.offset().top;
                y2 = y1 + ele.height();
                x1 = ele.offset().left;
                x2 = x1 + ele.width();
                setting.type=2;
                setting.item=$(".l-img .Content-body");
                $('.ym_wx_plus_btn').css('left','auto').css('right','20px').css('top',(y1+50)+'px').show();
            }else{
                ele = $(event.target).parents('li.style-item');
                if(ele.length<=0) ele = $(event.target).parents('li.vip-style');
                if(ele.length>0){
                    y1 = ele.offset().top;
                    y2 = y1 + ele.height();
                    x1 = ele.offset().left;
                    x2 = x1 + ele.width();
                    if( mouseX < x1 || mouseX > x2 || mouseY < y1 || mouseY > y2){
                        unsafeWindow.window.top.$('.ym_wx_plus_btn').hide();
                        setting.item=null;
                    }else{
                        unsafeWindow.window.top.$('.ym_wx_plus_btn').css('left',(x2-120)+'px').css('top',(y1+5)+'px').show();
                        setting.type=1;
                        setting.item=ele;
                    }
                }else{
                    if(!$(event.target).hasClass('ym_wx_plus_btn'))unsafeWindow.window.top.$('.ym_wx_plus_btn').hide();
                }
            }
		});
	}
    function init96(){
        setInterval(function(){
            $('.rich_media_content').attr('data-vip',1);
        },2000);
    }
    function initYD(){
        setInterval(function(){
            $('.yead_editor').attr('data-use',1);
        },2000);
    }
    function initZB(){
        setInterval(function(){
            unsafeWindow.AlreadyLogin = true;
            unsafeWindow.localStorage.year=99;
            if($('#user_vip').length==0){
                $('body').append('<div style="display:none"><div id="user_vip" data-vip="4"></div></div>');
            }else{
                $('#user_vip').attr('data-vip',4);
            }
            $('.rich_media_content').attr('data-vip',1);
        },2000);
    }
	function initYB(){
        $('<div class="ym_wx_plus_btn">强势插入</div>').appendTo('body').on('click',function(){
			if(!setting.item) return false;
            var ue = UE.getEditor('ueditor-container');
			var h=setting.item.find('.html-container').html();
			if(h) ue.setContent(h, true);
		});
        $("body").on('mousemove',function(event){
            var mouseX = event.pageX,mouseY = event.pageY;
			var ele = $(event.target).parents('.material-item');
			if(ele.length>0){
                var y1 = ele.offset().top;
                var y2 = y1 + ele.height();
                var x1 = ele.offset().left;
                var x2 = x1 + ele.width();
                if( mouseX < x1 || mouseX > x2 || mouseY < y1 || mouseY > y2){
                    $('.ym_wx_plus_btn').hide();
                    setting.item=null;
                }else{
                    $('.ym_wx_plus_btn').css('left',(x2-120)+'px').css('top',(y1)+'px').show();
                    setting.item=ele;
                }
            }else{
                if(!$(event.target).hasClass('ym_wx_plus_btn'))$('.ym_wx_plus_btn').hide();
            }
		});
    }
    function initWXYB(){
        var wxybinit=false;
        $('<div class="ym_wx_plus_btn">强势插入</div>').appendTo('body').on('click',function(){
			if(!setting.item) return false;
			var h=setting.item.find('.html-container').html();
			if(h) UE.instants["ueditorInstant0"].setContent(h,true);
		});

        $("body").on('mousemove',function(event){
            var mouseX = event.pageX,mouseY = event.pageY;
			var ele = $(event.target).parents('.material-item');
			if(ele.length>0){
                var y1 = ele.offset().top;
                var y2 = y1 + ele.height();
                var x1 = ele.offset().left;
                var x2 = x1 + ele.width();
                if( mouseX < x1 || mouseX > x2 || mouseY < y1 || mouseY > y2){
                    $('.ym_wx_plus_btn').hide();
                    setting.item=null;
                }else{
                    $('.ym_wx_plus_btn').css('left',(x2-120)+'px').css('top',(y1)+'px').show();
                    setting.item=ele;
                }
            }else{
                if(!$(event.target).hasClass('ym_wx_plus_btn'))$('.ym_wx_plus_btn').hide();
            }
		});
    }
    function initXMY(){
        setInterval(function(){
            var e = localStorage.getItem("userinfo");
            if(e){}else{
            var d = new Date();
            var date1 = d.getFullYear() + "-" +(d.getMonth() + 1) + "-" + d.getDate();
            var date2 = d.getFullYear() + "" +(d.getMonth() + 1) + "" + d.getDate();
            var userinfo={"id":1,"username":"","nickname":"noBody","mobile":"18888888888","mobile_bak":"","avatar":"","group_id":4,"team_grade_id":0,"team_expire_time":0,"compnay":"","label":"","birthday":0,"gender":0,"position":"","email":"","introduction":"","coin":9999999,"money":"99999.00","urlcode":"","inviter":"","login_type":"","font_setting":0,"expire_time":0,"readhelp":0,"is_disable":0,"is_delete":0,"create_time":date1+" 00:00:00","update_time":date1+" 00:00:00","province_id":0,"close_coin_prompt":1,"city_id":0,"area_id":0,"address":"","color":"","diy_category":"{\"scene\":\"\",\"industry\":\"\",\"template\":\"\"}","constellation_id":0,"qq":"","old_id":0,"sync_time":0,"inviter_id":0,"reminder":0,"is_reminder":0,"extend":"","reminder_time":0,"day_send":0,"default_font":"微软雅黑,Microsoft YaHei","code_img":"","leftposter":"[{\"id\":\"14\",\"num\":1,\"time\":\""+date2+"\"}]","logcode":"E38DFtpaEG","message_count":0,"color_array":[],"catelist":{"scene":"","industry":"","template":""}};
            localStorage.setItem("userinfo", JSON.stringify(userinfo));
            localStorage.setItem("ugroup", JSON.stringify({"id":4}));
            }
        },1000);
        setInterval(function(){
            $('.L2-a-list').attr('data-vip',0).attr('data-coll',1);
        },2000);
    }
    function initXMY2(){
		 $('<div class="ym_wx_plus_btn">强势插入</div>').appendTo('body').on('click',function(){
			if(!setting.item) return false;
            var h=setting.item.find('.LB-sl-content').html().replace(/class="xmyedltor"/g,'class="xmyeditor"');//.replace(/<div/g,'<section').replace(/<\/div>/,'</section>');
			if(h) ue.setContent(h, true);
		});
        $("body").on('mousemove',function(event){
			var mouseX = event.pageX,mouseY = event.pageY;
            var ele = $(event.target).parents('li.LB-sl-li');
			if(ele.length>0){
                var y1 = ele.offset().top;
                var y2 = y1 + ele.height();
                var x1 = ele.offset().left;
                var x2 = x1 + ele.width();
                if( mouseX < x1 || mouseX > x2 || mouseY < y1 || mouseY > y2){
                    $('.ym_wx_plus_btn').hide();
                    setting.item=null;
                }else{
                    $('.ym_wx_plus_btn').css('left',(x2-120)+'px').css('top',(y1)+'px').show();
                    setting.item=ele;
                }
            }else{
                if(!$(event.target).hasClass('ym_wx_plus_btn'))$('.ym_wx_plus_btn').hide();
            }
		});
	}
    function init365(){
		 $('<div class="ym_wx_plus_btn">强势插入</div>').appendTo('body').on('click',function(){
			if(!setting.item) return false;
            var h;
			if(setting.type==1) h=setting.item.find('.KolEditor').html();
			else if(setting.type==2){
				h= setting.item.children().eq(2).prop('outerHTML');
				$('.phone-perview-inner .close-btn').trigger('click');
			}
			if(h) UE.instants["ueditorInstant0"].setContent(h,true);
			$('.ym_wx_plus_btn').hide();
		});

        $("body").on('mousemove',function(event){
			var mouseX = event.pageX,mouseY = event.pageY;
			var ele,x1,x2,y1,y2;
            ele = $(event.target).parents('.content-material .material-list');
			if(ele.length>0){
				setting.type=1;
				y1 = ele.offset().top;
                y2 = y1 + ele.height();
                x1 = ele.offset().left;
                x2 = x1 + ele.width();
				if( mouseX < x1 || mouseX > x2 || mouseY < y1 || mouseY > y2){
                    $('.ym_wx_plus_btn').hide();
                    setting.item=null;
                }else{
                    $('.ym_wx_plus_btn').css('left',(x2-120)+'px').css('top',(y1)+'px').show();
                    setting.item=ele;
                }
			}else{
				ele = $(event.target).parents('.phone-perview-inner .preview-body');
				if(ele.length>0){
					y1 = ele.offset().top;
					y2 = y1 + ele.height();
					x1 = ele.offset().left;
					x2 = x1 + ele.width();
					setting.type=2;
					setting.item=ele;
					$('.ym_wx_plus_btn').css('left',(x2-150)+'px').css('top',(y1+5)+'px').show();
				}else{
					if(!$(event.target).hasClass('ym_wx_plus_btn'))$('.ym_wx_plus_btn').hide();
				}
			}
		});
	}
	addStyle(`
	.ym_wx_plus_btn{position:absolute;display:none;left:0;top:5px;cursor:pointer;width:120px;height:30px;line-height:30px;background:#f00;color:#fff;text-align:center;z-index:99999999;}
	`);
	init();
})();