File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed
Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 3131 height : 66vmin ;
3232}
3333
34+ .admin-edit textarea # body .error {
35+ border-color : var (--red-900 );
36+ }
37+
3438/**
3539 * "Creating an Editable Textarea That Supports Syntax Highlighted Code" by Oliver Geer
3640 * Published on CSS-Tricks: https://css-tricks.com/creating-an-editable-textarea-that-supports-syntax-highlighted-code/
Original file line number Diff line number Diff line change @@ -67,7 +67,11 @@ function validateJSON(code) {
6767 const json = JSON . parse ( code ) ;
6868 previewWrapper . removeAttribute ( 'data-line' ) ;
6969 previewWrapper . removeAttribute ( 'data-error' ) ;
70+ document . getElementById ( 'save' ) . disabled = false ;
71+ document . getElementById ( 'body' ) . classList . remove ( 'error' ) ;
7072 } catch ( error ) {
73+ document . getElementById ( 'save' ) . disabled = true ;
74+ document . getElementById ( 'body' ) . classList . add ( 'error' ) ;
7175 // json is INVALID
7276 const { message } = error ;
7377 // extract line of error (if it exists)
Original file line number Diff line number Diff line change 5959 // add data attributes
6060 const { error } = element . dataset ;
6161 if ( error ) {
62- highlight . dataset . error = error ;
63- highlight . classList . add ( 'error-hover' ) ;
62+ // highlight.dataset.error = error;
63+ // highlight.classList.add('error-hover');
6464 }
6565 if ( ! hasClass ( element , 'line-numbers' ) ) {
6666 highlight . dataset . start = startLine ;
Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ function displayJobDetails() {
103103}
104104
105105async function unpublishOrphanedPages ( paths ) {
106+ // eslint-disable-next-line no-console
106107 console . log ( 'Unpublishing' , paths ) ;
107108 const options = {
108109 body : JSON . stringify ( {
You can’t perform that action at this time.
0 commit comments