summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-05-07 06:49:01 +0200
committerByron Jones <glob@mozilla.com>2015-05-07 06:49:01 +0200
commit33a4bd46fd17ab28567cdeb2eb3733901f2a033e (patch)
tree2639f65e1e408482b8e1b65f73c2245ae58617ba /template
parent7a75256f5daa3b81bea0c6d47b53d2409568d7fa (diff)
downloadbugzilla-33a4bd46fd17ab28567cdeb2eb3733901f2a033e.tar.gz
bugzilla-33a4bd46fd17ab28567cdeb2eb3733901f2a033e.tar.xz
Bug 1159589: migrate autocomplete from yui to jquery
r=dylan,a=glob
Diffstat (limited to 'template')
-rw-r--r--template/en/default/account/prefs/prefs.html.tmpl1
-rw-r--r--template/en/default/admin/components/create.html.tmpl1
-rw-r--r--template/en/default/admin/components/edit.html.tmpl1
-rw-r--r--template/en/default/admin/products/create.html.tmpl1
-rw-r--r--template/en/default/attachment/create.html.tmpl1
-rw-r--r--template/en/default/attachment/edit.html.tmpl1
-rw-r--r--template/en/default/bug/create/create.html.tmpl2
-rw-r--r--template/en/default/bug/edit.html.tmpl4
-rw-r--r--template/en/default/bug/field.html.tmpl31
-rw-r--r--template/en/default/bug/show-header.html.tmpl4
-rw-r--r--template/en/default/global/header.html.tmpl8
-rw-r--r--template/en/default/global/userselect.html.tmpl25
-rw-r--r--template/en/default/list/list.html.tmpl2
-rw-r--r--template/en/default/request/queue.html.tmpl1
-rw-r--r--template/en/default/search/field.html.tmpl23
-rw-r--r--template/en/default/search/form.html.tmpl18
-rw-r--r--template/en/default/search/search-advanced.html.tmpl3
-rw-r--r--template/en/default/search/search-create-series.html.tmpl2
-rw-r--r--template/en/default/search/search-report-graph.html.tmpl2
-rw-r--r--template/en/default/search/search-report-table.html.tmpl2
20 files changed, 52 insertions, 81 deletions
diff --git a/template/en/default/account/prefs/prefs.html.tmpl b/template/en/default/account/prefs/prefs.html.tmpl
index 21a823fb6..8d90d7b6e 100644
--- a/template/en/default/account/prefs/prefs.html.tmpl
+++ b/template/en/default/account/prefs/prefs.html.tmpl
@@ -59,7 +59,6 @@
style_urls = ['skins/standard/admin.css']
javascript_urls = ['js/util.js', 'js/field.js', 'js/TUI.js']
doc_section = current_tab.doc_section
- yui = ['autocomplete']
%]
[% WRAPPER global/tabs.html.tmpl
diff --git a/template/en/default/admin/components/create.html.tmpl b/template/en/default/admin/components/create.html.tmpl
index 96c9ce384..858df7102 100644
--- a/template/en/default/admin/components/create.html.tmpl
+++ b/template/en/default/admin/components/create.html.tmpl
@@ -16,7 +16,6 @@
title = title
generate_api_token = 1
style_urls = ['skins/standard/admin.css']
- yui = [ 'autocomplete' ]
javascript_urls = [ "js/field.js" ]
%]
diff --git a/template/en/default/admin/components/edit.html.tmpl b/template/en/default/admin/components/edit.html.tmpl
index c4da1181b..1e93542a5 100644
--- a/template/en/default/admin/components/edit.html.tmpl
+++ b/template/en/default/admin/components/edit.html.tmpl
@@ -20,7 +20,6 @@
title = title
generate_api_token = 1
style_urls = ['skins/standard/admin.css']
- yui = [ 'autocomplete' ]
javascript_urls = [ "js/field.js" ]
%]
diff --git a/template/en/default/admin/products/create.html.tmpl b/template/en/default/admin/products/create.html.tmpl
index 0dcfd7283..0b116f480 100644
--- a/template/en/default/admin/products/create.html.tmpl
+++ b/template/en/default/admin/products/create.html.tmpl
@@ -20,7 +20,6 @@
generate_api_token = 1
style_urls = ['skins/standard/admin.css']
javascript_urls = ['js/util.js', 'js/field.js']
- yui = [ 'autocomplete' ]
%]
[% DEFAULT
diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl
index 05223ede4..75c7702cc 100644
--- a/template/en/default/attachment/create.html.tmpl
+++ b/template/en/default/attachment/create.html.tmpl
@@ -18,7 +18,6 @@
subheader = subheader
generate_api_token = 1
style_urls = ['skins/standard/bug.css']
- yui = [ 'autocomplete' ]
javascript_urls = [ "js/attachment.js", 'js/field.js', "js/util.js", "js/TUI.js" ]
doc_section = "using/editing.html#attachments"
%]
diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl
index d2554dfb8..b6f612f3f 100644
--- a/template/en/default/attachment/edit.html.tmpl
+++ b/template/en/default/attachment/edit.html.tmpl
@@ -25,7 +25,6 @@
doc_section = "using/editing.html#attachments"
javascript_urls = ['js/attachment.js', 'js/field.js']
style_urls = ['skins/standard/bug.css']
- yui = [ 'autocomplete' ]
bodyclasses = "no_javascript"
%]
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl
index c9a7c7db9..23fb276c9 100644
--- a/template/en/default/bug/create/create.html.tmpl
+++ b/template/en/default/bug/create/create.html.tmpl
@@ -12,7 +12,7 @@
[% PROCESS global/header.html.tmpl
title = title
generate_api_token = 1
- yui = [ 'autocomplete', 'calendar', 'datatable', 'button' ]
+ yui = [ 'calendar', 'datatable', 'button' ]
style_urls = ['skins/standard/bug.css']
javascript_urls = [ "js/attachment.js", "js/util.js",
"js/field.js", "js/TUI.js", "js/bug.js" ]
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 5402624f6..460b5b697 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -12,11 +12,11 @@
[% IF user.can_tag_comments %]
<div id="bz_ctag_div" class="bz_default_hidden">
<a href="javascript:void(0)" onclick="YAHOO.bugzilla.commentTagging.hideInput()">x</a>
- <div>
+ <span>
<input id="bz_ctag_add" size="10" placeholder="add tag"
maxlength="[% constants.MAX_COMMENT_TAG_LENGTH FILTER html %]">
<span id="bz_ctag_autocomp"></span>
- </div>
+ </span>
&nbsp;
</div>
<div id="bz_ctag_error" class="bz_default_hidden">
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index f1ddf633f..bfd385f9d 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -196,23 +196,20 @@
</script>
[% END %]
[% END %]
- [% CASE constants.FIELD_TYPE_KEYWORDS %]
- <div id="[% field.name FILTER html %]_container">
- <input type="text" id="[% field.name FILTER html %]" size="40"
- class="text_input" name="[% field.name FILTER html %]"
- value="[% value FILTER html %]">
- <div id="[% field.name FILTER html %]_autocomplete"></div>
- </div>
- <script type="text/javascript">
- if (typeof YAHOO.bugzilla.field_array === "undefined")
- YAHOO.bugzilla.field_array = [];
- YAHOO.bugzilla.field_array["[% field.name FILTER js %]"] = [
- [%- FOREACH val = possible_values %]
- [%-# %]"[% val FILTER js %]"
- [%- "," IF NOT loop.last %][% END %]];
- YAHOO.bugzilla.fieldAutocomplete.init('[% field.name FILTER js %]',
- '[% field.name FILTER js %]_autocomplete');
- </script>
+ [% CASE constants.FIELD_TYPE_KEYWORDS %]
+ <input type="text" id="[% field.name FILTER html %]" size="40"
+ class="text_input bz_autocomplete_values"
+ name="[% field.name FILTER html %]"
+ data-values="[% field.name FILTER html %]"
+ value="[% value FILTER html %]">
+ <script type="text/javascript">
+ if (typeof BUGZILLA.autocomplete_values === 'undefined')
+ BUGZILLA.autocomplete_values = [];
+ BUGZILLA.autocomplete_values['[% field.name FILTER js %]'] = [
+ [%- FOREACH val = possible_values %]
+ [%- %]"[% val FILTER js %]"
+ [%- "," IF NOT loop.last %][% END %]];
+ </script>
[% END %]
[% ELSE %]
[% SWITCH field.type %]
diff --git a/template/en/default/bug/show-header.html.tmpl b/template/en/default/bug/show-header.html.tmpl
index f18afed96..473df17da 100644
--- a/template/en/default/bug/show-header.html.tmpl
+++ b/template/en/default/bug/show-header.html.tmpl
@@ -24,8 +24,8 @@
[% END %]
[% title = title _ filtered_desc %]
[% generate_api_token = 1 %]
-[% yui = ['autocomplete', 'calendar'] %]
-[% yui.push('container') IF user.can_tag_comments %]
+[% yui = [ 'calendar' ] %]
+[% yui.push('json', 'connection', 'container') IF user.can_tag_comments %]
[% javascript_urls = [ "js/util.js", "js/field.js", "js/comments.js" ] %]
[% javascript_urls.push("js/bug.js") IF user.id %]
[% javascript_urls.push('js/comment-tagging.js')
diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl
index 65b96ec84..b05784ebe 100644
--- a/template/en/default/global/header.html.tmpl
+++ b/template/en/default/global/header.html.tmpl
@@ -43,7 +43,6 @@
[% IF NOT no_yui %]
[% SET yui_css = {
- autocomplete => 1,
calendar => 1,
datatable => 1,
button => 1,
@@ -54,8 +53,7 @@
# if that module is going to be specified in "yui".
#%]
[% 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
@@ -86,8 +84,8 @@
] %]
[% style_urls.import(jquery_css, jq_css_urls) FILTER null %]
-[%# Add jQuery cookie support %]
-[% jquery.push("cookie") %]
+[%# Add our required jQuery plugins %]
+[% jquery.push("cookie", "devbridgeAutocomplete") %]
[%# We should be able to set the default value of the header variable
# to the value of the title variable using the DEFAULT directive,
diff --git a/template/en/default/global/userselect.html.tmpl b/template/en/default/global/userselect.html.tmpl
index e2210c6f2..67d9f8d48 100644
--- a/template/en/default/global/userselect.html.tmpl
+++ b/template/en/default/global/userselect.html.tmpl
@@ -71,10 +71,14 @@
[% END %]
</select>
[% ELSE %]
- [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %]
- <div id="[% id FILTER html %]_autocomplete"
- [% IF classes %] class="[% classes.join(' ') FILTER html %]" [% END %]>
- [% END %]
+ [%
+ IF id && feature_enabled('jsonrpc') && Param('ajax_user_autocompletion');
+ IF !classes.defined;
+ classes = [];
+ END;
+ classes.push("bz_autocomplete_user");
+ END;
+ %]
<input
name="[% name FILTER html %]"
value="[% value FILTER html %]"
@@ -86,17 +90,6 @@
[% IF size %] size="[% size FILTER html %]" [% END %]
[% IF id %] id="[% id FILTER html %]" [% 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 %]
diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl
index 65065bf32..c8750ffcd 100644
--- a/template/en/default/list/list.html.tmpl
+++ b/template/en/default/list/list.html.tmpl
@@ -61,7 +61,7 @@
title = title
generate_api_token = dotweak
atomlink = "buglist.cgi?$urlquerypart&title=$title&ctype=atom"
- yui = [ 'autocomplete', 'calendar' ]
+ yui = [ 'calendar' ]
javascript_urls = [ "js/util.js", "js/field.js", "js/TUI.js" ]
style_urls = [ "skins/standard/buglist.css" ]
doc_section = "using/finding.html"
diff --git a/template/en/default/request/queue.html.tmpl b/template/en/default/request/queue.html.tmpl
index 828bdba9f..4e406190d 100644
--- a/template/en/default/request/queue.html.tmpl
+++ b/template/en/default/request/queue.html.tmpl
@@ -15,7 +15,6 @@
onload="var f = document.request_form; selectProduct(f.product, f.component, null, null, 'Any');"
javascript_urls=["js/productform.js", "js/field.js"]
style_urls = ['skins/standard/buglist.css']
- yui = ['autocomplete']
%]
<script type="text/javascript">
diff --git a/template/en/default/search/field.html.tmpl b/template/en/default/search/field.html.tmpl
index 5a95d67c1..b2013eff6 100644
--- a/template/en/default/search/field.html.tmpl
+++ b/template/en/default/search/field.html.tmpl
@@ -35,22 +35,19 @@
types = types,
selected = type_selected
%]
- <div id="[% field.name FILTER html %]_container">
- <input name="[% field.name FILTER html %]"
- id="[% field.name FILTER html %]" size="40"
- [% IF onchange %] onchange="[% onchange FILTER html %]"[% END %]
- value="[% value FILTER html %]" [% 'autofocus' IF focus %]>
- <div id="[% field.name FILTER html %]_autocomplete"></div>
- </div>
+ <input name="[% field.name FILTER html %]"
+ id="[% field.name FILTER html %]" size="40"
+ class="bz_autocomplete_values"
+ [% IF onchange %] onchange="[% onchange FILTER html %]"[% END %]
+ value="[% value FILTER html %]" [% 'autofocus' IF focus %]
+ data-values="[% field.name FILTER html %]">
<script type="text/javascript">
- if (typeof YAHOO.bugzilla.field_array === "undefined")
- YAHOO.bugzilla.field_array = [];
- YAHOO.bugzilla.field_array["[% field.name FILTER js %]"] = [
+ if (typeof BUGZILLA.autocomplete_values === 'undefined')
+ BUGZILLA.autocomplete_values = [];
+ BUGZILLA.autocomplete_values['[% field.name FILTER js %]'] = [
[%- FOREACH val = possible_values %]
- [%-# %]"[% val FILTER js %]"
+ [%- %]"[% val FILTER js %]"
[%- "," IF NOT loop.last %][% END %]];
- YAHOO.bugzilla.fieldAutocomplete.init('[% field.name FILTER js %]',
- '[% field.name FILTER js %]_autocomplete');
</script>
[% CASE [constants.FIELD_TYPE_DATETIME, constants.FIELD_TYPE_DATE] %]
[% INCLUDE "bug/field-label.html.tmpl"
diff --git a/template/en/default/search/form.html.tmpl b/template/en/default/search/form.html.tmpl
index c9265f076..410bd2d20 100644
--- a/template/en/default/search/form.html.tmpl
+++ b/template/en/default/search/form.html.tmpl
@@ -268,19 +268,11 @@ TUI_hide_default('information_query');
[% " selected" IF default.emailtype.$n == qv.name %]>[% qv.description %]</option>
[% END %]
</select>
- [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') %]
- <div id="email[% n %]_autocomplete">
- [% END %]
- <input name="email[% n %]" class="email" id="email[% n %]"
- 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 %]
+ <input
+ name="email[% n %]"
+ class="email [% "bz_autocomplete_user" IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') %]"
+ id="email[% n %]"
+ value="[% default.email.$n FILTER html %]">
</div>
[% END %]
[% Hook.process('email_numbering_end') %]
diff --git a/template/en/default/search/search-advanced.html.tmpl b/template/en/default/search/search-advanced.html.tmpl
index 07c5fc528..af07aa475 100644
--- a/template/en/default/search/search-advanced.html.tmpl
+++ b/template/en/default/search/search-advanced.html.tmpl
@@ -26,7 +26,8 @@ function remove_token() {
[% PROCESS global/header.html.tmpl
title = "Search for $terms.bugs"
- yui = [ 'autocomplete', 'calendar' ]
+ generate_api_token = 1
+ yui = [ 'calendar' ]
javascript = javascript
javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js"]
style_urls = ['skins/standard/buglist.css']
diff --git a/template/en/default/search/search-create-series.html.tmpl b/template/en/default/search/search-create-series.html.tmpl
index 95750ebc0..6df1a79d3 100644
--- a/template/en/default/search/search-create-series.html.tmpl
+++ b/template/en/default/search/search-create-series.html.tmpl
@@ -19,7 +19,7 @@
[% PROCESS global/header.html.tmpl
title = "Create New Data Set"
onload = "doOnSelectProduct(0);"
- yui = [ 'autocomplete', 'calendar' ]
+ yui = [ 'calendar' ]
javascript = js_data
javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ]
style_urls = ['skins/standard/buglist.css']
diff --git a/template/en/default/search/search-report-graph.html.tmpl b/template/en/default/search/search-report-graph.html.tmpl
index b382edf95..6cbafd11c 100644
--- a/template/en/default/search/search-report-graph.html.tmpl
+++ b/template/en/default/search/search-report-graph.html.tmpl
@@ -18,7 +18,7 @@ var queryform = "reportform"
[% PROCESS global/header.html.tmpl
title = "Generate Graphical Report"
onload = "doOnSelectProduct(0); chartTypeChanged()"
- yui = [ 'autocomplete', 'calendar' ]
+ yui = [ 'calendar' ]
javascript = js_data
javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ]
style_urls = ['skins/standard/buglist.css']
diff --git a/template/en/default/search/search-report-table.html.tmpl b/template/en/default/search/search-report-table.html.tmpl
index 483fd5b07..18c871313 100644
--- a/template/en/default/search/search-report-table.html.tmpl
+++ b/template/en/default/search/search-report-table.html.tmpl
@@ -18,7 +18,7 @@ var queryform = "reportform"
[% PROCESS global/header.html.tmpl
title = "Generate Tabular Report"
onload = "doOnSelectProduct(0)"
- yui = [ 'autocomplete', 'calendar' ]
+ yui = [ 'calendar' ]
javascript = js_data
javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ]
style_urls = ['skins/standard/buglist.css']