<?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="meetingTimer" extends="labelExplorerBox" labelid="638"
        docking="true" resizeable="false" closable="false" width="260"
        x="$once{ canvas.width - this.width - 10 }" y="10" height="160">
    
    <attribute name="roomobj" value="null" />
    <attribute name="refObj" value="null" />
    
    <attribute name="demoTime" value="0" type="number" />
    
    <handler name="oninit">
        this.dText = canvas.getLabelName(639);
        this.demoTime = this.roomobj.demoTime;
        this.fadeText(null);
    </handler>
    
    <method name="fadeText" args="item">
        <![CDATA[
            if (this.demoTime > 0) {
                var min = Math.floor(this.demoTime/60);
                var restSeconds = this.demoTime - (min * 60);
                if (restSeconds < 10) {
                    restSeconds = "0"+restSeconds;
                }
                var tString = this.dText + min + "min " + restSeconds + "sec";
                
                this._text._text.setAttribute("text",tString);
                this.demoTime--;
                lz.Timer.addTimer( new LzDelegate( this, "fadeText" ), 1000 );
            } else {
                if ($debug) Debug.write("DEMO IS OVER ");
                canvas.doActionmenu('quit');
            }
        ]]>
    </method>
    
    <!--
    this.roomobj.demoTime
     -->
    
    <view name="_text" x="2" width="$once{ parent.width -4 }" clip="true"
        y="24" height="$once{ parent.height-25 }">
        <labelText name="_text" text="" 
            width="$once{ parent.width }" multiline="true" resize="false"/>
    </view>

</class>

</library>
