css:wrap_avillepreux

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
css:wrap_avillepreux [2026/03/26 17:31] avillepreuxcss:wrap_avillepreux [2026/04/08 15:15] (Version actuelle) avillepreux
Ligne 58: Ligne 58:
  
 </CSS> </CSS>
 +
 <JS> <JS>
-/* 
-var string_to_color = function(str) { 
  
-  var hash = 0; 
-  for (var i = 0; i < str.length; i++) { 
-    hash = str.charCodeAt(i) + ((hash << 5) - hash); 
-  } 
-  var colour = '#'; 
-  for (var i = 0; i < 3; i++) { 
-    var value = (hash >> (i * 8)) & 0xFF; 
-    colour += ('00' + value.toString(16)).substr(-2); 
-  } 
-  return colour; 
-}*/ 
 var string_to_color = function(str, h, s, l) { var string_to_color = function(str, h, s, l) {
   var hash = 0;   var hash = 0;
Ligne 85: Ligne 73:
 function init_username_wrap(wrap_element, username) function init_username_wrap(wrap_element, username)
 { {
- var img_url = 'https://intranet.cyanide-studio.com/_media/user/' + username + '.jpg';+ /* 
 +  var url_img_check = 'https://intranet.cyanide-studio.com/_media/user/' + username + '.jpg';*/ 
 +        var url_img_check = 'https://web.cyanide-studio.com/trombi/photo/?username=' + username + '&check';
  
  try   try 
  {  {
-                console.log("Init username", username); + /*console.log("Init username...", username, wrap_element.html());*/
- +
-          jQuery.get(img_url).done(function({+
  
 +          jQuery.get(url_img_check).done(function() {
 +          
 +                    wrap_element.addClass("plugin_wrap");
                     wrap_element.addClass("wrap_username");                     wrap_element.addClass("wrap_username");
                     wrap_element.addClass("wrap_"+username);                     wrap_element.addClass("wrap_"+username);
 +                    
 +                    document.querySelectorAll(".wrap_"+username).forEach(function(e) { 
 +                    e.classList.add("plugin_wrap"); 
 +                    e.classList.add("wrap_username"); 
 +                    });
 +
 +                console.log("Init username OK", username, wrap_element.html(), wrap_element.attr("class").split(/\s+/));
  
                     var color = string_to_color(username, -20, 50, 50);                     var color = string_to_color(username, -20, 50, 50);
Ligne 115: Ligne 113:
           }).fail(function () {           }).fail(function () {
                      
-          +                /*console.log("Init username FAIL", username, wrap_element.html());*/ 
           });           });
           }           }
           catch (e)           catch (e)
           {           {
 +              console.log("Init username EXCEPTION", username, wrap_element.html());
           }           }
 } }
  • css/wrap_avillepreux.1774542709.txt.gz
  • Dernière modification : 2026/03/26 17:31
  • de avillepreux