diff --git a/assets/js/misuzu/forum/editor.js b/assets/js/misuzu/forum/editor.js index 2afd01f..4c60ccd 100644 --- a/assets/js/misuzu/forum/editor.js +++ b/assets/js/misuzu/forum/editor.js @@ -149,26 +149,26 @@ Misuzu.Forum.Editor.init = function() { }; uploadTask.onComplete = function(fileInfo) { - const parserMode = parseInt(postingParser.value); - let insertText = location.protocol + fileInfo.url; - - if(parserMode == 1) { // bbcode - if(fileInfo.isImage()) - insertText = '[img]' + fileInfo.url + '[/img]'; - else if(fileInfo.isAudio()) - insertText = '[audio]' + fileInfo.url + '[/audio]'; - else if(fileInfo.isVideo()) - insertText = '[video]' + fileInfo.url + '[/video]'; - } else if(parserMode == 2) { // markdown - if(fileInfo.isMedia()) - insertText = '![](' + fileInfo.url + ')'; - } - uploadElem.classList.add('eeprom-widget-file-done'); uploadElemName.href = fileInfo.url; uploadElemProgressText.textContent = ''; const insertTheLinkIntoTheBoxEx2 = function() { + const parserMode = parseInt(postingParser.value); + let insertText = location.protocol + fileInfo.url; + + if(parserMode == 1) { // bbcode + if(fileInfo.isImage()) + insertText = '[img]' + fileInfo.url + '[/img]'; + else if(fileInfo.isAudio()) + insertText = '[audio]' + fileInfo.url + '[/audio]'; + else if(fileInfo.isVideo()) + insertText = '[video]' + fileInfo.url + '[/video]'; + } else if(parserMode == 2) { // markdown + if(fileInfo.isMedia()) + insertText = '![](' + fileInfo.url + ')'; + } + $insertTags(postingText, insertText, ''); postingText.value = postingText.value.trim(); };