[vhffs-dev] [532] Added common js functions.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 532
Author:   beuss
Date:     2007-03-27 17:14:04 +0000 (Tue, 27 Mar 2007)

Log Message:
-----------
Added common js functions. Removed unused function open_template.

Modified Paths:
--------------
    branches/vhffs_4.1/Makefile
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm
    branches/vhffs_4.1/vhffs-panel/web/web_submit.pl

Added Paths:
-----------
    branches/vhffs_4.1/vhffs-panel/js/commons.js


Modified: branches/vhffs_4.1/Makefile
===================================================================
--- branches/vhffs_4.1/Makefile	2007-03-27 17:01:58 UTC (rev 531)
+++ branches/vhffs_4.1/Makefile	2007-03-27 17:14:04 UTC (rev 532)
@@ -274,6 +274,8 @@
 	install -m 755 vhffs-panel/user/*.pl            $(PANELDIR)/user/
 	install -m 755 vhffs-panel/web/*.pl             $(PANELDIR)/web/
 	#install themes now
+	install -d -m 755 $(PANELDIR)/js
+	install -m 644 vhffs-panel/js/*.js				$(PANELDIR)/js/
 	#default theme
 	install -d -m 755 $(PANELDIR)/themes/vhffs
 	install -d -m 755 $(PANELDIR)/themes/vhffs/images

Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm	2007-03-27 17:01:58 UTC (rev 531)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm	2007-03-27 17:14:04 UTC (rev 532)
@@ -3,7 +3,7 @@
 package Vhffs::Panel::Main;
 require Exporter;
 @ISA    = qw(Exporter);
-@EXPORT = qw( open_template display display_light );
+@EXPORT = qw( display display_light );
 
 use POSIX qw(locale_h);
 use HTML::Template;
@@ -273,6 +273,7 @@
     my $jsglob = $config->get_themesdir()."$theme/js/*.js";
     my $jswebpath = "/themes/$theme/js/";
     my @jscripts;
+    push @jscripts, {SCRIPT => '/js/commons.js'};
     while(glob($jsglob)) {
         use File::Basename;
         push @jscripts, {SCRIPT => $jswebpath.basename( $_ )};
@@ -674,35 +675,4 @@
 	return;
 }
 
-
-sub open_template
-{
-	my ( $arg1 , $arg2 , $arg3 , $vhffs , $path , $template ,  $tmp );
-	$vhffs = shift;
-	$arg1 = shift;
-	$arg2 = shift;
-	$arg3 = shift;
-	$path = $vhffs->get_config->get_templatedir;
-
-	$tmp = shift;
-	
-	if( $arg3 )
-	{
-		$path .= "/" . $arg1 . "/" . $arg2 . "/" . $arg3 . ".tmpl";
-	}
-	elsif( $arg2 )
-	{
-		$path .= "/" . $arg1 . "/" . $arg2 . ".tmpl";
-	}
-	else
-	{
-		$path .= "/" . $arg1 . ".tmpl";
-	}
-
-	$template = new HTML::Template( filename => $path  , die_on_bad_params => 0  );
-
-	return( $template );
-}
-
- 
 1;

Added: branches/vhffs_4.1/vhffs-panel/js/commons.js
===================================================================
--- branches/vhffs_4.1/vhffs-panel/js/commons.js	2007-03-27 17:01:58 UTC (rev 531)
+++ branches/vhffs_4.1/vhffs-panel/js/commons.js	2007-03-27 17:14:04 UTC (rev 532)
@@ -0,0 +1,9 @@
+function toggle(id) {
+    var el = document.getElementById(id);
+    if(!el) return;
+    if(el.style.display == 'none') {
+        el.style.display = '';
+    } else {
+        el.style.display = 'none';
+    }
+}

Modified: branches/vhffs_4.1/vhffs-panel/web/web_submit.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/web/web_submit.pl	2007-03-27 17:01:58 UTC (rev 531)
+++ branches/vhffs_4.1/vhffs-panel/web/web_submit.pl	2007-03-27 17:14:04 UTC (rev 532)
@@ -91,7 +91,7 @@
 	}
 }
 
-$template = open_template( $vhffs , "misc" , "simplemsg" );
+$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
 $template->param( MESSAGE => $message );
 
 set_refresh_url Vhffs::Panel::Main($panel, "/panel.pl?project=$groupname", 0);


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/