Changeset 26767
- Timestamp:
- 2013-01-21T19:07:55+13:00 (11 years ago)
- Location:
- gs3-extensions/html-to-expeditee/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/html-to-expeditee/trunk/src/perllib/ExpediteeFrameIO.pm
r26749 r26767 621 621 622 622 my $attr = {}; 623 623 624 my $link = $html_node->{'link'}; 625 $attr->{'F'} = $link if defined $link; 626 624 627 my $img_text = "\@i: $img_url"; 625 628 … … 649 652 650 653 my $link = $html_node->{'link'}; 651 $attr->{' l'} = $link if defined $link;654 $attr->{'F'} = $link if defined $link; 652 655 653 656 my $data = $html_node->{'data'}; -
gs3-extensions/html-to-expeditee/trunk/src/src/cgi-bin/html-to-expeditee.pl.in
r26753 r26767 355 355 356 356 var docRE = new RegExp("(?:\\\\/)document\\\\/(.*?)(?:\$)"); 357 357 var clRE = new RegExp("(\\\\/)browse\\\\/" + cl + "(\\\\/\\\\d+)+(\$)"); 358 358 359 359 for(var i = 0; i < gsContentChildren.length; i++){ … … 383 383 if(fn !== null && fn!== undefined){ 384 384 var frameName = collect + fn; 385 386 //aElemChild.setAttribute("link",frameName); 387 //console.log(aElemChild.getAttribute('link')); 388 //console.log(aElemChild.link); 385 aElemChild.setAttribute("link",frameName); 389 386 } 390 387 } 391 388 392 }else{ 393 //TODO: Check if the link is a CL link. 394 //TODO: Make a hashmap for storing CL page frame numbers? 389 }else if(aElemSrc.match(clRE)){ //link the item to one of the other CL browsing frameset pages 390 391 var clMatch = clRE.exec(aElemSrc); 392 var clPage = clMatch[2].substring(1); 393 console.log(clPage); 394 aElem.setAttribute("link",clPage); 395 395 } 396 396 } 397 397 } 398 398 399 400 //TODO: Need to change htmlToExpeditee code to account for links401 402 403 399 var expFrameTree = htmlToExpeditee(gsContent); 404 400 var expFrame = JSON.stringify(expFrameTree); -
gs3-extensions/html-to-expeditee/trunk/src/src/js/html-to-expeditee.js
r26749 r26767 139 139 var jsonNode = null; 140 140 141 141 142 if (node.nodeType == 3) { /* text node */ 142 143 143 144 144 var text = node.nodeValue; 145 145 … … 155 155 jsonNode.yb = pyb; 156 156 157 var link = node.link;158 if(link !== null && link !== undefined){159 jsonNode.link = link;160 console.log("Adding link");161 }else{162 console.log("no link found");163 }164 165 157 var parent = node.parentNode; 166 158 167 159 if (parent != null) { 160 161 //set a frame link attribute 162 var link = parent.attributes["link"]; 163 164 if(link !== null && link !== undefined){ 165 console.log(link.value); 166 jsonNode.link = link.value; 167 } 168 168 169 169 if(compute_font){ … … 189 189 font_weight = new_font_weight; 190 190 191 //TODO: if parent node is an <i> element, then set style["font-style"] to be "italic". 191 192 if(new_font_style !== undefined && new_font_style !== null) 192 193 font_style = new_font_style; … … 233 234 } 234 235 235 236 var elemName = node.nodeName.toLowerCase(); 236 237 237 238 if (!elemName.match(/script/)) { … … 259 260 jsonNode.rect = rect; 260 261 262 //TODO: Set link attribute for images. 261 263 if (elemName.match("img")) { 264 265 var getLink = node.getAttribute("link"); 266 if(getLink !== null && getLink !== undefined){ 267 jsonNode.link = getLink; 268 } 269 262 270 jsonNode.img = node.src; 271 272 263 273 } 264 274 265 275 var style = {}; 266 267 //style["font-family"] = getStyle(node,"font-family"); 268 //style["font-size"] = getStyle(node,"font-size"); 276 269 277 style["background-color"] = getStyle(node,"background-color"); 270 278 … … 272 280 273 281 var attr = node.attributes["attr"]; 274 if (attr != null) {275 // console.log("attr = " + attr.value);276 jsonNode.attr = attr.value;282 283 if (attr != null) { 284 jsonNode.attr = attr.value; 277 285 } 278 279 280 var jsonChildNodes = []; 286 287 var jsonChildNodes = []; 281 288 282 289 var cnode = node.firstChild;
Note:
See TracChangeset
for help on using the changeset viewer.