diff options
author | Robert Speicher <robert@gitlab.com> | 2016-08-11 19:06:56 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-08-11 19:06:56 +0300 |
commit | 5a33bc984abfb4ee6243c00bbcc71ccd086d2266 (patch) | |
tree | 493ae70072eb30de51a6682c9630b6604c33c8c3 /app | |
parent | 4c29c25497c9a20a5d1f57cd287123cd41edad96 (diff) | |
parent | ecb3f1eb6c87ab40108a5d71a3287a205ab6fefb (diff) |
Merge branch '15000-rename-markdown-preview' into 'master'
Rename `markdown_preview` routes to `preview_markdown`
_Originally opened at !3700 by @cbartz._
Closes #15000.
See merge request !5774
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/dropzone_input.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/preview_markdown.js (renamed from app/assets/javascripts/markdown_preview.js) | 4 | ||||
-rw-r--r-- | app/controllers/projects/wikis_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects_controller.rb | 2 | ||||
-rw-r--r-- | app/views/layouts/project.html.haml | 6 |
5 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js index 288cce04f87..4a6fea929c7 100644 --- a/app/assets/javascripts/dropzone_input.js +++ b/app/assets/javascripts/dropzone_input.js @@ -1,5 +1,5 @@ -/*= require markdown_preview */ +/*= require preview_markdown */ (function() { this.DropzoneInput = (function() { diff --git a/app/assets/javascripts/markdown_preview.js b/app/assets/javascripts/preview_markdown.js index 18fc7bae09a..5fd75799640 100644 --- a/app/assets/javascripts/markdown_preview.js +++ b/app/assets/javascripts/preview_markdown.js @@ -28,7 +28,7 @@ }; MarkdownPreview.prototype.renderMarkdown = function(text, success) { - if (!window.markdown_preview_path) { + if (!window.preview_markdown_path) { return; } if (text === this.ajaxCache.text) { @@ -36,7 +36,7 @@ } return $.ajax({ type: 'POST', - url: window.markdown_preview_path, + url: window.preview_markdown_path, data: { text: text }, diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb index 607fe9c7fed..177ccf5eec9 100644 --- a/app/controllers/projects/wikis_controller.rb +++ b/app/controllers/projects/wikis_controller.rb @@ -91,7 +91,7 @@ class Projects::WikisController < Projects::ApplicationController ) end - def markdown_preview + def preview_markdown text = params[:text] ext = Gitlab::ReferenceExtractor.new(@project, current_user) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 207f9d6a77f..47efbd4a939 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -238,7 +238,7 @@ class ProjectsController < Projects::ApplicationController } end - def markdown_preview + def preview_markdown text = params[:text] ext = Gitlab::ReferenceExtractor.new(@project, current_user) diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index ee9c0366f2b..9fe94291db7 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -6,13 +6,13 @@ - content_for :scripts_body_top do - project = @target_project || @project - if @project_wiki && @page - - markdown_preview_path = namespace_project_wiki_markdown_preview_path(project.namespace, project, @page.slug) + - preview_markdown_path = namespace_project_wiki_preview_markdown_path(project.namespace, project, @page.slug) - else - - markdown_preview_path = markdown_preview_namespace_project_path(project.namespace, project) + - preview_markdown_path = preview_markdown_namespace_project_path(project.namespace, project) - if current_user :javascript window.project_uploads_path = "#{namespace_project_uploads_path project.namespace,project}"; - window.markdown_preview_path = "#{markdown_preview_path}"; + window.preview_markdown_path = "#{preview_markdown_path}"; - content_for :scripts_body do = render "layouts/init_auto_complete" if current_user |