mui.text.js

来自「一套基于开源javascript framework mootools的UI」· JavaScript 代码 · 共 39 行

JS
39
字号
if(!window["MUI"]) window["MUI"]={};

MUI.Label = new Class({
    initialize:function(el){
	var myel = $($pick(el, document.createElement("span")));
	$extend(myel, MUI.Label.prototype);
	return myel;
    },
    
    setText:function(text){
	this.innerHTML = text;
	//this.appendText(text);
	this.fireEvent("change");
	return this;	
    },
    
    getText:function(){
	return this.firstChild.data;
    }
});


MUI.Input = MUI.Label.extend({
    initialize:function(){
	myel = new Element("input", {"type":"text"});
	$extend(myel, MUI.Input.prototype);
	return myel;
    },
    
    setText:function(text){
	this.value = text;
	this.fireEvent("change");
	return this;
    },
    
    getText:function(){
	return this.value;
    }
});

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?