Support/Live Chat/Web Client PRD/Templates

From MozillaWiki
Jump to navigation Jump to search

Templates are used to specify when to load/unload Widgets, as well as specify options for each widget. Any static html, a list of themes, and any access control options are configured here.

The current implementation is simplistic, but a future version will enable a true multi-stage client (login, full access, restore session, logout, etc) using event listeners.

Syntax, including yet-to-be-implemented features:

<template name="agent" xmlns="http://support.mozilla.com/chatapp" xmlns:html="http://www.w3.org/1999/xhtml">
 <themes>
   <theme name="SUMO" path="themes/sumo.css" priority="0">
 </themes>
 <resources>
   <resource type="javascript" path="templates/agent.js"/>
   <resource type="component" path="xmpp">
     <option name="autojoin" value="Contributors"/>
   </resource>
   <resource type="component" path="xmpp.chat"/>
   <resource type="component" path="xmpp.fastpath"/>
 </resources>
 <listeners>
   <listener event="xmpp.auth.success">
     <transition from="*" to="1">
   </listener>
 </listeners>
 <content>
   <transition levels="99">

<html:div></html:div> </transition> <transition levels="0"> <widget name="basicauth"/> </transition> <transition levels="2"> <widget name="create-account"/> </transition> <transition levels="1"> <widget name="notifier" id="notifier"> <option name="position" value="top"/> </widget> <html:div id="sidebar"> <widget name="container.panel" id="sidepanel"> <option name="draggable" value="true"/> <option name="droppable" value="true"/> <widget name="fastpath.stats"/> </widget> </html:div> <html:div id="main"> <widget name="container.tabs" id="chattabs"> <option name="droppable" value="false"/> <option name="draggable" value="false"/> <widget name="chat.launcher" id="chatlauncher"> <option name="chat-widget" value="chat.fancychat"/> </widget> </widget> </html:div> </transition> </content> </template>