Users/Markup

* implemented pending-status for newly created accounts
 * Markup should now properly recognize external links
 * Markup will remove links by pending accounts
This commit is contained in:
Sarjuuk
2016-02-17 00:21:03 +01:00
parent 08717c36d0
commit 741ebf38f9
16 changed files with 68 additions and 40 deletions

View File

@@ -44,7 +44,8 @@ var Markup = {
CLASS_USER: MARKUP_CLASS_USER,
CLASS_PENDING: MARKUP_CLASS_PENDING,
whitelistedWebsites: [/(.*\.)?wowhead.com/i, /(.*\.)?thottbot.com/i, /(.*\.)?torhead.com/i, /(.*\.)?mmoui.com/i, /(.*\.)?tankspot.com/i, /(.*\.)?guildfans.com/i, /(.*\.)?allakhazam.com/i, /(.*\.)?zam.com/i, /(.*\.)?blizzard.com/i, /(.*\.)?worldofwarcraft.com/i, /(.*\.)?wow-europe.com/i, /(.*\.)?battle.net/i, /(.*\.)?sc2ranks.com/i, /(.*\.)?torchlightarmory.com/i, /(.*\.)?vindictusdb.com/i, /(.*\.)?wowinterface.com/i, /(.*\.)?vginterface.com/i, /(.*\.)?lotrointerface.com/i, /(.*\.)?eq2interface.com/i, /(.*\.)?eqinterface.com/i, /(.*\.)?mmo-champion.com/i, /(.*\.)?joystiq.com/i, /(.*\.)?wow-heroes.com/i, /(.*\.)?be-imba.hu/i, /(.*\.)?wowpedia.org/i, /(.*\.)?curse.com/i, /(.*\.)?elitistjerks.com/i, /(.*\.)?wowwiki.com/i, /(.*\.)?worldoflogs.com/i, /(.*\.)?wowinsider.com/i, /(.*\.)?guildwork.com/i],
/* aowow custom: first element */
whitelistedWebsites: [new RegExp('(.*\\.)?' + location.hostname, 'i'), /(.*\.)?wowhead.com/i, /(.*\.)?thottbot.com/i, /(.*\.)?torhead.com/i, /(.*\.)?mmoui.com/i, /(.*\.)?tankspot.com/i, /(.*\.)?guildfans.com/i, /(.*\.)?allakhazam.com/i, /(.*\.)?zam.com/i, /(.*\.)?blizzard.com/i, /(.*\.)?worldofwarcraft.com/i, /(.*\.)?wow-europe.com/i, /(.*\.)?battle.net/i, /(.*\.)?sc2ranks.com/i, /(.*\.)?torchlightarmory.com/i, /(.*\.)?vindictusdb.com/i, /(.*\.)?wowinterface.com/i, /(.*\.)?vginterface.com/i, /(.*\.)?lotrointerface.com/i, /(.*\.)?eq2interface.com/i, /(.*\.)?eqinterface.com/i, /(.*\.)?mmo-champion.com/i, /(.*\.)?joystiq.com/i, /(.*\.)?wow-heroes.com/i, /(.*\.)?be-imba.hu/i, /(.*\.)?wowpedia.org/i, /(.*\.)?curse.com/i, /(.*\.)?elitistjerks.com/i, /(.*\.)?wowwiki.com/i, /(.*\.)?worldoflogs.com/i, /(.*\.)?wowinsider.com/i, /(.*\.)?guildwork.com/i],
rolesToClass: function(roles)
{
@@ -3483,14 +3484,16 @@ var Markup = {
_fixUrl: function(url)
{
if(!url) return '';
if (!url)
return '';
// Make local URLs absolute
var firstChar = url.charAt(0);
if(firstChar == '/' || firstChar == '?')
if (firstChar == '/' || firstChar == '?')
{
url = url.replace(/^[\/\?]+/, '');
// aowow custom
// url = '/' + url;
url = '?' + url;
}
@@ -3500,9 +3503,12 @@ var Markup = {
_isUrlExternal: function(str)
{
if(!str)
if (!str)
return false;
return (str.indexOf('wowhead.com') == -1 && str.match(/^([^:\\./]+):/i));
// aowow custom
// return (str.indexOf('wowhead.com') == -1 && str.match(/^([^:\\./]+):/i));
return g_isExternalUrl(str);
},
_nodeSearch: function(node, name, depth)

View File

@@ -1526,7 +1526,7 @@ Summary.prototype = {
var o = $WH.ce('option');
o.value = p;
o._weights = weights[p];
$WH.ae(o, $WH.ct(weights[p].name ? weights[p].name :LANG.presets[p]));
$WH.ae(o, $WH.ct(weights[p].name ? weights[p].name : LANG.presets[p]));
$WH.ae(group, o);
}

View File

@@ -2207,7 +2207,9 @@ var g_user_roles = {
10: 'Übersetzer',
11: 'Handelsvertreter',
12: 'Screenshot-Verwalter',
13: 'Video-Verwalter'
13: 'Video-Verwalter',
14: 'API-Partner',
15: 'Ausstehend'
};
var g_gem_colors = {
@@ -2316,6 +2318,9 @@ var g_conditions = {
/* end custom */
var LANG = {
linkremoved: "Link entfernt",
linkremoved_tip: "Neue Benutzer können nicht<br />zu nicht-weißgelisteten Seiten verlinken.",
and: " und ",
or: " oder ", // custom
comma: ", ",

View File

@@ -2252,7 +2252,9 @@ var g_user_roles = {
10: 'Localizer',
11: 'Sales agent',
12: 'Screenshot manager',
13: 'Video manager'
13: 'Video manager',
14: 'API partner',
15: 'Pending'
};
var g_gem_colors = {
@@ -2362,6 +2364,9 @@ var g_conditions = {
/* end custom */
var LANG = {
linkremoved: "link removed",
linkremoved_tip: "Newly registered users cannot<br />post links.",
and: " and ",
or: " or ", // custom
comma: ", ",

View File

@@ -2208,7 +2208,9 @@ var g_user_roles = {
10: 'Traductor',
11: 'Agente de ventas',
12: 'Gestor de Capturas de pantalla',
13: 'Gestor de vídeos'
13: 'Gestor de vídeos',
14: 'Partner de API',
15: 'Pendiente'
};
var g_gem_colors = {
@@ -2318,8 +2320,11 @@ var g_conditions = {
/* end custom */
var LANG = {
linkremoved: "enlace eliminado",
linkremoved_tip: "Los nuevos usuarios no pueden enlazar a<br />webs que no estén aprobadas.",
and: " y ",
or: " o ",
or: " o ", // custom
comma: ", ",
ellipsis: "…",
dash: " ",

View File

@@ -2195,7 +2195,9 @@ var g_user_roles = {
10: 'Traducteur',
11: 'Agent de ventes',
12: 'Gestionnaire de capture d\'écran',
13: 'Gestionnaire de vidéos'
13: 'Gestionnaire de vidéos',
14: 'artenaire API',
15: 'En attente'
};
var g_gem_colors = {
@@ -2305,8 +2307,11 @@ var g_conditions = {
/* end custom */
var LANG = {
linkremoved: "lien enlevé",
linkremoved_tip: "Les nouveaux utilisateurs ne peuvent pas donner de liens vers<br />des sites web non-approuvés.",
and: " et ",
or: " ou ",
or: " ou ", // custom
comma: ", ",
ellipsis: "…",
dash: " ",

View File

@@ -2195,7 +2195,9 @@ var g_user_roles = {
10: 'Переводчик',
11: 'Агент по продажам',
12: 'Менеджер изображений',
13: 'Менеджер видео'
13: 'Менеджер видео',
14: 'API партнер',
15: 'Ожидающее'
};
var g_gem_colors = {
@@ -2305,8 +2307,11 @@ var g_conditions = {
/* end custom */
var LANG = {
linkremoved: "ссылка удалена",
linkremoved_tip: "Новые пользователи не могут публиковать<br />\nссылки на не разрешенные сайты.",
and: " и ",
or: " или ",
or: " или ", // custom
comma: ", ",
ellipsis: "…",
dash: " ",