diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-13 09:49:11 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-13 09:49:11 +0000 |
commit | e44a7e37b6c7b5961adaffc62b9042b8d442938e (patch) | |
tree | 95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dijit/demos/chat/operator.html | |
parent | a62b9742ee5e28bcec6872d88f50f25b820914f6 (diff) | |
download | semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2 |
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dijit/demos/chat/operator.html')
-rw-r--r-- | includes/js/dijit/demos/chat/operator.html | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/includes/js/dijit/demos/chat/operator.html b/includes/js/dijit/demos/chat/operator.html new file mode 100644 index 0000000..594fc6e --- /dev/null +++ b/includes/js/dijit/demos/chat/operator.html @@ -0,0 +1,83 @@ +<html> +<head> + <title>Cometd chat / Operator Page</title> + <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad:false"></script> + <script type="text/javascript" src="room.js"></script> + <script type="text/javascript"> + dojo.require("dijit.layout.TabContainer"); + dojo.require("dijit.layout.ContentPane"); + dojo.require("dojo.parser"); + var control = { + _chats: {}, + _getAlert: function(e){ + console.log(e); + if (!this._chats[(e.data.user)] && (operator != e.data.user)){ + dojox.cometd.subscribe("/chat/demo/"+e.data.joined,this,"_privateChat"); + + var tabNode = document.createElement('div'); + tabNode.id = "chatWith" + e.data.user; + var chatNode = document.createElement('div'); + chatNode.id = e.data.user + "Widget"; + tabNode.appendChild(chatNode); + var newTab = new dijit.layout.ContentPane({ + title: e.data.user, + closable: true + },tabNode); + dijit.byId('tabView').addChild(newTab); + var chat = new dijit.demos.chat.Room({ + roomId: e.data.joined, + registeredAs: operator + },chatNode); + chat.startup(); + this._chats[(e.data.user)]=true; + } + }, + + _privateChat: function(e){ + var thisChat = dijit.byId(e.data.user+"Widget") || false; + if (thisChat) { /* thisChat._chat(e); */} + } + }; + + dojo.addOnLoad(function(){ + dojo.parser.parse(dojo.body()); + + dojox.cometd.init("http://comet.sitepen.com:9190/cometd"); + dojox.cometd.subscribe("/chat/demo",control,"_getAlert"); + + }); + + var operator; + function registerOperator(){ + operator = dojo.byId('opName').value; + dojo.byId('login').style.display = "none"; + dojo.byId('status').innerHTML = "You are: <b>"+operator+"</b>"; + } + + </script> + <style type="text/css"> + @import "chat.css"; + @import "../../tests/css/dijitTests.css"; + @import "../../themes/tundra/tundra.css"; + #status { position:absolute; top:5px; right:25px; } + </style> +</head> +<body class="tundra"> + +<h1 class="testTitle">Tech Support Operator Page:</h1> + +<div id="tabView" dojoType="dijit.layout.TabContainer" style="width:100%; height:75%; "> + + <div dojoType="dijit.layout.ContentPane" title="Home" style="padding:8px;" > + <h3>Welcome Operator</h3> + <p>It is your job to respond to incoming Support Requests. Sit here, and watch the screen.</p> + <p id="login">Please Login as an operator: + <br><br> + Name: <input type="text" name="username" id="opName" value="" /> <input type="submit" value="login" onclick="registerOperator()"/> + </p> + </div><!-- home tab --> + +</div><!-- tabContainer --> +<div id="status"></div> +</body> +</html> |