includes/clientside/static/misc.js
changeset 550 685e839d934e
parent 537 547b7ba6d535
child 581 5e8fd89c02ea
equal deleted inserted replaced
549:6894cfd94dfb 550:685e839d934e
   434   for ( var i = 0; i < pid_clean.length; i++ )
   434   for ( var i = 0; i < pid_clean.length; i++ )
   435     pid_dirty[i] = pid_clean.substr(i, 1);
   435     pid_dirty[i] = pid_clean.substr(i, 1);
   436 
   436 
   437   for ( var i = 0; i < pid_dirty.length; i++ )
   437   for ( var i = 0; i < pid_dirty.length; i++ )
   438   {
   438   {
   439     var char = pid_dirty[i];
   439     var chr = pid_dirty[i];
   440     if ( char == 'X' )
   440     if ( chr == 'X' )
   441       continue;
   441       continue;
   442     var cid = char.charCodeAt(0);
   442     var cid = chr.charCodeAt(0);
   443     cid = cid.toString(16).toUpperCase();
   443     cid = cid.toString(16).toUpperCase();
   444     if ( cid.length < 2 )
   444     if ( cid.length < 2 )
   445     {
   445     {
   446       cid = '0' + cid;
   446       cid = '0' + cid;
   447     }
   447     }
   454   
   454   
   455   var page_id_cleaned = '';
   455   var page_id_cleaned = '';
   456 
   456 
   457   for ( var id in pid_chars )
   457   for ( var id in pid_chars )
   458   {
   458   {
   459     var char = pid_chars[id];
   459     var chr = pid_chars[id];
   460     if ( pid_dirty[id] == 'X' )
   460     if ( pid_dirty[id] == 'X' )
   461       page_id_cleaned += char;
   461       page_id_cleaned += chr;
   462     else
   462     else
   463       page_id_cleaned += pid_dirty[id];
   463       page_id_cleaned += pid_dirty[id];
   464   }
   464   }
   465   
   465   
   466   return page_id_cleaned;
   466   return page_id_cleaned;