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
42d47fcc
Commit
42d47fcc
authored
Aug 31, 2016
by
jon r
Browse files
move conversation link to top
parent
961d0bdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
index.html
View file @
42d47fcc
...
...
@@ -10,6 +10,7 @@
body
{
background
:
#eee
;
font-family
:
'Roboto'
,
sans-serif
;
font-size
:
12
;
}
#chat
{
max-width
:
450px
;
...
...
@@ -76,8 +77,8 @@ time {
</style>
</head>
<body>
<div
id=
"chat"
>
Loading...
</div>
<a
href=
"https://vector.im/beta/#/room/#degrowth2016:matrix.org"
>
Click here to join the conversation.
</a>
<div
id=
"chat"
>
Loading...
</div>
<script
type=
"text/javascript"
>
var
blog
=
new
MatrixBlog
({
selector
:
'
#chat
'
,
...
...
matrix-blog.js
View file @
42d47fcc
...
...
@@ -2,7 +2,7 @@
var
MatrixBlog
=
function
(
settings
)
{
var
self
=
this
;
this
.
last
=
null
;
this
.
settings
=
settings
;
this
.
settings
.
locale
=
this
.
settings
.
locale
||
'
nb-NO
'
;
...
...
@@ -44,7 +44,7 @@ var MatrixBlog = function(settings) {
self
.
client
.
credentials
.
userId
=
data
.
user_id
;
$root
.
empty
();
$root
.
append
(
self
.
$people
);
//
$root.append(self.$people);
$root
.
append
(
self
.
$posts
);
self
.
client
.
peekInRoom
(
self
.
roomId
);
...
...
@@ -64,8 +64,8 @@ MatrixBlog.prototype.getUserInfo = function(user_id) {
MatrixBlog
.
prototype
.
makeTimeString
=
function
(
ts
)
{
var
ret
=
new
Date
();
ret
.
setTime
(
ts
);
var
options
=
{
hour
:
'
2-digit
'
,
var
options
=
{
hour
:
'
2-digit
'
,
minute
:
'
2-digit
'
,
day
:
'
numeric
'
,
month
:
'
short
'
...
...
@@ -84,7 +84,7 @@ MatrixBlog.prototype.processPresence = function(evt, user) {
var
mxc
=
user
.
avatarUrl
;
url
=
this
.
client
.
mxcUrlToHttp
(
mxc
,
32
,
32
,
"
crop
"
);
}
var
$item
=
this
.
$people
.
find
(
"
[data-user-id=
\"
"
+
user
.
userId
+
"
\"
"
);
if
(
$item
.
length
>
0
)
{
$item
=
$
(
$item
[
0
]);
...
...
@@ -127,8 +127,8 @@ MatrixBlog.prototype.processChunk = function(message) {
if
(
message
.
event
.
content
.
msgtype
==
'
m.text
'
)
{
$item
.
addClass
(
'
text
'
);
var
$body
=
$
(
'
<div class="body">
'
).
text
(
message
.
event
.
content
.
body
);
$item
.
a
ppend
(
$user
);
$item
.
a
ppend
(
$body
);
$item
.
p
re
pend
(
$user
);
$item
.
p
re
pend
(
$body
);
}
else
if
(
message
.
event
.
content
.
msgtype
==
'
m.image
'
)
{
$item
.
addClass
(
'
image
'
);
...
...
@@ -151,4 +151,3 @@ MatrixBlog.prototype.processChunk = function(message) {
};
}
};
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