io.box.text_text={initialize:function(_1){
if(_1.io.type.state.editor){
var _2=io.type.getContentsChild(_1);
if(_1.io.access>1){
_1.io.type.events.keyup.push(dojo.connect(_2,"keyup",null,io.box.text_text.onKeyUp));
}else{
_1.io.type.events.keyup=[];
}
}
return true;
},disconnect:function(_3){
if(_3.io&&_3.io.initialized){
while(_3.io.type.events.keyup.length>0){
dojo.disconnect(_3.io.type.events.keyup.pop());
}
}
return true;
},onKeyUp:function(_4){
_4=io.fixEvent(_4);
if(io.box.selected){
if(io.box.selected==_4.io.box){
if(!_4.io.box.io.type.state.edited){
_4.io.box.io.type.state.edited=true;
}
}
}
},edit:function(_5){
io.box.text_text.disconnect(_5);
io.box.text_text.initialize(_5);
var _6=io.type.getContentsChild(_5);
if(_6){
if(_6.typeName="TEXTAREA"){
_6.focus();
_5.io.type.state.editor=true;
}
}
},save:function(_7){
_7=io.getBox(_7);
if(_7){
var _8=io.getContents(_7);
if(_8){
var _9=io.type.getContentsChild(_7);
if(_9.tagName=="TEXTAREA"){
_7.io.type.data.contents=_9.value;
}
}
}
},list:{touchStart:function(_a){
ioEvent=io.fixEvent(_a);
return true;
},touchEnd:function(_b){
ioEvent=io.fixEvent(_b);
return true;
}},settings:{touchEnd:function(_c){
_c=io.fixEvent(_c);
var _d=_c.io.target;
while(!dojo.hasClass(_d,"control")){
_d=_d.parentNode;
}
if(io.controls.controlScroll.moved){
return false;
}
var _e=io.box.selected;
if(_d.id=="control_property_info"){
io.dialog.open(io.box.info);
}else{
if(_d.id=="control_property_background"){
io.dialog.open(io.box.backgroundColor);
}else{
if(_d.id=="control_property_borderColor"){
io.dialog.open(io.box.borderColor);
}else{
if(_d.id=="control_property_borderWidth"){
var _f=io.box.selected.io.frame.data._borderWidth;
if(_c.io.target.id=="borderWidthUp"){
var _10=_f+1;
}else{
if(_c.io.target.id=="borderWidthDown"){
_10=_f-1;
if(_10<0){
_10=0;
}
}else{
_10=_f;
}
}
if(_10!=_f){
io.box.selected.io.frame.data._borderWidth=_10;
io.box.selected.style.borderWidth=_10+"px";
io.frame.save(io.box.selected);
}
}else{
if(_d.id=="control_property_borderRadius"){
var _11=io.box.selected.io.frame.data._borderRadius;
if(_c.io.target.id=="borderRadiusUp"){
var _12=_11+1;
}else{
if(_c.io.target.id=="borderRadiusDown"){
_12=_11-1;
if(_12<0){
_12=0;
}
}else{
_12=_11;
}
}
if(_12!=_11){
io.box.selected.io.frame.data._borderRadius=_12;
io.box.selected.style.borderRadius=_12+"px";
io.frame.save(io.box.selected);
}
}else{
if(_d.id=="control_property_binding"){
var _13=io.box.selected.io.frame.data.binding;
var _14=_13;
if(_c.io.target.id=="bindingPosition"){
_14^=1;
}else{
if(_c.io.target.id=="bindingSize"){
_14^=2;
}else{
if(_c.io.target.id=="bindingContent"){
_14^=4;
}else{
if(_c.io.target.id=="bindingAccess"){
_14^=8;
}
}
}
}
if(_14!=_13){
io.box.selected.io.frame.data.binding=_14;
io.frame.save(io.box.selected);
}
}else{
if(_d.id=="control_property_locking"){
var _15=io.box.selected.io.frame.data.locking;
var _16=_15;
if(_c.io.target.id=="lockingPosition"){
_16^=1;
}else{
if(_c.io.target.id=="lockingSize"){
_16^=2;
}else{
if(_c.io.target.id=="lockingContent"){
_16^=4;
}else{
if(_c.io.target.id=="lockingAccess"){
_16^=8;
}
}
}
}
if(_16!=_15){
io.box.selected.io.frame.data.locking=_16;
io.frame.save(io.box.selected);
}
}else{
if(_d.id=="control_property_layerIndex"){
var _17=io.box.selected.io.frame.data.position;
if(_c.io.target.id=="layerMoveUp"){
var _18=_17+1;
}else{
if(_c.io.target.id=="layerMoveDown"){
_18=_17-1;
}else{
_18=_17;
}
}
io.frame.updateLayers(io.box.selected,_17,_18);
}else{
if(_d.id=="control_property_color"){
io.dialog.open(io.box.text_text.color);
}else{
if(_d.id=="control_property_fontSize"){
var _19=_e.io.type.data._fontSize;
_19=Number(_19.substr(0,_19.length-2));
var _1a=_19;
if(_c.io.target.id=="fontSizeUp"){
_1a=Number(_1a)+1;
}else{
if(_c.io.target.id=="fontSizeDown"){
_1a=Number(_1a)-1;
}
}
if(_19!=_1a){
_e.io.type.data._fontSize=_1a+"px";
var _1b=io.type.getContentsChild(_e);
_1b.style.fontSize=_e.io.type.data._fontSize;
var _1c=dojo.byId("fontSizeThumb");
_1c.innerHTML=_e.io.type.data._fontSize;
_1c.style.fontSize=_e.io.type.data._fontSize;
_1c.style.fontFamily=_e.io.type.data._fontFamily;
io.type.save(_e);
}
}else{
if(_d.id=="control_property_fontFamily"){
var _1d=dojo.query(".font-selected",_d)[0];
var _1e=io.getId(_1d);
var _1f=false;
if(_c.io.target.id=="fontFamilyUp"){
_1f=Number(_1e)-1;
}else{
if(_c.io.target.id=="fontFamilyDown"){
_1f=Number(_1e)+1;
}
}
if(_1f){
newSelected=dojo.byId("fontFamily_"+_1f);
if(newSelected){
dojo.removeClass(_1d,"font-selected");
dojo.addClass(newSelected,"font-selected");
var _1b=io.type.getContentsChild(_e);
_e.io.type.data._fontFamily=newSelected.style.fontFamily;
_1b.style.fontFamily=_e.io.type.data._fontFamily;
var _1c=dojo.byId("fontSizeThumb");
_1c.style.fontFamily=_e.io.type.data._fontFamily;
io.type.save(_e);
}
}
}else{
if(_d.id=="control_property_fontWeight"){
var _20=false;
if(_c.io.target.id=="fontWeightNormal"){
_20="normal";
}else{
if(_c.io.target.id=="fontWeightBold"){
_20="bold";
}else{
if(_c.io.target.id=="fontWeightItalic"){
alert("Italic has not been implemented yet.");
}
}
}
if(_20){
if(_20!=_e.io.type.data._fontWeight){
dojo.query(">.button-selected",_c.io.target.parentNode).forEach(function(_21,_22){
dojo.removeClass(_21,"button-selected");
dojo.addClass(_21,"button");
});
dojo.addClass(_c.io.target,"button-selected");
_e.io.type.data._fontWeight=_20;
var _23=io.type.getContentsChild(_e);
_23.style.fontWeight=_20;
io.type.save(_e);
}
}
}else{
if(_d.id=="control_property_textAlign"){
if(_c.io.target.id=="textAlignLeft"){
newAlign="left";
}else{
if(_c.io.target.id=="textAlignCenter"){
newAlign="center";
}else{
if(_c.io.target.id=="textAlignRight"){
newAlign="right";
}
}
}
if(newAlign){
if(newAlign!=_e.io.type.data._textAlign){
dojo.query(">.button-selected",_c.io.target.parentNode).forEach(function(_24,_25){
dojo.removeClass(_24,"button-selected");
dojo.addClass(_24,"button");
});
dojo.addClass(_c.io.target,"button-selected");
_e.io.type.data._textAlign=newAlign;
var _23=io.type.getContentsChild(_e);
_23.style.textAlign=newAlign;
io.type.save(_e);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
return true;
},touchStart:function(_26){
ioEvent=io.fixEvent(_26);
return true;
}},color:{dialog:{height:100,width:100,header:"",contents:"",value:""},load:function(){
var _27={height:200,width:400,header:"Edit text color",contents:"colorPicker",value:io.box.selected.io.type.data._color};
io.box.text_text.color.dialog=_27;
var _28={recordid:io.box.selected.io.frame.data.recordid,parentid:io.box.selected.io.frame.data.parentid};
},save:function(){
console.warn("Updating text color");
var cp=dojo.byId("colorPicker");
if(cp){
var _29=dojo.byId("transparency");
if(_29.checked){
io.box.selected.io.type.data._color="transparent";
}else{
io.box.selected.io.type.data._color=cp.value;
}
io.box.selected.io.contents.style.color=io.box.selected.io.type.data._color;
var _2a=io.type.getContentsChild(io.box.selected);
_2a.style.color=io.box.selected.io.type.data._color;
io.type.save(io.box.selected);
}else{
console.warn("Color not saved: colorPicker not found");
}
},cancel:function(){
}},undo:{touchStart:function(_2b){
ioEvent=io.fixEvent(_2b);
return true;
},touchEnd:function(_2c){
ioEvent=io.fixEvent(_2c);
return true;
}},access:{touchStart:function(_2d){
ioEvent=io.fixEvent(_2d);
return true;
},touchEnd:function(_2e){
ioEvent=io.fixEvent(_2e);
return true;
}}};
io.onTypeLoad("text_text",io.box.text_text);


