Index: trunk/extensions/WebFonts/js/webfonts.js |
— | — | @@ -88,14 +88,17 @@ |
89 | 89 | // Build font dropdown |
90 | 90 | $select = $( '<ul />' ); |
91 | 91 | for ( var scheme in config ) { |
92 | | - $fontlink = $( '<a />' ) |
93 | | - .css( { "font-size": "1.2em" } ) |
94 | | - .text( config[scheme] ); |
95 | | - |
| 92 | + $fontlink = $( '<input>' ) |
| 93 | + .attr("type","radio") |
| 94 | + .attr("name","font") |
| 95 | + .attr("id","webfont-"+config[scheme]) |
| 96 | + .attr("value",config[scheme] ); |
| 97 | + |
96 | 98 | $fontItem = $( '<li />' ) |
97 | 99 | .val( config[scheme] ) |
98 | | - .append( $fontlink ); |
99 | | - |
| 100 | + .append( $fontlink ) |
| 101 | + .append( config[scheme] ); |
| 102 | + |
100 | 103 | haveSchemes = true; |
101 | 104 | //some closure trick :) |
102 | 105 | (function (font) { |
— | — | @@ -106,15 +109,17 @@ |
107 | 110 | |
108 | 111 | $select.append($fontItem); |
109 | 112 | } |
110 | | - $fontlink = $( '<a />' ) |
111 | | - .text( 'Reset' ) |
112 | | - .css( { "font-size": "1.2em" } ) |
113 | | - .click( function( event ) { |
114 | | - $.webfonts.set( 'none'); |
115 | | - }); |
| 113 | + $fontlink = $( '<input >' ) |
| 114 | + .attr("type","radio") |
| 115 | + .attr("name","font") |
| 116 | + .attr("name","webfont-none") |
| 117 | + .click( function( event ) { |
| 118 | + $.webfonts.set( 'none'); |
| 119 | + }); |
116 | 120 | $fontItem = $( '<li />' ) |
117 | 121 | .val( 'none') |
118 | | - .append( $fontlink ); |
| 122 | + .append( $fontlink ) |
| 123 | + .append( "Reset"); |
119 | 124 | |
120 | 125 | $select.append($fontItem); |
121 | 126 | |
— | — | @@ -144,10 +149,14 @@ |
145 | 150 | |
146 | 151 | if(cookie_font == null){ |
147 | 152 | $.webfonts.set( config[0]); |
| 153 | + //mark it as checked |
| 154 | + $('#webfont-'+config[0]).attr('checked', 'checked'); |
148 | 155 | } |
149 | 156 | else{ |
150 | 157 | if (cookie_font !=='none'){ |
151 | 158 | $.webfonts.set( cookie_font); |
| 159 | + //mark it as checked |
| 160 | + $('#webfont-'+cookie_font).attr('checked', 'checked'); |
152 | 161 | } |
153 | 162 | } |
154 | 163 | |