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
Tatuya Kamada
gitlab-ce
Commits
ecb3f1eb
Commit
ecb3f1eb
authored
Apr 13, 2016
by
Christopher Bartz
Committed by
Rémy Coutable
Aug 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `markdown_preview` routes to `preview_markdown`
parent
a081b842
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
14 deletions
+15
-14
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/dropzone_input.js
app/assets/javascripts/dropzone_input.js
+1
-1
app/assets/javascripts/preview_markdown.js
app/assets/javascripts/preview_markdown.js
+2
-2
app/controllers/projects/wikis_controller.rb
app/controllers/projects/wikis_controller.rb
+1
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-1
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+3
-3
config/routes.rb
config/routes.rb
+2
-2
spec/routing/project_routing_spec.rb
spec/routing/project_routing_spec.rb
+4
-4
No files found.
CHANGELOG
View file @
ecb3f1eb
...
@@ -5,6 +5,7 @@ v 8.11.0 (unreleased)
...
@@ -5,6 +5,7 @@ v 8.11.0 (unreleased)
- Fix don't pass a local variable called `i` to a partial. !20510 (herminiotorres)
- Fix don't pass a local variable called `i` to a partial. !20510 (herminiotorres)
- Fix rename `add_users_into_project` and `projects_ids`. !20512 (herminiotorres)
- Fix rename `add_users_into_project` and `projects_ids`. !20512 (herminiotorres)
- Fix the title of the toggle dropdown button. !5515 (herminiotorres)
- Fix the title of the toggle dropdown button. !5515 (herminiotorres)
- Rename `markdown_preview` routes to `preview_markdown`. (Christopher Bartz)
- Improve diff performance by eliminating redundant checks for text blobs
- Improve diff performance by eliminating redundant checks for text blobs
- Ensure that branch names containing escapable characters (e.g. %20) aren't unescaped indiscriminately. !5770 (ewiltshi)
- Ensure that branch names containing escapable characters (e.g. %20) aren't unescaped indiscriminately. !5770 (ewiltshi)
- Convert switch icon into icon font (ClemMakesApps)
- Convert switch icon into icon font (ClemMakesApps)
...
...
app/assets/javascripts/dropzone_input.js
View file @
ecb3f1eb
/*= require
markdown_preview
*/
/*= require
preview_markdown
*/
(
function
()
{
(
function
()
{
this
.
DropzoneInput
=
(
function
()
{
this
.
DropzoneInput
=
(
function
()
{
...
...
app/assets/javascripts/
markdown_preview
.js
→
app/assets/javascripts/
preview_markdown
.js
View file @
ecb3f1eb
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
};
};
MarkdownPreview
.
prototype
.
renderMarkdown
=
function
(
text
,
success
)
{
MarkdownPreview
.
prototype
.
renderMarkdown
=
function
(
text
,
success
)
{
if
(
!
window
.
markdown_preview
_path
)
{
if
(
!
window
.
preview_markdown
_path
)
{
return
;
return
;
}
}
if
(
text
===
this
.
ajaxCache
.
text
)
{
if
(
text
===
this
.
ajaxCache
.
text
)
{
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
}
}
return
$
.
ajax
({
return
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
url
:
window
.
markdown_preview
_path
,
url
:
window
.
preview_markdown
_path
,
data
:
{
data
:
{
text
:
text
text
:
text
},
},
...
...
app/controllers/projects/wikis_controller.rb
View file @
ecb3f1eb
...
@@ -91,7 +91,7 @@ class Projects::WikisController < Projects::ApplicationController
...
@@ -91,7 +91,7 @@ class Projects::WikisController < Projects::ApplicationController
)
)
end
end
def
markdown_preview
def
preview_markdown
text
=
params
[
:text
]
text
=
params
[
:text
]
ext
=
Gitlab
::
ReferenceExtractor
.
new
(
@project
,
current_user
)
ext
=
Gitlab
::
ReferenceExtractor
.
new
(
@project
,
current_user
)
...
...
app/controllers/projects_controller.rb
View file @
ecb3f1eb
...
@@ -238,7 +238,7 @@ class ProjectsController < Projects::ApplicationController
...
@@ -238,7 +238,7 @@ class ProjectsController < Projects::ApplicationController
}
}
end
end
def
markdown_preview
def
preview_markdown
text
=
params
[
:text
]
text
=
params
[
:text
]
ext
=
Gitlab
::
ReferenceExtractor
.
new
(
@project
,
current_user
)
ext
=
Gitlab
::
ReferenceExtractor
.
new
(
@project
,
current_user
)
...
...
app/views/layouts/project.html.haml
View file @
ecb3f1eb
...
@@ -6,13 +6,13 @@
...
@@ -6,13 +6,13 @@
-
content_for
:scripts_body_top
do
-
content_for
:scripts_body_top
do
-
project
=
@target_project
||
@project
-
project
=
@target_project
||
@project
-
if
@project_wiki
&&
@page
-
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
-
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
-
if
current_user
:javascript
:javascript
window
.
project_uploads_path
=
"
#{
namespace_project_uploads_path
project
.
namespace
,
project
}
"
;
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
-
content_for
:scripts_body
do
=
render
"layouts/init_auto_complete"
if
current_user
=
render
"layouts/init_auto_complete"
if
current_user
...
...
config/routes.rb
View file @
ecb3f1eb
...
@@ -471,7 +471,7 @@ Rails.application.routes.draw do
...
@@ -471,7 +471,7 @@ Rails.application.routes.draw do
post
:unarchive
post
:unarchive
post
:housekeeping
post
:housekeeping
post
:toggle_star
post
:toggle_star
post
:
markdown_preview
post
:
preview_markdown
post
:export
post
:export
post
:remove_export
post
:remove_export
post
:generate_new_export
post
:generate_new_export
...
@@ -660,7 +660,7 @@ Rails.application.routes.draw do
...
@@ -660,7 +660,7 @@ Rails.application.routes.draw do
get
'/wikis/*id'
,
to:
'wikis#show'
,
as:
'wiki'
,
constraints:
WIKI_SLUG_ID
get
'/wikis/*id'
,
to:
'wikis#show'
,
as:
'wiki'
,
constraints:
WIKI_SLUG_ID
delete
'/wikis/*id'
,
to:
'wikis#destroy'
,
constraints:
WIKI_SLUG_ID
delete
'/wikis/*id'
,
to:
'wikis#destroy'
,
constraints:
WIKI_SLUG_ID
put
'/wikis/*id'
,
to:
'wikis#update'
,
constraints:
WIKI_SLUG_ID
put
'/wikis/*id'
,
to:
'wikis#update'
,
constraints:
WIKI_SLUG_ID
post
'/wikis/*id/
markdown_preview'
,
to:
'wikis#markdown_preview'
,
constraints:
WIKI_SLUG_ID
,
as:
'wiki_markdown_preview
'
post
'/wikis/*id/
preview_markdown'
,
to:
'wikis#preview_markdown'
,
constraints:
WIKI_SLUG_ID
,
as:
'wiki_preview_markdown
'
end
end
resource
:repository
,
only:
[
:create
]
do
resource
:repository
,
only:
[
:create
]
do
...
...
spec/routing/project_routing_spec.rb
View file @
ecb3f1eb
...
@@ -60,7 +60,7 @@ end
...
@@ -60,7 +60,7 @@ end
# project GET /:id(.:format) projects#show
# project GET /:id(.:format) projects#show
# PUT /:id(.:format) projects#update
# PUT /:id(.:format) projects#update
# DELETE /:id(.:format) projects#destroy
# DELETE /:id(.:format) projects#destroy
#
markdown_preview_project POST /:id/markdown_preview(.:format) projects#markdown_preview
#
preview_markdown_project POST /:id/preview_markdown(.:format) projects#preview_markdown
describe
ProjectsController
,
'routing'
do
describe
ProjectsController
,
'routing'
do
it
'to #create'
do
it
'to #create'
do
expect
(
post
(
'/projects'
)).
to
route_to
(
'projects#create'
)
expect
(
post
(
'/projects'
)).
to
route_to
(
'projects#create'
)
...
@@ -91,9 +91,9 @@ describe ProjectsController, 'routing' do
...
@@ -91,9 +91,9 @@ describe ProjectsController, 'routing' do
expect
(
delete
(
'/gitlab/gitlabhq'
)).
to
route_to
(
'projects#destroy'
,
namespace_id:
'gitlab'
,
id:
'gitlabhq'
)
expect
(
delete
(
'/gitlab/gitlabhq'
)).
to
route_to
(
'projects#destroy'
,
namespace_id:
'gitlab'
,
id:
'gitlabhq'
)
end
end
it
'to #
markdown_preview
'
do
it
'to #
preview_markdown
'
do
expect
(
post
(
'/gitlab/gitlabhq/
markdown_preview
'
)).
to
(
expect
(
post
(
'/gitlab/gitlabhq/
preview_markdown
'
)).
to
(
route_to
(
'projects#
markdown_preview
'
,
namespace_id:
'gitlab'
,
id:
'gitlabhq'
)
route_to
(
'projects#
preview_markdown
'
,
namespace_id:
'gitlab'
,
id:
'gitlabhq'
)
)
)
end
end
end
end
...
...
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