Add some more reserved names.

This commit is contained in:
Ismail Badawi 2014-05-14 14:15:00 -04:00
parent 66c7b64d01
commit 269d50ef18
1 changed files with 19 additions and 2 deletions

View File

@ -49,7 +49,24 @@
if (!match) return false if (!match) return false
// must not be a reserved `username` // must not be a reserved `username`
if (~['settings', 'organizations', 'site', 'blog'].indexOf(match[1])) return false var RESERVED_USERNAMES = [
'settings',
'organizations',
'site',
'blog',
'about',
'orgs',
'styleguide',
'showcases',
'trending',
'stars',
'dashboard',
'notifications'
];
var RESERVED_REPONAMES = ['followers', 'following'];
if (~RESERVED_USERNAMES.indexOf(match[1])) return false
if (~RESERVED_REPONAMES.indexOf(match[2])) return false
// TODO: the intention is to hide the sidebar when users navigate to non-code areas (e.g. Issues, Pulls) // TODO: the intention is to hide the sidebar when users navigate to non-code areas (e.g. Issues, Pulls)
// and show it again when users navigate back to the code area // and show it again when users navigate back to the code area
@ -194,4 +211,4 @@
return localStorage.setItem(key, JSON.stringify(val)) return localStorage.setItem(key, JSON.stringify(val))
} }
} }
})() })()