Index: /gs3-extensions/html-to-expeditee/trunk/src/perllib/ExpediteeFrameIO.pm
===================================================================
--- /gs3-extensions/html-to-expeditee/trunk/src/perllib/ExpediteeFrameIO.pm (revision 26766)
+++ /gs3-extensions/html-to-expeditee/trunk/src/perllib/ExpediteeFrameIO.pm (revision 26767)
@@ -621,5 +621,8 @@
my $attr = {};
-
+
+ my $link = $html_node->{'link'};
+ $attr->{'F'} = $link if defined $link;
+
my $img_text = "\@i: $img_url";
@@ -649,5 +652,5 @@
my $link = $html_node->{'link'};
- $attr->{'l'} = $link if defined $link;
+ $attr->{'F'} = $link if defined $link;
my $data = $html_node->{'data'};
Index: /gs3-extensions/html-to-expeditee/trunk/src/src/cgi-bin/html-to-expeditee.pl.in
===================================================================
--- /gs3-extensions/html-to-expeditee/trunk/src/src/cgi-bin/html-to-expeditee.pl.in (revision 26766)
+++ /gs3-extensions/html-to-expeditee/trunk/src/src/cgi-bin/html-to-expeditee.pl.in (revision 26767)
@@ -355,5 +355,5 @@
var docRE = new RegExp("(?:\\\\/)document\\\\/(.*?)(?:\$)");
-
+ var clRE = new RegExp("(\\\\/)browse\\\\/" + cl + "(\\\\/\\\\d+)+(\$)");
for(var i = 0; i < gsContentChildren.length; i++){
@@ -383,22 +383,18 @@
if(fn !== null && fn!== undefined){
var frameName = collect + fn;
-
- //aElemChild.setAttribute("link",frameName);
- //console.log(aElemChild.getAttribute('link'));
- //console.log(aElemChild.link);
+ aElemChild.setAttribute("link",frameName);
}
}
- }else{
- //TODO: Check if the link is a CL link.
- //TODO: Make a hashmap for storing CL page frame numbers?
+ }else if(aElemSrc.match(clRE)){ //link the item to one of the other CL browsing frameset pages
+
+ var clMatch = clRE.exec(aElemSrc);
+ var clPage = clMatch[2].substring(1);
+ console.log(clPage);
+ aElem.setAttribute("link",clPage);
}
}
}
-
- //TODO: Need to change htmlToExpeditee code to account for links
-
-
var expFrameTree = htmlToExpeditee(gsContent);
var expFrame = JSON.stringify(expFrameTree);
Index: /gs3-extensions/html-to-expeditee/trunk/src/src/js/html-to-expeditee.js
===================================================================
--- /gs3-extensions/html-to-expeditee/trunk/src/src/js/html-to-expeditee.js (revision 26766)
+++ /gs3-extensions/html-to-expeditee/trunk/src/src/js/html-to-expeditee.js (revision 26767)
@@ -139,7 +139,7 @@
var jsonNode = null;
+
if (node.nodeType == 3) { /* text node */
-
-
+
var text = node.nodeValue;
@@ -155,15 +155,15 @@
jsonNode.yb = pyb;
- var link = node.link;
- if(link !== null && link !== undefined){
- jsonNode.link = link;
- console.log("Adding link");
- }else{
- console.log("no link found");
- }
-
var parent = node.parentNode;
if (parent != null) {
+
+ //set a frame link attribute
+ var link = parent.attributes["link"];
+
+ if(link !== null && link !== undefined){
+ console.log(link.value);
+ jsonNode.link = link.value;
+ }
if(compute_font){
@@ -189,4 +189,5 @@
font_weight = new_font_weight;
+ //TODO: if parent node is an element, then set style["font-style"] to be "italic".
if(new_font_style !== undefined && new_font_style !== null)
font_style = new_font_style;
@@ -233,5 +234,5 @@
}
- var elemName = node.nodeName.toLowerCase();
+ var elemName = node.nodeName.toLowerCase();
if (!elemName.match(/script/)) {
@@ -259,12 +260,19 @@
jsonNode.rect = rect;
+ //TODO: Set link attribute for images.
if (elemName.match("img")) {
+
+ var getLink = node.getAttribute("link");
+ if(getLink !== null && getLink !== undefined){
+ jsonNode.link = getLink;
+ }
+
jsonNode.img = node.src;
+
+
}
var style = {};
-
- //style["font-family"] = getStyle(node,"font-family");
- //style["font-size"] = getStyle(node,"font-size");
+
style["background-color"] = getStyle(node,"background-color");
@@ -272,11 +280,10 @@
var attr = node.attributes["attr"];
- if (attr != null) {
- // console.log("attr = " + attr.value);
- jsonNode.attr = attr.value;
+
+ if (attr != null) {
+ jsonNode.attr = attr.value;
}
-
-
- var jsonChildNodes = [];
+
+ var jsonChildNodes = [];
var cnode = node.firstChild;