Tieba Multiuser

百度贴吧马甲切换

05.03.2014 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name	Tieba Multiuser
// @namespace	http://gera2ld.blog.163.com/
// @author	Gerald <[email protected]>
// @icon	http://s.gravatar.com/avatar/a0ad718d86d21262ccd6ff271ece08a3?s=80
// @version	1.3
// @description	百度贴吧马甲切换
// @homepage	http://userscripts.org/scripts/show/154072
// @include	http://tieba.baidu.com/*
// @require	http://userscripts.org/scripts/source/186749.user.js
// @grant	GM_getValue
// @grant	GM_setValue
// @grant	GM_registerMenuCommand
// ==/UserScript==
function e(e,t){var n=GM_getValue(e,"");return n&&"string"==typeof n&&(n=JSON.parse(n)),n||t}function t(e,t){GM_setValue(e,JSON.stringify(t))}function n(e,t){var n=new Date;e?n.setTime(16094e8):e="",document.cookie="BDUSS="+e+";domain=baidu.com;path=/;expires="+n.toGMTString(),"function"==typeof t?t():"string"==typeof t?location.replace(t):location.reload()}function o(){t("ge_users",s)}function i(e,t,i){e.preventDefault(),i=e.target,e=i.parentNode,t=e.parentNode,"A"==i.tagName?e==t.firstChild?n():e==t.lastChild?location.href="http://wappass.baidu.com/?login&u="+encodeURIComponent(location.href):n(s[i.innerText||i.textContent]):"SPAN"==i.tagName&&(i=i.previousSibling,delete s[i.innerText||i.textContent],setTimeout(o,0),t.removeChild(e))}function r(e){utils.addStyle("#ge_tu>li{position:relative;cursor:pointer;}#ge_tu span{position:absolute;top:0;right:0;background:#77f;color:white;border-radius:3px;border:1px solid;border:none;margin:2px;cursor:pointer;text-align:center;padding:0 2px;}");var t=document.createElement("li"),n=document.createElement("li");e.insertBefore(t,e.firstChild),t.className="split",e.insertBefore(n,t),n.innerHTML="<a href=# class=u_arrow>马甲</a>",n.onmouseover=function(){t.style.display="block"},n.onmouseout=function(){t.style.display="none"},t=document.createElement("div"),n.appendChild(t),t.className="u_ddl",t.setAttribute("style","display:none;width:40px;top:-2px;"),e=document.createElement("div"),t.appendChild(e),e.className="u_ddl_con u_ddl_con_top",c=document.createElement("ul"),e.appendChild(c),c.id="ge_tu",c.onclick=i,a()}function a(){if(d=[],s){d.push("<li><a href=#>未登录状态</a></li>");for(var e in s)e?d.push("<li><a href=#>"+e.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</a><span>删</span></li>"):delete s[e]}else d.push('<li title="未检测到Cookie,请任意添加一个马甲或自行去除对应Cookie的HttpOnly属性。" style="color:gray">未检测到Cookie</li>');d.push("<li><a href=#>添加马甲</a></li>"),c.innerHTML=d.join("")}function l(){utils.popup.show({html:'<h3>设置 - 贴吧马甲切换脚本</h3><fieldset><legend>马甲数据 <button id=gu_import>导入</button> <button id=gu_export>导出</button> <a title="复制数据到以下文本框然后点击导入即可导入数据。\n点击导出后复制数据文本即可用于导入。">(?)</a></legend><textarea id=gu_data></textarea></fieldset>',className:"ge_opt",init:function(e){var t=e.querySelector("#gu_data");t.onclick=function(){this.select()},e.querySelector("#gu_import").onclick=function(e){try{e=JSON.parse(t.value)}catch(n){e=null}if(e&&"object"==typeof e){for(var i in e)s[i]=e[i];o(),a(),alert("导入成功!")}else alert("导入失败!")},e.querySelector("#gu_export").onclick=function(){t.value=JSON.stringify(s)}}})}function u(t,n){function i(e){"com_userbar"==e.target.parentNode.id&&(document.body.removeEventListener("DOMNodeInserted",i,!1),r(e.target))}s=e("ge_users",{}),(t=PageData)&&t.user&&t.user.is_login&&t.user.name&&(t=t.user.name),t&&(n=document.cookie.match(/BDUSS=(.*?)(;|$)/),n?(s[t]=n[1],o()):s=null),GM_registerMenuCommand("贴吧马甲设置",l),document.body.addEventListener("DOMNodeInserted",i,!1)}var s,c;document.querySelector("a[param=word]")&&u();