Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gualter
matrix-sustrares-blog
Commits
6c2e7203
Commit
6c2e7203
authored
Mar 23, 2015
by
Simen Graaten
Browse files
Move internal elements to blog lib
parent
76f5ea6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
index.html
View file @
6c2e7203
...
...
@@ -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
'
,
...
...
matrix-blog.js
View file @
6c2e7203
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment