- Timestamp:
- 2013-01-21T19:07:55+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.