blob: 051c86de78e4292badc43ecc0ef4044d3ad3b8bc [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001/* Copyright 2016 The Chromium Authors. All Rights Reserved.
2 *
3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file or at
5 * https://developers.google.com/open-source/licenses/bsd
6 */
7/* eslint-disable camelcase */
8/* eslint-disable no-unused-vars */
9
10
11/**
12 * This file contains the Monorail onload() function that is called
13 * when each EZT page loads.
14 */
15
16
17/**
18 * This code is run on every DIT page load. It registers a handler
19 * for autocomplete on four different types of text fields based on the
20 * name of that text field.
21 */
22function TKR_onload() {
23 TKR_install_ac();
24 _PC_Install();
25 TKR_allColumnNames = _allColumnNames;
26 TKR_labelFieldIDPrefix = _lfidprefix;
27 TKR_allOrigLabels = _allOrigLabels;
28 TKR_initialFormValues = TKR_currentFormValues();
29}
30
31// External names for functions that are called directly from HTML.
32// JSCompiler does not rename functions that begin with an underscore.
33// They are not defined with "var" because we want them to be global.
34
35// TODO(jrobbins): the underscore names could be shortened by a
36// cross-file search-and-replace script in our build process.
37
38_selectAllIssues = TKR_selectAllIssues;
39_selectNoneIssues = TKR_selectNoneIssues;
40
41_toggleRows = TKR_toggleRows;
42_toggleColumn = TKR_toggleColumn;
43_toggleColumnUpdate = TKR_toggleColumnUpdate;
44_addGroupBy = TKR_addGroupBy;
45_addcol = TKR_addColumn;
46_checkRangeSelect = TKR_checkRangeSelect;
47_makeIssueLink = TKR_makeIssueLink;
48
49_onload = TKR_onload;
50
51_handleListActions = TKR_handleListActions;
52_handleDetailActions = TKR_handleDetailActions;
53
54_loadStatusSelect = TKR_loadStatusSelect;
55_fetchUserProjects = TKR_fetchUserProjects;
56_setACOptions = TKR_setUpAutoCompleteStore;
57_openIssueUpdateForm = TKR_openIssueUpdateForm;
58_addAttachmentFields = TKR_addAttachmentFields;
59_ignoreWidgetIfOpIsClear = TKR_ignoreWidgetIfOpIsClear;
60
61_acstore = _AC_SimpleStore;
62_accomp = _AC_Completion;
63_acreg = _ac_register;
64
65_formatContextQueryArgs = TKR_formatContextQueryArgs;
66_ctxArgs = '';
67_ctxCan = undefined;
68_ctxQuery = undefined;
69_ctxSortspec = undefined;
70_ctxGroupBy = undefined;
71_ctxDefaultColspec = undefined;
72_ctxStart = undefined;
73_ctxNum = undefined;
74_ctxResultsPerPage = undefined;
75
76_filterTo = TKR_filterTo;
77_sortUp = TKR_sortUp;
78_sortDown = TKR_sortDown;
79
80_closeAllPopups = TKR_closeAllPopups;
81_closeSubmenus = TKR_closeSubmenus;
82_showRight = TKR_showRight;
83_showBelow = TKR_showBelow;
84_highlightRow = TKR_highlightRow;
85
86_setFieldIDs = TKR_setFieldIDs;
87_selectTemplate = TKR_selectTemplate;
88_saveTemplate = TKR_saveTemplate;
89_newTemplate = TKR_newTemplate;
90_deleteTemplate = TKR_deleteTemplate;
91_switchTemplate = TKR_switchTemplate;
92_templateNames = TKR_templateNames;
93
94_confirmNovelStatus = TKR_confirmNovelStatus;
95_confirmNovelLabel = TKR_confirmNovelLabel;
96_vallab = TKR_validateLabel;
97_exposeExistingLabelFields = TKR_exposeExistingLabelFields;
98_confirmDiscardEntry = TKR_confirmDiscardEntry;
99_confirmDiscardUpdate = TKR_confirmDiscardUpdate;
100_lfidprefix = undefined;
101_allOrigLabels = undefined;
102_checkPlusOne = TKR_checkPlusOne;
103_checkUnrestrict = TKR_checkUnrestrict;
104
105_clearOnFirstEvent = TKR_clearOnFirstEvent;
106_forceProperTableWidth = TKR_forceProperTableWidth;
107
108_initialFormValues = TKR_initialFormValues;
109_currentFormValues = TKR_currentFormValues;
110
111_acof = _ac_onfocus;
112_acmo = _ac_mouseover;
113_acse = _ac_select;
114_acrob = _ac_ob;
115
116// Variables that are given values in the HTML file.
117_allColumnNames = [];
118
119_go = TKR_go;
120_getColspec = TKR_getColspecElement;
121
122// Make the document actually listen for click events, otherwise the
123// event handlers above would never get called.
124if (document.captureEvents) document.captureEvents(Event.CLICK);
125
126_setupKibblesOnEntryPage = TKR_setupKibblesOnEntryPage;
127_setupKibblesOnListPage = TKR_setupKibblesOnListPage;
128
129_checkFieldNameOnServer = TKR_checkFieldNameOnServer;
130_checkLeafName = TKR_checkLeafName;
131
132_addMultiFieldValueWidget = TKR_addMultiFieldValueWidget;
133_removeMultiFieldValueWidget = TKR_removeMultiFieldValueWidget;
134_trimCommas = TKR_trimCommas;
135
136_initDragAndDrop = TKR_initDragAndDrop;