orestbida / cookieconsent

:cookie: Simple cross-browser cookie-consent plugin written in vanilla js
https://playground.cookieconsent.orestbida.com/
MIT License
3.85k stars 405 forks source link

Enhancement: move ccb_cookies_table th to language file #4

Closed adelmazza closed 3 years ago

adelmazza commented 3 years ago

All the table header field names of ccb_cookies_table are currently hardcoded on cookieconsent.js As an enhacement request, plese move the TH to the language file.

Name | Domain | Description | Expiration | Type

Thanks a lot!

orestbida commented 3 years ago

yea, sure, update should arrive ~ by saturday.

orestbida commented 3 years ago

update is up. You can now define custom table headers by using the ccb_table_headers prop as:

ccb_table_headers : [
    {th1: "Name"}, 
    {th2: "Domain"}, 
    {th3: "Expiration"}
],

where th1, th2, ... are now used as keys for ccb_cookies_table(th1, th2 are not keywords, you can choose whatever you want, just make sure they match the keys used in ccb_cookies_table) :

ccb_cookies_table: [
    {
        th1: 'darkmode',
        th2: 'orestbida.com',
        th3: 'One week after the cookie has been created',
    }
]

From now on the ccb_table_headers is required, should you create tables. Check the full example config for a better idea Example config