/[drupal]/contributions/modules/themer/theme/ie-border-radius.jquery.htc
ViewVC logotype

Diff of /contributions/modules/themer/theme/ie-border-radius.jquery.htc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Wed Jan 7 13:09:20 2009 UTC revision 1.2, Wed Jul 1 03:44:05 2009 UTC
# Line 28  function drawIeBorderRadius() { Line 28  function drawIeBorderRadius() {
28      var borderRadius = parseInt(this.currentStyle['border-radius']);      var borderRadius = parseInt(this.currentStyle['border-radius']);
29      var arcSize = Math.min(1, borderRadius / smallestDimension);      var arcSize = Math.min(1, borderRadius / smallestDimension);
30    
31      // Workout other details about the shape.      // Work out other details about the shape.
32      var strokeColor = e.css('border-color');      var strokeColor = e.css('border-color');
33      var strokeWeight = e.css('border-width');      var strokeWeight = e.css('border-width');
34      var fillColor = e.css('background-color');      var fillColor = e.css('background-color');
35      var fillSrc = e.css('background-image').replace(/^url\("(.+)"\)$/, '$1'); // @todo: Test this.      var fillSrc = e.css('background-image').replace(/^url\("(.+)"\)$/, '$1'); // @todo: Test this.
36    
37        // Determine the width for inline and block elements.
38        var oldWidth;
39        var oldHeight;
40        if (e.css('display') == 'inline') {
41          var pad = 2 * (parseInt(strokeWeight));
42          oldWidth = (e.width() + pad) + 'px';
43          oldHeight = (e.height() + pad) + 'px';
44        }
45        else  {
46          oldWidth = '99.9%';
47          oldHeight = '99.9%';
48        }
49    
50      // Save elements layout      // Save elements layout
51      var oldStyle = {      var oldStyle = {
52          'display': e.css('display'),
53        'margin-top': e.css('margin-top'),        'margin-top': e.css('margin-top'),
54        'margin-right': e.css('margin-right'),        'margin-right': e.css('margin-right'),
55        'margin-bottom': e.css('margin-bottom'),        'margin-bottom': e.css('margin-bottom'),
# Line 77  function drawIeBorderRadius() { Line 91  function drawIeBorderRadius() {
91    
92      var markup = '';      var markup = '';
93      markup += '<div id="' + uniqueId + '" class="ie-border-radius">';      markup += '<div id="' + uniqueId + '" class="ie-border-radius">';
94      markup += '  <v:roundrect arcsize="' + arcSize + '" strokecolor="' + strokeColor + '" strokeweight="' + strokeWeight + '" style="behavior: url(#default#VML); display: inline-block; width: 99.9%; height: 99.9%; antialias: true; padding: ' + strokeWeight + 'px;">';      markup += '  <v:roundrect arcsize="' + arcSize + '" strokecolor="' + strokeColor + '" strokeweight="' + strokeWeight + '" style="behavior: url(#default#VML); display: inline-block; width: ' + oldWidth + '; height: ' + oldHeight + '; antialias: true; padding: ' + strokeWeight + 'px;">';
95      markup += '    <v:fill color="' + fillColor + '" src="' + fillSrc + '" type="tile" style="behavior: url(#default#VML);" />';      markup += '    <v:fill color="' + fillColor + '" src="' + fillSrc + '" type="tile" style="behavior: url(#default#VML);" />';
96      markup +=      this.outerHTML;      markup +=      this.outerHTML;
97      markup += '  </v:roundrect>';      markup += '  </v:roundrect>';
# Line 85  function drawIeBorderRadius() { Line 99  function drawIeBorderRadius() {
99      this.outerHTML = markup;      this.outerHTML = markup;
100    
101      // Apply the old style to the new wrapper.      // Apply the old style to the new wrapper.
102      $('#' + uniqueId).css(oldStyle);      $('#' + uniqueId).css(oldStyle);
103    }    }
104  }  }
105    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2