1// ------------------------------------------------------------------------------------------ 2// Copyright AspDotNetStorefront.com, 1995-2010. All Rights Reserved. 3// http://www.aspdotnetstorefront.com 4// For details on this license please visit the product homepage at the URL above. 5// THE ABOVE NOTICE MUST REMAIN INTACT. 6// ------------------------------------------------------------------------------------------ 7function $bindMethod(object, method) { 8 return function() { 9 return method.apply(object, arguments); 10 }; 11} 12 13function $window_addLoad(handler) { 14 if (window.addEventListener) { 15 window.addEventListener('load',handler,false); 16 } 17 else if (document.addEventListener) { 18 document.addEventListener('load',handler,false); 19 } 20 else if (window.attachEvent) { 21 window.attachEvent('onload',handler); 22 } 23 else { 24 if (typeof window.onload=='function') { 25 var oldload=window.onload; 26 window.onload = function(){ 27 oldload(); 28 handler(); 29 } 30 } 31 else { window.onload=init; } 32 } 33 34} 35 36function $getElement(id, handler) { 37 var el = document.getElementById(id); 38 return el; 39} 40 41var Keys = { 42 Enter: 13 43} 44 45function $handleSearchEnterKey(id, handler) { 46 var el = $getElement(id); 47 if(el) { 48 var delKeypress = function(e) { 49 50 var keyCode; 51 if (e && e.which) { 52 keyCode = e.which; 53 } 54 else if (typeof (event) != 'undefined') { 55 keyCode = event.keyCode; 56 } 57 58 // we must manually invoke the Page_ClientValidate 59 // method here since relying on the normal behavior 60 // is not guaranteed to set the appropriate validation flags 61 // to stop the postback. 62 if (keyCode == Keys.Enter) { 63 if (typeof (Page_ClientValidate) != 'undefined') { 64 if (Page_ClientValidate() == false) { 65 return; 66 } 67 } 68 69 handler(); 70 71 return false; 72 } 73 } 74 75 el.onkeypress = delKeypress; 76 } 77 78} 79 80
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.