Project

General

Profile

« Previous | Next » 

Revision ac95b982

Added by Scott Ullrich over 20 years ago

Add a highlight text color, add border color. Change to pfSense color scheme.

View differences:

usr/local/www/auto_complete_helper.js
1 1

  
2 2
/* ---- Variables ---- */
3 3
var actb_timeOut = -1; // Autocomplete Timeout in ms (-1: autocomplete never time out)
4
var actb_lim = 1;    // Number of elements autocomplete can show (-1: no limit)
4
var actb_lim = 5;    // Number of elements autocomplete can show (-1: no limit)
5 5
var actb_firstText = false; // should the auto complete be limited to the beginning of keyword?
6 6
/* ---- Variables ---- */
7 7

  
8 8
/* --- Styles --- */
9
var actb_bgColor = '#888888';
10
var actb_textColor = '#FFFFFF';
11
var actb_hColor = '#000000';
9
var actb_bgColor = '#FFFFFF';
10
var actb_textColor = '#000000';
11
var actb_hBgColor = '#990000';
12
var actb_htextColor = '#FFFFFF';
12 13
var actb_fFamily = 'Courier';
13 14
var actb_fSize = '14px';
14 15
var actb_hStyle = 'text-decoration:underline;font-weight="bold"';
......
28 29
var actb_tomake = true;
29 30
/* ---- Constants ---- */
30 31

  
31
alert(navigator.appName);
32

  
33 32
function actb_parse(n){
34 33
    var t = escape(actb_curr.value);
35 34
    var tobuild = '';
......
74 73
    a = document.createElement('table');
75 74
    a.cellSpacing='1px';
76 75
    a.cellPadding='2px';
76
    a.style.border = '1px solid #990000';
77 77
    a.style.zIndex = 5;
78 78
    a.style.position='absolute';
79 79
    a.style.top = eval(curTop() + actb_curr.offsetHeight) + "px";
......
93 93
            counter++;
94 94
            r = a.insertRow(-1);
95 95
            if (first && !actb_tomake){
96
                r.style.backgroundColor = actb_hColor;
96
                r.style.backgroundColor = actb_hBgColor;
97 97
                first = false;
98 98
                actb_pos = counter;
99 99
            }else if(actb_pre == i){
100
                r.style.backgroundColor = actb_hColor;
100
                r.style.backgroundColor = actb_hBgColor;
101 101
                first = false;
102 102
                actb_pos = counter;
103 103
            }else{
104 104
                r.style.backgroundColor = actb_bgColor;
105
                r.style.color = actb_bgColor;
105 106
            }
106 107
            r.id = 'tat_tr'+(j);
107 108
            c = r.insertCell(-1);
108 109
            c.style.color = actb_textColor;
110
            counter = 0;
111
            first = true;
112
            if (first && !actb_tomake){
113
                c.style.color = actb_htextColor;
114
                first = false;
115
                actb_pos = counter;
116
            }else if(actb_pre == i){
117
                c.style.color = actb_htextColor;
118
                first = false;
119
                actb_pos = counter;
120
            }else{
121
                c.style.color = actb_textColor;
122
            }
109 123
            c.style.fontFamily = actb_fFamily;
110 124
            a.style.zIndex = 5;
111 125
            c.style.fontSize = actb_fSize;
......
155 169
    }
156 170
    return actb_toreturn;
157 171
}
158
function actb_remake(){
172
function actb_remake() {
159 173
    document.body.removeChild(document.getElementById('tat_table'));
160 174
    if(navigator.appName == "Microsoft Internet Explorer") {
161 175
        document.body.removeChild(document.getElementById('tat_frame'));
......
229 243
        height = height + c.height;
230 244
        width = c.width;
231 245
    }
232
    alert(height);
233 246
    if(navigator.appName == "Microsoft Internet Explorer") {
234 247
        frame.width=width
235 248
        frame.height=height;
......
239 252
    if (!actb_display) return;
240 253
    if (actb_pos == 1) return;
241 254
    document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_bgColor;
255
    document.getElementById('tat_td'+actb_pos).style.color = actb_textColor;
242 256
    actb_pos--;
243 257
    if (actb_pos < actb_rangeu) actb_moveup();
244
    document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_hColor;
258
    document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_hBgColor;
259
    document.getElementById('tat_td'+actb_pos).style.color = actb_htextColor;
245 260
    if (actb_toid) clearTimeout(actb_toid);
246 261
    if (actb_timeOut > 0) actb_toid = setTimeout("actb_removedisp()",actb_timeOut);
247 262
}
......
249 264
    if (!actb_display) return;
250 265
    if (actb_pos == actb_total) return;
251 266
    document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_bgColor;
267
    document.getElementById('tat_td'+actb_pos).style.color = actb_textColor;
252 268
    actb_pos++;
253 269
    if (actb_pos > actb_ranged) actb_movedown();
254
    document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_hColor;
270
    document.getElementById('tat_tr'+actb_pos).style.backgroundColor = actb_hBgColor;
271
    document.getElementById('tat_td'+actb_pos).style.color= actb_htextColor;
255 272
    if (actb_toid) clearTimeout(actb_toid);
256 273
    if (actb_timeOut > 0) actb_toid = setTimeout("actb_removedisp()",actb_timeOut);
257 274
}

Also available in: Unified diff