--- a/includes/clientside/static/misc.js Tue Apr 01 01:26:22 2008 -0400
+++ b/includes/clientside/static/misc.js Tue Apr 08 20:29:18 2008 -0400
@@ -212,92 +212,6 @@
}
/*
- * Search boxes
- */
-
-function buildSearchBoxes()
-{
- var divs = document.getElementsByTagName('*');
- var boxes = new Array();
- for ( var i = 0; i < divs.length; i++ )
- {
- if ( divs[i].className)
- {
- if ( divs[i].className.substr(0, 9) == 'searchbox' )
- {
- boxes.push(divs[i]);
- }
- }
- }
- for ( var i = 0; i < boxes.length; i++ )
- {
- if ( boxes[i].className.match(/^searchbox\[([0-9]+)px\]$/) )
- {
- var width = boxes[i].className.match(/^searchbox\[([0-9]+)px\]$/);
- width = parseInt(width[1]);
- }
- else
- {
- var width = 120;
- }
- createSearchBox(boxes[i], width);
- }
-}
-
-function createSearchBox(parent, width)
-{
- if ( typeof(parent) != 'object')
- {
- alert('BUG: createSearchBox(): parent is not an object');
- return false;
- }
- //parent.style.padding = '0px';
- //parent.style.textAlign = 'center';
- parent.style.width = width + 'px';
- var submit = document.createElement('div');
- submit.onclick = function() { searchFormSubmit(this); };
- submit.className = 'js-search-submit';
- var input = document.createElement('input');
- input.className = 'js-search-box';
- input.value = 'Search';
- input.name = 'q';
- input.style.width = ( width - 28 ) + 'px';
- input.onfocus = function() { if ( this.value == 'Search' ) this.value = ''; };
- input.onblur = function() { if ( this.value == '' ) this.value = 'Search'; };
- parent.appendChild(input);
- var off = fetch_offset(input);
- var top = off['top'] + 'px';
- var left = ( parseInt(off['left']) + ( width - 24 ) ) + 'px';
- submit.style.top = top;
- submit.style.left = left;
- parent.appendChild(submit);
-}
-
-function searchFormSubmit(obj)
-{
- var input = obj.previousSibling;
- if ( input.value == 'Search' || input.value == '' )
- return false;
- var p = obj;
- while(true)
- {
- p = p.parentNode;
- if ( !p )
- break;
- if ( typeof(p.tagName) != 'string' )
- break;
- else if ( p.tagName.toLowerCase() == 'form' )
- {
- p.submit();
- }
- else if ( p.tagName.toLowerCase() == 'body' )
- {
- break;
- }
- }
-}
-
-/*
* AJAX login box (experimental)
* Moved / rewritten in login.js
*/