Re: patch for randomize playlist in 1.0rc1

Matt McClure <[email protected]> Fri, 07 Nov 2003 12:50:35 -0500
Newsgroups gmane.comp.audio.netjuke.user
Organization me
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig4BD9CB5602C807C58CDFDC35
Content-Type: multipart/mixed;
 boundary="------------010906030005050107030504"

This is a multi-part message in MIME format.
--------------010906030005050107030504
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

On 11/1/2003 6:16 PM, Matt McClure wrote:

> Not sure if this is already fixed in 1.0rc2 since I haven't upgraded
> yet, but the randomize checkbox next the "Play Selected" on playlists
> doesn't work in 1.0rc1.  Here's a patch.

My last patch broke the viewForm in search.php.  This one should make
both work:

BTW, I browsed the current CVS, and this doesn't appear to be fixed there.

-- 
Matt
http://www.faradic.net/~mmcclure/

    When you solely have an American state of mind, you're
    increasingly becoming a smaller part of the world.
        -Chuck D



--------------010906030005050107030504
Content-Type: text/plain;
 name="randomize.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="randomize.patch"

--- pl-edit.php.~1.19.~	2003-06-29 17:27:33.000000000 -0400
+++ pl-edit.php	2003-11-07 12:43:00.000000000 -0500
@@ -617,8 +617,10 @@
            <td class="content" align=center nowrap><B><A HREF="play.php?do=plist&val=<?php echo $_REQUEST['pl_id']?>" title='<?php echo  PLEDIT_TB_PLAY_ALL_HELP ?>'><?php echo  PLEDIT_TB_PLAY_ALL ?></A></B></td>
            <td class="content" align=center nowrap><B><A HREF="Javascript:SelectAll();" title="<?php echo  PLEDIT_TB_SELECT_HELP ?>"><?php echo  PLEDIT_TB_SELECT ?></A></B></td>
            <td class="content" align=center nowrap><B><A HREF="Javascript:ResetAll();" title="<?php echo  PLEDIT_TB_RESET_HELP ?>"><?php echo  PLEDIT_TB_RESET ?></A></B></td>
+           <form action='' method=get name='randomForm' onSubmit="return('false');">
            <td class="content" align=center nowrap><B><A HREF="Javascript:Plist('play');" title="<?php echo  PLEDIT_TB_PLAY_HELP ?>"><?php echo  PLEDIT_TB_PLAY ?></A></B><input type="checkbox" name='random' align='center' title="<?php echo PLEDIT_RANDOMIZE_HELP ?>"><?php echo PLEDIT_RANDOMIZE ?></td>
+           </form>
            <td class="content" align=center nowrap><B><A HREF="Javascript:deleteTracks('');" title="<?php echo  PLEDIT_TB_DELETE_HELP ?>"><?php echo  PLEDIT_TB_DELETE ?></A></B></td>
            <?php if (BATCH_DOWNLOAD == 't') { ?>
              <td class="content" align=center nowrap><B><A HREF="Javascript:Plist('batch');" title="<?php echo  PLEDIT_TB_BATCH_HELP ?>"><?php echo  PLEDIT_TB_BATCH ?></A></B></td>
--- inc-jscript.php.~1.13.~	2003-04-25 16:20:19.000000000 -0400
+++ inc-jscript.php	2003-11-07 12:37:51.000000000 -0500
@@ -44,9 +44,14 @@
            }
         }
      }
-	 for (var i=0;i< document.viewForm.elements.length;i++) {
-	 	if (document.viewForm.elements[i].name == 'random') {
-			if (document.viewForm.elements[i].checked == true) {
+     if (document.randomForm) {
+         theForm=document.randomForm;
+     } else {
+         theForm=document.viewForm;
+     }
+	 for (var i=0;i< theForm.elements.length;i++) {
+	 	if (theForm.elements[i].name == 'random') {
+			if (theForm.elements[i].checked == true) {
 				random = '1';
 			}
 		}
@@ -137,4 +142,4 @@
     document.all[id].style.backgroundColor = color;
   else if (document.getElementById)
     document.getElementById(id).style.backgroundColor = color;
-}
\ No newline at end of file
+}


--------------010906030005050107030504--

--------------enig4BD9CB5602C807C58CDFDC35
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/q9turGgMpZIoLA8RAlVaAKCO7tj+k7SMF770sKKGNEQPSlNd2wCbBxGr
OGJstk59IdEdHyU0xNP8wq0=
=1rUV
-----END PGP SIGNATURE-----

--------------enig4BD9CB5602C807C58CDFDC35--



-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/