@@ -16,6 +16,7 @@ module.exports = function () {
1616 var ai_task_list = new Object ( ) ;
1717 var is_cnt_article_encrypted = false ;
1818 var password_if_enabled_encryption_for_article = "" ;
19+ let encrypted_orginal_content_if_encrypted ;
1920
2021 if ( path . indexOf ( "/data/articles/" ) !== - 1 ) {
2122 // article
@@ -30,6 +31,8 @@ module.exports = function () {
3031 keyboard : false ,
3132 } ) ;
3233 encryptionOptionsModal . show ( ) ;
34+ encrypted_orginal_content_if_encrypted = original_content ;
35+ original_content = "" ;
3336 document . getElementById ( "encryptionOptionsModalBody" ) . innerHTML = `<div class="mb-3">
3437 <label class="form-label"><i class="fa fa-password"></i> ${ langdata . INPUT_A_PASSWORD [ lang_name ] } </label>
3538 <input class="form-control" placeholder="${ langdata . INPUT_A_PASSWORD [ lang_name ] } " value="" id="article_password_modal_value">
@@ -41,6 +44,7 @@ module.exports = function () {
4144
4245 document . getElementById ( "encryptionOptionsModalStartEditingBtn" ) . addEventListener ( "click" , ( ) => {
4346 password_if_enabled_encryption_for_article = document . getElementById ( "article_password_modal_value" ) . value ;
47+ original_content = encrypted_orginal_content_if_encrypted ;
4448 original_content = decrypt_content ( original_content , password_if_enabled_encryption_for_article ) ;
4549 document . getElementById ( "editor_textarea" ) . value = original_content ;
4650 encryptionOptionsModal . hide ( ) ;
@@ -123,7 +127,6 @@ ${langdata["CURRENTLY_EDITING"][lang_name]}“${title}”`+document.getElementBy
123127 document . getElementById ( "third-wrapper" ) . style . display = "" ;
124128 document . getElementById ( "ai_related_functions_in_editor" ) . style . display = "none" ;
125129 document . getElementById ( "btn_help" ) . style . display = "none" ;
126- document . getElementById ( "btn_change_to_default_editor" ) . style . display = "none" ;
127130 document . getElementById ( "btn_save_changes" ) . style . display = "none" ;
128131 }
129132
@@ -133,7 +136,6 @@ ${langdata["CURRENTLY_EDITING"][lang_name]}“${title}”`+document.getElementBy
133136 document . getElementById ( "third-wrapper" ) . style . display = "none" ;
134137 document . getElementById ( "ai_related_functions_in_editor" ) . style . display = "" ;
135138 document . getElementById ( "btn_help" ) . style . display = "" ;
136- document . getElementById ( "btn_change_to_default_editor" ) . style . display = "" ;
137139 document . getElementById ( "btn_save_changes" ) . style . display = "" ;
138140 }
139141
@@ -391,7 +393,7 @@ ${langdata["CURRENTLY_EDITING"][lang_name]}“${title}”`+document.getElementBy
391393 } ;
392394
393395 document . getElementById ( "btn_save_changes" ) . onclick = markdown_editor_save_changes ;
394-
396+ /*
395397 document.getElementById("btn_change_to_default_editor").onclick=function(){
396398 function to_default() {
397399 writeFileSync(`${rootDir}/${path}`, document.getElementById("editor_textarea").value);
@@ -431,7 +433,7 @@ ${langdata["CURRENTLY_EDITING"][lang_name]}“${title}”`+document.getElementBy
431433 }
432434 default_editor = !default_editor;
433435 };
434-
436+ */
435437 document . onkeydown = function ( event ) {
436438 let toReturn = true ;
437439 if ( event . ctrlKey || event . metaKey ) { // detect ctrl or cmd
0 commit comments