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