var put = (function(encode){
function Outer(monitor, a){
var add = typeof a == "string" ? encode(a) : '';
this.text = monitor.text + add;
this.element = monitor.element;
}
Outer.prototype = {
constructor : Outer,
add : function(){
//..
},
replace : function(){
//..
}
}
function Monitor(elem, text){
this.text = encode(text);
this.element = elem;
}
Monitor.prototype = {
constructor : Monitor,
now : function(a){
return new Outer(this, a);
},
after : function(time){
// do smth
}
}
return function(elem, text){
return new Monitor(elem, text);
}
})(encodeURIComponent);