184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 1
/**
263
d57af0b0302e
Major improvements in the security of the CAPTCHA system (no SQL injection or anything like that); fixed denied form submission due to _af_acting on form object wrongly switched to true
Dan
diff
changeset
+ − 2
* Javascript auto-completion for form fields. This supercedes the code in autocomplete.js for MOZILLA ONLY. It doesn't seem to work real
d57af0b0302e
Major improvements in the security of the CAPTCHA system (no SQL injection or anything like that); fixed denied form submission due to _af_acting on form object wrongly switched to true
Dan
diff
changeset
+ − 3
* well with other browsers yet.
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 4
*/
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 5
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 6
// fill schemas
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 7
var autofill_schemas = {};
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 8
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 9
// default, generic schema
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 10
autofill_schemas.generic = {
582
+ − 11
template: '<div id="--ID--_region" spry:region="autofill_ds_--CLASS--" class="tblholder">' + "\n" +
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 12
' <table border="0" cellspacing="1" cellpadding="3" style="font-size: smaller;">' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 13
' <tr spry:repeat="autofill_region_--ID--">' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 14
' <td class="row1" spry:suggest="{name}">{name}</td>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 15
' </tr>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 16
' </table>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 17
'</div>',
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 18
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 19
init: function(element, fillclass)
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 20
{
582
+ − 21
// calculate positions before spry f***s everything up
+ − 22
var top = $dynano(element).Top() + $dynano(element).Height() - 10; // tblholder has 10px top margin
+ − 23
var left = $dynano(element).Left();
+ − 24
+ − 25
// dataset name
+ − 26
var ds_name = 'autofill_ds_' + fillclass;
+ − 27
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 28
// setup the dataset
687
+ − 29
window[ds_name] = new Spry.Data.JSONDataSet(makeUrlNS('Special', 'Autofill', 'type=' + fillclass));
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 30
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 31
// inject our HTML wrapper
582
+ − 32
var template = this.template.replace(new RegExp('--ID--', 'g'), element.id).replace(new RegExp('--CLASS--', 'g', fillclass));
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 33
var wrapper = element.parentNode; // document.createElement('div');
645
24f2fa13a2a0
Fixed autofill ignoring existing ID for text box parent node. Note that autofill is still in a nonworking state.
Dan
diff
changeset
+ − 34
if ( !wrapper.id )
24f2fa13a2a0
Fixed autofill ignoring existing ID for text box parent node. Note that autofill is still in a nonworking state.
Dan
diff
changeset
+ − 35
wrapper.id = 'autofill_wrap_' + element.id;
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 36
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 37
// a bunch of hacks to add a spry wrapper
582
+ − 38
wrapper.innerHTML = template + wrapper.innerHTML;
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 39
645
24f2fa13a2a0
Fixed autofill ignoring existing ID for text box parent node. Note that autofill is still in a nonworking state.
Dan
diff
changeset
+ − 40
var autosuggest = new Spry.Widget.AutoSuggest(wrapper.id, element.id + '_region', window[ds_name], 'name', {loadFromServer: true, urlParam: 'userinput', hoverSuggestClass: 'row2', minCharsType: 3});
582
+ − 41
var regiondiv = document.getElementById(element.id + '_region');
+ − 42
regiondiv.style.position = 'absolute';
+ − 43
regiondiv.style.top = top + 'px';
+ − 44
regiondiv.style.left = left + 'px';
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 45
}
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 46
};
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 47
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 48
function autofill_init_element(element, params)
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 49
{
582
+ − 50
if ( !Spry.Data );
+ − 51
load_spry_data();
+ − 52
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 53
params = params || {};
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 54
// assign an ID if it doesn't have one yet
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 55
if ( !element.id )
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 56
{
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 57
element.id = 'autofill_' + Math.floor(Math.random() * 100000);
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 58
}
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 59
var id = element.id;
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 60
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 61
// get the fill type
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 62
var fillclass = element.className;
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 63
fillclass = fillclass.split(' ');
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 64
fillclass = fillclass[1];
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 65
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 66
var schema = ( autofill_schemas[fillclass] ) ? autofill_schemas[fillclass] : autofill_schemas['generic'];
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 67
if ( typeof(schema.init) != 'function' )
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 68
{
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 69
schema.init = autofill_schemas.generic.init;
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 70
}
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 71
schema.init(element, fillclass, params);
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 72
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 73
element.af_initted = true;
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 74
}
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 75
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 76
var autofill_onload = function()
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 77
{
582
+ − 78
if ( this.loaded )
+ − 79
{
+ − 80
return true;
+ − 81
}
+ − 82
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 83
autofill_schemas.username = {
582
+ − 84
template: '<div id="--ID--_region" spry:region="autofill_ds_username" class="tblholder">' + "\n" +
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 85
' <table border="0" cellspacing="1" cellpadding="3" style="font-size: smaller;">' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 86
' <tr>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 87
' <th>' + $lang.get('user_autofill_heading_suggestions') + '</th>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 88
' </tr>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 89
' <tr spry:repeat="autofill_region_--ID--">' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 90
' <td class="row1" spry:suggest="{name}">{name_highlight}<br /><small style="{rank_style}">{rank_title}</small></td>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 91
' </tr>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 92
' </table>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 93
'</div>',
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 94
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 95
init: function(element, fillclass, params)
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 96
{
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 97
// calculate positions before spry f***s everything up
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 98
var top = $dynano(element).Top() + $dynano(element).Height() - 10; // tblholder has 10px top margin
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 99
var left = $dynano(element).Left();
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 100
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 101
var allow_anon = ( params.allow_anon ) ? '1' : '0';
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 102
// setup the dataset
582
+ − 103
if ( !window.autofill_ds_username )
+ − 104
{
+ − 105
window.autofill_ds_username = new Spry.Data.JSONDataSet(makeUrlNS('Special', 'Autofill', 'type=' + fillclass + '&allow_anon' + allow_anon));
+ − 106
}
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 107
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 108
// inject our HTML wrapper
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 109
var template = this.template.replace(new RegExp('--ID--', 'g'), element.id);
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 110
var wrapper = element.parentNode; // document.createElement('div');
647
+ − 111
if ( !wrapper.id )
+ − 112
wrapper.id = 'autofill_wrap_' + element.id;
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 113
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 114
// a bunch of hacks to add a spry wrapper
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 115
wrapper.innerHTML = template + wrapper.innerHTML;
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 116
647
+ − 117
var autosuggest = new Spry.Widget.AutoSuggest(wrapper.id, element.id + '_region', window.autofill_ds_username, 'name', {loadFromServer: true, urlParam: 'userinput', hoverSuggestClass: 'row2', minCharsType: 3});
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 118
var regiondiv = document.getElementById(element.id + '_region');
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 119
regiondiv.style.position = 'absolute';
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 120
regiondiv.style.top = top + 'px';
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 121
regiondiv.style.left = left + 'px';
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 122
}
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 123
};
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 124
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 125
autofill_schemas.page = {
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 126
template: '<div id="--ID--_region" spry:region="autofill_region_--ID--" class="tblholder">' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 127
' <table border="0" cellspacing="1" cellpadding="3" style="font-size: smaller;">' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 128
' <tr>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 129
' <th colspan="2">' + $lang.get('page_autosuggest_heading') + '</th>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 130
' </tr>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 131
' <tr spry:repeat="autofill_region_--ID--">' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 132
' <td class="row1" spry:suggest="{page_id}">{pid_highlight}<br /><small>{name_highlight}</small></td>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 133
' </tr>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 134
' </table>' + "\n" +
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 135
'</div>'
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 136
}
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 137
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 138
var inputs = document.getElementsByClassName('input', 'autofill');
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 139
582
+ − 140
if ( inputs.length > 0 )
+ − 141
{
+ − 142
// we have at least one input that needs to be made an autofill element.
+ − 143
// is spry data loaded?
+ − 144
if ( !Spry.Data )
+ − 145
{
+ − 146
load_spry_data();
+ − 147
return true;
+ − 148
}
+ − 149
}
+ − 150
+ − 151
this.loaded = true;
+ − 152
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 153
for ( var i = 0; i < inputs.length; i++ )
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 154
{
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 155
autofill_init_element(inputs[i]);
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 156
}
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 157
}
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 158
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 159
addOnloadHook(autofill_onload);
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 160
582
+ − 161
function autofill_force_region_refresh()
+ − 162
{
+ − 163
Spry.Data.initRegions();
+ − 164
}
+ − 165
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 166
function AutofillUsername(element, event, allowanon)
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 167
{
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 168
element.onkeyup = element.onkeydown = element.onkeypress = function(e) {};
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 169
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 170
element.className = 'autofill username';
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 171
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 172
allowanon = allowanon ? true : false;
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 173
autofill_init_element(element, {
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 174
allow_anon: allowanon
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
diff
changeset
+ − 175
});
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 176
}
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 177
582
+ − 178
// load spry data components
+ − 179
function load_spry_data()
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 180
{
582
+ − 181
var scripts = [ 'SpryData.js', 'SpryJSONDataSet.js', 'SpryAutoSuggest.js' ];
+ − 182
for ( var i = 0; i < scripts.length; i++ )
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 183
{
582
+ − 184
load_component(scripts[i]);
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 185
}
582
+ − 186
autofill_onload();
184
d74ff822acc9
Replaced autocompleting username with a much more efficient algorithm and caching system
Dan
parents:
diff
changeset
+ − 187
}