ChaseFlorell / jQuery.ProfanityFilter

filter out profane words on the client
https://chaseflorell.github.io/jQuery.ProfanityFilter/demo/
MIT License
110 stars 42 forks source link

Different external swear word files aren't allowed #21

Closed JohanBengtsson closed 8 years ago

JohanBengtsson commented 8 years ago

Since the external swear word files are stored in local storage with the same key "localSwears" it is not possible to use different external swear words files in the same browser/host name. I have fixed this on a local branch with

...

                data = [],
                localSwearsKey = 'localSwears' + options.externalSwears;

            if (options.externalSwears !== null) {
                if (localStorageIsEnabled) {
                    if (localStorage.getItem(localSwearsKey) === null) {
                        // stringify the array so that it can be stored in local storage
                        localStorage.setItem(localSwearsKey, JSON.stringify(readJsonFromController(options.externalSwears)));
                    }
                    badWords = JSON.parse(localStorage.getItem(localSwearsKey));
                } else {

...

in jquery.ProfanityFilter.js

ChaseFlorell commented 8 years ago

This looks good, would you also consider adding a PR on this as well?

JohanBengtsson commented 8 years ago

Sure, just give me the access rights @ChaseFlorell

ChaseFlorell commented 8 years ago

It's just a pull request.

Fork the repo to your own account. Make the changes Submit a PR.

JohanBengtsson commented 8 years ago

Ah ok, I'll try that, thanks. New to this process :)

JohanBengtsson commented 8 years ago

Actually https://github.com/ChaseFlorell/jQuery.ProfanityFilter/pull/24 closes this issue

ChaseFlorell commented 8 years ago

My Mistake. Always good to add it in the PR message... I just overlooked it.