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
Boxiang Sun
gitlab-ce
Commits
a789dcae
Commit
a789dcae
authored
Jan 11, 2016
by
Jason Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use JavaScript instead of CoffeeScript in Views, the reason #9819
parent
70cba8e9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
22 deletions
+24
-22
app/views/projects/_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+2
-2
app/views/projects/find_file/show.html.haml
app/views/projects/find_file/show.html.haml
+6
-6
app/views/votes/_votes_block.html.haml
app/views/votes/_votes_block.html.haml
+16
-14
No files found.
app/views/projects/_home_panel.html.haml
View file @
a789dcae
...
@@ -52,5 +52,5 @@
...
@@ -52,5 +52,5 @@
=
render
'projects/buttons/notifications'
=
render
'projects/buttons/notifications'
:coffeescript
:javascript
new Star()
new
Star
();
\ No newline at end of file
app/views/projects/find_file/show.html.haml
View file @
a789dcae
...
@@ -18,10 +18,10 @@
...
@@ -18,10 +18,10 @@
%tbody
%tbody
=
spinner
nil
,
true
=
spinner
nil
,
true
:
coffee
script
:
java
script
projectFindFile = new ProjectFindFile($(".file-finder-holder"), {
var
projectFindFile
=
new
ProjectFindFile
(
$
(
"
.file-finder-holder
"
),
{
url: "
#{
escape_javascript
(
namespace_project_files_path
(
@project
.
namespace
,
@project
,
@ref
,
@options
.
merge
(
format: :json
)))
}
"
url
:
"
#{
escape_javascript
(
namespace_project_files_path
(
@project
.
namespace
,
@project
,
@ref
,
@options
.
merge
(
format: :json
)))
}
"
,
treeUrl: "
#{
escape_javascript
(
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@ref
))
}
"
treeUrl
:
"
#{
escape_javascript
(
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@ref
))
}
"
,
blobUrlTemplate
:
"
#{
escape_javascript
(
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
@id
||
@commit
.
id
))
}
"
blobUrlTemplate
:
"
#{
escape_javascript
(
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
@id
||
@commit
.
id
))
}
"
})
})
;
new ShortcutsFindFile(projectFindFile)
new
ShortcutsFindFile
(
projectFindFile
)
;
app/views/votes/_votes_block.html.haml
View file @
a789dcae
...
@@ -20,27 +20,29 @@
...
@@ -20,27 +20,29 @@
=
emoji_icon
(
emoji
[
"name"
],
emoji
[
"unicode"
],
emoji
[
"aliases"
])
=
emoji_icon
(
emoji
[
"name"
],
emoji
[
"unicode"
],
emoji
[
"aliases"
])
-
if
current_user
-
if
current_user
:
coffee
script
:
java
script
post_emoji_url = "
#{
award_toggle_namespace_project_notes_path
(
@project
.
namespace
,
@project
)
}
"
var
post_emoji_url
=
"
#{
award_toggle_namespace_project_notes_path
(
@project
.
namespace
,
@project
)
}
"
;
noteable_type = "
#{
votable
.
class
.
name
.
underscore
}
"
var
noteable_type
=
"
#{
votable
.
class
.
name
.
underscore
}
"
;
noteable_id = "
#{
votable
.
id
}
"
var
noteable_id
=
"
#{
votable
.
id
}
"
;
aliases =
#{
AwardEmoji
.
aliases
.
to_json
}
var
aliases
=
#{
AwardEmoji
.
aliases
.
to_json
}
;
window
.
awards_handler
=
new
AwardsHandler
(
window
.
awards_handler
=
new
AwardsHandler
(
post_emoji_url
,
post_emoji_url
,
noteable_type
,
noteable_type
,
noteable_id
,
noteable_id
,
aliases
aliases
)
)
;
$(".awards").on "click", ".emoji-menu-content li", (e) ->
$
(
"
.awards
"
).
on
(
"
click
"
,
"
.emoji-menu-content li
"
,
function
(
e
)
{
emoji = $(this).find(".emoji-icon").data("emoji")
var
emoji
=
$
(
this
).
find
(
"
.emoji-icon
"
).
data
(
"
emoji
"
);
awards_handler.addAward(emoji)
awards_handler
.
addAward
(
emoji
);
});
$(".awards").on "click", ".award", (e) ->
$
(
"
.awards
"
).
on
(
"
click
"
,
"
.award
"
,
function
(
e
)
{
emoji = $(this).find(".icon").data("emoji")
var
emoji
=
$
(
this
).
find
(
"
.icon
"
).
data
(
"
emoji
"
);
awards_handler.addAward(emoji)
awards_handler
.
addAward
(
emoji
);
});
$(".award").tooltip()
$
(
"
.award
"
).
tooltip
()
;
$(".emoji-menu-content").niceScroll({cursorwidth: "7px", autohidemode: false})
$
(
"
.emoji-menu-content
"
).
niceScroll
({
cursorwidth
:
"
7px
"
,
autohidemode
:
false
})
;
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