Ignore:
Timestamp:
2012-01-11T11:17:00+13:00 (12 years ago)
Author:
davidb
Message:

Some initial work at converting CSS style information into Expeditee attributes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/html-to-expeditee/trunk/src/src/js/html-to-expeditee.js

    r24935 r24939  
    5252}
    5353
    54 function getStyle(el,styleProp)
     54function getStyle(node,styleProp)
    5555{
    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];
    5958    }
    6059    else if (window.getComputedStyle) {
    61     var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
     60    var y = document.defaultView.getComputedStyle(node,null).getPropertyValue(styleProp);
    6261    }
    6362    return y;
     
    138137        jsonNode.rect = rect;
    139138   
     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
    140147            var jsonChildNodes = [];
    141148
Note: See TracChangeset for help on using the changeset viewer.