Closed orestbida closed 2 years ago
@orestbida I really think moving the autoclear config away from the languages is the right move. This makes my suggestions in #250 mostly useless.
A few suggestions:
autoclearCookies
/ autoclear
shoud be autoClearCookies
/ autoClear
. Would be even better if we kept only one key, maybe autoClearCookies
as it's more obvious force_consent
should be rename to be more obvious, like disablePageInteraction
or event disableInteractionBeforeConsent
, because it's actually what it does categoryToggle
, why not simply category
so there's no confusion about what it is manageScriptTags
=> interceptScriptTags
? @superbiche yes!
autoclear
→ autoClear
& autoclearCookies
→ autoClearCookies
disablePageInteraction
is the sweet spot. Not as clear as disableInteractionBeforeConsent
, but shorter to say the leastAs for categoryToggle
, I wanted something which hinted at the fact that a toggle (checkbox) would be generated and linked to that specific section/block; category
alone does not convey this. Another suggestion could be linkedCategory
.
disablePageInteraction is the sweet spot
Agreed!
As for categoryToggle, I wanted something which hinted at the fact that a toggle (checkbox) would be generated and linked to that specific section/block;
Yeah I understand. I guess whatever works if it's properly documented.
Callback functions were renamed:
onFirstAction
→ onFirstConsent
onAccept
→ onConsent
Other renames:
acceptBtn
→ acceptAllBtn
rejectBtn
→ acceptNecessaryBtn
auto_lang
→ autoDetect
(now as language
's prop.)current_lang
→ default
(now as language
's prop.)
This issue will serve as a discussion. I'm open to suggestions like better naming proposals, refactoring or anything else which could make the configuration easier/simpler.
Issue: the current configuration object's structure is pretty chaotic, and there is no clear separation between translations and other (logical) config. options.
Proposed big main changes:
snake_case
to thecamelCase
(personal preference: nicer to look at, fewer characters wasted)force_consent
is misleading)json
files)cookie_table
completely optionallanguages
objectRenames:
auto_run
→autoShowModal
page_scripts
→manageScriptTags
force_consent
→disablePageInteraction
camelCase
Although there are a lot of changes, everything that was possible until now should still be achievable relatively easy.
Here is a first example/idea of how the new configuration object could look like, taking into account the above suggested changes: