Show
Ignore:
Timestamp:
12/28/08 01:51:26 (4 years ago)
Author:
drry
Message:
  • fixed a regex that i made at [27432].
Location:
lang/javascript/sisso
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/sisso/sisso.js

    r27434 r27495  
    55 * Dual licensed under the MIT <http://www.opensource.org/licenses/mit-license.php> 
    66 * and GPL <http://www.opensource.org/licenses/gpl-license.php> licenses. 
    7  * Date: 2008-12-25 
     7 * Date: 2008-12-28 
    88 * @author kyo_ago <http://tech.kayac.com/archive/iepngfix-library-sisso-js.html> 
    9  * @version 1.0.1 
     9 * @version 1.0.2 
    1010 * 
    1111 * thanks from 
     
    110110        }; 
    111111 
    112         if (!/^Mozilla 4\.0 \(compatible; MSIE (?:5\.5|6\.)/.test(navigator.userAgent)) { 
     112        if (!/^Mozilla\/4\.0 \(compatible; MSIE (?:5\.5|6\.)/.test(navigator.userAgent)) { 
    113113                if (!self.noRoll) self.exec_hover(); 
    114114                return; 
  • lang/javascript/sisso/sisso.min.js

    r27435 r27495  
    55 * Dual licensed under the MIT <http://www.opensource.org/licenses/mit-license.php> 
    66 * and GPL <http://www.opensource.org/licenses/gpl-license.php> licenses. 
    7  * Date: 2008-12-25 
     7 * Date: 2008-12-28 
    88 * @author kyo_ago <http://tech.kayac.com/archive/iepngfix-library-sisso-js.html> 
    9  * @version 1.0.1 
     9 * @version 1.0.2 
    1010 * 
    1111 * thanks from 
     
    1414 *   http://kyosuke.jp/portfolio/javascript/yuga.html 
    1515 */ 
    16 ;new function(){var c="Sisso";var a=window[c]||{};window[c]=a;a.overClass=a.overClass||"btn";a.noRoll=a.noRoll||false;a.noFix=a.noFix||false;var d=window.jQuery;var b=document;a.get_elems=(function(){if(b.getElementsByClassName){return function(g){return b.getElementsByClassName(g)}}if(b.querySelectorAll){return function(g){return b.querySelectorAll("*."+g)}}if(b.evaluate){return function(k){var j=b.evaluate("descendant::*[@class="+k+" or contains(concat(' ', @class, ' '), ' "+k+" ')]",b,null,7,null);var g=[];for(var m=0,h=j.snapshotLength;m<h;g.push(j.snapshotItem(m++))){}return g}}var f=a.overClass;var e=new RegExp("[ \\n\\r\\t]"+f+"[ \\n\\r\\t]");return function(k){var j=b.body.getElementsByTagName("*");var g=[];for(var m=0,h=j.length;m<h;++m){var n=j[m];if(n.className.indexOf(f)==-1){continue}if(!e.test(" "+n.className+" ")){continue}g.push(n)}return g}})();a.get_src=function(f){if(f.src){return f.src}src=(f.currentStyle||b.defaultView.getComputedStyle(f,"")).backgroundImage;var e=src.match(/^url\((["']?)(.*\.png)\1\)$/i)||[src];return e.pop()};a.hover=function(e){var g=a.get_src(e);var f=a.replace_over(g);return e.src?a.add_src_over(e,g,f):a.add_bg_over(e,g,f)};a.replace_over=function(e){return e.replace(/(?:_o)?(\.\w+)$/,"_o$1")};a.observe=d?function(g,e,f){d(g).bind(e+"."+c,f)}:window.addEventListener?function(g,e,f){g.addEventListener(e,f,false)}:function(g,e,f){g.attachEvent("on"+e,function(){f&&f.call(g,window.event)})};a.add_src_over=function(f,h,g){var e=new Image();e.src=g;a.observe(f,"mouseover",function(){f.src=g});a.observe(f,"mouseout",function(){f.src=h})};a.add_bg_over=function(f,h,g){var e=new Image();e.src=g;a.observe(f,"mouseover",function(){f.style.backgroundImage="url("+g+")"});a.observe(f,"mouseout",function(){f.style.backgroundImage="url("+h+")"})};a.exec_hover=function(){a.observe(window,"load",function(){e(a.get_elems(a.overClass));function e(g){for(var h=0,f=g.length;h<f;a.hover(g[h++])){}}})};if(!/^Mozilla 4\.0 \(compatible; MSIE (?:5\.5|6\.)/.test(navigator.userAgent)){if(!a.noRoll){a.exec_hover()}return}a.blank="http://tech.kayac.com/data/iepngfix-library-sisso-js/blank.gif";a.elems=[];a.eid="_"+c+"_id_"+(new Date).getTime();a.store=function(e,f){var g=e[a.eid];if(g!==undefined){g=e[a.eid]=a.elems.length}return f?(a.elems[g]=f):a.elems[g]};a.hover=function(e){var g=a.store(e);if(!g){g=a.get_src(e);a.store(e,g)}var f=a.replace_over(g);return e.src?a.add_src_over(e,g,f):a.add_bg_over(e,g,f)};a.add_src_over=function(f,h,g){var e=new Image();e.src=g;a.observe(f,"mouseover",function(){a.swap(f,g)});a.observe(f,"mouseout",function(){a.swap(f,h)})};a.add_bg_over=function(f,h,g){var e=new Image();e.src=g;a.observe(f,"mouseover",function(){a.swap(f,g)});a.observe(f,"mouseout",function(){a.swap(f,h)})};a.fix=function(e){var f=a.store(e);if(!f){f=a.get_src(e);a.store(e,f)}a.swap(e,f);if(!e.src){a.fix_bg_elem(e)}};a.set_width=function(e){var f=e.currentStyle;if(f.width!="auto"||f.height!="auto"){return}e.style.width=e.offsetWidth+"px"};a.fix_bg_elem=function(e){e.style.backgroundImage="none";a.set_pos(e);(e.tagName.toUpperCase()=="A")&&(e.style.cursor=e.style.cursor||"pointer")};a.set_pos=function(h){var e=h.childNodes;for(var f=0,k=e.length;f<k;++f){var j=e[f];if(j.hasChildNodes()){a.set_pos(j)}if(!j.style){return}var g=j.style;g.position=g.position||"relative"}};a.swap=function(f,g){f.runtimeStyle.behavior="none";if(!g){g=f.src}if(!g){return}if(g==a.blank){return}if(!/\.png$/.test(g.toLowerCase())){return}a.set_width(f);if(f.src){f.src=a.blank}var e=f.className.match(/sizing[-_]?method[-_]?(\w+)/i);e=e?e.pop().toLowerCase():"scale";f.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+g+'",sizingMethod="'+e+'");'};a.exec_pngfix=function(){var e="expression("+c+".fix(this));";var f=b.createElement("div");f.innerHTML=(['div<div><style type="text/css">',"img, input { behavior : "+e+" };",".bgpng { behavior : "+e+" };","</style></div>"]).join("");b.getElementsByTagName("head")[0].appendChild(f.getElementsByTagName("style")[0])};if(!a.noRoll){a.exec_hover()}if(!a.noFix){a.exec_pngfix()}}; 
     16;new function(){var c="Sisso";var a=window[c]||{};window[c]=a;a.overClass=a.overClass||"btn";a.noRoll=a.noRoll||false;a.noFix=a.noFix||false;var d=window.jQuery;var b=document;a.get_elems=(function(){if(b.getElementsByClassName){return function(g){return b.getElementsByClassName(g)}}if(b.querySelectorAll){return function(g){return b.querySelectorAll("*."+g)}}if(b.evaluate){return function(k){var j=b.evaluate("descendant::*[@class="+k+" or contains(concat(' ', @class, ' '), ' "+k+" ')]",b,null,7,null);var g=[];for(var m=0,h=j.snapshotLength;m<h;g.push(j.snapshotItem(m++))){}return g}}var f=a.overClass;var e=new RegExp("[ \\n\\r\\t]"+f+"[ \\n\\r\\t]");return function(k){var j=b.body.getElementsByTagName("*");var g=[];for(var m=0,h=j.length;m<h;++m){var n=j[m];if(n.className.indexOf(f)==-1){continue}if(!e.test(" "+n.className+" ")){continue}g.push(n)}return g}})();a.get_src=function(f){if(f.src){return f.src}src=(f.currentStyle||b.defaultView.getComputedStyle(f,"")).backgroundImage;var e=src.match(/^url\((["']?)(.*\.png)\1\)$/i)||[src];return e.pop()};a.hover=function(e){var g=a.get_src(e);var f=a.replace_over(g);return e.src?a.add_src_over(e,g,f):a.add_bg_over(e,g,f)};a.replace_over=function(e){return e.replace(/(?:_o)?(\.\w+)$/,"_o$1")};a.observe=d?function(g,e,f){d(g).bind(e+"."+c,f)}:window.addEventListener?function(g,e,f){g.addEventListener(e,f,false)}:function(g,e,f){g.attachEvent("on"+e,function(){f&&f.call(g,window.event)})};a.add_src_over=function(f,h,g){var e=new Image();e.src=g;a.observe(f,"mouseover",function(){f.src=g});a.observe(f,"mouseout",function(){f.src=h})};a.add_bg_over=function(f,h,g){var e=new Image();e.src=g;a.observe(f,"mouseover",function(){f.style.backgroundImage="url("+g+")"});a.observe(f,"mouseout",function(){f.style.backgroundImage="url("+h+")"})};a.exec_hover=function(){a.observe(window,"load",function(){e(a.get_elems(a.overClass));function e(g){for(var h=0,f=g.length;h<f;a.hover(g[h++])){}}})};if(!/^Mozilla\/4\.0 \(compatible; MSIE (?:5\.5|6\.)/.test(navigator.userAgent)){if(!a.noRoll){a.exec_hover()}return}a.blank="http://tech.kayac.com/data/iepngfix-library-sisso-js/blank.gif";a.elems=[];a.eid="_"+c+"_id_"+(new Date).getTime();a.store=function(e,f){var g=e[a.eid];if(g!==undefined){g=e[a.eid]=a.elems.length}return f?(a.elems[g]=f):a.elems[g]};a.hover=function(e){var g=a.store(e);if(!g){g=a.get_src(e);a.store(e,g)}var f=a.replace_over(g);return e.src?a.add_src_over(e,g,f):a.add_bg_over(e,g,f)};a.add_src_over=function(f,h,g){var e=new Image();e.src=g;a.observe(f,"mouseover",function(){a.swap(f,g)});a.observe(f,"mouseout",function(){a.swap(f,h)})};a.add_bg_over=function(f,h,g){var e=new Image();e.src=g;a.observe(f,"mouseover",function(){a.swap(f,g)});a.observe(f,"mouseout",function(){a.swap(f,h)})};a.fix=function(e){var f=a.store(e);if(!f){f=a.get_src(e);a.store(e,f)}a.swap(e,f);if(!e.src){a.fix_bg_elem(e)}};a.set_width=function(e){var f=e.currentStyle;if(f.width!="auto"||f.height!="auto"){return}e.style.width=e.offsetWidth+"px"};a.fix_bg_elem=function(e){e.style.backgroundImage="none";a.set_pos(e);(e.tagName.toUpperCase()=="A")&&(e.style.cursor=e.style.cursor||"pointer")};a.set_pos=function(h){var e=h.childNodes;for(var f=0,k=e.length;f<k;++f){var j=e[f];if(j.hasChildNodes()){a.set_pos(j)}if(!j.style){return}var g=j.style;g.position=g.position||"relative"}};a.swap=function(f,g){f.runtimeStyle.behavior="none";if(!g){g=f.src}if(!g){return}if(g==a.blank){return}if(!/\.png$/.test(g.toLowerCase())){return}a.set_width(f);if(f.src){f.src=a.blank}var e=f.className.match(/sizing[-_]?method[-_]?(\w+)/i);e=e?e.pop().toLowerCase():"scale";f.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+g+'",sizingMethod="'+e+'");'};a.exec_pngfix=function(){var e="expression("+c+".fix(this));";var f=b.createElement("div");f.innerHTML=(['div<div><style type="text/css">',"img, input { behavior : "+e+" };",".bgpng { behavior : "+e+" };","</style></div>"]).join("");b.getElementsByTagName("head")[0].appendChild(f.getElementsByTagName("style")[0])};if(!a.noRoll){a.exec_hover()}if(!a.noFix){a.exec_pngfix()}};