Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
7b757ee2eded
Commit
7d56a51b
authored
Mar 26, 2012
by
Dmitriy Zaporozhets
Browse files
Js refactoring and ajax animation replaced
parent
4a92eae0d3a6
Changes
14
Hide whitespace changes
Inline
Side-by-side
app/assets/images/ajax-loader-facebook.gif
deleted
100644 → 0
View file @
4a92eae0
723 Bytes
app/assets/images/ajax-loader.gif
deleted
100644 → 0
View file @
4a92eae0
4.08 KB
app/assets/images/ajax_loader.gif
0 → 100644
View file @
7b757ee2
7.37 KB
app/assets/javascripts/application.js
View file @
7b757ee2
...
...
@@ -70,3 +70,7 @@ function showMenu() {
function
resetMenu
()
{
$
(
this
).
removeClass
(
"
hover
"
);
}
function
slugify
(
text
)
{
return
text
.
replace
(
/
[^
-a-zA-Z0-9
]
+/g
,
'
_
'
).
toLowerCase
();
}
app/assets/javascripts/merge_requests.js
View file @
7b757ee2
...
...
@@ -31,10 +31,12 @@ var MergeRequest = {
$
.
ajax
({
type
:
"
GET
"
,
url
:
$
(
"
.merge-diffs-tab
"
).
attr
(
"
data-url
"
),
beforeSend
:
function
(){
$
(
'
.status
'
).
addClass
(
"
loading
"
)},
complete
:
function
(){
MergeRequest
.
diffs_loaded
=
true
;
$
(
"
.merge_request_notes
"
).
hide
();
$
(
"
.dashboard-loader
"
).
hide
()},
$
(
'
.status
'
).
removeClass
(
"
loading
"
);
},
dataType
:
"
script
"
});
}
}
app/assets/javascripts/projects.js
0 → 100644
View file @
7b757ee2
function
Projects
()
{
$
(
"
#project_name
"
).
live
(
"
change
"
,
function
(){
var
slug
=
slugify
(
$
(
this
).
val
());
$
(
"
#project_code
"
).
val
(
slug
);
$
(
"
#project_path
"
).
val
(
slug
);
});
$
(
'
.new_project, .edit_project
'
).
live
(
'
ajax:before
'
,
function
()
{
$
(
'
.project_new_holder, .project_edit_holder
'
).
hide
();
$
(
'
.ajax_loader
'
).
show
();
});
$
(
'
form #project_default_branch
'
).
chosen
();
}
app/assets/stylesheets/common.scss
View file @
7b757ee2
...
...
@@ -589,7 +589,7 @@ table a code {
.loading
{
margin
:
20px
auto
;
background
:
url(ajax
-
loader
-facebook
.gif)
no-repeat
center
center
;
background
:
url(ajax
_
loader.gif)
no-repeat
center
center
;
width
:
40px
;
height
:
40px
;
}
...
...
app/views/issues/index.html.haml
View file @
7b757ee2
...
...
@@ -3,7 +3,7 @@
Issues
%span
.rss-icon
=
link_to
project_issues_path
(
@project
,
:atom
,
{
:private_token
=>
current_user
.
private_token
})
do
=
image_tag
"Rss-UI.PNG"
,
:width
=>
22
,
:title
=>
"feed"
=
image_tag
"Rss-UI.PNG"
,
:width
=>
16
,
:title
=>
"feed"
-
if
can?
current_user
,
:write_issue
,
@project
=
link_to
new_project_issue_path
(
@project
),
:class
=>
"right btn small"
,
:title
=>
"New Issue"
,
:remote
=>
true
do
...
...
app/views/merge_requests/show.html.haml
View file @
7b757ee2
...
...
@@ -73,12 +73,11 @@
=
link_to
"#diffs"
,
"data-url"
=>
diffs_project_merge_request_path
(
@project
,
@merge_request
),
:class
=>
"merge-diffs-tab tab"
do
Diff
%img
{
:src
=>
"/assets/ajax-loader-facebook.gif"
,
:class
=>
"dashboard-loader"
}
.merge_request_notes
#notes
=
render
"notes/notes"
,
:tid
=>
@merge_request
.
id
,
:tt
=>
"merge_request"
.merge-request-diffs
.status
:javascript
$
(
function
(){
...
...
app/views/projects/_form.html.haml
View file @
7b757ee2
...
...
@@ -49,7 +49,7 @@
.clearfix
=
f
.
label
:description
.input
=
f
.
text_area
:description
,
:placeholder
=>
"project description"
,
:class
=>
"xlarge"
,
:rows
=>
4
=
f
.
text_area
:description
,
:placeholder
=>
"project description"
,
:class
=>
"
x
xlarge"
,
:rows
=>
5
%p
.hint
Markdown is enabled.
%br
...
...
app/views/projects/create.js.haml
View file @
7b757ee2
...
...
@@ -3,5 +3,6 @@
location.href = "
#{
project_path
(
@project
,
:notice
=>
'Project was successfully created.'
)
}
";
-
else
:plain
$('.project_new_holder').show();
$("#new_project").replaceWith("
#{
escape_javascript
(
render
(
'form'
))
}
");
$('.ajax_loader').hide();
app/views/projects/edit.html.haml
View file @
7b757ee2
=
render
"project_head"
%h3
Edit Project
%hr
=
render
"projects/form"
%div
{
:class
=>
"ajax_loader"
,
:style
=>
"display:none;height:200px;"
}
.project_edit_holder
%h3
Edit Project
%hr
=
render
"projects/form"
%div
.ajax_loader.hide
%center
=
image_tag
"ajax
-
loader.gif"
,
:class
=>
"append-bottom"
%div
.padded
=
image_tag
"ajax
_
loader.gif"
%h3
.prepend-top
Saving project
&
repository. Please wait...
:javascript
$
(
function
(){
$
(
"
#project_name
"
).
live
(
"
change
"
,
function
(){
var
slug
=
slugify
(
$
(
this
).
val
());
$
(
"
#project_code
"
).
val
(
slug
);
$
(
"
#project_path
"
).
val
(
slug
);
});
});
function
slugify
(
text
)
{
return
text
.
replace
(
/
[^
-a-zA-Z0-9
]
+/g
,
'
_
'
).
toLowerCase
();
}
$
(
function
(){
$
(
'
.edit_project
'
).
live
(
'
ajax:before
'
,
function
()
{
$
(
this
).
hide
();
$
(
'
.ajax_loader
'
).
show
();
});
$
(
'
form #project_default_branch
'
).
chosen
();
})
$
(
function
(){
new
Projects
();
});
app/views/projects/new.html.haml
View file @
7b757ee2
%h3
New Project
%hr
=
render
'form'
%div
{
:class
=>
"ajax_loader"
,
:style
=>
"display:none;height:200px;"
}
.project_new_holder
%h3
New Project
%hr
=
render
'form'
%div
.ajax_loader.hide
%center
=
image_tag
"ajax
-
loader.gif"
,
:class
=>
"append-bottom"
%div
.padded
=
image_tag
"ajax
_
loader.gif"
%h3
.prepend-top
Creating project
&
repository. Please wait for few minutes
:javascript
$
(
function
(){
$
(
"
#project_name
"
).
live
(
"
change
"
,
function
(){
var
slug
=
slugify
(
$
(
this
).
val
());
$
(
"
#project_code
"
).
val
(
slug
);
$
(
"
#project_path
"
).
val
(
slug
);
});
});
function
slugify
(
text
)
{
return
text
.
replace
(
/
[^
-a-zA-Z0-9
]
+/g
,
'
_
'
).
toLowerCase
();
}
$
(
function
(){
$
(
'
.new_project
'
).
live
(
'
ajax:before
'
,
function
()
{
$
(
this
).
hide
();
$
(
'
.ajax_loader
'
).
show
();
});
$
(
'
form #project_default_branch
'
).
chosen
();
})
$
(
function
(){
new
Projects
();
});
app/views/projects/update.js.haml
View file @
7b757ee2
...
...
@@ -3,5 +3,6 @@
location.href = "
#{
edit_project_path
(
@project
,
:notice
=>
'Project was successfully updated.'
)
}
";
-
else
:plain
$('.project_edit_holder').show();
$(".edit_project").replaceWith("
#{
escape_javascript
(
render
(
'form'
))
}
");
$('.ajax_loader').hide();
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