/* mousetrap v1.4.6 craig.is/killing/mice */ (function(J,r,f){function s(a,b,d){a.addEventListener?a.addEventListener(b,d,!1):a.attachEvent("on"+b,d)}function A(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return h[a.which]?h[a.which]:B[a.which]?B[a.which]:String.fromCharCode(a.which).toLowerCase()}function t(a){a=a||{};var b=!1,d;for(d in n)a[d]?b=!0:n[d]=0;b||(u=!1)}function C(a,b,d,c,e,v){var g,k,f=[],h=d.type;if(!l[a])return[];"keyup"==h&&w(a)&&(b=[a]);for(g=0;gg||h.hasOwnProperty(g)&&(p[h[g]]=g)}e=p[d]?"keydown":"keypress"}"keypress"==e&&f.length&&(e="keydown");return{key:c,modifiers:f,action:e}}function F(a,b,d,c,e){q[a+":"+d]=b;a=a.replace(/\s+/g," ");var f=a.split(" ");1":".","?":"/","|":"\\"},G={option:"alt",command:"meta","return":"enter",escape:"esc",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},p,l={},q={},n={},D,z=!1,I=!1,u=!1;for(f=1;20>f;++f)h[111+f]="f"+f;for(f=0;9>=f;++f)h[f+96]=f;s(r,"keypress",y);s(r,"keydown",y);s(r,"keyup",y);var m={bind:function(a,b,d){a=a instanceof Array?a:[a];for(var c=0;c$2") .replace( /\[(\d\d\d\d-\d\d-\d\d)\s(\d\d\:\d\d)\:(\d\d)\]/g, '[$1 $2:$3]' ) .replace(/(\[[0-9:\-\s]*?\])/g, '$1') .replace(/(\<\;[^\s]+?\>\;)/g, "$1") .replace(/(\*\*\*.+)/g, "$1") .replace(/(\>\;imp[^\n\r\<]*)/g, "$1") .replace(/(https?:\/\/.+?)([\s|<])/g, "$1$2") .replace(/magnet:\?.+dn=([^\< ]+)/g, function(match, m1) { return "[MAGNET] " + urldesc(m1) + ""; }) ; } function fontSize(change) { var curSize = cookie_get("fontsize"); if (curSize === null) { curSize = 12; } else { curSize = + curSize; } curSize += change; cookie_set("fontsize", curSize); i("chatarea").style["fontSize"] = ""+curSize+"px"; } function toggleMenu() { t(i("tr1")); t(i("tr2")); t(i("spm")); } function highlightLine(no) { var lines = i('chatarea').innerHTML.split('
'); lines[no] = '' + lines[no] + ''; i('chatarea').innerHTML = lines.join('
'); } var alreadyLoaded = false; function onLoad() { if (alreadyLoaded) { return; } alreadyLoaded = true; // i('chatarea').innerHTML = highlight(i('chatarea').innerHTML); // if ( ! /\/search\//.test(window.location.pathname) && document.location.hash.substr(0, 6) === '#line-' ) { highlightLine( parseInt(document.location.hash.substr(6), 10) ); document.location.hash = ''; } // fontSize(0); // i('selHub').onchange = function() { if ( /\/search\//.test(window.location.pathname) ) { window.location.pathname = i('selHub').value + "/search/" + encodeURIComponent( i('searchbox').value ); } else if ( /\/rx\//.test(window.location.pathname) ) { window.location.pathname = i('selHub').value + "/rx/" + encodeURIComponent( i('searchbox').value ) } else { i('frmHub').submit(); } }; // Mousetrap.bind('ctrl+alt+h', function() { i("pgprev").click(); }); Mousetrap.bind('ctrl+alt+l', function() { i("pgnext").click(); }); Mousetrap.bind('ctrl+alt+j', function() { YMgoto( YMmod(i("seldate").value, 1) ) }); Mousetrap.bind('ctrl+alt+k', function() { YMgoto( YMmod(i("seldate").value, -1) ) }); Mousetrap.bind('ctrl+alt+m', function() { i("searchbox").focus(); }); // } function YMmod(str, change) { var t = str.split('-').map(function(x) { return +x; }); t[1] += change; if (t[1] == 13) { t[0] += 1; t[1] = 1; } if (t[1] == 0) { t[0] -= 1; t[1] = 12; } return t.join('-'); } function YMgoto(str) { var t = str.split("-"); i("f_y").value = t[0]; i("f_m").value = t[1]; i("seldate").form.submit(); } function setYM(el) { YMgoto(el.value); } window.addEventListener('load', onLoad);