diff buy.pl @ 47:4431dc7d4bb5 laserkard

[svn r48] almost fixed "hover over" bug
author rlm
date Sun, 31 Jan 2010 14:21:14 -0500
parents 1045db9799e3
children 95fa4bcc5d67
line wrap: on
line diff
     1.1 --- a/buy.pl	Sun Jan 31 12:33:33 2010 -0500
     1.2 +++ b/buy.pl	Sun Jan 31 14:21:14 2010 -0500
     1.3 @@ -16,13 +16,14 @@
     1.4  my %hash = ( 
     1.5  
     1.6  'material' => \&material,
     1.7 -'pokedex'  => \&pokedex,
     1.8 +
     1.9  'template'	=> \&template, 
    1.10  'inputbox'	=> \&inputbox,
    1.11  'display'	=> \&display,
    1.12  'change_rules' => \&change_rules,
    1.13  'vanish'      => \&vanish,
    1.14 -'updateForm'  => \&updateForm
    1.15 +'updateForm'  => \&updateForm,
    1.16 +'cardType'    => \&cardType
    1.17  );
    1.18  
    1.19   
    1.20 @@ -33,6 +34,15 @@
    1.21  # this outputs the html for the page
    1.22  print $pjx->build_html($q,\&gen,{-Cache_Control => 'no-store, no-cache, must-revalidate', -Pragma => 'no-cache'}); 
    1.23  
    1.24 +
    1.25 +
    1.26 +sub cardType
    1.27 +{
    1.28 +
    1.29 +return $_[0];
    1.30 +	
    1.31 +}
    1.32 +
    1.33   
    1.34  
    1.35  sub updateForm
    1.36 @@ -123,43 +133,58 @@
    1.37  
    1.38  
    1.39  <input TYPE="image" src = "./images/templates/big_$materialcolor.jpg" 	
    1.40 -onmouseover="pokedex(['args__big'],['pokedex']);" 	
    1.41 +onmouseover="pokedex('big_$materialcolor');"
    1.42 +onmouseout = "pokedex(document.getElementById('currentSpec').innerHTML);"
    1.43 +
    1.44 +
    1.45 + 	
    1.46  onclick=
    1.47  "display(['template2'], ['display']); 
    1.48  inputbox(['template2', 'formValues'], ['inputbox']);
    1.49  material(['template2'], ['materials']);
    1.50 -redraw('bold');" ID="template2" NAME="template2" VALUE="big_$materialcolor">
    1.51 +cardType(['template2'], ['currentSpec']);
    1.52 +redraw('bold');" 
    1.53 +ID="template2" NAME="template2" VALUE="big_$materialcolor">
    1.54  <br>
    1.55  
    1.56    
    1.57  
    1.58  <input TYPE="image" src = "./images/templates/basic_$materialcolor.jpg"
    1.59 -onmouseover="pokedex(['args__basic'],['pokedex']);"	
    1.60 +onmouseover="pokedex('basic_$materialcolor');" 
    1.61 +onmouseout = "pokedex(document.getElementById('currentSpec').innerHTML);"
    1.62  onclick=
    1.63  "display(['template3'], ['display']); 
    1.64  inputbox(['template3', 'formValues'], ['inputbox']);
    1.65  material(['template3'], ['materials']);
    1.66 -redraw('arrow');" ID="template3" NAME="template3" VALUE="basic_$materialcolor"          ><br>
    1.67 +cardType(['template3'], ['currentSpec']);
    1.68 +redraw('arrow');" 
    1.69 +ID="template3" NAME="template3" VALUE="basic_$materialcolor"          ><br>
    1.70  
    1.71   
    1.72  
    1.73  <input TYPE="image" src = "./images/templates/classic_$materialcolor.jpg"  
    1.74 -onmouseover="pokedex(['args__classic'],['pokedex']);"	
    1.75 +onmouseover="pokedex('classic_$materialcolor');" 
    1.76 +onmouseout = "pokedex(document.getElementById('currentSpec').innerHTML);"
    1.77  onclick=
    1.78  "display(['template1'], ['display']); 
    1.79  inputbox(['template1', 'formValues'], ['inputbox']);
    1.80  material(['template1'], ['materials']);
    1.81 -redraw('classic');" ID="template1" NAME="template1" VALUE="classic_$materialcolor"    ><br>
    1.82 +cardType(['template1'], ['currentSpec']);
    1.83 +redraw('classic');" 
    1.84 +ID="template1" NAME="template1" VALUE="classic_$materialcolor"    ><br>
    1.85  
    1.86   
    1.87  
    1.88  <input TYPE="image" src = "./images/templates/lines_$materialcolor.jpg" 
    1.89 -onmouseover="pokedex(['args__lines'],['pokedex']);"	
    1.90 +onmouseover="pokedex('lines_$materialcolor');" 	
    1.91 +onmouseout = "pokedex(document.getElementById('currentSpec').innerHTML);"
    1.92  onclick=
    1.93  "display(['template4'], ['display']); 
    1.94  inputbox(['template4', 'formValues'], ['inputbox']);
    1.95  material(['template4'], ['materials']);
    1.96 -redraw('direct');" ID="template4" NAME="template4" VALUE="lines_$materialcolor"           > 
    1.97 +cardType(['template4'], ['currentSpec']);
    1.98 +redraw('direct');" 
    1.99 +ID="template4" NAME="template4" VALUE="lines_$materialcolor"           > 
   1.100  
   1.101  	</div>
   1.102  	</div>
   1.103 @@ -224,7 +249,14 @@
   1.104  
   1.105  #every type has it's own associated paylist file the contains the things we need
   1.106  
   1.107 -$z = '<div id = "whatever" onmouseover='."\"pokedex([\'args__$type\'],[\'pokedex\']);\">".$z.'</div>';
   1.108 +$z = <<HERE . $z;
   1.109 +<div id = "whatever" onmouseover = "pokedex(document.getElementById('currentSpec').innerHTML);">
   1.110 +HERE
   1.111 +
   1.112 +
   1.113 +
   1.114 +
   1.115 +$z = $z.'</div>';
   1.116  
   1.117  
   1.118  foreach my $key ( keys %fieldHash )
   1.119 @@ -273,7 +305,9 @@
   1.120  #~ $t =~ s/PERL::PIC/$all/g;
   1.121  
   1.122  	$t = <<HERE;
   1.123 -	<image src = "./images/display/blank.jpg" 	onmouseover="pokedex(['args__PERL::PIC'],['pokedex']);">
   1.124 +	<image src = "./images/display/blank.jpg" 	
   1.125 +	onmouseover = "pokedex(document.getElementById('currentSpec').innerHTML);"
   1.126 +	>
   1.127  	
   1.128  	<div id = overlay>
   1.129  
   1.130 @@ -316,12 +350,12 @@
   1.131  $a =~ s/PERL-REPLACE::TOP_MENU/$b/; #equivalent to <?php include("top_menu.html"); ?>, but in perl and with more memory problems :)
   1.132  $b = &material("void_acrylic_clear",1);
   1.133  $a =~ s/PERL-REPLACE::MATERIALS/$b/; #let's do it again!!! :)
   1.134 +
   1.135 +
   1.136 +
   1.137 +$b = "big_acrylic_clear";
   1.138 +$a =~ s/PERL::INITIALCARD/$b/;
   1.139  $b = &template("big_acrylic_clear");
   1.140 -
   1.141 -
   1.142 -
   1.143 -
   1.144 -
   1.145  $a =~ s/PERL-REPLACE::TEMPLATES/$b/; 
   1.146  
   1.147  $b = &display("big_acrylic_clear");