fix preview
This commit is contained in:
parent
3004074e2e
commit
2175a898be
|
@ -57,7 +57,7 @@ CommentsController = (Comment, Preview, confirmMessage, $scope, compileHTML, $ro
|
||||||
|
|
||||||
promise = Preview.get_preview(vm.project, body)
|
promise = Preview.get_preview(vm.project, body)
|
||||||
promise.success( (response) ->
|
promise.success( (response) ->
|
||||||
vm.preview_body = response
|
vm.preview_body = response.html
|
||||||
Preview.old_text = body
|
Preview.old_text = body
|
||||||
).error( (response) ->
|
).error( (response) ->
|
||||||
vm.preview_body = 'Error :('
|
vm.preview_body = 'Error :('
|
||||||
|
|
|
@ -46,7 +46,7 @@ IssueController = (dataservice, $http, Issue, $rootScope, Preview, Label, confir
|
||||||
|
|
||||||
promise = Preview.get_preview(vm.project, body)
|
promise = Preview.get_preview(vm.project, body)
|
||||||
promise.success( (response) ->
|
promise.success( (response) ->
|
||||||
vm.preview_body = response
|
vm.preview_body = response.html
|
||||||
Preview.old_text = body
|
Preview.old_text = body
|
||||||
).error( (response) ->
|
).error( (response) ->
|
||||||
vm.preview_body = 'Error :('
|
vm.preview_body = 'Error :('
|
||||||
|
|
|
@ -4,14 +4,8 @@ previewService = ($http) ->
|
||||||
old_text: old_text
|
old_text: old_text
|
||||||
get_preview: (name_with_owner, text, old_text) ->
|
get_preview: (name_with_owner, text, old_text) ->
|
||||||
return null if text is old_text
|
return null if text is old_text
|
||||||
path = Routes.project_md_preview_path(
|
path = Routes.project_md_preview_path(name_with_owner)
|
||||||
{
|
$http.post(path, {text: text})
|
||||||
name_with_owner: name_with_owner,
|
|
||||||
text: text
|
|
||||||
}
|
|
||||||
)
|
|
||||||
$http.post(path)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
angular
|
angular
|
||||||
|
|
|
@ -166,7 +166,10 @@ class Projects::ProjectsController < Projects::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def preview
|
def preview
|
||||||
render inline: view_context.markdown(params[:text]), layout: false
|
respond_to do |format|
|
||||||
|
format.json {}
|
||||||
|
format.html {render inline: view_context.markdown(params[:text]), layout: false}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def refs_list
|
def refs_list
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
json.html markdown(params[:text])
|
Loading…
Reference in New Issue