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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
3c5a3fe0
Commit
3c5a3fe0
authored
Oct 27, 2012
by
randx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'front-end' of
https://github.com/NARKOZ/gitlabhq
into NARKOZ-front-end
Conflicts: app/views/issues/_form.html.haml
parents
2e0e63e1
414080cb
Changes
14
Show 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 @
3c5a3fe0
# Creates the variables for setting up GFM auto-completion
###
Creates the variables for setting up GFM auto-completion
###
# Emoji
window
.
autocompleteEmojiData
=
[];
window
.
autocompleteEmojiTemplate
=
"<li data-value='${insert}'>${name} <img alt='${name}' height='20' src='${image}' width='20' /></li>"
;
data
=
[]
template
=
"<li data-value='${insert}'>${name} <img alt='${name}' height='20' src='${image}' width='20' /></li>"
window
.
autocompleteEmoji
=
{
data
,
template
}
# Team Members
window
.
autocompleteMembersUrl
=
""
;
window
.
autocompleteMembersParams
=
private_token
:
""
page
:
1
window
.
autocompleteMembersData
=
[];
url
=
''
;
params
=
{
private_token
:
''
,
page
:
1
}
window
.
autocompleteMembers
=
{
data
,
url
,
params
}
# 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
###
Add GFM auto-completion to all input fields, that accept GFM input.
###
window
.
setupGfmAutoComplete
=
->
###
Emoji
###
$
(
'.gfm-input'
).
atWho
':'
,
data
:
autocompleteEmojiData
,
tpl
:
autocompleteEmojiTemplate
###
Team Members
###
$
(
'.gfm-input'
).
atWho
'@'
,
(
query
,
callback
)
->
# Team Members
$input
.
atWho
'@'
,
(
query
,
callback
)
->
(
getMoreMembers
=
->
$
.
getJSON
(
autocompleteMembersUrl
,
autocompleteMembersParams
)
.
success
(
members
)
->
$
.
getJSON
(
autocompleteMembers
.
url
,
autocompleteMembers
.
params
).
success
(
members
)
->
# pick the data we need
newMembersData
=
$
.
map
members
,
(
m
)
->
m
.
name
# add the new page of data to the rest
$
.
merge
autocompleteMembersD
ata
,
newMembersData
$
.
merge
autocompleteMembers
.
d
ata
,
newMembersData
# show the pop-up with a copy of the current data
callback
autocompleteMembersD
ata
[..]
callback
autocompleteMembers
.
d
ata
[..]
# are we past the last page?
if
newMembersData
.
length
==
0
if
newMembersData
.
length
is
0
# set static data and stop callbacks
$
(
'.gfm-input'
)
.
atWho
'@'
,
data
:
autocompleteMembersD
ata
$input
.
atWho
'@'
,
data
:
autocompleteMembers
.
d
ata
callback
:
null
else
# get next page
getMoreMembers
()
# so the next request gets the next page
autocompleteMembersParams
.
page
+=
1
;
).
call
();
\ No newline at end of file
autocompleteMembers
.
params
.
page
+=
1
).
call
()
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 @
3c5a3fe0
...
...
@@ -7,7 +7,7 @@ window.slugify = (text) ->
window
.
ajaxGet
=
(
url
)
->
$
.
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
)
->
field
=
$
(
field_selector
)
closest_submit
=
field
.
closest
(
"form"
).
find
(
button_selector
)
...
...
@@ -15,21 +15,21 @@ window.disableButtonIfEmptyField = (field_selector, button_selector) ->
closest_submit
.
disable
()
if
field
.
val
()
is
""
field
.
on
"keyup"
,
->
if
$
(
this
).
val
()
is
""
if
$
(
@
).
val
()
is
""
closest_submit
.
disable
()
else
closest_submit
.
enable
()
$
->
# 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
$
(
'select.chosen'
).
chosen
()
# Disable form buttons while a form is submitting
$
(
'body'
).
on
'ajax:complete, ajax:beforeSend, submit'
,
'form'
,
(
e
)
->
buttons
=
$
(
'[type="submit"]'
,
this
)
buttons
=
$
(
'[type="submit"]'
,
@
)
switch
e
.
type
when
'ajax:beforeSend'
,
'submit'
...
...
@@ -38,7 +38,7 @@ $ ->
buttons
.
enable
()
# 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
$
(
document
).
keypress
(
e
)
->
...
...
@@ -52,22 +52,22 @@ $ ->
# Commit show suppressed diff
$
(
".supp_diff_link"
).
bind
"click"
,
->
$
(
this
).
next
(
'table'
).
show
()
$
(
this
).
remove
()
$
(
@
).
next
(
'table'
).
show
()
$
(
@
).
remove
()
# Note markdown preview
$
(
document
).
on
'click'
,
'#preview-link'
,
(
e
)
->
$
(
'#preview-note'
).
text
(
'Loading...'
)
$
(
'#preview-note'
).
text
'Loading...'
previewLinkText
=
if
$
(
this
).
text
()
==
'Preview'
then
'Edit'
else
'Preview'
$
(
this
).
text
(
previewLinkText
)
previewLinkText
=
if
$
(
@
).
text
()
is
'Preview'
then
'Edit'
else
'Preview'
$
(
@
).
text
previewLinkText
note
=
$
(
'#note_note'
).
val
()
if
note
.
trim
().
length
==
0
$
(
'#preview-note'
).
text
(
"Nothing to preview."
)
if
note
.
trim
().
length
is
0
$
(
'#preview-note'
).
text
'Nothing to preview.'
else
$
.
post
$
(
this
).
attr
(
'href'
),
{
note
:
note
},
(
data
)
->
$
.
post
$
(
@
).
attr
(
'href'
),
{
note
:
note
},
(
data
)
->
$
(
'#preview-note'
).
html
(
data
)
$
(
'#preview-note, #note_note'
).
toggle
()
...
...
@@ -79,14 +79,14 @@ $ ->
$
.
fn
.
extend
chosen
:
(
options
)
->
default_options
=
search_contains
:
"true"
$
.
extend
default_options
,
options
_chosen
.
apply
this
,
[
default_options
]
_chosen
.
apply
@
,
[
default_options
]
# Disable an element and add the 'disabled' Bootstrap class
$
.
fn
.
extend
disable
:
->
$
(
this
).
attr
(
'disabled'
,
'disabled'
).
addClass
(
'disabled'
)
$
(
@
).
attr
(
'disabled'
,
'disabled'
).
addClass
(
'disabled'
)
# Enable an element and remove the 'disabled' Bootstrap class
$
.
fn
.
extend
enable
:
->
$
(
this
).
removeAttr
(
'disabled'
).
removeClass
(
'disabled'
)
$
(
@
).
removeAttr
(
'disabled'
).
removeClass
(
'disabled'
)
)(
jQuery
)
app/assets/javascripts/projects.js.coffee
View file @
3c5a3fe0
...
...
@@ -22,3 +22,10 @@ $ ->
# Ref switcher
$
(
'.project-refs-select'
).
on
'change'
,
->
$
(
@
).
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 @
3c5a3fe0
...
...
@@ -12,7 +12,7 @@
=
f
.
label
:title
do
%strong
=
"Subject *"
.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_assignee
=
f
.
label
:assignee_id
do
...
...
@@ -37,7 +37,7 @@
.clearfix
=
f
.
label
:description
,
"Details"
.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'
}
.
...
...
app/views/layouts/_init_auto_complete.html.haml
View file @
3c5a3fe0
:javascript
$
(
function
()
{
autocompleteMembers
U
rl
=
"
#{
"/api/v2/projects/#{@project.code}/members"
if
@project
}
"
;
autocompleteMembers
Params
.
private_token
=
"
#{
current_user
.
authentication
_token
}
"
;
autocompleteMembers
.
u
rl
=
"
#{
"/api/v2/projects/#{@project.code}/members"
if
@project
}
"
;
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
autocompleteEmoji
Data
=
$
.
map
(
autocompleteEmojiD
ata
,
function
(
value
)
{
autocompleteEmoji
.
data
=
$
.
map
(
autocompleteEmoji
.
d
ata
,
function
(
value
)
{
return
{
name
:
value
,
insert
:
value
+
'
:
'
,
...
...
app/views/merge_requests/_form.html.haml
View file @
3c5a3fe0
...
...
@@ -32,7 +32,7 @@
.top_box_content
=
f
.
label
:title
do
%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
=
f
.
label
:assignee_id
do
%i
.icon-user
...
...
app/views/notes/_common_form.html.haml
View file @
3c5a3fe0
...
...
@@ -8,7 +8,7 @@
=
f
.
hidden_field
:noteable_id
=
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
.hint
.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 @
3c5a3fe0
...
...
@@ -13,7 +13,7 @@
=
f
.
hidden_field
:noteable_id
=
f
.
hidden_field
:noteable_type
=
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
.buttons
=
f
.
submit
'Add note'
,
class:
"btn save-btn submit_note submit_inline_note"
,
id:
"submit_note"
...
...
app/views/projects/graph.html.haml
View file @
3c5a3fe0
...
...
@@ -10,5 +10,5 @@
initGraph
();
$
(
function
(){
branchGraph
(
$
(
"
#holder
"
)[
0
]);
initGraphNav
();
GraphNav
.
init
();
});
app/views/wikis/_form.html.haml
View file @
3c5a3fe0
...
...
@@ -21,7 +21,7 @@
.bottom_box_content
=
f
.
label
:content
.input
=
f
.
text_area
:content
,
class:
'span8 gfm-input'
.input
=
f
.
text_area
:content
,
class:
'span8
js-
gfm-input'
.actions
=
f
.
submit
'Save'
,
class:
"save-btn btn"
=
link_to
"Cancel"
,
project_wiki_path
(
@project
,
:index
),
class:
"btn cancel-btn"
spec/requests/api/projects_spec.rb
View file @
3c5a3fe0
...
...
@@ -239,7 +239,7 @@ describe Gitlab::API do
end
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
)
response
.
status
.
should
==
200
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