문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 여기에는 다른 사용자의 개인 설정이 포함되어 있기 때문에 이 자바스크립트 문서를 편집할 수 없습니다. 문서의 원본을 보거나 복사할 수 있습니다. function Mascot2() { this.is_loaded = false; this.is_show = false; this.mascot_img_list = []; this.message_queue = []; this.now_balloon = null; this.is_small = false; this.imgSrc = ""; this.comments = []; } Mascot2.prototype.ToSmall = function() { $(this.mascot_img_html).css("width",96); if(this.now_balloon != null) { $(this.now_balloon).css("bottom",$(this.mascot_img_html).height()/2 +16 - $(this.now_balloon).height()/2 + 32); $(this.now_balloon).css("right",$(this.mascot_img_html).width() + 32); } $("#to-top-btn").css("width",$(this.mascot_img_html).width()/2); $("#hisyokan-bookmark").css("width",$(this.mascot_img_html).width()/2); this.is_small = true; localStorage.setItem("custom_dmns_is_small",true); }; Mascot2.prototype.ToBig = function() { $(this.mascot_img_html).css("width",256); if(this.now_balloon != null) { $(this.now_balloon).css("bottom",$(this.mascot_img_html).height()/2 +16 - $(this.now_balloon).height()/2 + 32); $(this.now_balloon).css("right",$(this.mascot_img_html).width() + 32); } $("#to-top-btn").css("width",$(this.mascot_img_html).width()/2); $("#hisyokan-bookmark").css("width",$(this.mascot_img_html).width()/2); this.is_small = false; localStorage.setItem("custom_dmns_is_small",false); } Mascot2.prototype.Show = function() { if(this.is_show) return; this.is_show = true; var select = this.imgSrc; var wrap_div = document.createElement("div"); this.mascot_img_html = document.createElement("img"); this.mascot_img_html.obj = this; if(localStorage.getItem("custom_dmns_is_small") == "true") { this.ToSmall(); } else { this.ToBig(); } this.mascot_img_html.onload = function() { var obj = this.obj; if(localStorage.getItem("custom_dmns_is_small") == "true") { obj.ToSmall(); } else { obj.ToBig(); } if(obj.message_queue.length != 0) { obj._show_balloon(); } $(".top_s_btn").css("display","none"); $("#to-top-btn").css("width",$(this).width()/2); $("#hisyokan-bookmark").css("width",$(this).width()/2); obj.is_loaded = true; }; $(this.mascot_img_html).click( function() { if(this.obj.is_small == false) { this.obj.ToSmall(); } else { this.obj.ToBig(); } }); this.mascot_img_html.src = select; $(this.mascot_img_html).css("display","block"); $(wrap_div).css("position","fixed"); $(wrap_div).css("right","16px"); $(wrap_div).css("bottom","16px"); $(wrap_div).append(this.mascot_img_html); $(wrap_div).append("<ul style='list-style:none;padding: 0px;margin:0px;display:inline;'><li style='float:left;'><a id='to-top-btn' href='#' style='text-align:center;display:inline-block;line-height:32px;width:100%;background-color:#000;color:#FFF;font-weight:bold;'>위로</a></li><li style='float:left;'> <a id='hisyokan-bookmark' href='#' style='text-align:center;display:inline-block;line-height:32px;width:100%;background-color:#000;color:#FFF;font-weight:bold;'>메뉴</a></li></ul>"); $(document.body).append(wrap_div); document.getElementById("hisyokan-bookmark").obj = this; $("#hisyokan-bookmark").click( function() { var menu_list_h = document.createElement("ul"); $(menu_list_h).css("list-style","none"); $(menu_list_h).css("margin",0); $(menu_list_h).css("padding",0); var li = document.createElement("li"); var a_tag = document.createElement("a"); a_tag.href = "#"; a_tag.obj = this.obj; $(a_tag).css("display","inline-block"); $(a_tag).css("line-height","16px"); $(a_tag).css("padding","2px"); $(a_tag).css("color","#FFF"); $(a_tag).html("이 페이지 등록"); $(a_tag).click( function() { var link = document.location.href; var name = document.title; name = name.replace(" - 리브레 위키",""); var bookmark = new BookmarkStorage(); bookmark.AddBookmark(name,link); this.obj.CloseMessage(); this.obj.ShowMessage("등록되었습니다"); return false; } ); $(li).html(a_tag); $(menu_list_h).append(li); li = document.createElement("li"); a_tag = document.createElement("a"); a_tag.href = "#"; a_tag.obj = this.obj; $(a_tag).css("display","inline-block"); $(a_tag).css("line-height","16px"); $(a_tag).css("padding","2px"); $(a_tag).css("color","#FFF"); $(a_tag).html("북마크 리스트"); $(a_tag).click(function(){ var bookmark = new BookmarkStorage(); this.obj.ShowMessageNow(GetHtmlList(bookmark.GetList())); return false; }); $(li).html(a_tag); $(menu_list_h).append(li); li = document.createElement("li"); a_tag = document.createElement("a"); a_tag.href = "#"; a_tag.obj = this.obj; $(a_tag).css("display","inline-block"); $(a_tag).css("line-height","16px"); $(a_tag).css("padding","2px"); $(a_tag).css("color","#FFF"); $(a_tag).html("쌓인 메시지 지우기"); $(a_tag).click(function(){ this.obj.message_queue = []; return false; }); $(li).html(a_tag); $(menu_list_h).append(li); this.obj.ShowMessageNow(menu_list_h); return false; } ); if(this.comments != null) { this.ShowMessage(this.comments[ randomRange(0, this.comments.length)]) ; } var links = $(".libre_main_content a"); for(var i = 0 ; i < links.length ; i++) { var it = links[i]; var isRemove = false; var itHref = $(it).attr("href"); isRemove = itHref.startsWith("javascript") || isRemove; isRemove = itHref.startsWith("#") || isRemove; isRemove = itHref.startsWith("http") || isRemove; isRemove =( (itHref.indexOf("action=edit") != -1) &&(itHref.indexOf("section=") != -1) )|| isRemove; isRemove = (itHref.indexOf("/wiki/%EC%82%AC%EC%9A%A9%EC%9E%90:") != -1) || isRemove; isRemove = (itHref.indexOf("user:") != -1) || isRemove; isRemove = (itHref.indexOf("/wiki/%ED%8A%B9%EC%88%98:") != -1) || isRemove; isRemove = (itHref.indexOf("user:") != -1) || isRemove; isRemove = (itHref.indexOf("oldid=") != -1) || isRemove; isRemove = (itHref.indexOf("%ED%8A%B9%EC%88%98:") != -1) || isRemove; isRemove = ($(it).attr("class") =="external text") || isRemove; isRemove = ($(it).attr("title") ==null) || isRemove; isRemove = ($(it).attr("class") =="image") || isRemove; isRemove = ($(it).attr("class") =="internal") || isRemove; if(isRemove) { links.splice(i,1); i--; } } if(links.length == 0)return; var randoem_susume = links[randomRange(0,links.length)]; var title = $(randoem_susume).attr("title"); var serihu = []; var href = $(randoem_susume).attr("href"); serihu.push("<a href=\""); serihu.push(href); serihu.push("\">"); serihu.push("\""); if(href.indexOf("action=edit") != -1) { title = title.replace("(없는 문서)",""); serihu.push(this.comments["항목 생성 추천"].replace("$1",title.trim())); } else { serihu.push(this.comments["항목 추천"].replace("$1",title.trim())); } serihu.push("</a>"); mascot.ShowMessage(serihu.join("")); setInterval(function(){ var randoem_susume = links[randomRange(0,links.length)]; var title = $(randoem_susume).attr("title"); var serihu = []; var href = $(randoem_susume).attr("href"); serihu.push("<a href=\""); serihu.push(href); serihu.push("\">"); serihu.push("\""); if(href.indexOf("action=edit") != -1) { title = title.replace("(없는 문서)",""); serihu.push(this.comments["항목 생성 추천"].replace("$1",title.trim())); } else { serihu.push(this.comments["항목 추천"].replace("$1",title.trim())); } serihu.push("</a>"); mascot.ShowMessage(serihu.join("")); },2 * 1000 * 60); }; var damezuma_hisyokan = new Mascot2(); var user_name = mw.config.get("wgRelevantUserName"); $.ajax("/index.php?title=사용자:"+user_name+"/비서함&action=raw&ctype=text/html",{ dataType:"text" }) .done(function(res){ param = { data:{ action:"parse", format:"json", prop:"text|modules", pst:"", text:res }, method:"POST", dataType:"json" }; $.ajax("/api.php",param).done(function(res){ ggg = {}; var temp = document.createElement("div"); temp.innerHTML = res.parse.text["*"]; var pres = temp.getElementsByTagName("pre"); var img = temp.getElementsByTagName("img"); damezuma_hisyokan.imgSrc = img[0].src; for(var key in Object.keys(pres)){ pres[key].id =decodeURI(pres[key].id.replace(/\./gi,"%").replace(/_/gi," ")) ; ggg[pres[key].id] = $(pres[key]).text(); } damezuma_hisyokan.comments = ggg; damezuma_hisyokan.Show(); }); }); 사용자:다메즈마/common.js 문서로 돌아갑니다.