Skip to content

Commit

Permalink
feat: Toggle code editor (#60)
Browse files Browse the repository at this point in the history
* feat: Toggle code editor

Enable editing post content mark up with the plain text editor.

* task: Capture build output

* fix: Clean up switch editor mode global

Avoid unexpected lingering globals.

* task: Capture build output

* feat: Reduce code editor text size and line height

Prioritize displaying more of the verbose content on the screen.

* task: Capture build output
  • Loading branch information
dcalhoun authored Jan 16, 2025
1 parent 39949fd commit cc52214
Show file tree
Hide file tree
Showing 14 changed files with 238 additions and 138 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ class GutenbergView : WebView {
private var openMediaLibraryListener: OpenMediaLibraryListener? = null
private var editorDidBecomeAvailableListener: EditorAvailableListener? = null

var textEditorEnabled: Boolean = false
set(value) {
field = value
val mode = if (value) "text" else "visual"
handler.post {
this.evaluateJavascript("editor.switchEditorMode('$mode');", null)
}
}

fun setContentChangeListener(listener: ContentChangeListener) {
contentChangeListener = listener
}
Expand Down

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cc52214

Please sign in to comment.