Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 2bd239d

Browse files
jlporterjeffkaufman
authored andcommitted
Remove console_start.js, and just call the required initialization routine in admin_site.cc.
1 parent c561d12 commit 2bd239d

File tree

3 files changed

+8
-25
lines changed

3 files changed

+8
-25
lines changed

pagespeed/system/admin_site.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ void AdminSite::ConsoleHandler(const SystemRewriteOptions& global_options,
230230
//
231231
// TODO(jmarantz): Change the JS to remove pagespeedStatisticsUrl.
232232
fetch->Write(console_js, handler);
233+
fetch->Write("google.setOnLoadCallback(pagespeed.startConsole);", handler);
233234
fetch->Write("</script>\n", handler);
234235
} else {
235236
fetch->Write("<p>\n"

pagespeed/system/console.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
* Fetches JSON statistics data from server to draw graphs over time of
2121
* various "notable issues".
2222
*
23+
* Note that for unit testing purposes, the initialization code here is not
24+
* actually run. admin_site.cc injects the call to
25+
* google.setOnLoadCallback(pagespeed.startConsole); to actually run the code
26+
* here.
27+
*
2328
* PRECONDITIONS: pagespeedStatisticsUrl must be set in JavaScript and
2429
* <script src='https://www.google.com/jsapi'></script> must be loaded in HTML.
2530
*
@@ -30,12 +35,12 @@
3035

3136
'use strict';
3237

33-
goog.require('goog.structs.Set');
34-
3538
goog.provide('pagespeed');
3639
goog.provide('pagespeed.Console');
3740
goog.provide('pagespeed.statistics');
3841

42+
goog.require('goog.structs.Set');
43+
3944
// Google Charts API.
4045
// Requires <script src='https://www.google.com/jsapi'></script> loaded in HTML.
4146
google.load('visualization', '1.0', {'packages': ['corechart']});

pagespeed/system/console_start.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)