Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: res/js/common.js

Issue 1144163010: Getting started on the fuzzer web front end. (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Update startsWith polyfill Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fuzzer/templates/titlebar.html ('k') | webtry/templates/titlebar.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * common.js is a set of common functions used across all of skiaperf. 2 * common.js is a set of common functions used across all of skiaperf.
3 * 3 *
4 * Everything is scoped to 'sk' except $$ and $$$ which are global since they 4 * Everything is scoped to 'sk' except $$ and $$$ which are global since they
5 * are used so often. 5 * are used so often.
6 * 6 *
7 */ 7 */
8 8
9 /** 9 /**
10 * $$ returns a real JS array of DOM elements that match the CSS query selector. 10 * $$ returns a real JS array of DOM elements that match the CSS query selector.
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 }); 576 });
577 } 577 }
578 578
579 // Capitalize each word in the string. 579 // Capitalize each word in the string.
580 sk.toCapWords = function(s) { 580 sk.toCapWords = function(s) {
581 return s.replace(/\b\w/g, function(firstLetter) { 581 return s.replace(/\b\w/g, function(firstLetter) {
582 return firstLetter.toUpperCase(); 582 return firstLetter.toUpperCase();
583 }); 583 });
584 } 584 }
585 585
586 // Polyfill for String.startsWith from
587 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Ob jects/String/startsWith#Polyfill
588 // returns true iff the string starts with the given prefix
589 if (!String.prototype.startsWith) {
590 String.prototype.startsWith = function(searchString, position) {
591 position = position || 0;
592 return this.indexOf(searchString, position) === position;
593 };
594 }
586 return sk; 595 return sk;
587 }(); 596 }();
OLDNEW
« no previous file with comments | « fuzzer/templates/titlebar.html ('k') | webtry/templates/titlebar.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698