add title in code block
parent
566ab02f5a
commit
9fd57f52ad
|
@ -215,6 +215,7 @@
|
|||
},
|
||||
"WYSIWYG": {
|
||||
"CODE_SNIPPET": "Code Snippet",
|
||||
"DB_CLICK": "double click to edit",
|
||||
"SELECT_LANGUAGE_PLACEHOLDER": "Select Language",
|
||||
"SELECT_LANGUAGE_REMOVE_FORMATING": "Remove formatting",
|
||||
"OUTDATED": "Another person has made changes while you were editing. Check the new version on the activiy tab before you save your changes.",
|
||||
|
|
|
@ -87,6 +87,8 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
# prevent edit a pre
|
||||
pre.setAttribute('contenteditable', false)
|
||||
|
||||
pre.setAttribute('title', $translate.instant("COMMON.WYSIWYG.DB_CLICK"))
|
||||
|
||||
if pre.nextElementSibling && pre.nextElementSibling.nodeName.toLowerCase() == 'p' && !pre.nextElementSibling.children.length
|
||||
pre.nextElementSibling.appendChild(document.createElement('br'))
|
||||
|
||||
|
@ -207,6 +209,9 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
wysiwygCodeHightlighterService.getLanguages().then (codeLans) ->
|
||||
$scope.codeLans = codeLans
|
||||
|
||||
setEditMode = (editMode) ->
|
||||
$scope.editMode = editMode
|
||||
|
||||
setHtmlMedium = (markdown) ->
|
||||
html = wysiwygService.getHTML(markdown)
|
||||
editorMedium.html(html)
|
||||
|
@ -271,7 +276,7 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
e.preventDefault() if e
|
||||
|
||||
if !isEditOnly
|
||||
$scope.editMode = false
|
||||
setEditMode(false)
|
||||
|
||||
if notPersist
|
||||
clean()
|
||||
|
@ -296,7 +301,7 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
$scope.saving = false
|
||||
|
||||
if !isEditOnly
|
||||
$scope.editMode = false
|
||||
setEditMode(false)
|
||||
|
||||
if notPersist
|
||||
clean()
|
||||
|
@ -481,7 +486,7 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
mediumInstance.subscribe 'focus', (event) ->
|
||||
$scope.$applyAsync () ->
|
||||
if !$scope.editMode
|
||||
$scope.editMode = true
|
||||
setEditMode(true)
|
||||
|
||||
mediumInstance.subscribe 'editableDrop', (event) ->
|
||||
$scope.onUploadFile({files: event.dataTransfer.files, cb: uploadEnd})
|
||||
|
@ -503,7 +508,7 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
else if code == 27
|
||||
editorMedium.blur()
|
||||
|
||||
$scope.editMode = editMode
|
||||
setEditMode(editMode)
|
||||
|
||||
$scope.$applyAsync () ->
|
||||
wysiwygCodeHightlighterService.addHightlighter(mediumInstance.elements[0])
|
||||
|
@ -523,7 +528,7 @@ Medium = ($translate, $confirm, $storage, wysiwygService, animationFrame, tgLoad
|
|||
$scope.outdated = isOutdated()
|
||||
|
||||
if !mediumInstance && isDraft()
|
||||
$scope.editMode = true
|
||||
setEditMode(true)
|
||||
|
||||
if ($scope.markdown.length || content.length) && $scope.markdown == content
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue