10月13日の日記

2013年10月13日
//PopUpCards フロントエンド Javascript (Cross-browser :-)
//Made by Pao for mtg-jp.com
// HTTP通信用、共通関数
function createXMLHttpRequest(cbFunc){
var XMLhttpObject = null;
try{
XMLhttpObject = new XMLHttpRequest();
}catch(e){
try{
XMLhttpObject = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
XMLhttpObject = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){
return null;
}
}
}
if (XMLhttpObject) XMLhttpObject.onreadystatechange = cbFunc;
return XMLhttpObject;
}



function popUpCard( cardname, evt ) {
var puc = document.getElementById( ’PopupCard’ );
var style = puc.style;
httpObj = createXMLHttpRequest(displayData);

if (httpObj){
httpObj.open("GET", "/js/PopUpCards.cgi?name=" + encodeURI(cardname), true);
httpObj.send(null);
}
if (! evt) { evt = event; }
var ox; var oy;
var dx; var dy;
ox = (document.body.scrollLeft || document.documentElement.scrollLeft);
oy = (document.body.scrollTop || document.documentElement.scrollTop);
if ((!document.all || window.opera) && document.getElementById) {
dx=window.innerWidth;
dy=window.innerHeight;
}else if (document.getElementById && (document.compatMode==’CSS1Compat’)) {
dx=document.documentElement.clientWidth;
dy=document.documentElement.clientHeight;
}else if (document.all) {
dx=document.body.clientWidth;
dy=document.body.clientHeight;
} else {
dx=1024;
dy=800;
}

var width = 288;
if (evt.clientX + width + 16 > dx){
style.left = (evt.clientX + ox - width) + "px";
} else {
style.left = (evt.clientX + ox + 16) + ’px’;
}
var height = 500;
if (evt.clientY + height + 16 > dy){
style.top = (dy + oy - height) + "px";
} else {
style.top = (evt.clientY + oy + 16) +"px";
}

}
function displayData() {
var puc = document.getElementById( ’PopupCard’ );
if ((httpObj.readyState == 4) && (httpObj.status == 200)){
puc.innerHTML = httpObj.responseText;
}else{
puc.innerHTML = "Loading..." + httpObj.status;
puc.style.display = ’block’;
}
}
function popDown() {
httpObj.abort();
document.getElementById( ’PopupCard’ ).style.display = ’none’;
}
reptxt(/《([^》//(]+)[^》]*?》(?:[w+])?/ig, 3, function(){
if (arguments[1].search(/[A-Za-z]/) == -1){
if (arguments[1].search(/[++]/) == -1){
return (’《’ + arguments[1] + ’》’);
}else{
JAPs = arguments[1].split(/[++]/);
return (’《’ + JAPs[0] + ’+’ + JAPs[1] + ’》’);
}
}else{
return (’《

最新の日記 一覧

<<  2025年7月  >>
293012345
6789101112
13141516171819
20212223242526
272829303112

お気に入り日記の更新

テーマ別日記一覧

まだテーマがありません

この日記について

日記内を検索