[Cpan-forum-commit] rev 356 - in trunk: . lib/CPAN/Forum/RM templates/popup www

svn at pti.co.il svn at pti.co.il
Fri Oct 26 13:46:24 EEST 2007


Author: gabor
Date: 2007-10-26 13:46:24 +0300 (Fri, 26 Oct 2007)
New Revision: 356

Modified:
   trunk/
   trunk/lib/CPAN/Forum/RM/Tags.pm
   trunk/templates/popup/head.tmpl
   trunk/templates/popup/modules_with_tags.tmpl
   trunk/www/display_tags.js
Log:
clicking on a link in the pop-up window show reload the main window with the new URL
and close the pop-up window



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 7bc34947-122d-0410-bc5a-f898d2bb5f81:/local/cpan-forum:4577
8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:12752
   + 7bc34947-122d-0410-bc5a-f898d2bb5f81:/local/cpan-forum:4589
8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:12752

Modified: trunk/lib/CPAN/Forum/RM/Tags.pm
===================================================================
--- trunk/lib/CPAN/Forum/RM/Tags.pm	2007-10-26 10:46:03 UTC (rev 355)
+++ trunk/lib/CPAN/Forum/RM/Tags.pm	2007-10-26 10:46:24 UTC (rev 356)
@@ -61,6 +61,10 @@
     my $modules = CPAN::Forum::DB::Tags->get_modules_with_tag($value); # SQL
     $t->param(tag => $value);
     $t->param(modules => $modules);
+
+    my $referer = $ENV{HTTP_REFERER} || '';
+    $referer =~ s{^(https?://[^/]+).*}{$1};
+    $t->param(referer => "$referer/dist");
     return $t->output; 
 }
 

Modified: trunk/templates/popup/head.tmpl
===================================================================
--- trunk/templates/popup/head.tmpl	2007-10-26 10:46:03 UTC (rev 355)
+++ trunk/templates/popup/head.tmpl	2007-10-26 10:46:24 UTC (rev 356)
@@ -1,7 +1,19 @@
+<html>
+<head>
+<script language="javascript">
+
+function show(url) {
+    window.opener.location = url;
+    window.close();
+}
+</script>
+
+</head>
+<body>
 <TMPL_IF loggedin>You are logged in to CPAN::Forum as <TMPL_VAR username></TMPL_IF>
 <TMPL_IF admin></TMPL_IF>
 <TMPL_IF test_site_warning>
-<p class="warning">Warning: this is a test site, the data here will be deleted.<br />
-For real use, please visit the <a href="http://www.cpanforum.com/">the live site</a>.</p>
+<p class="warning">Warning: this is a test site, the data here will be deleted.</p>
 </TMPL_IF>
 
+

Modified: trunk/templates/popup/modules_with_tags.tmpl
===================================================================
--- trunk/templates/popup/modules_with_tags.tmpl	2007-10-26 10:46:03 UTC (rev 355)
+++ trunk/templates/popup/modules_with_tags.tmpl	2007-10-26 10:46:24 UTC (rev 356)
@@ -1,5 +1,5 @@
 <TMPL_INCLUDE NAME="popup/head.tmpl">
 <p>Modules with tag <b><TMPL_VAR tag></b></p>
 <TMPL_LOOP modules>
-<a href="/dist/<TMPL_VAR name>"><TMPL_VAR name></a> <TMPL_VAR cnt><br />
+<a href="javascript:show('<TMPL_VAR referer>/<TMPL_VAR name>')"><TMPL_VAR name></a> (<TMPL_VAR cnt>), 
 </TMPL_LOOP>

Modified: trunk/www/display_tags.js
===================================================================
--- trunk/www/display_tags.js	2007-10-26 10:46:03 UTC (rev 355)
+++ trunk/www/display_tags.js	2007-10-26 10:46:24 UTC (rev 356)
@@ -32,11 +32,7 @@
 }
 
 function cpan_forum_popup_tag(tag) {
-    var w = window.open(cpan_forum_url + '/tags/name_popup/' + tag, 'cpan_forum_list_distros', "width=600,height=300");
-    //w.document.write("Tag: '" + tag + "'<br/>");
-    //var distros = cpan_forum_get_distros_by_tag(tag);
-    //for(var i=0; i<distros.length; i++) {
-    //    w.document.write('<a href="/dist/' + distros[i] + '">' + distros[i] + '</a><br>');
-    //}
+    var w = window.open(cpan_forum_url + '/tags/name_popup/' + tag, 'cpan_forum_list_distros', "width=600,height=300,resizable=1");
+    w.focus(1);
 }
 



More information about the Cpan-forum-commit mailing list