88 lines
No EOL
2.7 KiB
HTML
88 lines
No EOL
2.7 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>Stendhal Admin Client</title>
|
|
<style type="text/css">
|
|
body {font-family: "Arial"}
|
|
#chat {border: 1px solid #000; padding:0.5em; overflow-y: scroll}
|
|
#chat p {margin: 0}
|
|
p.logerror {color: #F00}
|
|
p.logprivmsg {color: #444}
|
|
p.logclient {color: #888}
|
|
p.logerror {color: #F00}
|
|
p.loginformation {color: #ffc800}
|
|
p.lognegative {color: #f00}
|
|
p.lognormal {color: #000}
|
|
p.logpositive {color: #0f0}
|
|
p.loggroup {color: #633d8b}
|
|
p.logemote {color: #633d8b}
|
|
p.logresponse {color: #006400}
|
|
p.logscene_setting {color: #572002}
|
|
p.logsignificant_negative {color: #ff8f8f}
|
|
p.logsignificant_positive {color: #4169e1}
|
|
p.logtutorial {color: #ac00ac}
|
|
p.logsupport {color: #ff7200}
|
|
</style>
|
|
|
|
<script src="json.js"></script>
|
|
<script src="/socket.io/socket.io.js"></script>
|
|
<!-- <script src="/marauroa-compressed.js"></script> -->
|
|
<script type="text/javascript" src="marauroa.js"></script>
|
|
<script type="text/javascript" src="client-framework.js"></script>
|
|
<script type="text/javascript" src="message-factory.js"></script>
|
|
<script type="text/javascript" src="perception.js"></script>
|
|
<script type="text/javascript" src="rpobject-factory.js"></script>
|
|
|
|
<script type="text/javascript" src="stendhal-webui.js"></script>
|
|
<script type="text/javascript" src="stendhal-actions.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
<script>
|
|
|
|
function esc(msg){
|
|
return msg.replace(/</g, '<').replace(/>/g, '>');
|
|
};
|
|
|
|
marauroa.rpobjectFactory._default = function() {
|
|
this.onEvent = function(e) {
|
|
if (e.c == "private_text") {
|
|
stendhal.ui.chatLog.addLine(e.a.texttype.toLowerCase(), e.a.text);
|
|
}
|
|
}
|
|
}
|
|
|
|
marauroa.clientFramework.onDisconnect = function(reason, error){
|
|
stendhal.ui.chatLog.addLine("error", "Disconnected: " + error);
|
|
}
|
|
marauroa.clientFramework.onAvailableCharacterDetails = function(characters) {
|
|
if (window.location.hash) {
|
|
marauroa.clientFramework.chooseCharacter(window.location.hash.substring(1));
|
|
} else {
|
|
marauroa.clientFramework.chooseCharacter(marauroa.util.first(characters).a.name);
|
|
}
|
|
}
|
|
|
|
marauroa.clientFramework.onLoginFailed = function(reason, text) {
|
|
alert("Login failed. Please login on the Stendhal website first.");
|
|
marauroa.clientFramework.close();
|
|
document.getElementById("chatbar").disabled = true;
|
|
document.getElementById("chat").style.backgroundColor = "#AAA";
|
|
}
|
|
|
|
marauroa.clientFramework.connect(null, null);
|
|
|
|
document.onkeydown=stendhal.ui.chatBar.keydown;
|
|
</script>
|
|
|
|
<h1>Sample chat client</h1>
|
|
<form id="form" onsubmit="stendhal.ui.chatBar.send(); return false">
|
|
<input type="text" name="chatbar" id="chatbar" style="width:90%">
|
|
<input type="submit" value="Send">
|
|
</form>
|
|
<div id="chat" style="height:200px">
|
|
<p>Connecting...</p>
|
|
<noscript>JavaScript is required by the Stendhal Web Client.</noscript>
|
|
</div>
|
|
</body>
|
|
</html> |