Changeset 24939
- Timestamp:
- 2012-01-11T11:17:00+13:00 (11 years ago)
- Location:
- gs3-extensions/html-to-expeditee/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/html-to-expeditee/trunk/src/perllib/ExpediteeFrameIO.pm
r24938 r24939 65 65 return $fdate; 66 66 } 67 68 sub convertStyleToAttr 69 { 70 my ($css_attr) = @_; 71 72 my $exp_attr = {}; 73 74 if (defined $css_attr->{'background-color'}) { 75 $exp_attr->{'e'} = $css_attr->{'background-color'}; 76 } 77 78 # load up some defaults for font information 79 my $font_family = "s"; # t 80 my $font_face = "r"; 81 my $font_size = "14"; 82 83 # if (defined $css_attr->{'font-family'}) { 84 # $font_family = $font_family_lookup->[$css_attr->{'font-family'}]; 85 # } 86 87 # if (defined $css_attr->{'font-size'}) { 88 # $font_size = convert_font_size($css_attr->{'font-size'}); 89 # } 90 91 # if (defined $css_attr->{'font-face'}) { 92 # $font = conver_font_face($css_attr->{'font-face'}); 93 # } 94 95 return $exp_attr; 96 } 97 67 98 68 99 sub _nextFreeId … … 166 197 # fudge factor for now (based on default font size used) 167 198 $y += 16; # y-value of text item in Expeditee is it's base line 199 $x += 4; 168 200 169 201 my %attr_copy = %$attr; # make a private copy of 'attr' … … 406 438 my $yb = $rect->{'yb'}; 407 439 408 my $attr = {};440 my $attr = convertStyleToAttr($html_node->{'style'}); 409 441 410 442 $self->addRect($xl,$yt,$xr,$yb,$attr); … … 417 449 my $y = $html_node->{'y'}; 418 450 419 my $attr = {};451 my $attr = convertStyleToAttr($html_node->{'style'}); 420 452 421 453 $self->addText($x,$y,$text,$attr); … … 442 474 443 475 if (open(FNOUT,">$filename")) { 444 binmode(F OUT,":utf8");476 binmode(FNOUT,":utf8"); 445 477 446 478 print FNOUT "$last_frame_number\n"; -
gs3-extensions/html-to-expeditee/trunk/src/src/js/html-to-expeditee.js
r24935 r24939 52 52 } 53 53 54 function getStyle( el,styleProp)54 function getStyle(node,styleProp) 55 55 { 56 var x = document.getElementById(el); 57 if (x.currentStyle) { 58 var y = x.currentStyle[styleProp]; 56 if (node.currentStyle) { 57 var y = node.currentStyle[styleProp]; 59 58 } 60 59 else if (window.getComputedStyle) { 61 var y = document.defaultView.getComputedStyle( x,null).getPropertyValue(styleProp);60 var y = document.defaultView.getComputedStyle(node,null).getPropertyValue(styleProp); 62 61 } 63 62 return y; … … 138 137 jsonNode.rect = rect; 139 138 139 140 var style = {}; 141 142 style["font-family"] = getStyle(node,"font-family"); 143 style["background-color"] = getStyle(node,"background-color"); 144 145 jsonNode.style = style 146 140 147 var jsonChildNodes = []; 141 148
Note:
See TracChangeset
for help on using the changeset viewer.