mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
Merge branch 'feature/encryption' into v0.2.15-RC
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* FixIt decryptor for encrypted pages
|
||||
* FixIt decryptor for encrypted pages and fixit-encryptor shortcode
|
||||
* @param {Object} options
|
||||
* @param {Function} [options.decrypted] [Lifecycle Hooks] handler after decrypting
|
||||
* @param {Function} [options.reset] [Lifecycle Hooks] handler after encrypting again
|
||||
@@ -45,7 +45,7 @@ FixItDecryptor = function (options = {}) {
|
||||
this.addEventListener('decrypted', this.options?.decrypted);
|
||||
this.addEventListener('reset', this.options?.reset);
|
||||
this.validateCache();
|
||||
|
||||
|
||||
const _decryptor = this;
|
||||
this.$el.querySelector('#fixit-decryptor-input')?.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Enter') {
|
||||
@@ -135,7 +135,7 @@ FixItDecryptor = function (options = {}) {
|
||||
'afterbegin',
|
||||
CryptoJS.enc.Base64.parse(base64EncodeContent).toString(CryptoJS.enc.Utf8)
|
||||
);
|
||||
$decryptor.parentElement.classList.add('decrypted')
|
||||
$decryptor.parentElement.classList.add('decrypted');
|
||||
} catch (err) {
|
||||
return console.error(err);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{{ if $params.password -}}
|
||||
***{{ T "encryptedAbstract" }}***
|
||||
{{- else -}}
|
||||
{{ .RawContent }}
|
||||
{{ .RawContent | replaceRE "\n?{{% fixit-encryptor .+ %}}((\n|.)*){{% /fixit-encryptor %}}\n?" "" }}
|
||||
{{- end }}
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user