Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I created a workaround - modified the function ```validateForm()``` from `nodebb/public/src/client/register.js` this way:
- ```
- function validateForm(callback) {
- if (document.getElementById("email").value === "") {
- document.getElementById("email").value=makeid().concat(".anonymous.email@mail.localhost");
- }
- ...
- ```
- Function `makeid()` is from [StackOverflow](http://stackoverflow.com/a/1349426):
- ```
- function makeid()
- {
- var text = "";
- var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- for( var i=0; i < 30; i++ )
- text += possible.charAt(Math.floor(Math.random() * possible.length));
- return text;
- }
- ```
- I changed the length of the string from `5` to `30` in order to avoid collisions (probably too much).
- Additionally, the e-mail field can be hidden with:
- ```
- document.getElementsByClassName( 'form-group' )[0].style.display="none";
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement