This repository was archived by the owner on Apr 11, 2024. It is now read-only.
File tree 2 files changed +4
-42
lines changed
2 files changed +4
-42
lines changed Original file line number Diff line number Diff line change @@ -210,16 +210,15 @@ <h3>Help us improve HTML5 test by donating</h3>
210
210
finalizePage ( ) ;
211
211
} ) ;
212
212
213
-
213
+
214
214
function showResults ( r , c , m ) {
215
215
/* Update total score */
216
216
var container = document . getElementById ( 'score' ) ;
217
217
218
- container . innerHTML = tim (
218
+ container . innerHTML =
219
219
"<div class='pointsPanel'>" +
220
- "<h2><span>Your browser scores</span> <strong>{{score}}</strong> <span>out of {{maximum}} points</span></h2>" +
221
- "</div>" ,
222
- c ) ;
220
+ "<h2><span>Your browser scores</span> <strong>" + c . score + "</strong> <span>out of " + c . maximum + " points</span></h2>" +
221
+ "</div>" ;
223
222
224
223
/* Show box for confirming useragent detection */
225
224
new Confirm ( container , {
Original file line number Diff line number Diff line change 215
215
alert ( 'Could not submit results: ' + e . message ) ;
216
216
}
217
217
}
218
-
219
- var tim = ( function ( ) {
220
- var starts = "\\{\\{" ,
221
- ends = "\\}\\}" ,
222
- path = "[a-z0-9_][\\.a-z0-9_]*" , // e.g. config.person.name
223
- pattern = new RegExp ( starts + "(" + path + ")" + ends , "gim" ) ,
224
- undef ;
225
-
226
- return function ( template , data , notFound ) {
227
- // Merge the data into the template string
228
- return template . replace ( pattern , function ( tag , ref ) {
229
- var path = ref . split ( "." ) ,
230
- len = path . length ,
231
- lookup = data ,
232
- i = 0 ;
233
-
234
- for ( ; i < len ; i ++ ) {
235
- lookup = lookup [ path [ i ] ] ;
236
-
237
- // Error handling for when the property is not found
238
- if ( lookup === undef ) {
239
- // If specified, substitute with the "not found" arg
240
- if ( notFound !== undef ) {
241
- return notFound ;
242
- }
243
- // Throw error
244
- throw "Tim: '" + path [ i ] + "' not found in " + tag ;
245
- }
246
-
247
- // Success! Return the required value
248
- if ( i === len - 1 ) {
249
- return lookup ;
250
- }
251
- }
252
- } ) ;
253
- } ;
254
- } ( ) ) ;
255
218
256
219
function escapeSlashes ( string ) {
257
220
return string . replace ( / \\ / g, '\\\\' ) .
You can’t perform that action at this time.
0 commit comments