MCPcopy Create free account
hub / github.com/PowerBroker2/DFPlayerMini_Fast / SearchBox

Function SearchBox

docs/html/search.js:82–422  ·  view source on GitHub ↗
(name, resultsPath, inFrame, label)

Source from the content-addressed store, hash-verified

80 resultPath - path to use for external files
81*/
82function SearchBox(name, resultsPath, inFrame, label)
83{
84 if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); }
85
86 // ---------- Instance variables
87 this.name = name;
88 this.resultsPath = resultsPath;
89 this.keyTimeout = 0;
90 this.keyTimeoutLength = 500;
91 this.closeSelectionTimeout = 300;
92 this.lastSearchValue = "";
93 this.lastResultsPage = "";
94 this.hideTimeout = 0;
95 this.searchIndex = 0;
96 this.searchActive = false;
97 this.insideFrame = inFrame;
98 this.searchLabel = label;
99
100 // ----------- DOM Elements
101
102 this.DOMSearchField = function()
103 { return document.getElementById("MSearchField"); }
104
105 this.DOMSearchSelect = function()
106 { return document.getElementById("MSearchSelect"); }
107
108 this.DOMSearchSelectWindow = function()
109 { return document.getElementById("MSearchSelectWindow"); }
110
111 this.DOMPopupSearchResults = function()
112 { return document.getElementById("MSearchResults"); }
113
114 this.DOMPopupSearchResultsWindow = function()
115 { return document.getElementById("MSearchResultsWindow"); }
116
117 this.DOMSearchClose = function()
118 { return document.getElementById("MSearchClose"); }
119
120 this.DOMSearchBox = function()
121 { return document.getElementById("MSearchBox"); }
122
123 // ------------ Event Handlers
124
125 // Called when focus is added or removed from the search field.
126 this.OnSearchFieldFocus = function(isActive)
127 {
128 this.Activate(isActive);
129 }
130
131 this.OnSearchSelectShow = function()
132 {
133 var searchSelectWindow = this.DOMSearchSelectWindow();
134 var searchField = this.DOMSearchSelect();
135
136 if (this.insideFrame)
137 {
138 var left = getXPos(searchField);
139 var top = getYPos(searchField);

Callers

nothing calls this directly

Calls 2

getXPosFunction · 0.70
getYPosFunction · 0.70

Tested by

no test coverage detected