Вход Регистрация
Файл: gamele.ru/index/js/jquery.maphilight.min.js
Строк: 157
<?php
(function(F) {
    var 
BCILKHEGAJ;
    
document.namespaces;
    
has_canvas = !!document.createElement("canvas").getContext;
    if (! (
has_canvas || B)) {
        
F.fn.maphilight = function() {
            return 
this
        
};
        return
    }
    if (
has_canvas) {
        
= function(M) {
            return 
Math.max(0Math.min(parseInt(M16), 255))
        };
        
= function(MN) {
            return 
"rgba(" E(M.substr(02)) + "," E(M.substr(22)) + "," E(M.substr(42)) + "," ")"
        
};
        
= function(M) {
            var 
F('<canvas style="width:' M.width "px;height:" M.height 'px;"></canvas>').get(0);
            
N.getContext("2d").clearRect(00N.widthN.height);
            return 
N
        
};
        
= function(PMSON) {
            var 
RP.getContext("2d");
            
Q.beginPath();
            if (
== "rect") {
                
Q.rect(S[0], S[1], S[2] - S[0], S[3] - S[1])
            } else {
                if (
== "poly") {
                    
Q.moveTo(S[0], S[1]);
                    for (
2S.length+= 2) {
                        
Q.lineTo(S[R], S[1])
                    }
                } else {
                    if (
== "circ") {
                        
Q.arc(S[0], S[1], S[2], 0Math.PI 2false)
                    }
                }
            }
            
Q.closePath();
            if (
O.fill) {
                
Q.fillStyle G(O.fillColorO.fillOpacity);
                
Q.fill()
            }
            if (
O.stroke) {
                
Q.strokeStyle G(O.strokeColorO.strokeOpacity);
                
Q.lineWidth O.strokeWidth;
                
Q.stroke()
            }
            if (
O.fade) {
                
F(P).css("opacity"0).animate({
                    
opacity1
                
},
                
100)
            }
        };
        
= function(M) {
            
M.getContext("2d").clearRect(00M.widthM.height)
        }
    } else {
        
= function(M) {
            return 
F('<var style="zoom:1;overflow:hidden;display:block;width:' M.width "px;height:" M.height 'px;"></var>').get(0)
        };
        
= function(NQRUM) {
            var 
STOP;
            
'<v:fill color="#' U.fillColor '" opacity="' + (U.fill U.fillOpacity0) + '" />';
            
= (U.stroke 'strokeweight="' U.strokeWidth '" stroked="t" strokecolor="#' U.strokeColor '"''stroked="f"');
            
'<v:stroke opacity="' U.strokeOpacity '"/>';
            if (
== "rect") {
                
F('<v:rect name="' '" filled="t" ' ' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:' R[0] + "px;top:" R[1] + "px;width:" + (R[2] - R[0]) + "px;height:" + (R[3] - R[1]) + 'px;"></v:rect>')
            } else {
                if (
== "poly") {
                    
F('<v:shape name="' '" filled="t" ' ' coordorigin="0,0" coordsize="' N.width "," N.height '" path="m ' R[0] + "," R[1] + " l " R.join(",") + ' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:' N.width "px;height:" N.height 'px;"></v:shape>')
                } else {
                    if (
== "circ") {
                        
F('<v:oval name="' '" filled="t" ' ' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:' + (R[0] - R[2]) + "px;top:" + (R[1] - R[2]) + "px;width:" + (R[2] * 2) + "px;height:" + (R[2] * 2) + 'px;"></v:oval>')
                    }
                }
            }
            
P.get(0).innerHTML O;
            
F(N).append(P)
        };
        
= function(M) {
            
F(M).find("[name=highlighted]").remove()
        }
    }
    
= function(N) {
        var 
MN.getAttribute("coords").split(",");
        for (
0O.lengthM++) {
            
O[M] = parseFloat(O[M])
        }
        return [
N.getAttribute("shape").toLowerCase().substr(04), O]
    };
    
= function(ON) {
        var 
F(O);
        return 
F.extend({},
        
NF.metadata M.metadata() : falseM.data("maphilight"))
    };
    
= function(M) {
        if (!
M.complete) {
            return 
false
        
}
        if (
typeof M.naturalWidth != "undefined" && M.naturalWidth == 0) {
            return 
false
        
}
        return 
true
    
};
    
= {
        
position"absolute",
        
left0,
        
top0,
        
padding0,
        
border0
    
};
    var 
false;
    
F.fn.maphilight = function(O) {
        
F.extend({},
        
F.fn.maphilight.defaultsO);
        if (!
has_canvas && F.browser.msie && !D) {
            
document.namespaces.add("v""urn:schemas-microsoft-com:vml");
            var 
document.createStyleSheet();
            var 
= ["shape""rect""oval""circ""fill""stroke""imagedata""group""textbox"];
            
F.each(M,
            function() {
                
N.addRule("v\:" this"behavior: url(#default#VML); antialias:true")
            });
            
true
        
}
        return 
this.each(function() {
            var 
URYQTVXSW;
            
F(this);
            if (!
A(this)) {
                return 
window.setTimeout(function() {
                    
U.maphilight(O)
                },
                
200)
            }
            
F.extend({},
            
OF.metadata U.metadata() : falseU.data("maphilight"));
            
U.get(0).getAttribute("usemap");
            
F('map[name="' W.substr(1) + '"]');
            if (! (
U.is("img") && && Q.size() > 0)) {
                return
            }
            if (
U.hasClass("maphilighted")) {
                var 
U.parent();
                
U.insertBefore(P);
                
P.remove();
                
F(Q).unbind(".maphilight").find("area[coords]").unbind(".maphilight")
            }
            
F("<div></div>").css({
                
display"block",
                
background'url("' this.src '")',
                
position"relative",
                
padding0,
                
widththis.width,
                
heightthis.height
            
});
            if (
Y.wrapClass) {
                if (
Y.wrapClass === true) {
                    
R.addClass(F(this).attr("class"))
                } else {
                    
R.addClass(Y.wrapClass)
                }
            }
            
U.before(R).css("opacity"0).css(H).remove();
            if (
F.browser.msie) {
                
U.css("filter""Alpha(opacity=0)")
            }
            
R.append(U);
            
C(this);
            
F(T).css(H);
            
T.height this.height;
            
T.width this.width;
            
= function(b) {
                var 
Za;
                
J(thisY);
                if (!
a.neverOn && !a.alwaysOn) {
                    
K(this);
                    
I(TZ[0], Z[1], a"highlighted");
                    if (
a.groupBy && F(this).attr(a.groupBy)) {
                        var 
this;
                        
Q.find("area[" a.groupBy '="' F(this).attr(a.groupBy) + '"]').each(function() {
                            if (
this != c) {
                                var 
J(thisY);
                                if (!
e.neverOn && !e.alwaysOn) {
                                    var 
K(this);
                                    
I(Td[0], d[1], e"highlighted")
                                }
                            }
                        })
                    }
                    if (!
has_canvas) {
                        
F(T).append("<v:rect></v:rect>")
                    }
                }
            };
            
F(Q).bind("alwaysOn.maphilight",
            function() {
                if (
V) {
                    
L(V)
                }
                if (!
has_canvas) {
                    
F(T).empty()
                }
                
F(Q).find("area[coords]").each(function() {
                    var 
Za;
                    
J(thisY);
                    if (
a.alwaysOn) {
                        if (!
&& has_canvas) {
                            
C(U.get());
                            
F(V).css(H);
                            
V.width U.width();
                            
V.height U.height();
                            
U.before(V)
                        }
                        
a.fade a.alwaysOnFade;
                        
K(this);
                        if (
has_canvas) {
                            
I(VZ[0], Z[1], a"")
                        } else {
                            
I(TZ[0], Z[1], a"")
                        }
                    }
                })
            });
            
F(Q).trigger("alwaysOn.maphilight").find("area[coords]").bind("mouseover.maphilight"X).bind("mouseout.maphilight",
            function(
Z) {
                
L(T)
            });
            
U.before(T);
            
U.addClass("maphilighted")
        })
    };
    
F.fn.maphilight.defaults = {
        
filltrue,
        
fillColor"000000",
        
fillOpacity0.2,
        
stroketrue,
        
strokeColor"ff0000",
        
strokeOpacity1,
        
strokeWidth1,
        
fadetrue,
        
alwaysOnfalse,
        
neverOnfalse,
        
groupByfalse,
        
wrapClasstrue
    
}
})(
jQuery);
?>
Онлайн: 1
Реклама