From 1544b45af5435fde1190634dc44b65ca6ab55238 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Mon, 25 Mar 2019 17:41:51 +0100 Subject: Move upload button into toolbar Currently we have the odd situation to have two toolbars. One inside the header and one in the editor. Since we only show the image upload button when the editor is visible we should move the upload button into the editor toolbar. This patch does this by adding the image upload button besides the image tag button. Signed-off-by: Sheogorath --- public/js/index.js | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'public/js/index.js') diff --git a/public/js/index.js b/public/js/index.js index 76f952c1..c59c94d0 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -304,7 +304,6 @@ var editor = editorInstance.init(textit) // FIXME: global referncing in jquery-textcomplete patch window.editor = editor -var inlineAttach = inlineAttachment.editors.codemirror4.attach(editor) defaultTextHeight = parseInt($('.CodeMirror').css('line-height')) // initalize ui reference @@ -801,7 +800,6 @@ function changeMode (type) { editor.getInputField().blur() } if (appState.currentMode === modeType.edit || appState.currentMode === modeType.both) { - ui.toolbar.uploadImage.fadeIn() // add and update status bar if (!editorInstance.statusBar) { editorInstance.addStatusBar() @@ -814,8 +812,6 @@ function changeMode (type) { // work around foldGutter might not init properly editor.setOption('foldGutter', false) editor.setOption('foldGutter', true) - } else { - ui.toolbar.uploadImage.fadeOut() } if (appState.currentMode !== modeType.edit) { $(document.body).css('background-color', 'white') @@ -1051,17 +1047,6 @@ ui.toolbar.import.snippet.click(function () { ui.spinner.hide() }) }) -// import from clipboard -ui.toolbar.import.clipboard.click(function () { - // na -}) -// upload image -ui.toolbar.uploadImage.bind('change', function (e) { - var files = e.target.files || e.dataTransfer.files - e.dataTransfer = {} - e.dataTransfer.files = files - inlineAttach.onDrop(e) -}) // toc ui.toc.dropdown.click(function (e) { e.stopPropagation() -- cgit v1.2.3