From f8b984852ae27f14a5f44e651193f00977737ab1 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 26 May 2015 23:59:57 +0800 Subject: Bug 1146782: backport bug 1159589 to bmo (migrate autocomplete from yui to jquery) --- template/en/default/account/prefs/prefs.html.tmpl | 1 - .../en/default/admin/components/create.html.tmpl | 1 - .../en/default/admin/components/edit.html.tmpl | 1 - template/en/default/attachment/create.html.tmpl | 1 - template/en/default/attachment/edit.html.tmpl | 1 - template/en/default/bug/create/create.html.tmpl | 2 +- template/en/default/bug/edit.html.tmpl | 4 +- template/en/default/bug/field.html.tmpl | 25 +++++---- template/en/default/bug/show-header.html.tmpl | 2 +- template/en/default/global/header.html.tmpl | 6 +-- template/en/default/global/userselect.html.tmpl | 62 +++++++++------------- template/en/default/list/list.html.tmpl | 2 +- template/en/default/request/queue.html.tmpl | 1 - template/en/default/search/field.html.tmpl | 21 ++++---- template/en/default/search/form.html.tmpl | 18 ++----- .../en/default/search/search-advanced.html.tmpl | 2 +- .../default/search/search-create-series.html.tmpl | 2 +- .../default/search/search-report-graph.html.tmpl | 2 +- .../default/search/search-report-table.html.tmpl | 2 +- 19 files changed, 63 insertions(+), 93 deletions(-) (limited to 'template/en') diff --git a/template/en/default/account/prefs/prefs.html.tmpl b/template/en/default/account/prefs/prefs.html.tmpl index 289a155ea..1fcb3e25a 100644 --- a/template/en/default/account/prefs/prefs.html.tmpl +++ b/template/en/default/account/prefs/prefs.html.tmpl @@ -43,7 +43,6 @@ style_urls = ['skins/standard/admin.css'] javascript_urls = ['js/util.js', 'js/field.js', 'js/TUI.js'] doc_section = "userpreferences.html" - yui = ['autocomplete'] %] [% tabs = [{ name => "settings", label => "General Preferences", diff --git a/template/en/default/admin/components/create.html.tmpl b/template/en/default/admin/components/create.html.tmpl index a95d45399..b6b79f8b6 100644 --- a/template/en/default/admin/components/create.html.tmpl +++ b/template/en/default/admin/components/create.html.tmpl @@ -26,7 +26,6 @@ [% title = BLOCK %]Add component to the [% product.name FILTER html %] product[% END %] [% PROCESS global/header.html.tmpl - yui = [ 'autocomplete' ] javascript_urls = [ "js/field.js" ] title = title generate_api_token = 1 diff --git a/template/en/default/admin/components/edit.html.tmpl b/template/en/default/admin/components/edit.html.tmpl index 874310ac8..e1083e7e8 100644 --- a/template/en/default/admin/components/edit.html.tmpl +++ b/template/en/default/admin/components/edit.html.tmpl @@ -34,7 +34,6 @@ [% PROCESS global/header.html.tmpl title = title generate_api_token = 1 - yui = [ 'autocomplete' ] javascript_urls = [ "js/field.js" ] %] diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl index 0380f7ddd..ff359338a 100644 --- a/template/en/default/attachment/create.html.tmpl +++ b/template/en/default/attachment/create.html.tmpl @@ -35,7 +35,6 @@ subheader = subheader generate_api_token = 1 style_urls = [ 'skins/standard/attachment.css' ] - yui = [ 'autocomplete' ] javascript_urls = [ "js/attachment.js", 'js/field.js', "js/util.js", "js/TUI.js" ] doc_section = "attachments.html" %] diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl index 9a1763642..6bd75f448 100644 --- a/template/en/default/attachment/edit.html.tmpl +++ b/template/en/default/attachment/edit.html.tmpl @@ -41,7 +41,6 @@ doc_section = "attachments.html" javascript_urls = ['js/attachment.js', 'js/field.js'] style_urls = ['skins/standard/attachment.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 fc1bc5420..b3619f993 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -31,7 +31,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/attachment.css', 'skins/standard/enter_bug.css', 'skins/custom/create_bug.css' ] diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 0fc8762a4..eba5702e3 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -34,11 +34,11 @@ [% IF user.can_tag_comments %]
x -
+ -
+ [help]   diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl index 366fe1144..ba1237dc0 100644 --- a/template/en/default/bug/field.html.tmpl +++ b/template/en/default/bug/field.html.tmpl @@ -235,19 +235,18 @@ [% END %] [% END %] [% CASE constants.FIELD_TYPE_KEYWORDS %] -
- -
-
- [% CASE constants.FIELD_TYPE_EXTENSION %] [% Hook.process('editable') %] diff --git a/template/en/default/bug/show-header.html.tmpl b/template/en/default/bug/show-header.html.tmpl index 6170d7a45..e7d0a07fb 100644 --- a/template/en/default/bug/show-header.html.tmpl +++ b/template/en/default/bug/show-header.html.tmpl @@ -39,7 +39,7 @@ [% generate_api_token = 1 %] [% header = "$terms.Bug $bug.bug_id" %] [% header_addl_info = "Last modified: $filtered_timestamp" %] -[% yui = ['autocomplete', 'calendar'] %] +[% yui = ['calendar', 'connection', 'json'] %] [% yui.push('container') IF user.can_tag_comments %] [% javascript_urls = [ "js/util.js", "js/field.js" ] %] [% javascript_urls.push("js/bug.js") IF user.id %] 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 - # Frédéric Buclin - # Guy Pyrzak - # Reed Loden + # 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 %] @@ -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 %] [% ELSE %] - [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %] -
- [% END %] + [% + IF id && feature_enabled('jsonrpc') && Param('ajax_user_autocompletion'); + IF !classes.defined; + classes = []; + END; + classes.push("bz_autocomplete_user"); + END; + %] - [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %] -
-
- - [% END %] [% END %] diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl index 73e58c30f..0920a0669 100644 --- a/template/en/default/list/list.html.tmpl +++ b/template/en/default/list/list.html.tmpl @@ -48,7 +48,7 @@ generate_api_token = dotweak style = style atomlink = "buglist.cgi?$urlquerypart&title=$url_filtered_title&ctype=atom" - yui = [ 'autocomplete', 'calendar' ] + yui = [ 'calendar' ] javascript_urls = [ "js/util.js", "js/field.js" ] style_urls = [ "skins/standard/buglist.css" ] doc_section = "query.html#list" diff --git a/template/en/default/request/queue.html.tmpl b/template/en/default/request/queue.html.tmpl index d1920a132..64353b4dc 100644 --- a/template/en/default/request/queue.html.tmpl +++ b/template/en/default/request/queue.html.tmpl @@ -29,7 +29,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'] %] [% 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 1b9b8310f..2e36eb9e3 100644 --- a/template/en/default/search/form.html.tmpl +++ b/template/en/default/search/form.html.tmpl @@ -344,19 +344,11 @@ TUI_hide_default('information_query'); [% " selected" IF default.emailtype.$n == qv.name %]>[% qv.description %] [% END %] - [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') %] -
- [% END %] - - [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') %] -
-
- - [% END %] +
[% 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 f42a9cb00..04ab3d06f 100644 --- a/template/en/default/search/search-advanced.html.tmpl +++ b/template/en/default/search/search-advanced.html.tmpl @@ -45,7 +45,7 @@ function remove_token() { generate_api_token = 1 onload = "doOnSelectProduct(0);" javascript = js_data - yui = [ 'autocomplete', 'calendar' ] + yui = [ 'calendar' ] javascript_urls = [ "js/productform.js", "js/util.js", "js/TUI.js", "js/field.js"] style_urls = [ "skins/standard/search_form.css" ] doc_section = "query.html" diff --git a/template/en/default/search/search-create-series.html.tmpl b/template/en/default/search/search-create-series.html.tmpl index 85d54e51c..6b7678b23 100644 --- a/template/en/default/search/search-create-series.html.tmpl +++ b/template/en/default/search/search-create-series.html.tmpl @@ -34,7 +34,7 @@ title = "Create New Data Set" generate_api_token = 1 onload = "doOnSelectProduct(0);" - yui = [ 'autocomplete', 'calendar' ] + yui = [ 'calendar' ] javascript = js_data javascript_urls = [ "js/util.js", "js/productform.js", "js/TUI.js", "js/field.js" ] style_urls = [ "skins/standard/search_form.css" ] diff --git a/template/en/default/search/search-report-graph.html.tmpl b/template/en/default/search/search-report-graph.html.tmpl index 383e10220..20e8e184d 100644 --- a/template/en/default/search/search-report-graph.html.tmpl +++ b/template/en/default/search/search-report-graph.html.tmpl @@ -33,7 +33,7 @@ var queryform = "reportform" title = "Generate Graphical Report" generate_api_token = 1 onload = "doOnSelectProduct(0); chartTypeChanged()" - yui = [ 'autocomplete', 'calendar' ] + yui = [ 'calendar' ] javascript = js_data javascript_urls = [ "js/util.js", "js/productform.js", "js/TUI.js", "js/field.js" ] style_urls = [ "skins/standard/search_form.css" ] diff --git a/template/en/default/search/search-report-table.html.tmpl b/template/en/default/search/search-report-table.html.tmpl index 872773b07..7ff54b8da 100644 --- a/template/en/default/search/search-report-table.html.tmpl +++ b/template/en/default/search/search-report-table.html.tmpl @@ -33,7 +33,7 @@ var queryform = "reportform" title = "Generate Tabular Report" generate_api_token = 1 onload = "doOnSelectProduct(0)" - yui = [ 'autocomplete', 'calendar' ] + yui = [ 'calendar' ] javascript = js_data javascript_urls = [ "js/util.js", "js/productform.js", "js/TUI.js", "js/field.js" ] style_urls = [ "skins/standard/search_form.css" ] -- cgit v1.2.3-24-g4f1b