Remove unused swat2 code
[kai/samba.git] / swat2 / style / qooxdoo / widgets / widgets / QxTextField.js
diff --git a/swat2/style/qooxdoo/widgets/widgets/QxTextField.js b/swat2/style/qooxdoo/widgets/widgets/QxTextField.js
deleted file mode 100644 (file)
index 82a0571..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Copyright (c): 2002-2005 (Germany): United Internet, 1&1, GMX, Schlund+Partner, Alturo */
-function QxTextField(vText){QxWidget.call(this);if(isValid(vText)){this.setText(vText);};this.setHtmlProperty("type","text");this.setTabIndex(1);this.setCanSelect(true);this.setTagName("INPUT");this.setTextAlign("left");this.addEventListener("blur",this._onblur);this.addEventListener("focus",this._onfocus);};QxTextField.extend(QxWidget,"QxTextField");QxTextField.addProperty({name:"text",type:String,defaultValue:""});QxTextField.addProperty({name:"maxLength",type:Number});QxTextField.addProperty({name:"readOnly",type:Boolean});QxTextField.addProperty({name:"selectionStart",type:Number});QxTextField.addProperty({name:"selectionLength",type:Number});QxTextField.addProperty({name:"selectionText",type:String});proto._clonePropertyIgnoreList+=",selectionStart,selectionLength,selectionText";proto._checkText=function(_b1,_b2,_b3,_b4){return typeof _b1=="string"?_b1:"";};proto._modifyText=function(_b1,_b2,_b3,_b4){return this.setHtmlProperty("value",_b1);};proto._modifyMaxLength=function(_b1,_b2,_b3,_b4){return this.setHtmlProperty("maxLength",_b1);};proto._modifyReadOnly=function(_b1,_b2,_b3,_b4){return this.setHtmlProperty("readOnly",_b1);};if((new QxClient).isGecko()){proto._visualizeFocus=function(){this.setCssClassName(this.getCssClassName().add("QxFocused"," ").add(this.classname+"-Focused"," "));try{this.getElement().readOnly=true;this.getElement().focus();this.getElement().readOnly=this.getReadOnly();}catch(ex){};return true;};proto._addInlineEvents=function(el){el.addEventListener("input",QxWidget.__oninlineevent,false);return QxWidget.prototype._addInlineEvents.call(this,el);};proto._removeInlineEvents=function(el){el.removeEventListener("input",QxWidget.__oninlineevent,false);return QxWidget.prototype._removeInlineEvents.call(this,el);};};proto.getPreferredWidth=function(){var el=this.getElement();if(el){var w=el.style.width;el.style.width="";var o=el.offsetWidth;el.style.width=isValid(w)?w:"";return o;};return 0;};proto.getPreferredHeight=function(){var el=this.getElement();if(el){var h=el.style.height;el.style.height="";var o=el.offsetHeight;el.style.height=isValid(h)?h:"";return o;};return 0;};proto._textOnFocus=null;proto._ontabfocus=function(e){this.selectAll();};proto._onfocus=function(e){this._textOnFocus=this.getElement().value;};proto._onblur=function(e){if(this._textOnFocus!=this.getElement().value){this.setText(this.getElement().value);};this.setSelectionLength(0);};proto._oninlineevent=function(e){if(!e){e=this.getTopLevelWidget().getDocumentElement().parentWindow.event;};switch(e.type){case "input":if(this.hasEventListeners("input")){this.dispatchEvent(new QxDataEvent("input",this.getElement().value));};return true;case "propertychange":if(e.propertyName=="value"){if(this.hasEventListeners("input")){this.dispatchEvent(new QxDataEvent("input",this.getElement().value));};return true;};break;};return QxWidget.prototype._oninlineevent.call(this,e);};if((new QxClient).isMshtml()){proto._getRange=function(){this._visualPropertyCheck();return this.getElement().createTextRange();};proto._getSelectionRange=function(){this._visualPropertyCheck();return this.getTopLevelWidget().getDocumentElement().selection.createRange();};proto.setSelectionStart=function(vStart){this._visualPropertyCheck();var vText=this.getElement().value;var i=0;while(i<vStart){i=vText.indexOf("\r\n",i);if(i==-1){break;};vStart--;i++;};var vRange=this._getRange();vRange.collapse();vRange.move("character",vStart);vRange.select();};proto.getSelectionStart=function(){this._visualPropertyCheck();var vSelectionRange=this._getSelectionRange();if(!this.getElement().contains(vSelectionRange.parentElement())){return-1;};var vRange=this._getRange();vRange.setEndPoint("EndToStart",vSelectionRange);return vRange.text.length;};proto.setSelectionLength=function(vLength){this._visualPropertyCheck();var vSelectionRange=this._getSelectionRange();if(!this.getElement().contains(vSelectionRange.parentElement())){return;};vSelectionRange.collapse();vSelectionRange.moveEnd("character",vLength);vSelectionRange.select();};proto.getSelectionLength=function(){this._visualPropertyCheck();var vSelectionRange=this._getSelectionRange();if(!this.getElement().contains(vSelectionRange.parentElement())){return 0;};return vSelectionRange.text.length;};proto.setSelectionText=function(vText){this._visualPropertyCheck();var vStart=this.getSelectionStart();var vSelectionRange=this._getSelectionRange();if(!this.getElement().contains(vSelectionRange.parentElement())){return;};vSelectionRange.text=vText;this.setText(this.getElement().value);this.setSelectionStart(vStart);this.setSelectionLength(vText.length);return true;};proto.getSelectionText=function(){this._visualPropertyCheck();var vSelectionRange=this._getSelectionRange();if(!this.getElement().contains(vSelectionRange.parentElement())){return "";};return vSelectionRange.text;};proto.selectAll=function(){this._visualPropertyCheck();this.setSelectionStart(0);this.setSelectionLength(this.getText().length);this.getElement().select();};proto.selectFromTo=function(vStart,vEnd){this._visualPropertyCheck();this.setSelectionStart(vStart);this.setSelectionLength(vEnd-vStart);};}else {proto.setSelectionStart=function(vStart){this._visualPropertyCheck();this.getElement().selectionStart=vStart;};proto.getSelectionStart=function(){this._visualPropertyCheck();return this.getElement().selectionStart;};proto.setSelectionLength=function(vLength){this._visualPropertyCheck();var el=this.getElement();el.selectionEnd=el.selectionStart+vLength;};proto.getSelectionLength=function(){this._visualPropertyCheck();var el=this.getElement();return el.selectionEnd-el.selectionStart;};proto.setSelectionText=function(vText){this._visualPropertyCheck();var el=this.getElement();var vOldText=el.value;var vStart=el.selectionStart;var vOldTextBefore=vOldText.substr(0,vStart);var vOldTextAfter=vOldText.substr(el.selectionEnd);var vValue=el.value=vOldTextBefore+vText+vOldTextAfter;el.selectionStart=vStart;el.selectionEnd=vStart+vText.length;this.setText(vValue);return true;};proto.getSelectionText=function(){this._visualPropertyCheck();return this.getElement().value.substr(this.getSelectionStart(),this.getSelectionLength());};proto.selectAll=function(){this._visualPropertyCheck();this.getElement().select();};proto.selectFromTo=function(vStart,vEnd){this._visualPropertyCheck();var el=this.getElement();el.selectionStart=vStart;el.selectionEnd=vEnd;};};proto.dispose=function(){if(this.getDisposed()){return;};this.removeEventListener("blur",this._onblur);this.removeEventListener("focus",this._onfocus);QxWidget.prototype.dispose.call(this);};
\ No newline at end of file