Skip to content

Commit

Permalink
Add discrete preview buttons for MD and HTML files
Browse files Browse the repository at this point in the history
  • Loading branch information
LyubomirT committed Feb 10, 2024
1 parent 5fad466 commit da49ae9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
<div id="run-panel" class="sub-panel">
<div class="sub-button" id="run-button"><i class="fas fa-play"></i> Run Code</div>
<div class="sub-button" id="preview-button"><i class="fas fa-eye"></i> Preview MD/HTML</div>
<div class="sub-button hidden" id="preview-md-button"><i class="fas fa-eye"></i> Preview MD</div>
<div class="sub-button hidden" id="preview-html-button"><i class="fas fa-eye"></i> Preview HTML</div>
<div class="sub-button" id="ext-rest-button"><i class="fas fa-ban"></i> Toggle ExtRes</div>
<div class="sub-button" id="set-run-command-button"><i class="fas fa-cog"></i> Set Run Command</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ const confirmClearPrefsModalNo = document.getElementById('no-clear-prefs-button'
const runCommandInput = document.getElementById('run-command-input')
const setRunCommandModal = document.getElementById('set-run-command-modal')
const setRunCommandModalBtn = document.getElementById('set-run-command-button-nointerference')
const previewmdButton = document.getElementById('preview-md-button')
const previewhtmlButton = document.getElementById('preview-html-button')


let maximized = false
Expand Down Expand Up @@ -151,11 +153,17 @@ toggleExtRestriction.addEventListener('click', () => {
toggleExtRestriction.innerHTML = '<i class="fas fa-ban"></i> Toggle ExtRes (Off)'
extRestriction.innerHTML = 'Custom Run Command'
show(setRunCommandBtn)
show(previewhtmlButton)
show(previewmdButton)
hide(previewMDorHTML)
} else {
extRestrictionOn = true
toggleExtRestriction.innerHTML = '<i class="fas fa-ban"></i> Toggle ExtRes (On)'
extRestriction.innerHTML = 'Restricted By Extension'
hide(setRunCommandBtn)
hide(previewhtmlButton)
hide(previewmdButton)
show(previewMDorHTML)
}
preferences.extRestrictionOn = extRestrictionOn
savePreferences()
Expand Down

0 comments on commit da49ae9

Please sign in to comment.