Vergleich jscripts/autocomplete.js - 1.2.1 - 1.2.13

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 8Zeile 8
		{
return false;
}

		{
return false;
}

		

 
		this.cache = new Array();

		this.cache = new Array();

	

 
		this.lastValue = '';
this.lastKeycode = 0;
this.textbox = $(textbox);

		this.lastValue = '';
this.lastKeycode = 0;
this.textbox = $(textbox);

 
		this.formSubmit = false;
this.url = url;

this.currentIndex = -1;
this.valueSpan = options.valueSpan;
this.urlParam = options.urlParam;
if(options.minChars)
{
this.minChars = options.minChars;
}
else
{
this.minChars = 3;
}
this.menuOpen = false;
this.timeout = false;

Event.observe(window, "load", this.init.bindAsEventListener(this));
},

init: function()
{

		this.textbox.setAttribute("autocomplete", "off");
this.textbox.autocompletejs = this;
Event.observe(this.textbox, "keypress", this.onKeyPress.bindAsEventListener(this));
Event.observe(this.textbox, "keyup", this.onKeyUp.bindAsEventListener(this));
Event.observe(this.textbox, "keydown", this.onKeyDown.bindAsEventListener(this));

		this.textbox.setAttribute("autocomplete", "off");
this.textbox.autocompletejs = this;
Event.observe(this.textbox, "keypress", this.onKeyPress.bindAsEventListener(this));
Event.observe(this.textbox, "keyup", this.onKeyUp.bindAsEventListener(this));
Event.observe(this.textbox, "keydown", this.onKeyDown.bindAsEventListener(this));

		this.formSubmit = false;

 
		if(this.textbox.form)
{
if(this.textbox.form.onsubmit)

		if(this.textbox.form)
{
if(this.textbox.form.onsubmit)

Zeile 30Zeile 49
			this.textbox.form.onsubmit = this.onFormSubmit.bindAsEventListener(this);
}
this.textbox.onsubmit = this.onFormSubmit.bindAsEventListener(this);

			this.textbox.form.onsubmit = this.onFormSubmit.bindAsEventListener(this);
}
this.textbox.onsubmit = this.onFormSubmit.bindAsEventListener(this);

		this.url = url;

this.currentIndex = -1;
this.valueSpan = options.valueSpan;
this.urlParam = options.urlParam;
if(options.minChars)
{
this.minChars = options.minChars;
}
else
{
this.minChars = 3;
}
this.menuOpen = false;

 
		this.popup = document.createElement("div");
this.popup.style.position = "absolute";
this.popup.className = "autocomplete";
this.popup.style.display = "none";
document.body.appendChild(this.popup);

		this.popup = document.createElement("div");
this.popup.style.position = "absolute";
this.popup.className = "autocomplete";
this.popup.style.display = "none";
document.body.appendChild(this.popup);

		
this.timeout = false;

 

this.textbox.popup = this;

Event.observe(document, "unload", this.clearCache.bindAsEventListener(this));


this.textbox.popup = this;

Event.observe(document, "unload", this.clearCache.bindAsEventListener(this));

	},

	},


onFormSubmit: function(e)
{


onFormSubmit: function(e)
{

Zeile 72Zeile 75
			return true;
}
//this.textbox.setAttribute("autocomplete", "on");

			return true;
}
//this.textbox.setAttribute("autocomplete", "on");

	},

	},

	
onKeyDown: function(e)
{

	
onKeyDown: function(e)
{

Zeile 168Zeile 171
		if(this.textbox.value.length >= this.minChars)
{
if(this.cache[cacheValue])

		if(this.textbox.value.length >= this.minChars)
{
if(this.cache[cacheValue])

			{

			{

				this.popup.innerHTML = this.cache[cacheValue];
this.onComplete();
}

				this.popup.innerHTML = this.cache[cacheValue];
this.onComplete();
}

Zeile 232Zeile 235
			//item.style.height = "1em";
Event.observe(item, "mouseover", this.itemOver.bindAsEventListener(this));
Event.observe(item, "click", this.itemClick.bindAsEventListener(this));

			//item.style.height = "1em";
Event.observe(item, "mouseover", this.itemOver.bindAsEventListener(this));
Event.observe(item, "click", this.itemClick.bindAsEventListener(this));

		}

		}

		
// Clone to get offset height (not possible when display=none)
var clone = this.popup.cloneNode(true);

		
// Clone to get offset height (not possible when display=none)
var clone = this.popup.cloneNode(true);

Zeile 244Zeile 247
		
var maxHeight = 100;
if(offsetHeight > 0 && offsetHeight < maxHeight)

		
var maxHeight = 100;
if(offsetHeight > 0 && offsetHeight < maxHeight)

		{

		{

			this.popup.style.overflow = "hidden";	
}
else if(MyBB.browser == "ie")

			this.popup.style.overflow = "hidden";	
}
else if(MyBB.browser == "ie")

		{

		{

			this.popup.style.height = maxHeight+"px";
this.popup.style.overflowY = "auto";
}

			this.popup.style.height = maxHeight+"px";
this.popup.style.overflowY = "auto";
}

Zeile 265Zeile 268
			offsetTop += element.offsetTop || 0;
offsetLeft += element.offsetLeft || 0;
element = element.offsetParent;

			offsetTop += element.offsetTop || 0;
offsetLeft += element.offsetLeft || 0;
element = element.offsetParent;

 
			if(element)
{
if(DomLib.getStyle(element, 'position') == 'relative' || DomLib.getStyle(element, 'position') == 'absolute') break;
}

		} while(element);

this.popup.style.marginTop = "-1px";

		} while(element);

this.popup.style.marginTop = "-1px";