Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
13e72f5a
Commit
13e72f5a
authored
Oct 27, 2012
by
randx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'NARKOZ-front-end'
parents
2e0e63e1
3c5a3fe0
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
75 additions
and
99 deletions
+75
-99
app/assets/javascripts/gfm_auto_complete.js.coffee
app/assets/javascripts/gfm_auto_complete.js.coffee
+37
-47
app/assets/javascripts/graph.js.coffee
app/assets/javascripts/graph.js.coffee
+0
-10
app/assets/javascripts/loader.js.coffee
app/assets/javascripts/loader.js.coffee
+0
-5
app/assets/javascripts/main.js.coffee
app/assets/javascripts/main.js.coffee
+16
-16
app/assets/javascripts/projects.js.coffee
app/assets/javascripts/projects.js.coffee
+7
-0
app/assets/javascripts/snippets.js.coffee
app/assets/javascripts/snippets.js.coffee
+0
-6
app/views/issues/_form.html.haml
app/views/issues/_form.html.haml
+2
-2
app/views/layouts/_init_auto_complete.html.haml
app/views/layouts/_init_auto_complete.html.haml
+4
-4
app/views/merge_requests/_form.html.haml
app/views/merge_requests/_form.html.haml
+4
-4
app/views/notes/_common_form.html.haml
app/views/notes/_common_form.html.haml
+1
-1
app/views/notes/_per_line_form.html.haml
app/views/notes/_per_line_form.html.haml
+1
-1
app/views/projects/graph.html.haml
app/views/projects/graph.html.haml
+1
-1
app/views/wikis/_form.html.haml
app/views/wikis/_form.html.haml
+1
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+1
-1
No files found.
app/assets/javascripts/gfm_auto_complete.js.coffee
View file @
13e72f5a
# Creates the variables for setting up GFM auto-completion
###
Creates the variables for setting up GFM auto-completion
###
# Emoji
# Emoji
window
.
autocompleteEmojiData
=
[];
data
=
[]
window
.
autocompleteEmojiTemplate
=
"<li data-value='${insert}'>${name} <img alt='${name}' height='20' src='${image}' width='20' /></li>"
;
template
=
"<li data-value='${insert}'>${name} <img alt='${name}' height='20' src='${image}' width='20' /></li>"
window
.
autocompleteEmoji
=
{
data
,
template
}
# Team Members
# Team Members
window
.
autocompleteMembersUrl
=
""
;
url
=
''
;
window
.
autocompleteMembersParams
=
params
=
{
private_token
:
''
,
page
:
1
}
private_token
:
""
window
.
autocompleteMembers
=
{
data
,
url
,
params
}
page
:
1
window
.
autocompleteMembersData
=
[];
# Add GFM auto-completion to all input fields, that accept GFM input.
window
.
setupGfmAutoComplete
=
->
$input
=
$
(
'.js-gfm-input'
)
# Emoji
$input
.
atWho
':'
,
data
:
autocompleteEmoji
.
data
,
tpl
:
autocompleteEmoji
.
template
###
# Team Members
Add GFM auto-completion to all input fields, that accept GFM input.
$input
.
atWho
'@'
,
(
query
,
callback
)
->
###
window
.
setupGfmAutoComplete
=
->
###
Emoji
###
$
(
'.gfm-input'
).
atWho
':'
,
data
:
autocompleteEmojiData
,
tpl
:
autocompleteEmojiTemplate
###
Team Members
###
$
(
'.gfm-input'
).
atWho
'@'
,
(
query
,
callback
)
->
(
getMoreMembers
=
->
(
getMoreMembers
=
->
$
.
getJSON
(
autocompleteMembersUrl
,
autocompleteMembersParams
)
$
.
getJSON
(
autocompleteMembers
.
url
,
autocompleteMembers
.
params
).
success
(
members
)
->
.
success
(
members
)
->
# pick the data we need
# pick the data we need
newMembersData
=
$
.
map
members
,
(
m
)
->
m
.
name
newMembersData
=
$
.
map
members
,
(
m
)
->
m
.
name
# add the new page of data to the rest
# add the new page of data to the rest
$
.
merge
autocompleteMembers
.
data
,
newMembersData
$
.
merge
autocompleteMembersData
,
newMembersData
# show the pop-up with a copy of the current data
# show the pop-up with a copy of the current data
callback
autocompleteMembers
.
data
[..]
callback
autocompleteMembersData
[..]
# are we past the last page?
# are we past the last page?
if
newMembersData
.
length
is
0
if
newMembersData
.
length
==
0
# set static data and stop callbacks
# set static data and stop callbacks
$input
.
atWho
'@'
,
$
(
'.gfm-input'
).
atWho
'@'
,
data
:
autocompleteMembers
.
data
data
:
autocompleteMembersData
callback
:
null
callback
:
null
else
else
# get next page
# get next page
getMoreMembers
()
getMoreMembers
()
# so the next request gets the next page
# so the next request gets the next page
autocompleteMembersParams
.
page
+=
1
;
autocompleteMembers
.
params
.
page
+=
1
).
call
();
).
call
()
\ No newline at end of file
app/assets/javascripts/graph.js.coffee
deleted
100644 → 0
View file @
2e0e63e1
initGraphNav
=
->
$
(
'.graph svg'
).
css
'position'
,
'relative'
$
(
'body'
).
bind
'keyup'
,
(
e
)
->
if
e
.
keyCode
is
37
# left
$
(
'.graph svg'
).
animate
left
:
'+=400'
else
if
e
.
keyCode
is
39
# right
$
(
'.graph svg'
).
animate
left
:
'-=400'
window
.
initGraphNav
=
initGraphNav
app/assets/javascripts/loader.js.coffee
deleted
100644 → 0
View file @
2e0e63e1
Loader
=
html
:
(
width
)
->
$
(
'<img>'
).
attr
src
:
'/assets/ajax-loader.gif'
,
width
:
width
window
.
Loader
=
Loader
app/assets/javascripts/main.js.coffee
View file @
13e72f5a
...
@@ -7,7 +7,7 @@ window.slugify = (text) ->
...
@@ -7,7 +7,7 @@ window.slugify = (text) ->
window
.
ajaxGet
=
(
url
)
->
window
.
ajaxGet
=
(
url
)
->
$
.
ajax
({
type
:
"GET"
,
url
:
url
,
dataType
:
"script"
})
$
.
ajax
({
type
:
"GET"
,
url
:
url
,
dataType
:
"script"
})
# Disable button if text field is empty
# Disable button if text field is empty
window
.
disableButtonIfEmptyField
=
(
field_selector
,
button_selector
)
->
window
.
disableButtonIfEmptyField
=
(
field_selector
,
button_selector
)
->
field
=
$
(
field_selector
)
field
=
$
(
field_selector
)
closest_submit
=
field
.
closest
(
"form"
).
find
(
button_selector
)
closest_submit
=
field
.
closest
(
"form"
).
find
(
button_selector
)
...
@@ -15,21 +15,21 @@ window.disableButtonIfEmptyField = (field_selector, button_selector) ->
...
@@ -15,21 +15,21 @@ window.disableButtonIfEmptyField = (field_selector, button_selector) ->
closest_submit
.
disable
()
if
field
.
val
()
is
""
closest_submit
.
disable
()
if
field
.
val
()
is
""
field
.
on
"keyup"
,
->
field
.
on
"keyup"
,
->
if
$
(
this
).
val
()
is
""
if
$
(
@
).
val
()
is
""
closest_submit
.
disable
()
closest_submit
.
disable
()
else
else
closest_submit
.
enable
()
closest_submit
.
enable
()
$
->
$
->
# Click a .one_click_select field, select the contents
# Click a .one_click_select field, select the contents
$
(
".one_click_select"
).
live
'click'
,
->
$
(
this
).
select
()
$
(
".one_click_select"
).
on
'click'
,
->
$
(
@
).
select
()
# Initialize chosen selects
# Initialize chosen selects
$
(
'select.chosen'
).
chosen
()
$
(
'select.chosen'
).
chosen
()
# Disable form buttons while a form is submitting
# Disable form buttons while a form is submitting
$
(
'body'
).
on
'ajax:complete, ajax:beforeSend, submit'
,
'form'
,
(
e
)
->
$
(
'body'
).
on
'ajax:complete, ajax:beforeSend, submit'
,
'form'
,
(
e
)
->
buttons
=
$
(
'[type="submit"]'
,
this
)
buttons
=
$
(
'[type="submit"]'
,
@
)
switch
e
.
type
switch
e
.
type
when
'ajax:beforeSend'
,
'submit'
when
'ajax:beforeSend'
,
'submit'
...
@@ -38,7 +38,7 @@ $ ->
...
@@ -38,7 +38,7 @@ $ ->
buttons
.
enable
()
buttons
.
enable
()
# Show/Hide the profile menu when hovering the account box
# Show/Hide the profile menu when hovering the account box
$
(
'.account-box'
).
hover
->
$
(
this
).
toggleClass
(
'hover'
)
$
(
'.account-box'
).
hover
->
$
(
@
).
toggleClass
(
'hover'
)
# Focus search field by pressing 's' key
# Focus search field by pressing 's' key
$
(
document
).
keypress
(
e
)
->
$
(
document
).
keypress
(
e
)
->
...
@@ -52,22 +52,22 @@ $ ->
...
@@ -52,22 +52,22 @@ $ ->
# Commit show suppressed diff
# Commit show suppressed diff
$
(
".supp_diff_link"
).
bind
"click"
,
->
$
(
".supp_diff_link"
).
bind
"click"
,
->
$
(
this
).
next
(
'table'
).
show
()
$
(
@
).
next
(
'table'
).
show
()
$
(
this
).
remove
()
$
(
@
).
remove
()
# Note markdown preview
# Note markdown preview
$
(
document
).
on
'click'
,
'#preview-link'
,
(
e
)
->
$
(
document
).
on
'click'
,
'#preview-link'
,
(
e
)
->
$
(
'#preview-note'
).
text
(
'Loading...'
)
$
(
'#preview-note'
).
text
'Loading...'
previewLinkText
=
if
$
(
this
).
text
()
==
'Preview'
then
'Edit'
else
'Preview'
previewLinkText
=
if
$
(
@
).
text
()
is
'Preview'
then
'Edit'
else
'Preview'
$
(
this
).
text
(
previewLinkText
)
$
(
@
).
text
previewLinkText
note
=
$
(
'#note_note'
).
val
()
note
=
$
(
'#note_note'
).
val
()
if
note
.
trim
().
length
==
0
if
note
.
trim
().
length
is
0
$
(
'#preview-note'
).
text
(
"Nothing to preview."
)
$
(
'#preview-note'
).
text
'Nothing to preview.'
else
else
$
.
post
$
(
this
).
attr
(
'href'
),
{
note
:
note
},
(
data
)
->
$
.
post
$
(
@
).
attr
(
'href'
),
{
note
:
note
},
(
data
)
->
$
(
'#preview-note'
).
html
(
data
)
$
(
'#preview-note'
).
html
(
data
)
$
(
'#preview-note, #note_note'
).
toggle
()
$
(
'#preview-note, #note_note'
).
toggle
()
...
@@ -79,14 +79,14 @@ $ ->
...
@@ -79,14 +79,14 @@ $ ->
$
.
fn
.
extend
chosen
:
(
options
)
->
$
.
fn
.
extend
chosen
:
(
options
)
->
default_options
=
search_contains
:
"true"
default_options
=
search_contains
:
"true"
$
.
extend
default_options
,
options
$
.
extend
default_options
,
options
_chosen
.
apply
this
,
[
default_options
]
_chosen
.
apply
@
,
[
default_options
]
# Disable an element and add the 'disabled' Bootstrap class
# Disable an element and add the 'disabled' Bootstrap class
$
.
fn
.
extend
disable
:
->
$
.
fn
.
extend
disable
:
->
$
(
this
).
attr
(
'disabled'
,
'disabled'
).
addClass
(
'disabled'
)
$
(
@
).
attr
(
'disabled'
,
'disabled'
).
addClass
(
'disabled'
)
# Enable an element and remove the 'disabled' Bootstrap class
# Enable an element and remove the 'disabled' Bootstrap class
$
.
fn
.
extend
enable
:
->
$
.
fn
.
extend
enable
:
->
$
(
this
).
removeAttr
(
'disabled'
).
removeClass
(
'disabled'
)
$
(
@
).
removeAttr
(
'disabled'
).
removeClass
(
'disabled'
)
)(
jQuery
)
)(
jQuery
)
app/assets/javascripts/projects.js.coffee
View file @
13e72f5a
...
@@ -22,3 +22,10 @@ $ ->
...
@@ -22,3 +22,10 @@ $ ->
# Ref switcher
# Ref switcher
$
(
'.project-refs-select'
).
on
'change'
,
->
$
(
'.project-refs-select'
).
on
'change'
,
->
$
(
@
).
parents
(
'form'
).
submit
()
$
(
@
).
parents
(
'form'
).
submit
()
class
@
GraphNav
@
init
:
->
$
(
'.graph svg'
).
css
'position'
,
'relative'
$
(
'body'
).
bind
'keyup'
,
(
e
)
->
$
(
'.graph svg'
).
animate
(
left
:
'+=400'
)
if
e
.
keyCode
is
37
# left
$
(
'.graph svg'
).
animate
(
left
:
'-=400'
)
if
e
.
keyCode
is
39
# right
app/assets/javascripts/snippets.js.coffee
deleted
100644 → 0
View file @
2e0e63e1
$
->
$
(
'#snippets-table .snippet'
).
live
'click'
,
(
e
)
->
if
e
.
target
.
nodeName
isnt
'A'
and
e
.
target
.
nodeName
isnt
'INPUT'
location
.
href
=
$
(
@
).
attr
'url'
e
.
stopPropagation
()
false
app/views/issues/_form.html.haml
View file @
13e72f5a
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
=
f
.
label
:title
do
=
f
.
label
:title
do
%strong
=
"Subject *"
%strong
=
"Subject *"
.input
.input
=
f
.
text_field
:title
,
maxlength:
255
,
class:
"xxlarge gfm-input"
,
autofocus:
true
=
f
.
text_field
:title
,
maxlength:
255
,
class:
"xxlarge
js-
gfm-input"
,
autofocus:
true
.issue_middle_block
.issue_middle_block
.issue_assignee
.issue_assignee
=
f
.
label
:assignee_id
do
=
f
.
label
:assignee_id
do
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
.clearfix
.clearfix
=
f
.
label
:description
,
"Details"
=
f
.
label
:description
,
"Details"
.input
.input
=
f
.
text_area
:description
,
maxlength:
2000
,
class:
"xxlarge gfm-input"
,
rows:
14
=
f
.
text_area
:description
,
maxlength:
2000
,
class:
"xxlarge
js-
gfm-input"
,
rows:
14
%p
.hint
Issues are parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_markdown_path
,
target:
'_blank'
}
.
%p
.hint
Issues are parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_markdown_path
,
target:
'_blank'
}
.
...
...
app/views/layouts/_init_auto_complete.html.haml
View file @
13e72f5a
:javascript
:javascript
$
(
function
()
{
$
(
function
()
{
autocompleteMembers
U
rl
=
"
#{
"/api/v2/projects/#{@project.code}/members"
if
@project
}
"
;
autocompleteMembers
.
u
rl
=
"
#{
"/api/v2/projects/#{@project.code}/members"
if
@project
}
"
;
autocompleteMembers
Params
.
private_token
=
"
#{
current_user
.
authentication
_token
}
"
;
autocompleteMembers
.
params
.
private_token
=
"
#{
current_user
.
private
_token
}
"
;
autocompleteEmoji
D
ata
=
#{
raw
emoji_autocomplete_source
}
;
autocompleteEmoji
.
d
ata
=
#{
raw
emoji_autocomplete_source
}
;
// convert the list so that the items have the right format for completion
// convert the list so that the items have the right format for completion
autocompleteEmoji
Data
=
$
.
map
(
autocompleteEmojiD
ata
,
function
(
value
)
{
autocompleteEmoji
.
data
=
$
.
map
(
autocompleteEmoji
.
d
ata
,
function
(
value
)
{
return
{
return
{
name
:
value
,
name
:
value
,
insert
:
value
+
'
:
'
,
insert
:
value
+
'
:
'
,
...
...
app/views/merge_requests/_form.html.haml
View file @
13e72f5a
...
@@ -30,12 +30,12 @@
...
@@ -30,12 +30,12 @@
.clearfix
.clearfix
.main_box
.main_box
.top_box_content
.top_box_content
=
f
.
label
:title
do
=
f
.
label
:title
do
%strong
=
"Title *"
%strong
=
"Title *"
.input
=
f
.
text_field
:title
,
class:
"input-xxlarge pad gfm-input"
,
maxlength:
255
,
rows:
5
.input
=
f
.
text_field
:title
,
class:
"input-xxlarge pad
js-
gfm-input"
,
maxlength:
255
,
rows:
5
.middle_box_content
.middle_box_content
=
f
.
label
:assignee_id
do
=
f
.
label
:assignee_id
do
%i
.icon-user
%i
.icon-user
Assign to
Assign to
.input
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
include_blank:
"Select user"
},
{
class:
'chosen span3'
})
.input
=
f
.
select
(
:assignee_id
,
@project
.
users
.
all
.
collect
{
|
p
|
[
p
.
name
,
p
.
id
]
},
{
include_blank:
"Select user"
},
{
class:
'chosen span3'
})
...
...
app/views/notes/_common_form.html.haml
View file @
13e72f5a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
=
f
.
hidden_field
:noteable_id
=
f
.
hidden_field
:noteable_id
=
f
.
hidden_field
:noteable_type
=
f
.
hidden_field
:noteable_type
=
f
.
text_area
:note
,
size:
255
,
class:
'note-text gfm-input'
=
f
.
text_area
:note
,
size:
255
,
class:
'note-text
js-
gfm-input'
#preview-note
.preview_note.hide
#preview-note
.preview_note.hide
.hint
.hint
.right
Comments are parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_markdown_path
,
target:
'_blank'
}
.
.right
Comments are parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_markdown_path
,
target:
'_blank'
}
.
...
...
app/views/notes/_per_line_form.html.haml
View file @
13e72f5a
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
=
f
.
hidden_field
:noteable_id
=
f
.
hidden_field
:noteable_id
=
f
.
hidden_field
:noteable_type
=
f
.
hidden_field
:noteable_type
=
f
.
hidden_field
:line_code
=
f
.
hidden_field
:line_code
=
f
.
text_area
:note
,
size:
255
,
class:
'line-note-text gfm-input'
=
f
.
text_area
:note
,
size:
255
,
class:
'line-note-text
js-
gfm-input'
.note_actions
.note_actions
.buttons
.buttons
=
f
.
submit
'Add note'
,
class:
"btn save-btn submit_note submit_inline_note"
,
id:
"submit_note"
=
f
.
submit
'Add note'
,
class:
"btn save-btn submit_note submit_inline_note"
,
id:
"submit_note"
...
...
app/views/projects/graph.html.haml
View file @
13e72f5a
...
@@ -10,5 +10,5 @@
...
@@ -10,5 +10,5 @@
initGraph
();
initGraph
();
$
(
function
(){
$
(
function
(){
branchGraph
(
$
(
"
#holder
"
)[
0
]);
branchGraph
(
$
(
"
#holder
"
)[
0
]);
initGraphNav
();
GraphNav
.
init
();
});
});
app/views/wikis/_form.html.haml
View file @
13e72f5a
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
.bottom_box_content
.bottom_box_content
=
f
.
label
:content
=
f
.
label
:content
.input
=
f
.
text_area
:content
,
class:
'span8 gfm-input'
.input
=
f
.
text_area
:content
,
class:
'span8
js-
gfm-input'
.actions
.actions
=
f
.
submit
'Save'
,
class:
"save-btn btn"
=
f
.
submit
'Save'
,
class:
"save-btn btn"
=
link_to
"Cancel"
,
project_wiki_path
(
@project
,
:index
),
class:
"btn cancel-btn"
=
link_to
"Cancel"
,
project_wiki_path
(
@project
,
:index
),
class:
"btn cancel-btn"
spec/requests/api/projects_spec.rb
View file @
13e72f5a
...
@@ -239,7 +239,7 @@ describe Gitlab::API do
...
@@ -239,7 +239,7 @@ describe Gitlab::API do
end
end
describe
"GET /projects/:id/snippets"
do
describe
"GET /projects/:id/snippets"
do
it
"should return a
project snippet
"
do
it
"should return a
n array of project snippets
"
do
get
api
(
"/projects/
#{
project
.
code
}
/snippets"
,
user
)
get
api
(
"/projects/
#{
project
.
code
}
/snippets"
,
user
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
should
be_an
Array
...
...
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