Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Ind.ie Projects
Waystone
Commits
01bf86e8
Unverified
Commit
01bf86e8
authored
Sep 08, 2015
by
Aral Balkan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed public timeline posts being loaded into post pages.
parent
22cc58fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
static/js/post.js
static/js/post.js
+25
-0
No files found.
static/js/post.js
0 → 100644
View file @
01bf86e8
window
.
addEventListener
(
'
load
'
,
function
(){
// Set: don’t run in Node.
if
(
typeof
this
.
data
!==
'
undefined
'
)
{
// console.log("In Node: Not running in-browser code.");
return
;
}
setInterval
(
function
(){
// Update all the message clocks
var
postDates
=
document
.
getElementsByClassName
(
'
postDate
'
);
for
(
var
i
=
0
;
i
<
postDates
.
length
;
i
++
)
{
var
postDate
=
postDates
[
i
];
var
timestamp
=
(
postDate
.
getAttribute
(
'
data-timestamp
'
)).
replace
(
/_/g
,
'
:
'
);
var
timeOfPost
=
new
Date
(
timestamp
);
var
humanTime
=
moment
(
timeOfPost
).
fromNow
();
postDate
.
innerHTML
=
humanTime
+
"
"
;
}
},
3000
);
});
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