| <?xml version="1.0" encoding="UTF-8" ?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| --> |
| <library> |
| |
| |
| <class name="chatTabItemEmoticons" extends="view" width="$once{ parent.width }" bgcolor="$once{ this.usercolor }"> |
| |
| <attribute name="user_id" value="0" type="number" /> |
| <attribute name="username" value="" type="string" /> |
| <attribute name="usertime" value="" type="string" /> |
| <attribute name="usercolor" value="0" type="string" /> |
| <attribute name="publicSID" value="" type="string" /> |
| <attribute name="messageObj" value="null" /> |
| <attribute name="isDirectLink" value="false" type="boolean" /> |
| <attribute name="message" value="" type="string" /> |
| <attribute name="picture_uri" value="" type="string"/> |
| <attribute name="rawMessage" value="null" /> |
| |
| <handler name="oninit"> |
| <![CDATA[ |
| |
| if ($debug) Debug.write("this.picture_uri :: ",this.picture_uri); |
| |
| if (this.picture_uri != null && ( this.picture_uri.startsWith("http") || this.picture_uri.startsWith("https") ) ) { |
| |
| var downloadurl = this.picture_uri; |
| |
| } else { |
| if($debug) Debug.write("chatTabItemEmoticons/WIDTH: "+this.width); |
| var downloadurl = canvas.getUrl() + 'DownloadHandler?fileName=CHAT' |
| +'&moduleName=chat&parentPath=&room_id=' |
| +'&remoteUserid='+this.user_id |
| +'&sid='+canvas.sessionId; |
| } |
| |
| //Debug.write("downloadurl "+downloadurl); |
| this._userpic.setAttribute('src',downloadurl); |
| |
| if(canvas.isrtl == 'true'){ |
| if($debug) Debug.write("chatTabItemEmoticons RTL is set"); |
| |
| this.header_user.setAttribute('textalign', 'right'); |
| this.header_time.setAttribute('align', 'left'); |
| this.header_time.setAttribute('x', '40'); |
| this.multi.setAttribute('textalign', 'right'); |
| this.multi.setAttribute('align', 'right'); |
| } |
| |
| //Debug.write("TIME: "+this.usertime); |
| ]]> |
| </handler> |
| |
| <view name="bg" width="179" height="$once{ parent.height-1 }" bgcolor="0xFFFFFF" |
| opacity="0.1"> |
| </view> |
| |
| <image name="_userpic" stretches="both" x="1" y="1"> |
| <handler name="onload"> |
| <![CDATA[ |
| if (this.height > 38) { |
| //If bigger then containter then scale it |
| var width = this.width/(this.height/38); |
| this.setAttribute('height',38); |
| this.setAttribute('width',width); |
| } |
| if (this.width > 38) { |
| var height = this.height/(this.width/38); |
| this.setAttribute('height',height); |
| this.setAttribute('width',38); |
| } |
| ]]> |
| </handler> |
| </image> |
| |
| <text text="$once{ parent.username }" x="40" resize="false" fontsize="11" multiline="true" |
| width="140" height="$once{ parent.height }" |
| name="header_user"> |
| </text> |
| |
| <state applied="$once{ parent.rawMessage[9] }"> |
| <miniIcons resource="allow_ok_icon_rsc" width="16" height="16" |
| y="2" x="$once{ parent.width - 140 }" showhandcursor="true" > |
| <handler name="onclick"> |
| this.setAttribute('visible', false); |
| parent.setAttribute('visible', false); |
| parent.rawMessage.length = parent.rawMessage.length - 1; |
| parent.rawMessage[parent.rawMessage.length - 1] = false; |
| //if ($debug) Debug.write("!!!!!!!!!!!!! allow message ", parent, parent.rawMessage); |
| hib.sendChatMessageWithClient.sendMessage(parent.rawMessage); |
| </handler> |
| <labelTooltip labelid="1514" /> |
| </miniIcons> |
| </state> |
| |
| <state applied="$once{ !parent.isDirectLink }"> |
| |
| <miniIconsImage name="add" src="$once{ canvas.getThemeImage('edit_add_rsc') }" width="16" height="16" |
| y="2" x="$once{ parent.width - 122 }" showhandcursor="true"> |
| <handler name="onclick"> |
| if ($debug) Debug.write("Start Conference"); |
| if (hib.userobject.user_id == parent.user_id) { |
| new lz.labelerrorPopup(canvas,{errorlabelid:1225}); |
| return; |
| } |
| parent.requestUserToContactList.doCall(); |
| </handler> |
| <labelTooltip labelid="1186" /> |
| </miniIconsImage> |
| |
| </state> |
| |
| <!-- |
| public Long requestUserToContactList(String SID, Long userToAdd_id, |
| String domain, String port, String webapp) |
| --> |
| <netRemoteCallHib name="requestUserToContactList" funcname="userservice.requestUserToContactList" |
| remotecontext="$once{ canvas.thishib }" activeErrorHandler="true" > |
| <netparam><method name="getValue"> return canvas.sessionId; </method></netparam> |
| <netparam><method name="getValue"> return parent.parent.user_id; </method></netparam> |
| <netparam><method name="getValue"> return canvas.getHttpHost(); </method></netparam> |
| <netparam><method name="getValue"> return canvas.red5httpport; </method></netparam> |
| <netparam><method name="getValue"> return canvas.httpRootKey; </method></netparam> |
| <handler name="ondata" args="value"> |
| <![CDATA[ |
| if ($debug) Debug.write("requestUserToContactList: ",value); |
| if (value > 0) { |
| new lz.labelerrorPopup(canvas,{labelid:1267,errorlabelid:1266}); |
| } |
| ]]> |
| </handler> |
| </netRemoteCallHib> |
| |
| |
| <!-- space between each line of text --> |
| <attribute name="leading" value="5" type="number" /> |
| |
| <view name="bg_main" x="180" width="$once{ parent.width - 180 }" height="$once{ parent.height-1 }" |
| opacity="0.3" bgcolor="0xFFFFFF"> |
| </view> |
| |
| <text multiline="true" x="180" width="$once{ parent.width - 306 }" fontsize="11" selectable="true" name="multi" > |
| <handler name="oninit"> |
| <![CDATA[ |
| |
| if(canvas.isrtl!='true'){ |
| this.sprite.__LZtextclip.wordWrap = false; |
| if($debug) Debug.write("New Text"); |
| //Debug.write(this.sprite.getTextFormat()); |
| tFormat = this.sprite.__LZtextclip.getTextFormat(); |
| //Debug.write(this.sprite.__LZtextclip.getTextFormat()); |
| tFormat.leading = 4; |
| this.sprite.__LZtextclip.setTextFormat(tFormat); |
| var items = parent.messageObj; |
| var t = ""; |
| //items[0] = ["text","hello your are the hero lets check accomodation today i need some input"]; |
| for (var i=0;i<items.length;i++) { |
| |
| //if ($debug) Debug.write("Item :0: ",items[i][0]); |
| |
| if (items[i][0]=="text"){ |
| //if ($debug) Debug.write("Text :1: ",items[i][1]); |
| |
| t += items[i][1]; |
| } else { |
| if (t.length!=0){ |
| var tempString = calcLineWidthByTextField(this.width, t,this.fontsize,this.font); |
| var x = tempString[tempString.length-1]["lineWidth"]; |
| var y = (tempString.length-1)*(getLineHeight()+parent.leading-1); |
| }else { |
| var x = 0; |
| var y = 0; |
| } |
| t += items[i][2]; |
| |
| var swfurl = canvas.getUrl() + 'public/emoticons/'+items[i][1]; |
| var m = new lz.chatInnerSmily(parent,{x:x+this.x,y:y+this.y,iconlabel:items[i][3]}); |
| |
| //if ($debug) Debug.write("Smily :2: ",swfurl); |
| |
| m.setSource(swfurl); |
| } |
| } |
| //Debug.write("TTTT: ",t);"Verdana" |
| var tString = calcLineWidthByTextField(this.width, t,this.fontsize,this.font); |
| |
| for (var k = 0;k<tString.length;k++){ |
| this.setAttribute('text',this.getText()+textObject[k]["text"]+"\r"); |
| //if ($debug) Debug.write("text: ",k,textObject[k]["lineWidth"],textObject[k]["text"]); |
| } |
| |
| //if ($debug) Debug.write("text: ",this.getText()); |
| |
| //Debug.write(this.sprite.__LZtextclip.getTextFormat()); |
| tFormat.leading = parent.leading; |
| this.sprite.__LZtextclip.setTextFormat(tFormat); |
| //Debug.write(this.sprite.__LZtextclip.textHeight); |
| //Debug.write(getLineHeight()); |
| //Debug.write(this.sprite.__LZtextclip.textHeight+12); |
| this.setAttribute('height',this.sprite.__LZtextclip.textHeight+12); |
| } |
| else{ |
| var t = ""; |
| var items = parent.messageObj; |
| |
| for (var i=0;i<items.length;i++) { |
| if (items[i][0]=="text"){ |
| t += items[i][1]; |
| } |
| } |
| |
| this.setAttribute('text',this.getText()+ t); |
| } |
| |
| parent.setAttribute('height',this.height); |
| parent.header_user.setAttribute('height',this.height); |
| parent.bg.setAttribute('height',this.height-1); |
| parent.bg_main.setAttribute('height',this.height-1); |
| |
| ]]> |
| </handler> |
| |
| </text> |
| |
| <state applied="$once{ !parent.isDirectLink }"> |
| |
| <miniIcons name="private_message_add" resource="private_message_add_rsc" width="16" height="16" |
| y="0" x="$once{ parent.width - 104 }" showhandcursor="true"> |
| <handler name="onclick"> |
| if ($debug) Debug.write("Start Conference"); |
| new lz.newPrivateMessage(canvas,{ |
| x:200,y:120, |
| refObj:null, |
| minimizable:true, |
| maximizable:true, |
| userObject:null, |
| isdragable:true, |
| user_id:parent.user_id, |
| width:canvas.width-300, |
| height:canvas.height-130 |
| }); |
| </handler> |
| <labelTooltip labelid="1253" /> |
| </miniIcons> |
| |
| <miniIcons resource="user_profile_rsc" width="16" height="16" |
| y="0" x="$once{ parent.width - 84 }" showhandcursor="true"> |
| <handler name="onclick"> |
| if ($debug) Debug.write("Start Conference"); |
| new lz.viewUserProfileWindow(canvas,{ |
| userId:parent.user_id |
| }); |
| </handler> |
| <labelTooltip labelid="1236" /> |
| </miniIcons> |
| |
| <miniIcons y="0" x="$once{ parent.width - 64 }" |
| resource="start_conference2_rsc" width="16" height="16" |
| showhandcursor="true"> |
| <handler name="onclick"> |
| if ($debug) Debug.write("Start Conference"); |
| new lz.chatParticipantsInviteConference(canvas,{ |
| publicSID:parent.publicSID, |
| user_id:parent.user_id |
| }); |
| </handler> |
| <labelTooltip labelid="1131" /> |
| </miniIcons> |
| |
| </state> |
| |
| <text text="$once{ parent.usertime+' ' }" align="right" fgcolor="0xAAAAAA" |
| fontsize="10" name="header_time" /> |
| |
| </class> |
| |
| <class name="chatInnerTextBox" extends="text" resize="true" bgcolor="red" /> |
| |
| <class name="chatInnerSmily" extends="view" onmouseover="" onmouseout=""> |
| <attribute name="iconlabel" value="" type="string" /> |
| <labelTooltip text="$once{ parent.iconlabel }" /> |
| </class> |
| |
| </library> |