summaryrefslogtreecommitdiffstats
path: root/template/en/default/global
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-05-26 17:59:57 +0200
committerByron Jones <glob@mozilla.com>2015-05-26 17:59:57 +0200
commitf8b984852ae27f14a5f44e651193f00977737ab1 (patch)
tree7b7d631f17fa9b82844f0db79b605f157fa48e2c /template/en/default/global
parent95e71eea95c977eb7512156be813ede7eb161600 (diff)
downloadbugzilla-f8b984852ae27f14a5f44e651193f00977737ab1.tar.gz
bugzilla-f8b984852ae27f14a5f44e651193f00977737ab1.tar.xz
Bug 1146782: backport bug 1159589 to bmo (migrate autocomplete from yui to jquery)
Diffstat (limited to 'template/en/default/global')
-rw-r--r--template/en/default/global/header.html.tmpl6
-rw-r--r--template/en/default/global/userselect.html.tmpl62
2 files changed, 27 insertions, 41 deletions
diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl
index 5528a96c2..086191a39 100644
--- a/template/en/default/global/header.html.tmpl
+++ b/template/en/default/global/header.html.tmpl
@@ -58,7 +58,6 @@
[% IF NOT no_yui %]
[% SET yui_css = {
- autocomplete => 1,
calendar => 1,
datatable => 1,
button => 1,
@@ -69,7 +68,6 @@
# if that module is going to be specified in "yui".
#%]
[% SET yui_deps = {
- autocomplete => ['json', 'connection', 'datasource'],
datatable => ['json', 'connection', 'datasource', 'element'],
} %]
@@ -101,8 +99,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 d7b4786f9..f7dc03d89 100644
--- a/template/en/default/global/userselect.html.tmpl
+++ b/template/en/default/global/userselect.html.tmpl
@@ -1,19 +1,9 @@
-[%# The contents of this file are subject to the Mozilla Public
- # License Version 1.1 (the "License"); you may not use this file
- # except in compliance with the License. You may obtain a copy of
- # the License at http://www.mozilla.org/MPL/
+[%# This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
- # Software distributed under the License is distributed on an "AS
- # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- # implied. See the License for the specific language governing
- # rights and limitations under the License.
- #
- # The Original Code is the Bugzilla Bug Tracking System.
- #
- # Contributor(s): Byron Jones <bugzilla@glob.com.au>
- # Frédéric Buclin <LpSolit@gmail.com>
- # Guy Pyrzak <guy.pyrzak@gmail.com>
- # Reed Loden <reed@reedloden.com>
+ # This Source Code Form is "Incompatible With Secondary Licenses", as
+ # defined by the Mozilla Public License, v. 2.0.
#%]
[%# INTERFACE:
@@ -31,6 +21,7 @@
# custom_userlist: optional, specify a limited list of users to use
# field_title: optional, extra information to display as a tooltip
# placeholder: optional, input only; placeholder attribute value
+ # mandatory: optional; if true, the field cannot be empty.
#%]
[% IF Param("usemenuforusers") %]
@@ -42,6 +33,7 @@
[% IF accesskey %] accesskey="[% accesskey FILTER html %]" [% END %]
[% IF multiple %] multiple="multiple" size="[% multiple FILTER html %]" [% END %]
[% IF field_title %] title="[% field_title FILTER html %]" [% END %]
+ [% IF mandatory %] required [% END %]
>
[% IF emptyok %]
<option value=""></option>
@@ -54,12 +46,14 @@
[% custom_userlist = user.get_userlist %]
[% END %]
- [% SET selected = {} %]
- [% IF value.defined %]
- [% FOREACH selected_value IN value.split(', ') %]
- [% SET selected.$selected_value = 1 %]
- [% END %]
- [% END %]
+ [%
+ SET selected = {};
+ IF value.defined;
+ FOREACH selected_value IN value.split(', ');
+ SET selected.$selected_value = 1;
+ END;
+ END;
+ %]
[% FOREACH tmpuser = custom_userlist %]
[% IF tmpuser.visible OR selected.${tmpuser.login} == 1 %]
@@ -80,10 +74,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 %]"
@@ -95,17 +93,7 @@
[% IF size %] size="[% size FILTER html %]" [% END %]
[% IF placeholder %] placeholder="[% placeholder 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 %]