사용자:Sternradio/Sephirot.js: 두 판 사이의 차이

편집 요약 없음
편집 요약 없음
1번째 줄: 1번째 줄:
/*
/*
마스코트 클래스 및 그 객체를 생성한다. 객체의 이름은 mascot.
사용자:다메즈마로 부터 기본 코드를 가져왔습니다.
출처 : [[사:다메즈마/ikazuchi-hisyokan.js]]
사용하시는 것은 자유지만 사용자:다메즈마의 코드를 퍼왔다고 한 줄만 써주세요.  
바뀐 점
제가 안 쓰는 북마크 버튼을 삭제하고 대신 아래로 가는 버튼 추가.
"위로"와 "아래로"에 애니매이션 추가.
여러 이미지 사용 가능, 이미지 별로 코멘트 작성 가능.
모바일에선 안 나오게 수정.
*/
*/
function randomRange(n1, n2) {
function randomRange(n1, n2) {
   return Math.round( Math.random()  * 10000) % (n2 - n1) + n1;
   return Math.round( Math.random()  * 10000) % (n2 - n1) + n1;
}
}
function BookmarkStorage()
{
   
   
}
BookmarkStorage.prototype.AddBookmark = function(name, url)
{
var pre = localStorage.getItem("hisyokan-bookmark-key");
var keys =  name + ";";
if(pre != null){
keys =  name + ";" + pre;
}
localStorage.setItem("hisyokan-bookmark-key",keys);
localStorage.setItem("bookmark-" + name,url);
};
BookmarkStorage.prototype.GetList = function()
{
var keys =  localStorage.getItem("hisyokan-bookmark-key").split(";");
var res_list = [];
for(var i = 0 ; i < keys.length ; i++)
{
if(keys[i].length == 0)
{
continue;
}
res_list.push(
{
name:keys[i],
link:localStorage.getItem("bookmark-" + keys[i])
}
);
}
return res_list;
};
function GetHtmlList(list){
list_el = document.createElement("ul");
$(list_el).css({
"list-style":"none",
"padding":0,
"margin":0
});
for(var i = 0 ; i < list.length ; i++){
var li = document.createElement("li");
var a = document.createElement("a");
a.href = list[i].link;
    $(a).attr("href",list[i].link);
    $(a).html(list[i].name);
    $(li).html(a);
$(list_el).append(li);
}
return list_el;
}
function Mascot()
function Mascot()
{
{
65번째 줄: 21번째 줄:
this.message_queue =  [];
this.message_queue =  [];
this.now_balloon = null;
this.now_balloon = null;
this.is_small = false;
this.is_small = true;
}
}
Mascot.prototype.AddImage = function(img)
Mascot.prototype.AddImage = function(img)
{
{
this.mascot_img_list.push(img);
this.mascot_img_list.push(img);
};
};
Mascot.prototype._show_balloon = function()
Mascot.prototype._show_balloon = function()
{
{
97번째 줄: 55번째 줄:
$(obj.now_balloon).fadeOut(1000).delay(1000,function(){$(this).remove();});
$(obj.now_balloon).fadeOut(1000).delay(1000,function(){$(this).remove();});
obj.now_balloon = null;
obj.now_balloon = null;
if(obj.message_queue.length != 0)
if(obj.message_queue.length !== 0)
{
{
obj._show_balloon();
obj._show_balloon();
103번째 줄: 61번째 줄:
}
}
);
);
};
   
   
};
Mascot.prototype.Show = function()
Mascot.prototype.Show = function()
{
{
115번째 줄: 73번째 줄:
if(localStorage.getItem("custom_dmns_is_small") == "true")
if(localStorage.getItem("custom_dmns_is_small") == "true")
{
{
this.ToSmall();
this.ToSmall();
}
}
else
else
{
{
this.ToBig();
this.ToBig();
}
}
this.mascot_img_html.onload = function()
this.mascot_img_html.onload = function()
132번째 줄: 90번째 줄:
obj.ToBig();
obj.ToBig();
}
}
if(obj.message_queue.length != 0)
if(obj.message_queue.length !== 0)
{
{
obj._show_balloon();
obj._show_balloon();
138번째 줄: 96번째 줄:
$(".top_s_btn").css("display","none");
$(".top_s_btn").css("display","none");
$("#to-top-btn").css("width",$(this).width()/2);
$("#to-top-btn").css("width",$(this).width()/2);
$("#hisyokan-bookmark").css("width",$(this).width()/2);
$("#to-bottom-btn").css("width",$(this).width()/2);
obj.is_loaded = true;
obj.is_loaded = true;
};
};
144번째 줄: 102번째 줄:
function()
function()
{
{
if(this.obj.is_small == false)
if(this.obj.is_small === false)
{
{
this.obj.ToSmall();
this.obj.ToSmall();
161번째 줄: 119번째 줄:
$(wrap_div).css("bottom","16px");
$(wrap_div).css("bottom","16px");
$(wrap_div).append(this.mascot_img_html);
$(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>");
$(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='to-bottom-btn' 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.body).append(wrap_div);
document.getElementById("hisyokan-bookmark").obj = this;
$("#to-top-btn").click(
$("#hisyokan-bookmark").click(
function()
function()
{
{$('html, body').animate({scrollTop:0}, 'slow');}
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");
$("#to-bottom-btn").click(
var a_tag = document.createElement("a");
function()
a_tag.href = "#";
{$('html, body').animate({scrollTop:document.body.scrollHeight}, 'slow');}
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.ShowMessage(GetHtmlList(bookmark.GetList()));
return false;
}
);
$(li).html(a_tag);
$(menu_list_h).append(li);
this.obj.CloseMessage();
this.obj.ShowMessage(menu_list_h);
return false;
}
);
);
};
};
Mascot.prototype.ShowMessage = function(msg)
Mascot.prototype.ShowMessage = function(msg)
{
{
this.message_queue.push(msg);
this.message_queue.push(msg);
   
   
if(this.is_show == false)
if(this.is_show === false)
{
{
this.Show();
this.Show();
234번째 줄: 144번째 줄:
}
}
   
   
if(this.now_balloon == null && this.is_loaded == true)
if(this.now_balloon === null && this.is_loaded === true)
{
{
this._show_balloon();
this._show_balloon();
}
}
};
};
Mascot.prototype.CloseMessage = function()
Mascot.prototype.CloseMessage = function()
{
{
$(this.now_balloon).fadeOut(1000).delay(1000,function(){$(this).remove();});
$(this.now_balloon).fadeOut(1000).delay(1000,function(){$(this).remove();});
this.now_balloon = null;
this.now_balloon = null;
if(this.message_queue.length != 0)
if(this.message_queue.length !== 0)
{
{
this._show_balloon();
this._show_balloon();
}
}
};
};
Mascot.prototype.ToSmall = function()
Mascot.prototype.ToSmall = function()
{
{
$(this.mascot_img_html).css("width",96);
$(this.mascot_img_html).css("width",96);
if(this.now_balloon != null)
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("bottom",$(this.mascot_img_html).height()/2 +16 - $(this.now_balloon).height()/2 + 32);
258번째 줄: 169번째 줄:
}
}
$("#to-top-btn").css("width",$(this.mascot_img_html).width()/2);
$("#to-top-btn").css("width",$(this.mascot_img_html).width()/2);
$("#hisyokan-bookmark").css("width",$(this.mascot_img_html).width()/2);
$("#to-bottom-btn").css("width",$(this.mascot_img_html).width()/2);
this.is_small = true;
this.is_small = true;
localStorage.setItem("custom_dmns_is_small",true);
localStorage.setItem("custom_dmns_is_small",true);
};
};
Mascot.prototype.ToBig = function()
Mascot.prototype.ToBig = function()
{
{
$(this.mascot_img_html).css("width",256);
$(this.mascot_img_html).css("width",256);
if(this.now_balloon != null)
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("bottom",$(this.mascot_img_html).height()/2 +16 - $(this.now_balloon).height()/2 + 32);
271번째 줄: 183번째 줄:
}
}
$("#to-top-btn").css("width",$(this.mascot_img_html).width()/2);
$("#to-top-btn").css("width",$(this.mascot_img_html).width()/2);
$("#hisyokan-bookmark").css("width",$(this.mascot_img_html).width()/2);
$("#to-bottom-btn").css("width",$(this.mascot_img_html).width()/2);
this.is_small = false;
this.is_small = false;
localStorage.setItem("custom_dmns_is_small",false);
localStorage.setItem("custom_dmns_is_small",false);
};
var mascot = new Mascot();
$(document).ready(function(){
var isMobile = false;
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
isMobile = true;
}
}
var mascot = new Mascot();
if(isMobile === false){
var secretary1 = "http://i.imgur.com/8yu6oa5.png"; //하루카
var secretary2 = "http://i.imgur.com/9ZtuGxb.png"; //히비키
var secretary3 = "http://i.imgur.com/vbU5xfU.png"; //아미 마미
var secretary4 = "http://i.imgur.com/P272GzZ.png"; //유키호
var secretary5 = "http://i.imgur.com/1e6SUMl.png"; //야요이
var secretary6 = "http://i.imgur.com/cN7sDuD.png"; //치하야
var secretary7 = "http://i.imgur.com/b4JOqsx.png"; //타카네
var secretary8 = "http://i.imgur.com/ORRmfRB.png"; //미키
var secretary9 = "http://i.imgur.com/rQoUkcC.png"; //코토리
var secretary10 = "http://i.imgur.com/iKznVYS.png"; //이오리
var secretary11 = "http://i.imgur.com/cFilEvY.png"; //아즈사
var secretary12 = "http://i.imgur.com/VscIvyB.png"; //마코토
var secretary13 = "http://i.imgur.com/IIcJOWI.png"; //리츠코
var comment1 =
[
"안녕하세요, 프로듀서씨!",
"프로듀서 씨! 위키에요! 위키!",
"프로듀서 씨, 위키 너무 많이 하는거 아닌가요?",
"프로듀서 씨, 피곤해 보이는 것 같아요.",
"아노 소~라에↗ 와타시와↘ (・3・)토부→",
"봐이!"
];
var comment2 =
[
"하이사이!",
"나, 완벽하니까 위키 작성도 자신 있다조?",
"반달러들이 날뛰지만, 난쿠루나이사~",
"아, 프로듀서! 혹시 햄조 못 봤어?",
"그, 에... 프로듀서, 카나산도!"
];
var comment3 =
[
"니쨩, 안뇽~",
"응후후~ 니쨩 이상한 문서 보는거 아니지?",
"와!! 응후후~, 니쨩 놀랐지?",
"니쨩~ 위키는 그만하고 나가서 놀자?",
"또까찌쯔꾸찌떼~"
];
var comment4 =
[
"프로듀서, 안녕하세요.",
"빈약하고 쪼그맣지만 잘 부탁드려요... 프로듀서.",
"차를 내왔으니 드시고 하세요.",
"앗, 프로듀서. 저.. 저기에 개가...",
"우우.. 저 같은건 구멍파고 묻혀있을게요!"
];
var comment5 =
[
"안녕하세요! 프로듀서!",
"프로듀서! 하이-터치! 예이!",
"우으... 프로듀서, 이번 달 돈이 조금 모자랄지도...",
"반...달리즘? 우으... 어려운 단어 쓰지 말아주세요, 프로듀서.",
"ζ*'ヮ')ζ <웃우-"
];
var comment6 =
[
"안녕하세요, 프로듀서.",
"위키를 할 시간에 좀 더 레슨을 했으면...",
"반달리즘? 뭐어, 아무래도 상관 없지만요.",
"큿!"
];
var comment7 =
[
"안녕하십니까, 프로듀서.",
"오늘은 라-멘이 먹고 싶군요.",
"이 문서는... 멘요나!",
"위...키? 참으로 현대 문명은 어렵군요.",
"......"
];
var comment8 =
[
"허니♡ 안녕!",
"미키적으로는 이 문서 재미 없는 것 같은 느낌.",
"... 아후.",
"이 문서는 괜찮은 것 같은 거야. 아핫☆",
"오니기리나노-!"
];
var comment9 =
[
"프로듀서씨 안녕하세요.",
"윽, 코피가...",
"이.. 이 문서는! 나중에 이 소재로 한 번...",
"망상이... 안 돼.. 안 돼! 코토리!!"
];
var comment10 =
[
"안녕! 프로듀서.",
"이 변태! 초 변태! 변태 다렌!",
"오늘도 이 슈퍼 아이돌 이오리쨩을 보다니 운이 좋네?",
"니히힛~",
"따.. 딱히 한가해서 여기 있는게 아니니깐..."
];
var comment11 =
[
"프로듀서씨, 오늘도 좋은 날이네요.",
"어라...? 여긴 어디일까요?",
"아라아라~",
"어쩌면 프로듀서씨가 제 운명의...",
"(도타푸~웅)"
];
var comment12 =
[
"안녕하세요! 프로듀서!",
"꺄삐삐삐삐! 마코마코링~♪",
"프로듀서! 다음엔 귀여운... 아! 어디가세요!",
"프로듀서, 위키만 하면 몸에 안 좋아요."
];
var comment13 =
[
"안녕하세요, 프로듀서.",
"새우튀김? 파인애플? 또 이상한 소리를...",
"프로듀서, 위키 그만하고 일 좀 해주세요.",
"아, 프로듀서! 또 위키하고 있나요?"
];
var secretaries = [secretary1, secretary2, secretary3, secretary4, secretary5, secretary6, secretary7, secretary8, secretary9, secretary10, secretary11, secretary12, secretary13];
var comments = [comment1, comment2, comment3, comment4, comment5, comment6, comment7, comment8, comment9, comment10, comment11, comment12, comment13];
var index = randomRange(0,secretaries.length);
mascot.AddImage(secretaries[index]);
mascot.ShowMessage(comments[index][randomRange(0,comments[index].length)]);
var temp = function(){
var param =
{
"action":"query",
"meta":"notifications",
"notlimit":10,
"format":"json"
};
$.ajax("/api.php",
{
data:param,
dataType:"json"
})
.done(function(res)
{
var list_o = res.query.notifications.list;
var list = [];
for(var key in list_o)
{
list.push(list_o[key]);
}
var unread_message = [];
for(var i = 0 ; i < list.length ; i++)
{
if(list[i].read === null && list[i].type != "page-linked")
{
unread_message.push(list[i]);
}
}
if(unread_message.length !== 0)
{
if(index === 0)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서 씨! 메시지에요! 메시지!</a>");
}
if(index == 1)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서, 메시지 왔다조!</a>");
}
if(index == 2)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>니쨩, 메시지 왔어.</a>");
}
if(index == 3)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서, 메시지가 왔어요.</a>");
}
if(index == 4)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서! 메시지 왔어요!</a>");
}
if(index == 5)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서, 메시지 왔어요.</a>");
}
if(index == 6)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서, 메시지가 왔습니다.</a>");
}
if(index == 7)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>허니~, 메시지가 왔어.</a>");
}
if(index == 8)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'프로듀서씨, 메시지 왔어요.</a>");
}
if(index == 9)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'프로듀서, 메시지 왔어.</a>");
}
if(index == 10)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'프로듀서씨, 메시지가 왔어요.</a>");
}
if(index == 11)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'프로듀서!, 메시지 왔어요!</a>");
}
if(index == 12)
{
mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'프로듀서, 메시지 확인하세요.</a>");
}
}
});
};
temp();
setInterval(temp,1000 * 20);
}
});

2015년 12월 25일 (금) 01:44 판

/*
사용자:다메즈마로 부터 기본 코드를 가져왔습니다.
사용하시는 것은 자유지만 사용자:다메즈마의 코드를 퍼왔다고 한 줄만 써주세요. 
 
바뀐 점
제가 안 쓰는 북마크 버튼을 삭제하고 대신 아래로 가는 버튼 추가.
"위로"와 "아래로"에 애니매이션 추가.
여러 이미지 사용 가능, 이미지 별로 코멘트 작성 가능.
모바일에선 안 나오게 수정.
*/
 
function randomRange(n1, n2) {
  return Math.round( Math.random()  * 10000) % (n2 - n1) + n1;
}
 
function Mascot()
{
	this.is_loaded = false;
	this.is_show = false;
	this.mascot_img_list = [];
	this.message_queue =  [];
	this.now_balloon = null;
	this.is_small = true;
}
 
Mascot.prototype.AddImage = function(img)
{
	this.mascot_img_list.push(img);
};
 
Mascot.prototype._show_balloon = function()
{
	this.now_balloon = document.createElement("div");
	$(this.now_balloon).css("position","fixed");
	$(this.now_balloon).css("display","none");
	$(this.now_balloon).html(this.message_queue[0]);
	$(this.now_balloon).css("background-color","#000");
	$(this.now_balloon).css("color","#FFF");
	$(this.now_balloon).css("max-width","225px");
	$(this.now_balloon).css("padding","16px");
	$(document.body).append(this.now_balloon);
 
	$(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);
	$(this.now_balloon).css("border-radius",5);
	$(this.now_balloon).fadeIn(1000);
	this.message_queue.shift();
	this.now_balloon.obj = this;
	$(this.now_balloon).click
	(
	function()
	{
		var obj = this.obj;
		$(obj.now_balloon).fadeOut(1000).delay(1000,function(){$(this).remove();});
		obj.now_balloon = null;
		if(obj.message_queue.length !== 0)
		{
			obj._show_balloon();
		}
	}
	);
};
 
Mascot.prototype.Show = function()
{
	if(this.is_show) return;
	this.is_show = true;
	var select = this.mascot_img_list[randomRange(0,this.mascot_img_list.length)];
	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);
		$("#to-bottom-btn").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='to-bottom-btn' 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);
	$("#to-top-btn").click(
	function()
	{$('html, body').animate({scrollTop:0}, 'slow');}
	);
 
	$("#to-bottom-btn").click(
	function()
	{$('html, body').animate({scrollTop:document.body.scrollHeight}, 'slow');}
	);
};
 
Mascot.prototype.ShowMessage = function(msg)
{
	this.message_queue.push(msg);
 
	if(this.is_show === false)
	{
		this.Show();
	}
	else{
		this.CloseMessage();
	}
 
	if(this.now_balloon === null && this.is_loaded === true)
	{
		this._show_balloon();
	}
};
 
Mascot.prototype.CloseMessage = function()
{
	$(this.now_balloon).fadeOut(1000).delay(1000,function(){$(this).remove();});
	this.now_balloon = null;
	if(this.message_queue.length !== 0)
	{
		this._show_balloon();
	}
};
 
Mascot.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);
	$("#to-bottom-btn").css("width",$(this.mascot_img_html).width()/2);
	this.is_small = true;
	localStorage.setItem("custom_dmns_is_small",true);
};
 
