include - (2007/08/21 (火) 20:36:58) の1つ前との変更点
追加された行は緑色になります。
削除された行は赤色になります。
#javascript(){{{
function $()
{
var elements = new Array();
for ( var i = 0; i != arguments.length; i++ )
{
var element = arguments[i];
if (typeof element == 'string')
element = document.getElementById(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
return elements;
}
if('undefined'==typeof Function.prototype.apply)
{
Function.prototype.apply=function(obj,arg){
var _obj = obj || window,
_arg = String(arguments.slice(0)),
ret = null;
_obj.__func = this;
ret = eval('_obj.__func('+ _arg +')');
delete _obj.__func;
return ret;
}
}
if('undefined'==typeof Function.prototype.call)
{
Function.prototype.call=function(obj){
return this.apply(obj, arguments.slice(1));
}
}
function addEvent(node,eName,func,parentObj,useCap)
{
var p = parentObj||node||window,
_func = (function(){
var _f=arguments[0],_p=arguments[1];
return function(e){return _f.call(_p, e);}
})(func,p);
if(node.addEventListener)
{
node.addEventListener(eName, _func, useCap);
}
else if(node.attachEvent)
{
node.attachEvent('on'+eName, _func);
}
}
var topImages = new Array(
"http://www34.atwiki.jp/vipc/pub/top.jpg",
"http://www34.atwiki.jp/vipc/pub/top2.jpg",
"http://www34.atwiki.jp/vipc/pub/top3.jpg",
"http://www34.atwiki.jp/vipc/pub/top4.jpg",
null
);
addEvent(window,'load',function(){
$('photospace').style.backgroundImage = 'url('+topImages[parseInt(Math.random()*(topImages.length-1))]+')';
},window,false);
var harikae=(function(){
this.rules=[];
this.addRule=function(r)
{
r.incValue=('undefined' != typeof r.value);
this.rules[this.rules.length]=r;
};
this.addRule({
"srcId":"bmSrc_",
"srcAtr":"value",
"destId":"bmDest_",
"destAtr":"href"
});
this.yaruo=function()
{
var eles = document.getElementsByTagName('*'),
id='';
for(var i=0,l=eles.length;eval('i \x3c l');i++)
{
id=String(eles[i].id);
for(var j=0,m=this.rules.length;eval('j \x3c m');j++)
{
if(id.match('^'+this.rules[j].destId+'(.+)$'))
{
if(this.rules[j].incValue)
{
eles[i][this.rules[j].destAtr]=this.rules[j].value;
}
else
{
var src=$(this.rules[j].srcId+RegExp.$1);
if(src)
{
eles[i][this.rules[j].destAtr]=src[this.rules[j].srcAtr];
}
}
}
}
}
};
addEvent(window,'load',function(){
harikae.yaruo();
},window,false);
return this;
})()
}}}
#javascript(){{{
function $()
{
var elements = new Array();
for ( var i = 0; i != arguments.length; i++ )
{
var element = arguments[i];
if (typeof element == 'string')
element = document.getElementById(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
return elements;
}
if('undefined'==typeof Function.prototype.apply)
{
Function.prototype.apply=function(obj,arg){
var _obj = obj || window,
_arg = String(arguments.slice(0)),
ret = null;
_obj.__func = this;
ret = eval('_obj.__func('+ _arg +')');
delete _obj.__func;
return ret;
}
}
if('undefined'==typeof Function.prototype.call)
{
Function.prototype.call=function(obj){
return this.apply(obj, arguments.slice(1));
}
}
function addEvent(node,eName,func,parentObj,useCap)
{
var p = parentObj||node||window,
_func = (function(){
var _f=arguments[0],_p=arguments[1];
return function(e){return _f.call(_p, e);}
})(func,p);
if(node.addEventListener)
{
node.addEventListener(eName, _func, useCap);
}
else if(node.attachEvent)
{
node.attachEvent('on'+eName, _func);
}
}
var topImages = new Array(
"http://www34.atwiki.jp/vipc/pub/top.jpg",
"http://www34.atwiki.jp/vipc/pub/top2.jpg",
"http://www34.atwiki.jp/vipc/pub/top3.jpg",
"http://www34.atwiki.jp/vipc/pub/top4.jpg",
null
);
addEvent(window,'load',function(){
$('photospace').style.backgroundImage = 'url('+topImages[parseInt(Math.random()*(topImages.length-1))]+')';
},window,false);
var harikae=(function(){
this.rules=[];
this.addRule=function(r)
{
r.incValue=('undefined' != typeof r.value);
this.rules[this.rules.length]=r;
};
this.addRule({
"srcId":"bmSrc_",
"srcAtr":"value",
"destId":"bmDest_",
"destAtr":"href"
});
this.yaruo=function()
{
var eles = document.getElementsByTagName('*'),
id='';
for(var i=0,l=eles.length;eval('i \x3c l');i++)
{
id=String(eles[i].id);
for(var j=0,m=this.rules.length;eval('j \x3c m');j++)
{
if(id.match('^'+this.rules[j].destId+'(.+)$'))
{
if(this.rules[j].incValue)
{
eles[i][this.rules[j].destAtr]=this.rules[j].value;
}
else
{
var src=$(this.rules[j].srcId+RegExp.$1);
if(src)
{
eles[i][this.rules[j].destAtr]=src[this.rules[j].srcAtr];
}
}
}
}
}
};
return this;
})();
addEvent(window,'load',function(){
harikae.yaruo();
},window,false);
}}}
表示オプション
横に並べて表示:
変化行の前後のみ表示: