[Scummvm-cvs-logs] SF.net SVN: scummvm: [27322] web/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Jun 10 18:53:44 CEST 2007


Revision: 27322
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27322&view=rev
Author:   fingolfin
Date:     2007-06-10 09:53:43 -0700 (Sun, 10 Jun 2007)

Log Message:
-----------
Got rid of screenshots.js

Modified Paths:
--------------
    web/trunk/include/screenshots.php
    web/trunk/index.php
    web/trunk/screenshots.php

Removed Paths:
-------------
    web/trunk/screenshots.js

Modified: web/trunk/include/screenshots.php
===================================================================
--- web/trunk/include/screenshots.php	2007-06-10 16:28:50 UTC (rev 27321)
+++ web/trunk/include/screenshots.php	2007-06-10 16:53:43 UTC (rev 27322)
@@ -15,6 +15,18 @@
   return implode("", file($file_root."/screenshots/scummvm_".$id.".txt"));
 }
 
+function screenshot_previewer_link ($id, $content) {
+	// We use a height of 483 instead of 480 to workaround something which appears to be a bug in Mozilla?
+	$result =
+	"<div onclick=\"window.open('screenshots.php?screenshotID='+" . $id . ",'scummvm_screenshot_viewer','menubar=no,scrollbars=no,status=no,width=640,height=483')\"" .
+	    " onMouseOver=\"window.status='Click to View Full Size Image';return true;\"".
+	    " onMouseOut=\"window.status='';return true;\">" .
+		$content .
+	"</div>";
+
+	return $result;
+}
+
 // Grab list of images from screenshot dir
 // and loop through them and add to $screenshots array
 $screenshots = array();

Modified: web/trunk/index.php
===================================================================
--- web/trunk/index.php	2007-06-10 16:28:50 UTC (rev 27321)
+++ web/trunk/index.php	2007-06-10 16:53:43 UTC (rev 27322)
@@ -27,8 +27,6 @@
 } else {
   $randImg = $lastLECshot + rand(0, count($screenshots) - $lastLECshot - 1);
 }
-
-echo '<script src="'.$file_root.'/screenshots.js" type="text/javascript"></script>';
 ?>
 
 <script type="text/javascript">
@@ -47,7 +45,7 @@
   if (curScreenshotId >= screenshotIds.length) curScreenshotId = 0;
   if (curScreenshotId < 0) curScreenshotId = screenshotIds.length-1;
 
-  document['curScreenshotId'].src = "./screenshots/scummvm_" + screenshotIds[curScreenshotId] + ".jpg";
+  document['curScreenshot'].src = "./screenshots/scummvm_" + screenshotIds[curScreenshotId] + ".jpg";
 }
 </script>
 
@@ -69,16 +67,12 @@
 <tr><td class="content-wrap">
 <table border="0" cellpadding="0" cellspacing="0" align="center">
 <tr><td>
-<!-- We use a height of 483 instead of 480 to workaround something which
-  appears to be a bug in Mozilla? -->
-	<a href="javascript:openWin(screenshotIds[curScreenshotId]);"
-	onMouseOver="window.status='Click to View Full Size Image';return true;"
-	onMouseOut="window.status='';return true;"><img
 <?php
-        echo 'src="' . screenshot_thumb_path($screenshots[$randImg]) . '" width="128" height="96"'."\n";
+echo screenshot_previewer_link("screenshotIds[curScreenshotId]", 
+	'<img src="' . screenshot_thumb_path($screenshots[$randImg]) . '" width=128 height=96 '.
+	'style="margin: 5px" ' .
+	'name="curScreenshot" title="Click to view Full Size" alt="Random screenshot">');
 ?>
-	style="margin: 5px"
-	name="curScreenshotId" title="Click to view Full Size" alt="Random screenshot"></a>
 	</td></tr>
 </table>					
 </td></tr>

Deleted: web/trunk/screenshots.js
===================================================================
--- web/trunk/screenshots.js	2007-06-10 16:28:50 UTC (rev 27321)
+++ web/trunk/screenshots.js	2007-06-10 16:53:43 UTC (rev 27322)
@@ -1,3 +0,0 @@
-function openWin(screenshotID) {
-	myWindow = window.open("screenshots.php?screenshotID="+screenshotID,"scummvm_screenshot_viewer","menubar=no,scrollbars=no,status=no,width=640,height=483");
-}

Modified: web/trunk/screenshots.php
===================================================================
--- web/trunk/screenshots.php	2007-06-10 16:28:50 UTC (rev 27321)
+++ web/trunk/screenshots.php	2007-06-10 16:53:43 UTC (rev 27322)
@@ -43,8 +43,6 @@
 
 html_content_begin('Screenshots');
 
-echo '<script src="'.$file_root.'/screenshots.js" type="text/javascript"></script>';
-
 if ($cat1 == "") {
 ?>
   <div class="par-item">
@@ -79,11 +77,8 @@
 <tr><td width=17 height=10 colspan=2><img src="<?=$file_root?>/images/rs-top-left.png" alt=""></td><td rowspan=2 width=256 height=192>
 <?php
   $image = $screenshots[$randImg];
-  echo "<a href=\"javascript:openWin('" . $image ."');\"\n";
-  echo "  onMouseOver=\"window.status='Click to View Full Size Image';return true;\"\n";
-  echo "  onMouseOut=\"window.status='';return true;\">";
-  echo '<img align=right src="'.screenshot_thumb_path($image).'" alt="Random Screenshot"';
-  echo ' title="Click to view Full Size"></a>';
+  echo screenshot_previewer_link("'" . $image . "'", 
+  	'<img src="'.screenshot_thumb_path($image).'" width=256 height=192 align=right alt="Random Screenshot" title="Click to view Full Size">');
 ?>
 </td><td style="background:#a82709;" width=7 height=192 rowspan=2></td></tr>
 <tr><td width=10 height=182></td><td style="background:#a82709;" width=7></td></tr>
@@ -135,9 +130,8 @@
     // display image
     echo html_frame_td(
 	'<table cellpadding="0" cellspacing="0"><tr><td align="center">'.
-	"<a href=\"javascript:openWin('" . $image ."');\">".
-	'<img src="'.screenshot_thumb_path($image).'" '.
-	'width=256 height=192 alt="Screenshot '.$c.'"></a>'.
+	screenshot_previewer_link("'" . $image . "'", 
+		'<img src="'.screenshot_thumb_path($image).'" width=256 height=192 alt="Screenshot '.$c.'">').
 	'</td></tr><tr><td align="center">'.
 	screenshot_caption($image).
 	'</td></tr></table>',


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list