summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <me@douwe.me>2016-01-11 14:31:55 +0100
committerDouwe Maan <me@douwe.me>2016-01-11 14:31:55 +0100
commitd89ad5078dae250683c240b62eee8aeb9442b150 (patch)
tree06dcdff43d4dbefd823e923b656d23d229b6dab9 /app
parentf41b535ced0cdddb67661bdb0a6216216dc6b89c (diff)
parenta789dcaeb3958cf7b2f74d394b646f34297ff3a1 (diff)
downloadgitlab-ce-d89ad5078dae250683c240b62eee8aeb9442b150.tar.gz
Merge pull request #9960 from huacnlee/fix/do-not-use-coffeescript-in-erb
use JavaScript instead of CoffeeScript in Views for master
Diffstat (limited to 'app')
-rw-r--r--app/views/projects/_home_panel.html.haml4
-rw-r--r--app/views/projects/find_file/show.html.haml12
-rw-r--r--app/views/votes/_votes_block.html.haml30
3 files changed, 24 insertions, 22 deletions
diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml
index 0f61e623396..53eec76129b 100644
--- a/app/views/projects/_home_panel.html.haml
+++ b/app/views/projects/_home_panel.html.haml
@@ -52,5 +52,5 @@
= render 'projects/buttons/notifications'
-:coffeescript
- new Star() \ No newline at end of file
+:javascript
+ new Star();
diff --git a/app/views/projects/find_file/show.html.haml b/app/views/projects/find_file/show.html.haml
index 2930209fb56..40a2a61d8a1 100644
--- a/app/views/projects/find_file/show.html.haml
+++ b/app/views/projects/find_file/show.html.haml
@@ -18,10 +18,10 @@
%tbody
= spinner nil, true
-:coffeescript
- projectFindFile = new ProjectFindFile($(".file-finder-holder"), {
- 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))}"
+:javascript
+ var projectFindFile = new ProjectFindFile($(".file-finder-holder"), {
+ 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))}",
blobUrlTemplate: "#{escape_javascript(namespace_project_blob_path(@project.namespace, @project, @id || @commit.id))}"
- })
- new ShortcutsFindFile(projectFindFile)
+ });
+ new ShortcutsFindFile(projectFindFile);
diff --git a/app/views/votes/_votes_block.html.haml b/app/views/votes/_votes_block.html.haml
index ce0a0113403..b1f8645eea0 100644
--- a/app/views/votes/_votes_block.html.haml
+++ b/app/views/votes/_votes_block.html.haml
@@ -20,27 +20,29 @@
= emoji_icon(emoji["name"], emoji["unicode"], emoji["aliases"])
- if current_user
- :coffeescript
- post_emoji_url = "#{award_toggle_namespace_project_notes_path(@project.namespace, @project)}"
- noteable_type = "#{votable.class.name.underscore}"
- noteable_id = "#{votable.id}"
- aliases = #{AwardEmoji.aliases.to_json}
+ :javascript
+ var post_emoji_url = "#{award_toggle_namespace_project_notes_path(@project.namespace, @project)}";
+ var noteable_type = "#{votable.class.name.underscore}";
+ var noteable_id = "#{votable.id}";
+ var aliases = #{AwardEmoji.aliases.to_json};
window.awards_handler = new AwardsHandler(
post_emoji_url,
noteable_type,
noteable_id,
aliases
- )
+ );
- $(".awards").on "click", ".emoji-menu-content li", (e) ->
- emoji = $(this).find(".emoji-icon").data("emoji")
- awards_handler.addAward(emoji)
+ $(".awards").on("click", ".emoji-menu-content li", function(e) {
+ var emoji = $(this).find(".emoji-icon").data("emoji");
+ awards_handler.addAward(emoji);
+ });
- $(".awards").on "click", ".award", (e) ->
- emoji = $(this).find(".icon").data("emoji")
- awards_handler.addAward(emoji)
+ $(".awards").on("click", ".award", function(e) {
+ var emoji = $(this).find(".icon").data("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});