Commit 6c2e7203 authored by Simen Graaten's avatar Simen Graaten
Browse files

Move internal elements to blog lib

parent 76f5ea6a
......@@ -59,12 +59,11 @@ time {
</style>
</head>
<body>
<ul class="people">
</ul>
<ul class="posts">
</ul>
<div id="chat">Loading...</div>
<a href="https://github.com/simeng/matrix-blog">Matrix Blog</a> - a test app by @simeng:h4x.no for using <a href="http://matrix.org/">Matrix</a> as a Blog-like system.
<script type="text/javascript">
var blog = new MatrixBlog({
selector: '#chat',
room: '#blog:h4x.no',
userId: '@blog:h4x.no',
accessToken: 'QGJsb2c6aDR4Lm5v.LWtEDByFJNhlMCagjY',
......
......@@ -16,17 +16,20 @@ var MatrixBlog = function(settings) {
this.roomId = null;
this.lastId = null;
this.$posts = null;
this.$people = null;
this.$posts = $('<ul class="posts">');
this.$people = $('<ul class="people">');
this.client.resolveRoomAlias(this.settings.room, function (err, data) {
self.$posts = $("ul.posts");
self.$people = $("ul.people");
var $root = $(self.settings.selector);
self.roomId = data.room_id;
// client.sendTyping(roomId, true, 5000, function (err, data) {})
self.client.initialSync(50, function (err, data) {
$root.empty();
$root.append(self.$people);
$root.append(self.$posts);
self.lastId = data.end;
for (var j in data.rooms) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment