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
094cafca
Commit
094cafca
authored
Apr 13, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed GL Actions class
parent
7a1800fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
57 deletions
+0
-57
gl_form.js.coffee
app/assets/javascripts/gl_form.js.coffee
+0
-11
gl_form_actions.js.coffee
app/assets/javascripts/gl_form_actions.js.coffee
+0
-43
_hints.html.haml
app/views/projects/notes/_hints.html.haml
+0
-3
No files found.
app/assets/javascripts/gl_form.js.coffee
View file @
094cafca
...
...
@@ -11,13 +11,6 @@ class @GLForm
@
form
.
data
'gl-form'
,
@
destroy
:
->
# Destroy actions
actions
=
@
form
.
data
'form-actions'
if
actions
?
actions
.
clearEventListeners
()
@
form
.
data
'form-actions'
,
null
# Clean form listeners
@
clearEventListeners
()
@
form
.
data
'gl-form'
,
null
...
...
@@ -38,10 +31,6 @@ class @GLForm
autosize
(
@
textarea
)
# Setup action buttons
actions
=
new
GLFormActions
@
form
,
@
textarea
@
form
.
data
'form-actions'
,
actions
# form and textarea event listeners
@
addEventListeners
()
...
...
app/assets/javascripts/gl_form_actions.js.coffee
deleted
100644 → 0
View file @
7a1800fe
class
@
GLFormActions
constructor
:
(
@
form
,
@
textarea
)
->
@
clearEventListeners
()
@
addEventListeners
()
clearEventListeners
:
->
@
form
.
off
'click'
,
'.js-toolbar-button'
addEventListeners
:
->
@
form
.
on
'click'
,
'.js-toolbar-button'
,
@
toolbarButtonClick
toolbarButtonClick
:
(
e
)
=>
$btn
=
$
(
e
.
currentTarget
)
# Get the prefix from the button
prefix
=
$btn
.
data
(
'prefix'
)
@
addPrefixToTextarea
(
prefix
)
addPrefixToTextarea
:
(
prefix
)
->
caretStart
=
@
textarea
.
get
(
0
).
selectionStart
caretEnd
=
@
textarea
.
get
(
0
).
selectionEnd
textEnd
=
@
textarea
.
val
().
length
beforeSelection
=
@
textarea
.
val
().
substring
0
,
caretStart
afterSelection
=
@
textarea
.
val
().
substring
caretEnd
,
textEnd
beforeSelectionSplit
=
beforeSelection
.
split
''
beforeSelectionLength
=
beforeSelection
.
length
# Get the last character in the before selection
beforeSelectionLastChar
=
beforeSelectionSplit
[
beforeSelectionLength
-
1
]
if
beforeSelectionLastChar
?
and
beforeSelectionLastChar
isnt
''
# Append a white space char to the prefix if the previous char isn't a space
prefix
=
"
#{
prefix
}
"
# Update the textarea
@
textarea
.
val
beforeSelection
+
prefix
+
afterSelection
@
textarea
.
get
(
0
).
setSelectionRange
caretStart
+
prefix
.
length
,
caretEnd
+
prefix
.
length
# Focus the textarea
@
textarea
.
focus
()
@
textarea
.
trigger
(
'keyup'
)
app/views/projects/notes/_hints.html.haml
View file @
094cafca
.comment-toolbar.clearfix
%button
.toolbar-button.js-toolbar-button
{
type:
'button'
,
data:
{
prefix:
':'
},
tabindex:
'-1'
}
=
icon
(
'smile-o'
,
class:
'toolbar-button-icon'
)
Emoji
.toolbar-text
Styling with
=
link_to
'Markdown'
,
help_page_path
(
'markdown'
,
'markdown'
),
target:
'_blank'
,
tabindex:
-
1
...
...
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