blob: 8e1c61684ee97c9a1a78b4f488829a527ca22ad5 [file] [log] [blame]
<?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="innerlistViewparticipantsTable" extends="view" width="258" >
<simplelayout name="_layout" axis="y" spacing="0" />
</class>
<class name="participantsTable" extends="view" height="${ parent.height-20 }"
bgcolor="0xFFFFFF" x="2" y="6" clip="true" width="$once{ parent.width-4 }" >
<innerlistViewparticipantsTable name="innerList" />
<om_vscrollbar />
</class>
<class name="participantList" extends="view" width="$once{ parent.width }" height="${ parent.height-22 }"
bgcolor="$once{ canvas.getThemeColor('secondBorderColor') }" y="22">
<!-- clip="true" -->
<attribute name="sortType" value="alphabetical" type="string" />
<view width="$once{ parent.width-2 }" height="${ parent.height-2 }"
x="1" y="1" bgcolor="0xFFFFFF" />
<handler name="oninit">
<![CDATA[
var items = this._table.innerList.subnodes;
canvas.videoComp_lc.lc_setSoundMuted = function(publicSID,isMuted) {
if ($debug) Debug.write("lc_setSoundMuted: publicSID, isMuted",publicSID, isMuted);
for (var i=1; i<items.length; i++) {
var listItem = items[i];
if (listItem.refObj.publicSID == publicSID) {
var muteView = listItem._miniIcons._mute;
if (isMuted) {
muteView.setAttribute('frame', 2);
muteView._tip.setAttribute('labelid', 1075);
} else {
muteView.setAttribute('frame', 1);
muteView._tip.setAttribute('labelid', 1074);
}
break;
}
}
};
]]>
</handler>
<method name="addItem" args="object">
<![CDATA[
if ($debug) Debug.write("participantList addItem: ",object,object.publicSID);
for (var i=0;i<this._table.innerList.subviews.length;i++) {
if (this._table.innerList.subviews[i].refObj.publicSID == object.publicSID) {
//if ($debug) Debug.warn("Already on List, do not add twice");
return;
}
}
var lastname = object.lastname;
if ($debug) Debug.write("object.isSuperModerator ",object.isSuperModerator);
if (object.isSuperModerator) {
lastname += " *";
}
new lz.participantListItem(this._table.innerList,{
user_id:object.user_id,
isSuperModerator:object.isSuperModerator,
firstname:object.firstname,
lastname:lastname,
width:this.width-17,
refObj:object,
connectedSince:object.connectedSince,
isMod:object.isMod,
streamid:object.streamid,
username:object.username,
formatedDate:object.formatedDate
});
this.sortUserList();
]]>
</method>
<method name="sortUserList">
<![CDATA[
if (this.sortType == "alphabetical") {
function sortByName(a,b) {
if(a.firstname.toLowerCase() < b.firstname.toLowerCase()) return -1;
else if(a.firstname.toLowerCase() > b.firstname.toLowerCase()) return 1;
else return 0;
}
this._table.innerList.subviews.sort(sortByStreamId);
this._table.innerList._layout.subviews.sort(sortByStreamId);
} else {
function sortByStreamId(a,b) {
if(Number(a.streamid) == Number(b.streamid)) return 0;
else if(Number(a.streamid) > Number(b.streamid)) return 1;
else return -1;
}
this._table.innerList.subviews.sort(sortByStreamId);
this._table.innerList._layout.subviews.sort(sortByStreamId);
}
this._table.innerList._layout.update();
]]>
</method>
<method name="clearList">
this._table.destroy();
new lz.participantsTable(this,{name:'_table'});
</method>
<method name="disconnectclient" args="publicSID">
<![CDATA[
for (var i=0;i<this._table.innerList.subviews.length;i++){
if (this._table.innerList.subviews[i].refObj.publicSID==publicSID){
var item = this._table.innerList.subviews[i];
item.destroy();
break;
}
}
]]>
</method>
<!--- get a Objects List Item
@param string publicSID publicSID
-->
<method name="getUserListItemByPublicSID" args="publicSID">
<![CDATA[
var v = null;
var lst = this._table.innerList;
for (var i = 0; i < lst.subviews.length; i++) {
if (lst.subviews[i].refObj.publicSID == publicSID) {
v = lst.subviews[i];
break;
}
}
return v;
]]>
</method>
<participantsTable name="_table" y="20" />
<view name="_miniIcons" x="112" y="0" height="18">
<view width="1" height="${ parent.parent.height }" x="0"
bgcolor="$once{ canvas.getThemeColor('secondBorderColor') }" />
<view name="_icon_mod" x="2" y="3" resource="participants_isMod_rsc" onclick="" showhandcursor="false">
<labelTooltip labelid="608" />
</view>
<view width="1" height="${ parent.parent.height }" x="20"
bgcolor="$once{ canvas.getThemeColor('secondBorderColor') }" />
<view name="_icon_draw" x="22" y="3" resource="participants_allow_drawing_rsc" onclick="" showhandcursor="false">
<labelTooltip labelid="609" />
</view>
<view width="1" height="${ parent.parent.height }" x="40"
bgcolor="$once{ canvas.getThemeColor('secondBorderColor') }" />
<view name="_icon_share" x="42" y="3" resource="screen_allow_rsc" onclick="" showhandcursor="false">
<labelTooltip labelid="1073" />
</view>
<view width="1" height="${ parent.parent.height }" x="60"
bgcolor="$once{ canvas.getThemeColor('secondBorderColor') }" />
<view name="_icon_remote" x="62" y="3" resource="remote_allow_rsc" onclick="" showhandcursor="false">
<labelTooltip labelid="1084" />
</view>
<view width="1" height="${ parent.parent.height }" x="80"
bgcolor="$once{ canvas.getThemeColor('secondBorderColor') }" />
<view name="_icon_exclusive_audio" x="82" y="3" resource="participants_exclusive_audio_rsc" onclick="" showhandcursor="false">
<labelTooltip labelid="1423" />
</view>
<view width="1" height="${ parent.parent.height }" x="100"
bgcolor="$once{ canvas.getThemeColor('secondBorderColor') }" />
<view name="_icon_av_allow" x="102" y="3" resource="av_allow_rsc" onclick="" showhandcursor="false">
<labelTooltip labelid="610" />
</view>
<view width="1" height="${ parent.parent.height }" x="142"
bgcolor="$once{ canvas.getThemeColor('secondBorderColor') }" />
</view>
<view name="headerDivisionLine" width="${ parent.width }"
bgcolor="$once{ canvas.getThemeColor('secondBorderColor') }" height="1" y="20" />
</class>
</library>