Mascot.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);
	$("#to-bottom-btn").css("width",$(this.mascot_img_html).width()/2);
	this.is_small = false;
	localStorage.setItem("custom_dmns_is_small",false);
};
 
var mascot = new Mascot();
 
$(document).ready(function(){
 
var isMobile = false;
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
	isMobile = true;
}
 
if(isMobile === false){
var secretary1 = "http://i.imgur.com/8yu6oa5.png"; //하루카
var secretary2 = "http://i.imgur.com/9ZtuGxb.png"; //히비키
var secretary3 = "http://i.imgur.com/vbU5xfU.png"; //아미 마미
var secretary4 = "http://i.imgur.com/P272GzZ.png"; //유키호
var secretary5 = "http://i.imgur.com/1e6SUMl.png"; //야요이
var secretary6 = "http://i.imgur.com/cN7sDuD.png"; //치하야
var secretary7 = "http://i.imgur.com/b4JOqsx.png"; //타카네
var secretary8 = "http://i.imgur.com/ORRmfRB.png"; //미키
var secretary9 = "http://i.imgur.com/rQoUkcC.png"; //코토리
var secretary10 = "http://i.imgur.com/iKznVYS.png"; //이오리
var secretary11 = "http://i.imgur.com/cFilEvY.png"; //아즈사
var secretary12 = "http://i.imgur.com/VscIvyB.png"; //마코토
var secretary13 = "http://i.imgur.com/IIcJOWI.png"; //리츠코
 
var comment1 = 
[
"안녕하세요, 프로듀서씨!",
"프로듀서 씨! 위키에요! 위키!",
"프로듀서 씨, 위키 너무 많이 하는거 아닌가요?",
"프로듀서 씨, 피곤해 보이는 것 같아요.",
"아노 소~라에↗ 와타시와↘ (・3・)토부→",
"봐이!"
];
 
var comment2 =
[
"하이사이!",
"나, 완벽하니까 위키 작성도 자신 있다조?",
"반달러들이 날뛰지만, 난쿠루나이사~",
"아, 프로듀서! 혹시 햄조 못 봤어?",
"그, 에... 프로듀서, 카나산도!"
];
 
var comment3 =
[
"니쨩, 안뇽~",
"응후후~ 니쨩 이상한 문서 보는거 아니지?",
"와!! 응후후~, 니쨩 놀랐지?",
"니쨩~ 위키는 그만하고 나가서 놀자?",
"또까찌쯔꾸찌떼~"
];
 
var comment4 =
[
"프로듀서, 안녕하세요.",
"빈약하고 쪼그맣지만 잘 부탁드려요... 프로듀서.",
"차를 내왔으니 드시고 하세요.",
"앗, 프로듀서. 저.. 저기에 개가...",
"우우.. 저 같은건 구멍파고 묻혀있을게요!"
];
 
var comment5 =
[
"안녕하세요! 프로듀서!",
"프로듀서! 하이-터치! 예이!",
"우으... 프로듀서, 이번 달 돈이 조금 모자랄지도...",
"반...달리즘? 우으... 어려운 단어 쓰지 말아주세요, 프로듀서.",
"ζ*'ヮ')ζ <웃우-"
];
 
var comment6 =
[
"안녕하세요, 프로듀서.",
"위키를 할 시간에 좀 더 레슨을 했으면...",
"반달리즘? 뭐어, 아무래도 상관 없지만요.",
"큿!"
];
 
var comment7 =
[
"안녕하십니까, 프로듀서.",
"오늘은 라-멘이 먹고 싶군요.",
"이 문서는... 멘요나!",
"위...키? 참으로 현대 문명은 어렵군요.",
"......"
];
 
var comment8 =
[
"허니♡ 안녕!",
"미키적으로는 이 문서 재미 없는 것 같은 느낌.",
"... 아후.",
"이 문서는 괜찮은 것 같은 거야. 아핫☆",
"오니기리나노-!"
];
 
var comment9 =
[
"프로듀서씨 안녕하세요.",
"윽, 코피가...",
"이.. 이 문서는! 나중에 이 소재로 한 번...",
"망상이... 안 돼.. 안 돼! 코토리!!"
];
 
var comment10 =
[
"안녕! 프로듀서.",
"이 변태! 초 변태! 변태 다렌!",
"오늘도 이 슈퍼 아이돌 이오리쨩을 보다니 운이 좋네?",
"니히힛~",
"따.. 딱히 한가해서 여기 있는게 아니니깐..."
];
 
var comment11 =
[
"프로듀서씨, 오늘도 좋은 날이네요.",
"어라...? 여긴 어디일까요?",
"아라아라~",
"어쩌면 프로듀서씨가 제 운명의...",
"(도타푸~웅)"
];
 
var comment12 =
[
"안녕하세요! 프로듀서!",
"꺄삐삐삐삐! 마코마코링~♪",
"프로듀서! 다음엔 귀여운... 아! 어디가세요!",
"프로듀서, 위키만 하면 몸에 안 좋아요."
];
 
var comment13 =
[
"안녕하세요, 프로듀서.",
"새우튀김? 파인애플? 또 이상한 소리를...",
"프로듀서, 위키 그만하고 일 좀 해주세요.",
"아, 프로듀서! 또 위키하고 있나요?"
];
 
var secretaries = [secretary1, secretary2, secretary3, secretary4, secretary5, secretary6, secretary7, secretary8, secretary9, secretary10, secretary11, secretary12, secretary13];
var comments = [comment1, comment2, comment3, comment4, comment5, comment6, comment7, comment8, comment9, comment10, comment11, comment12, comment13];
var index = randomRange(0,secretaries.length);
 
mascot.AddImage(secretaries[index]);
mascot.ShowMessage(comments[index][randomRange(0,comments[index].length)]);
 
var temp = function(){
	var param = 
	{
		"action":"query",
		"meta":"notifications",
		"notlimit":10,
		"format":"json"
	};
	$.ajax("/api.php",
	{
		data:param,
		dataType:"json"
	})
	.done(function(res)
	{
		var list_o = res.query.notifications.list;
		var list = [];
		for(var key in list_o)
		{
			list.push(list_o[key]);
		}
		var unread_message = [];
		for(var i = 0 ; i < list.length ; i++)
		{
			if(list[i].read === null && list[i].type != "page-linked")
			{
				unread_message.push(list[i]);
			}
		}
		if(unread_message.length !== 0)
		{
			if(index === 0)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서 씨! 메시지에요! 메시지!</a>");
			}
 
			if(index == 1)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서, 메시지 왔다조!</a>");
			}
 
			if(index == 2)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>니쨩, 메시지 왔어.</a>");
			}
 
			if(index == 3)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서, 메시지가 왔어요.</a>");
			}
 
			if(index == 4)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서! 메시지 왔어요!</a>");
			}
 
			if(index == 5)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서, 메시지 왔어요.</a>");
			}
 
			if(index == 6)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>프로듀서, 메시지가 왔습니다.</a>");
			}
 
			if(index == 7)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'>허니~, 메시지가 왔어.</a>");
			}
 
			if(index == 8)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'프로듀서씨, 메시지 왔어요.</a>");
			}
 
			if(index == 9)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'프로듀서, 메시지 왔어.</a>");
			}
 
			if(index == 10)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'프로듀서씨, 메시지가 왔어요.</a>");
			}
 
			if(index == 11)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'프로듀서!, 메시지 왔어요!</a>");
			}
 
			if(index == 12)
			{
			mascot.ShowMessage("<a style='color:#FFF;' href='/wiki/"+ encodeURIComponent(unread_message[unread_message.length - 1].title.full)  + "'프로듀서, 메시지 확인하세요.</a>");
			}
		}
	});
};
temp();
setInterval(temp,1000 * 20);
}
});