@@ -9,18 +9,18 @@ const parseJSONText = (jsonText) => {
99
1010// updates email Live Preview
1111const onCodeMirrorChange = ( editor ) => {
12-
12+
1313 $ ( "#templatePreview" ) . attr ( "srcDoc" , editor . getValue ( ) ) ;
1414
1515 // get variables enclosed with {} from editor
1616 let variables =
1717 editor . getValue ( ) . match ( / (?< = \{ { 2 } ) [ A - Z a - z _ ] + [ a - z A - Z 0 - 9 _ f ] * (? = \} { 2 } ) / g) || [ ] ;
18-
18+
1919 const fillVars = parseJSONText (
2020 window . fillVarsCodeMirrorEditor . getValue ( )
2121 ) ;
2222
23-
23+
2424 const newFillVars = `{\n ${ variables
2525 . map ( ( variable ) => `"${ variable } ": "${ fillVars [ variable ] || "" } "` )
2626 . join ( ",\n " ) } \n}`;
@@ -59,7 +59,7 @@ const onFillVarsChange = (editor) => {
5959
6060const onFillVarsSave = ( ) => {
6161 previousFillVarsText = window . fillVarsCodeMirrorEditor . getValue ( )
62-
62+
6363 const lcFillVars = parseJSONText ( localStorage . getItem ( "fillVars" ) ) ;
6464
6565 const newLcFillVars = {
@@ -105,7 +105,7 @@ function listenToCodeMirror() {
105105 // restore previous fillVars for this template
106106 const lcFillVars = parseJSONText ( localStorage . getItem ( "fillVars" ) ) ;
107107 const newFillVarsText = JSON . stringify ( lcFillVars [ templateName ] || { } , null , 2 ) ;
108-
108+
109109 editor . on ( "change" , onCodeMirrorChange ) ;
110110 varsEditor . on ( "change" , onFillVarsChange ) ;
111111
@@ -132,7 +132,7 @@ function onUploadImageChange({ target: { files } }) {
132132 }
133133
134134 formData . append ( "file" , files [ 0 ] ) ;
135- formData . append ( "region" , localStorage . getItemItem ( "region" ) ) ;
135+ formData . append ( "region" , localStorage . getItem ( "region" ) ) ;
136136
137137 $ . ajax ( {
138138 type : "POST" ,
0 commit comments