Changeset 25057


Ignore:
Timestamp:
2012-02-08T15:55:59+13:00 (12 years ago)
Author:
davidb
Message:

Next round of improvements to cross-walking Greenstone web pages to Expeditee frames

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

    r24944 r25057  
    170170    $self->_setBaseDefaultAttributes($attr);
    171171
    172     $attr->{'d'} = "0 0 0"; # black color
     172    if(defined $attr->{'d'}){
     173
     174    }
     175    else {
     176    $attr->{'d'} = "0 0 0"; # black color
     177    }
     178
    173179}
    174180
     
    179185    my ($attr) = @_;
    180186
     187
    181188    $self->setPointDefaultAttributes($attr);
    182189
    183     $attr->{'d'} = "80 80 80"; # green color for rect lines
    184     $attr->{'h'} = "1.0";     # line thickness
     190    if((defined $attr->{'d'}) && (defined $attr->{'h'})){
     191
     192    }
     193    else {
     194        $attr->{'d'} = "80 80 80"; # grey color for rect lines
     195        $attr->{'h'} = "1.0";     # line thickness
     196    }
    185197}
    186198
     
    210222
    211223    $self->setTextDefaultAttributes(\%attr_copy);
    212 
    213224    my $items = $self->{'items'};
    214225
     
    349360
    350361    foreach my $item (@$items) {
     362
    351363    my $type = delete $item->{'_type'};
    352     my $id   = delete $item->{'_id'};
    353 
    354     print FOUT "S $type $id\n";
    355     foreach my $a (keys %$item) {
    356         print FOUT "$a ", $item->{$a}, "\n";
    357     }
     364    my $id = delete $item->{'_id'};
     365
     366    if(defined($type) && defined($id)) {
     367
     368         print FOUT "S $type $id\n";
     369
     370         foreach my $a (keys %$item) {
     371             print FOUT "$a ", $item->{$a}, "\n";
     372         }
    358373   
    359     print FOUT "\n";
    360     }
     374             print FOUT "\n";
     375
     376      }
     377
     378     }
    361379
    362380    print FOUT "Z\n\n";
     
    486504    $x += 4;
    487505
     506    my $data = $html_node->{'data'};
     507    $attr->{'D'} = $data if defined $data;
     508 
    488509    $self->addText($x,$y,$text,$w,$attr);
    489510    }
     
    510531    if (open(FNOUT,">$filename")) {
    511532    binmode(FNOUT,":utf8");
     533
     534    #writes frameset name concatenated with last frame number in the set to the frame.inf file.
     535        my $getFramesetName = $self->{'output_dir'};
     536    print FNOUT "$getFramesetName$last_frame_number\n";
     537
    512538   
    513     print FNOUT "$last_frame_number\n";
    514 
    515539    close(FNOUT);
    516540    $status = 1;
  • gs3-extensions/html-to-expeditee/trunk/src/src/js/html-to-expeditee.js

    r24944 r25057  
    130130        jsonNode.xr = pxr;
    131131        jsonNode.yb = pyb;
     132
     133        var parent = node.parentNode;
     134        if (parent != null) {
     135        var data = parent.attributes["data"];
     136
     137                if (data != null) {
     138          jsonNode.data = data.value;
     139            }
     140        }
    132141
    133142    }
Note: See TracChangeset for help on using the changeset viewer.