Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
css:wrap_avillepreux [2024/07/02 16:40] – avillepreux | css:wrap_avillepreux [2024/12/12 17:40] (Version actuelle) – avillepreux | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
.wrap_username { | .wrap_username { | ||
background-color: | background-color: | ||
+ | } | ||
+ | div.wrap_username { | ||
box-shadow: 0 0 3px 2px #00000017; | box-shadow: 0 0 3px 2px #00000017; | ||
} | } | ||
Ligne 21: | Ligne 23: | ||
gap: 0.3em; | gap: 0.3em; | ||
padding: 0 0.3em; | padding: 0 0.3em; | ||
+ | vertical-align: | ||
} | } | ||
.wrap_username: | .wrap_username: | ||
Ligne 29: | Ligne 32: | ||
display: inline-block; | display: inline-block; | ||
border-radius: | border-radius: | ||
- | border: 2px solid var(--color, | ||
} | } | ||
div.wrap_username: | div.wrap_username: | ||
+ | border: 2px solid var(--color, | ||
width: 24px; | width: 24px; | ||
height: 24px; | height: 24px; | ||
Ligne 49: | Ligne 52: | ||
} | } | ||
span.wrap_username: | span.wrap_username: | ||
- | width: | + | width: |
- | height: | + | height: |
} | } | ||
Ligne 96: | Ligne 99: | ||
' div.wrap_' | ' div.wrap_' | ||
' div.wrap_' | ' div.wrap_' | ||
- | ' span.wrap_' | + | ' span.wrap_' |
+ ' </ | + ' </ | ||
Ligne 115: | Ligne 118: | ||
console.log(" | console.log(" | ||
+ | | ||
+ | function is_valid_username(username) { | ||
+ | | ||
+ | if (jQuery.isNumeric(username)) return false; | ||
+ | username = username.trim().toLowerCase(); | ||
+ | if (jQuery.isNumeric(username)) return false; | ||
+ | if (username.length < 2) return false; | ||
+ | |||
+ | if (jQuery.inArray(username, | ||
+ | |||
+ | " | ||
+ | " | ||
+ | " | ||
+ | |||
+ | ]) >= 0) return false; | ||
+ | |||
+ | return true; | ||
+ | } | ||
| | ||
jQuery(' | jQuery(' | ||
Ligne 124: | Ligne 145: | ||
if (typeof id !== " | if (typeof id !== " | ||
{ | { | ||
- | if (id.length >= 2 && !jQuery.isNumeric(id)) { | + | if (is_valid_username(id)) { |
init_username_wrap(wrap_element, | init_username_wrap(wrap_element, | ||
} | } | ||
Ligne 136: | Ligne 157: | ||
var username = className.replace(" | var username = className.replace(" | ||
| | ||
- | init_username_wrap(wrap_element, | + | if (is_valid_username(username)) { |
+ | |||
+ | init_username_wrap(wrap_element, | ||
+ | } | ||
} ); | } ); | ||
} | } |