BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
4403f71f
Commit
4403f71f
authored
Mar 19, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added sanitize and linkify functions. Moved some js to lib/
parent
2465a4fd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
2 deletions
+9
-2
jquery.timeago.js
app/assets/javascripts/lib/jquery.timeago.js
+0
-0
md5.js
app/assets/javascripts/lib/md5.js
+0
-0
utf8_encode.js
app/assets/javascripts/lib/utf8_encode.js
+0
-0
main.js.coffee
app/assets/javascripts/main.js.coffee
+8
-0
wall.js.coffee
app/assets/javascripts/wall.js.coffee
+1
-2
No files found.
app/assets/javascripts/jquery.timeago.js
→
app/assets/javascripts/
lib/
jquery.timeago.js
View file @
4403f71f
File moved
app/assets/javascripts/md5.js
→
app/assets/javascripts/
lib/
md5.js
View file @
4403f71f
File moved
app/assets/javascripts/utf8_encode.js
→
app/assets/javascripts/
lib/
utf8_encode.js
View file @
4403f71f
File moved
app/assets/javascripts/main.js.coffee
View file @
4403f71f
...
...
@@ -32,6 +32,14 @@ window.disableButtonIfEmptyField = (field_selector, button_selector) ->
else
closest_submit
.
enable
()
window
.
sanitize
=
(
str
)
->
return
str
.
replace
(
/<(?:.|\n)*?>/gm
,
''
)
window
.
linkify
=
(
str
)
->
exp
=
/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig
return
str
.
replace
(
exp
,
"<a href='$1'>$1</a>"
)
$
->
# Click a .one_click_select field, select the contents
$
(
".one_click_select"
).
on
'click'
,
->
$
(
@
).
select
()
...
...
app/assets/javascripts/wall.js.coffee
View file @
4403f71f
...
...
@@ -70,7 +70,7 @@
renderNote
:
(
note
)
->
author
=
'<strong class="wall-author">'
+
note
.
author
.
name
+
'</strong>'
body
=
'<span class="wall-text">'
+
note
.
body
+
'</span>'
body
=
'<span class="wall-text">'
+
linkify
(
sanitize
(
note
.
body
))
+
'</span>'
file
=
''
time
=
'<abbr class="timeago" title="'
+
note
.
created_at
+
'">'
+
note
.
created_at
+
'</time>'
...
...
@@ -80,4 +80,3 @@
html
=
'<li>'
+
author
+
body
+
file
+
time
+
'</li>'
$
(
'ul.notes'
).
append
(
html
)
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