Not logged in. · Lost password · Register
Forum: Skins RSS
Ranger skin ' character file names bug fix
how to fix the Ranger skin bug
piper #1
Member since Sep 2009 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: Ranger skin ' character file names bug fix
There is a bug in the Ranger skin that prevents the playback of files & directories containing the ' (apostrophe) character in their names (the browser detects it as an end of string). I've made some modifications to the original Ranger skin HTML/javascript code to fix this bug. To apply the patch simply replace the content of 2 .html files in your [program files]/winamp/plugins/browseamp/ranger/templates directory.

1: browser_files.html
<!--
     fix the bug with file names containing the ' character
     we must replace it with \' so the browser doesn't detect an end
     of string and prevents the file from being played correctly
 -->

<script language="JavaScript" type="text/JavaScript">

   var filenamefix = "<#browser_enc_filename>";
   filenamefix = filenamefix.replace(/\'/g, "\\'");

</script>


<tr bgcolor="#000000">

    <td width="16"><input name="add" type="checkbox" id="add" value="<#browser_form_filename>"></td>

    <script language="JavaScript" type="text/JavaScript">

      // More bug fix ... the fixed name is sent to the function
     document.write ('<td width="48"><a href="JavaScript:;"><img src="gfx/rng_add.gif" border="0" width="48" height="16" onClick="parent.addToPlaylist(\''+filenamefix+'\')"></a></td>');
     document.write ('<td nowrap width="100%" colspan=2>&nbsp;<a href=\'JavaScript:;\' class="normallink" onClick="parent.addToPlaylistPlay(\''+filenamefix+'\')">');

     printValue("<#browser_filename hideextension=1>");

   </script>

   </a>&nbsp;
   </td>
</tr>


2: browser_directories.html

<!--
     fix the bug with directory names containing the ' character
     we must replace it with \' so the browser doesn't detect an end
     of string and prevents the files to be played correctly
 -->

<script language="JavaScript" type="text/JavaScript">

 var dirnamefix = "<#browser_enc_directoryname>";
 dirnamefix = dirnamefix.replace(/\'/g, "\\'");

</script>

<tr bgcolor="#000000">
    <td nowrap colspan=4>
      <table cellspacing="0" cellpadding="0" border="0" width="100%">
       <tr>
       <td>&nbsp; <a href="?dir=<#browser_enc_directoryname>" class="normallink">
        <img src="gfx/rng_folder.gif" border="0" width="16" height="16">&nbsp
        <script language="JavaScript" type="text/JavaScript">
           printDirValue("<#browser_directoryname>");
        </script>
        </a>&nbsp;
       </td>

       <script language="JavaScript" type="text/JavaScript">
        // More bug fix ... the fixed name is sent to the function
        document.write ('<td align="right"><a href="JavaScript:;"><img src="gfx/rng_add.gif" border="0" width="48" height="16" onClick="parent.addToPlaylist(\''+dirnamefix+'\')"></a></td>');
       </script>
     </tr>
    </table>
   </td>
</tr>


I hope it will be useful to some of you. I think the Ranger skin is really great and this bug was really annoying...
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Page created in 141 ms (51.7 ms) · 37 database queries in 44 ms
Current time: 2018-07-16, 06:22:07 (UTC +00:00)