Commit 33a4bd46 authored by Byron Jones's avatar Byron Jones

Bug 1159589: migrate autocomplete from yui to jquery

r=dylan,a=glob
parent 7a75256f
...@@ -34,40 +34,27 @@ YAHOO.bugzilla.commentTagging = { ...@@ -34,40 +34,27 @@ YAHOO.bugzilla.commentTagging = {
}); });
if (!can_edit) return; if (!can_edit) return;
var ds = new YAHOO.util.XHRDataSource("jsonrpc.cgi"); $('#bz_ctag_add').devbridgeAutocomplete({
ds.connTimeout = 30000; serviceUrl: function(query) {
ds.connMethodPost = true; return 'rest/bug/comment/tags/' + encodeURIComponent(query);
ds.connXhrMode = "cancelStaleRequests"; },
ds.maxCacheEntries = 5; params: {
ds.responseSchema = { Bugzilla_api_token: BUGZILLA.api_token
metaFields : { error: "error", jsonRpcId: "id"}, },
resultsList : "result" deferRequestBy: 250,
}; minChars: 1,
tabDisabled: true,
var ac = new YAHOO.widget.AutoComplete('bz_ctag_add', 'bz_ctag_autocomp', ds); transformResult: function(response) {
ac.maxResultsDisplayed = 7; response = $.parseJSON(response);
ac.generateRequest = function(query) { return {
query = YAHOO.lang.trim(query); suggestions: $.map(response, function(dataItem) {
YAHOO.bugzilla.commentTagging.last_query = query; return {
YAHOO.bugzilla.commentTagging.counter = YAHOO.bugzilla.commentTagging.counter + 1; value: dataItem,
YAHOO.util.Connect.setDefaultPostHeader('application/json', true); data : null
return YAHOO.lang.JSON.stringify({ };
version: "1.1", })
method : "Bug.search_comment_tags", };
id : YAHOO.bugzilla.commentTagging.counter, }
params : {
Bugzilla_api_token: BUGZILLA.api_token,
query : query,
limit : 10
}
});
};
ac.minQueryLength = this.min_len;
ac.autoHighlight = false;
ac.typeAhead = true;
ac.queryDelay = 0.5;
ac.dataReturnEvent.subscribe(function(type, args) {
args[0].autoHighlight = args[2].length == 1;
}); });
}, },
......
...@@ -805,117 +805,95 @@ function browserCanHideOptions(aSelect) { ...@@ -805,117 +805,95 @@ function browserCanHideOptions(aSelect) {
/* (end) option hiding code */ /* (end) option hiding code */
/** /**
* The Autoselect * Autocompletion
*/ */
YAHOO.bugzilla.userAutocomplete = {
counter : 0, $(function() {
dataSource : null,
generateRequest : function ( enteredText ){ // single user
YAHOO.bugzilla.userAutocomplete.counter =
YAHOO.bugzilla.userAutocomplete.counter + 1; function searchComplete() {
YAHOO.util.Connect.setDefaultPostHeader('application/json', true); var that = $(this);
var json_object = { that.data('counter', that.data('counter') - 1);
method : "User.get", if (that.data('counter') === 0)
id : YAHOO.bugzilla.userAutocomplete.counter, that.removeClass('autocomplete-running');
params : [ { if (document.activeElement != this)
that.autocomplete('hide');
};
var options_user = {
serviceUrl: 'rest/user',
params: {
Bugzilla_api_token: BUGZILLA.api_token, Bugzilla_api_token: BUGZILLA.api_token,
match : [ decodeURIComponent(enteredText) ], include_fields: 'name,real_name',
include_fields : [ "name", "real_name" ] limit: 100
} ] },
}; paramName: 'match',
var stringified = YAHOO.lang.JSON.stringify(json_object); deferRequestBy: 250,
var debug = { msg: "json-rpc obj debug info", "json obj": json_object, minChars: 3,
"param" : stringified} tabDisabled: true,
YAHOO.bugzilla.userAutocomplete.debug_helper( debug ); transformResult: function(response) {
return stringified; response = $.parseJSON(response);
}, return {
resultListFormat : function(oResultData, enteredText, sResultMatch) { suggestions: $.map(response.users, function(dataItem) {
return ( YAHOO.lang.escapeHTML(oResultData.real_name) + " (" return {
+ YAHOO.lang.escapeHTML(oResultData.name) + ")"); value: dataItem.name,
}, data : { login: dataItem.name, name: dataItem.real_name }
debug_helper : function ( ){ };
/* used to help debug any errors that might happen */ })
if( typeof(console) !== 'undefined' && console != null && arguments.length > 0 ){ };
console.log("debug helper info:", arguments); },
} formatResult: function(suggestion, currentValue) {
return true; return suggestion.data.name === '' ?
}, suggestion.data.login : suggestion.data.name + ' (' + suggestion.data.login + ')';
init_ds : function(){ },
this.dataSource = new YAHOO.util.XHRDataSource("jsonrpc.cgi"); onSearchStart: function(params) {
this.dataSource.connTimeout = 30000; var that = $(this);
this.dataSource.connMethodPost = true; params.match = $.trim(params.match);
this.dataSource.connXhrMode = "cancelStaleRequests"; that.addClass('autocomplete-running');
this.dataSource.maxCacheEntries = 5; that.data('counter', that.data('counter') + 1);
this.dataSource.responseSchema = { },
resultsList : "result.users", onSearchComplete: searchComplete,
metaFields : { error: "error", jsonRpcId: "id"}, onSearchError: searchComplete
fields : [ };
{ key : "name" },
{ key : "real_name"}
]
};
},
init : function( field, container, multiple ) {
if( this.dataSource == null ){
this.init_ds();
}
var userAutoComp = new YAHOO.widget.AutoComplete( field, container,
this.dataSource );
// other stuff we might want to do with the autocomplete goes here
userAutoComp.maxResultsDisplayed = BUGZILLA.param.maxusermatches;
userAutoComp.generateRequest = this.generateRequest;
userAutoComp.formatResult = this.resultListFormat;
userAutoComp.doBeforeLoadData = this.debug_helper;
userAutoComp.minQueryLength = 3;
userAutoComp.autoHighlight = false;
// this is a throttle to determine the delay of the query from typing
// set this higher to cause fewer calls to the server
userAutoComp.queryDelay = 0.05;
userAutoComp.useIFrame = true;
userAutoComp.resultTypeList = false;
if( multiple == true ){
userAutoComp.delimChar = [","];
}
}
};
YAHOO.bugzilla.fieldAutocomplete = { // multiple users (based on single user)
dataSource : [], var options_users = {
init_ds : function( field ) { delimiter: /,\s*/,
this.dataSource[field] = onSelect: function() {
new YAHOO.util.LocalDataSource( YAHOO.bugzilla.field_array[field] ); this.focus();
}, },
init : function( field, container ) { };
if( this.dataSource[field] == null ) { $.extend(options_users, options_user);
this.init_ds( field );
} // init user autocomplete fields
var fieldAutoComp = $('.bz_autocomplete_user')
new YAHOO.widget.AutoComplete(field, container, this.dataSource[field]); .each(function() {
fieldAutoComp.maxResultsDisplayed = YAHOO.bugzilla.field_array[field].length; var that = $(this);
fieldAutoComp.formatResult = fieldAutoComp.formatEscapedResult; that.data('counter', 0);
fieldAutoComp.minQueryLength = 0; if (that.data('multiple')) {
fieldAutoComp.useIFrame = true; that.devbridgeAutocomplete(options_users);
fieldAutoComp.delimChar = [","," "]; }
fieldAutoComp.resultTypeList = false; else {
fieldAutoComp.queryDelay = 0; that.devbridgeAutocomplete(options_user);
/* Causes all the possibilities in the field to appear when a user
* focuses on the textbox
*/
fieldAutoComp.textboxFocusEvent.subscribe( function(){
var sInputValue = YAHOO.util.Dom.get(field).value;
if( sInputValue.length === 0
&& YAHOO.bugzilla.field_array[field].length > 0 ){
this.sendQuery(sInputValue);
this.collapseContainer();
this.expandContainer();
} }
}); });
fieldAutoComp.dataRequestEvent.subscribe( function(type, args) {
args[0].autoHighlight = args[1] != ''; // init autocomplete fields with array of values
$('.bz_autocomplete_values')
.each(function() {
var that = $(this);
that.devbridgeAutocomplete({
lookup: BUGZILLA.autocomplete_values[that.data('values')],
tabDisabled: true,
delimiter: /,\s*/,
minChars: 0,
onSelect: function() {
this.focus();
}
});
}); });
} });
};
/** /**
* Set the disable email checkbox to true if the user has disabled text * Set the disable email checkbox to true if the user has disabled text
......
Copyright 2012 DevBridge and other contributors
http://www.devbridge.com/projects/autocomplete/jquery/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
...@@ -1069,3 +1069,31 @@ table.field_value_explanation { ...@@ -1069,3 +1069,31 @@ table.field_value_explanation {
} }
/* duplicates.cgi (end) */ /* duplicates.cgi (end) */
/* autocomplete */
.autocomplete-suggestions {
border: 1px solid #999;
background: #fff;
color: #000;
overflow: auto;
cursor: pointer;
}
.autocomplete-suggestion {
padding: 2px 5px;
white-space: nowrap;
overflow: hidden;
}
.autocomplete-selected {
background: #426fd9;
color: #FFF
}
.autocomplete-running {
background-image: url("throbber.gif") !important;
background-repeat: no-repeat !important;
background-position: right 8px center !important;
}
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
style_urls = ['skins/standard/admin.css'] style_urls = ['skins/standard/admin.css']
javascript_urls = ['js/util.js', 'js/field.js', 'js/TUI.js'] javascript_urls = ['js/util.js', 'js/field.js', 'js/TUI.js']
doc_section = current_tab.doc_section doc_section = current_tab.doc_section
yui = ['autocomplete']
%] %]
[% WRAPPER global/tabs.html.tmpl [% WRAPPER global/tabs.html.tmpl
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
title = title title = title
generate_api_token = 1 generate_api_token = 1
style_urls = ['skins/standard/admin.css'] style_urls = ['skins/standard/admin.css']
yui = [ 'autocomplete' ]
javascript_urls = [ "js/field.js" ] javascript_urls = [ "js/field.js" ]
%] %]
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
title = title title = title
generate_api_token = 1 generate_api_token = 1
style_urls = ['skins/standard/admin.css'] style_urls = ['skins/standard/admin.css']
yui = [ 'autocomplete' ]
javascript_urls = [ "js/field.js" ] javascript_urls = [ "js/field.js" ]
%] %]
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
generate_api_token = 1 generate_api_token = 1
style_urls = ['skins/standard/admin.css'] style_urls = ['skins/standard/admin.css']
javascript_urls = ['js/util.js', 'js/field.js'] javascript_urls = ['js/util.js', 'js/field.js']
yui = [ 'autocomplete' ]
%] %]
[% DEFAULT [% DEFAULT
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
subheader = subheader subheader = subheader
generate_api_token = 1 generate_api_token = 1
style_urls = ['skins/standard/bug.css'] style_urls = ['skins/standard/bug.css']
yui = [ 'autocomplete' ]
javascript_urls = [ "js/attachment.js", 'js/field.js', "js/util.js", "js/TUI.js" ] javascript_urls = [ "js/attachment.js", 'js/field.js', "js/util.js", "js/TUI.js" ]
doc_section = "using/editing.html#attachments" doc_section = "using/editing.html#attachments"
%] %]
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
doc_section = "using/editing.html#attachments" doc_section = "using/editing.html#attachments"
javascript_urls = ['js/attachment.js', 'js/field.js'] javascript_urls = ['js/attachment.js', 'js/field.js']
style_urls = ['skins/standard/bug.css'] style_urls = ['skins/standard/bug.css']
yui = [ 'autocomplete' ]
bodyclasses = "no_javascript" bodyclasses = "no_javascript"
%] %]
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = title title = title
generate_api_token = 1 generate_api_token = 1
yui = [ 'autocomplete', 'calendar', 'datatable', 'button' ] yui = [ 'calendar', 'datatable', 'button' ]
style_urls = ['skins/standard/bug.css'] style_urls = ['skins/standard/bug.css']
javascript_urls = [ "js/attachment.js", "js/util.js", javascript_urls = [ "js/attachment.js", "js/util.js",
"js/field.js", "js/TUI.js", "js/bug.js" ] "js/field.js", "js/TUI.js", "js/bug.js" ]
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
[% IF user.can_tag_comments %] [% IF user.can_tag_comments %]
<div id="bz_ctag_div" class="bz_default_hidden"> <div id="bz_ctag_div" class="bz_default_hidden">
<a href="javascript:void(0)" onclick="YAHOO.bugzilla.commentTagging.hideInput()">x</a> <a href="javascript:void(0)" onclick="YAHOO.bugzilla.commentTagging.hideInput()">x</a>
<div> <span>
<input id="bz_ctag_add" size="10" placeholder="add tag" <input id="bz_ctag_add" size="10" placeholder="add tag"
maxlength="[% constants.MAX_COMMENT_TAG_LENGTH FILTER html %]"> maxlength="[% constants.MAX_COMMENT_TAG_LENGTH FILTER html %]">
<span id="bz_ctag_autocomp"></span> <span id="bz_ctag_autocomp"></span>
</div> </span>
&nbsp; &nbsp;
</div> </div>
<div id="bz_ctag_error" class="bz_default_hidden"> <div id="bz_ctag_error" class="bz_default_hidden">
......
...@@ -196,23 +196,20 @@ ...@@ -196,23 +196,20 @@
</script> </script>
[% END %] [% END %]
[% END %] [% END %]
[% CASE constants.FIELD_TYPE_KEYWORDS %] [% CASE constants.FIELD_TYPE_KEYWORDS %]
<div id="[% field.name FILTER html %]_container"> <input type="text" id="[% field.name FILTER html %]" size="40"
<input type="text" id="[% field.name FILTER html %]" size="40" class="text_input bz_autocomplete_values"
class="text_input" name="[% field.name FILTER html %]" name="[% field.name FILTER html %]"
value="[% value FILTER html %]"> data-values="[% field.name FILTER html %]"
<div id="[% field.name FILTER html %]_autocomplete"></div> value="[% value FILTER html %]">
</div> <script type="text/javascript">
<script type="text/javascript"> if (typeof BUGZILLA.autocomplete_values === 'undefined')
if (typeof YAHOO.bugzilla.field_array === "undefined") BUGZILLA.autocomplete_values = [];
YAHOO.bugzilla.field_array = []; BUGZILLA.autocomplete_values['[% field.name FILTER js %]'] = [
YAHOO.bugzilla.field_array["[% field.name FILTER js %]"] = [ [%- FOREACH val = possible_values %]
[%- FOREACH val = possible_values %] [%- %]"[% val FILTER js %]"
[%-# %]"[% val FILTER js %]" [%- "," IF NOT loop.last %][% END %]];
[%- "," IF NOT loop.last %][% END %]]; </script>
YAHOO.bugzilla.fieldAutocomplete.init('[% field.name FILTER js %]',
'[% field.name FILTER js %]_autocomplete');
</script>
[% END %] [% END %]
[% ELSE %] [% ELSE %]
[% SWITCH field.type %] [% SWITCH field.type %]
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
[% END %] [% END %]
[% title = title _ filtered_desc %] [% title = title _ filtered_desc %]
[% generate_api_token = 1 %] [% generate_api_token = 1 %]
[% yui = ['autocomplete', 'calendar'] %] [% yui = [ 'calendar' ] %]
[% yui.push('container') IF user.can_tag_comments %] [% yui.push('json', 'connection', 'container') IF user.can_tag_comments %]
[% javascript_urls = [ "js/util.js", "js/field.js", "js/comments.js" ] %] [% javascript_urls = [ "js/util.js", "js/field.js", "js/comments.js" ] %]
[% javascript_urls.push("js/bug.js") IF user.id %] [% javascript_urls.push("js/bug.js") IF user.id %]
[% javascript_urls.push('js/comment-tagging.js') [% javascript_urls.push('js/comment-tagging.js')
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
[% IF NOT no_yui %] [% IF NOT no_yui %]
[% SET yui_css = { [% SET yui_css = {
autocomplete => 1,
calendar => 1, calendar => 1,
datatable => 1, datatable => 1,
button => 1, button => 1,
...@@ -54,8 +53,7 @@ ...@@ -54,8 +53,7 @@
# if that module is going to be specified in "yui". # if that module is going to be specified in "yui".
#%] #%]
[% SET yui_deps = { [% SET yui_deps = {
autocomplete => ['json', 'connection', 'datasource'], datatable => ['json', 'connection', 'datasource', 'element'],
datatable => ['json', 'connection', 'datasource', 'element'],
} %] } %]
[%# When using certain YUI modules, we need to process certain [%# When using certain YUI modules, we need to process certain
...@@ -86,8 +84,8 @@ ...@@ -86,8 +84,8 @@
] %] ] %]
[% style_urls.import(jquery_css, jq_css_urls) FILTER null %] [% style_urls.import(jquery_css, jq_css_urls) FILTER null %]
[%# Add jQuery cookie support %] [%# Add our required jQuery plugins %]
[% jquery.push("cookie") %] [% jquery.push("cookie", "devbridgeAutocomplete") %]
[%# We should be able to set the default value of the header variable [%# We should be able to set the default value of the header variable
# to the value of the title variable using the DEFAULT directive, # to the value of the title variable using the DEFAULT directive,
......
...@@ -71,10 +71,14 @@ ...@@ -71,10 +71,14 @@
[% END %] [% END %]
</select> </select>
[% ELSE %] [% ELSE %]
[% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %] [%
<div id="[% id FILTER html %]_autocomplete" IF id && feature_enabled('jsonrpc') && Param('ajax_user_autocompletion');
[% IF classes %] class="[% classes.join(' ') FILTER html %]" [% END %]> IF !classes.defined;
[% END %] classes = [];
END;
classes.push("bz_autocomplete_user");
END;
%]
<input <input
name="[% name FILTER html %]" name="[% name FILTER html %]"
value="[% value FILTER html %]" value="[% value FILTER html %]"
...@@ -86,17 +90,6 @@ ...@@ -86,17 +90,6 @@
[% IF size %] size="[% size FILTER html %]" [% END %] [% IF size %] size="[% size FILTER html %]" [% END %]
[% IF id %] id="[% id FILTER html %]" [% END %] [% IF id %] id="[% id FILTER html %]" [% END %]
[% IF mandatory %] required [% END %] [% IF mandatory %] required [% END %]
[% IF multiple %] data-multiple="1" [% END %]
> >
[% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %]
<div id="[% id FILTER html %]_autocomplete_container"></div>
</div>
<script type="text/javascript">
if( typeof(YAHOO.bugzilla.userAutocomplete) !== 'undefined'
&& YAHOO.bugzilla.userAutocomplete != null){
YAHOO.bugzilla.userAutocomplete.init( "[% id FILTER js %]",
"[% id FILTER js %]_autocomplete_container"
[% IF multiple %], true[% END%]);
}
</script>
[% END %]
[% END %] [% END %]
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
title = title title = title
generate_api_token = dotweak generate_api_token = dotweak
atomlink = "buglist.cgi?$urlquerypart&title=$title&ctype=atom" atomlink = "buglist.cgi?$urlquerypart&title=$title&ctype=atom"
yui = [ 'autocomplete', 'calendar' ] yui = [ 'calendar' ]
javascript_urls = [ "js/util.js", "js/field.js", "js/TUI.js" ] javascript_urls = [ "js/util.js", "js/field.js", "js/TUI.js" ]
style_urls = [ "skins/standard/buglist.css" ] style_urls = [ "skins/standard/buglist.css" ]
doc_section = "using/finding.html" doc_section = "using/finding.html"
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
onload="var f = document.request_form; selectProduct(f.product, f.component, null, null, 'Any');" onload="var f = document.request_form; selectProduct(f.product, f.component, null, null, 'Any');"
javascript_urls=["js/productform.js", "js/field.js"] javascript_urls=["js/productform.js", "js/field.js"]
style_urls = ['skins/standard/buglist.css'] style_urls = ['skins/standard/buglist.css']
yui = ['autocomplete']
%] %]
<script type="text/javascript"> <script type="text/javascript">
......
...@@ -35,22 +35,19 @@ ...@@ -35,22 +35,19 @@
types = types, types = types,
selected = type_selected selected = type_selected
%] %]
<div id="[% field.name FILTER html %]_container"> <input name="[% field.name FILTER html %]"
<input name="[% field.name FILTER html %]" id="[% field.name FILTER html %]" size="40"
id="[% field.name FILTER html %]" size="40" class="bz_autocomplete_values"
[% IF onchange %] onchange="[% onchange FILTER html %]"[% END %] [% IF onchange %] onchange="[% onchange FILTER html %]"[% END %]
value="[% value FILTER html %]" [% 'autofocus' IF focus %]> value="[% value FILTER html %]" [% 'autofocus' IF focus %]
<div id="[% field.name FILTER html %]_autocomplete"></div> data-values="[% field.name FILTER html %]">
</div>
<script type="text/javascript"> <script type="text/javascript">
if (typeof YAHOO.bugzilla.field_array === "undefined") if (typeof BUGZILLA.autocomplete_values === 'undefined')
YAHOO.bugzilla.field_array = []; BUGZILLA.autocomplete_values = [];
YAHOO.bugzilla.field_array["[% field.name FILTER js %]"] = [ BUGZILLA.autocomplete_values['[% field.name FILTER js %]'] = [
[%- FOREACH val = possible_values %] [%- FOREACH val = possible_values %]
[%-# %]"[% val FILTER js %]" [%- %]"[% val FILTER js %]"
[%- "," IF NOT loop.last %][% END %]]; [%- "," IF NOT loop.last %][% END %]];
YAHOO.bugzilla.fieldAutocomplete.init('[% field.name FILTER js %]',
'[% field.name FILTER js %]_autocomplete');
</script> </script>
[% CASE [constants.FIELD_TYPE_DATETIME, constants.FIELD_TYPE_DATE] %] [% CASE [constants.FIELD_TYPE_DATETIME, constants.FIELD_TYPE_DATE] %]
[% INCLUDE "bug/field-label.html.tmpl" [% INCLUDE "bug/field-label.html.tmpl"
......
...@@ -268,19 +268,11 @@ TUI_hide_default('information_query'); ...@@ -268,19 +268,11 @@ TUI_hide_default('information_query');
[% " selected" IF default.emailtype.$n == qv.name %]>[% qv.description %]</option> [% " selected" IF default.emailtype.$n == qv.name %]>[% qv.description %]</option>
[% END %] [% END %]
</select> </select>
[% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') %] <input
<div id="email[% n %]_autocomplete"> name="email[% n %]"
[% END %] class="email [% "bz_autocomplete_user" IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') %]"
<input name="email[% n %]" class="email" id="email[% n %]" id="email[% n %]"
value="[% default.email.$n FILTER html %]"> value="[% default.email.$n FILTER html %]">
[% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') %]
<div id="email[% n %]_autocomplete_container"></div>
</div>
<script type="text/javascript">
YAHOO.bugzilla.userAutocomplete.init( "email[% n %]",
"email[% n %]_autocomplete_container");
</script>
[% END %]
</div> </div>
[% END %] [% END %]
[% Hook.process('email_numbering_end') %] [% Hook.process('email_numbering_end') %]
......
...@@ -26,7 +26,8 @@ function remove_token() { ...@@ -26,7 +26,8 @@ function remove_token() {
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "Search for $terms.bugs" title = "Search for $terms.bugs"
yui = [ 'autocomplete', 'calendar' ] generate_api_token = 1
yui = [ 'calendar' ]
javascript = javascript javascript = javascript
javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js"] javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js"]
style_urls = ['skins/standard/buglist.css'] style_urls = ['skins/standard/buglist.css']
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "Create New Data Set" title = "Create New Data Set"
onload = "doOnSelectProduct(0);" onload = "doOnSelectProduct(0);"
yui = [ 'autocomplete', 'calendar' ] yui = [ 'calendar' ]
javascript = js_data javascript = js_data
javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ] javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ]
style_urls = ['skins/standard/buglist.css'] style_urls = ['skins/standard/buglist.css']
......
...@@ -18,7 +18,7 @@ var queryform = "reportform" ...@@ -18,7 +18,7 @@ var queryform = "reportform"
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "Generate Graphical Report" title = "Generate Graphical Report"
onload = "doOnSelectProduct(0); chartTypeChanged()" onload = "doOnSelectProduct(0); chartTypeChanged()"
yui = [ 'autocomplete', 'calendar' ] yui = [ 'calendar' ]
javascript = js_data javascript = js_data
javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ] javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ]
style_urls = ['skins/standard/buglist.css'] style_urls = ['skins/standard/buglist.css']
......
...@@ -18,7 +18,7 @@ var queryform = "reportform" ...@@ -18,7 +18,7 @@ var queryform = "reportform"
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "Generate Tabular Report" title = "Generate Tabular Report"
onload = "doOnSelectProduct(0)" onload = "doOnSelectProduct(0)"
yui = [ 'autocomplete', 'calendar' ] yui = [ 'calendar' ]
javascript = js_data javascript = js_data
javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ] javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ]
style_urls = ['skins/standard/buglist.css'] style_urls = ['skins/standard/buglist.css']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment