From ca1dfa17d5233f5e6eb20ff833623659fd390ea9 Mon Sep 17 00:00:00 2001 From: Michael Wiebusch <stratomaster@gmx.net> Date: Fri, 12 Jul 2013 10:48:34 +0200 Subject: [PATCH] moved some stuff around, will begin modularisation of subroutines hereafter, make global variables ours --- tools/jtageditor.pl | 83 ++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/tools/jtageditor.pl b/tools/jtageditor.pl index 735bfce..aff6d30 100755 --- a/tools/jtageditor.pl +++ b/tools/jtageditor.pl @@ -8,6 +8,10 @@ print "Content-type: text/html\n\n"; # in copy merge trees from xml2ini.pl # or put it in the common.pm +# correct size in tooltip + +# build ancestry without ancestry tree outside + # DONE # do not include wrong type, different specfile @@ -31,41 +35,7 @@ use HTML::Entities; require Common; -sub initPage { - - print <<EOF; -<HTML> -<HEAD> -<title>JTAG Editor</title> -<link href="../layout/styles.css" rel="stylesheet" type="text/css"/> -<link href="../layout/jtageditor.css" rel="stylesheet" type="text/css"/> -EOF - printJavaScripts(); - print <<EOF; -</HEAD> -<BODY onload='reloadFileSelection()'> -<h2>JTAG Configuration File Editor</h2> -<div id="debug"> -debug text -</div> -<div id="fileSelection"> - -Current File: unknown -</div> - -<div id="roterBereich"> -empty -</div> -<div id="blauerBereich"> -empty -</div> - - -</BODY> -</HTML> -EOF -} my %cgiHash = &read_input; @@ -95,6 +65,8 @@ my @ancestryList; my $confDir = '../config'; my $specDir = '../specs'; +# end of global variables + if ( $cgiHash{'print'} eq 'fileSelection' ) { print "<div class='header'>File Selection</div>"; print_fileSelection( $cgiHash{'configFile'} ); @@ -213,7 +185,6 @@ sub createFile { } - sub parseConfigAndSpec { parseConfig( $_[0] ); $specFileName = $configTree->findvalue("/MAPS/\@specDbFile"); @@ -756,15 +727,48 @@ EOF print "</div>"; } +sub initPage { + print <<EOF; +<HTML> +<HEAD> +<title>JTAG Editor</title> +<link href="../layout/styles.css" rel="stylesheet" type="text/css"/> +<link href="../layout/jtageditor.css" rel="stylesheet" type="text/css"/> +EOF + printJavaScripts(); + print <<EOF; +</HEAD> +<BODY onload='reloadFileSelection()'> +<h2>JTAG Configuration File Editor</h2> +<div id="debug"> +debug text +</div> +<div id="fileSelection"> + +Current File: unknown +</div> + +<div id="roterBereich"> +empty +</div> +<div id="blauerBereich"> +empty +</div> + + +</BODY> +</HTML> +EOF + +} ############################### ## general xml tools ############################### -sub mergeTrees -{ # give me two trees, tree1 overwrites everything in tree0 and will consequently be integrated in tree0 +sub mergeTrees { # give me two trees, tree1 overwrites everything in tree0 and will consequently be integrated in tree0 my $tree0 = $_[0]; my $tree1 = $_[1]; @@ -809,7 +813,6 @@ sub mergeTrees } } - sub changeAncestor { my $ancestorFileName = $_[0]; my $xmltree = $configTree; @@ -848,8 +851,6 @@ sub prepare_text { return $t; } - - sub save { my $registerName = $_[0]; @@ -941,8 +942,6 @@ sub printHash { } - - sub read_input { my $buffer; my @pairs; -- 2.43.0