From 33a4bd46fd17ab28567cdeb2eb3733901f2a033e Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Thu, 7 May 2015 12:49:01 +0800 Subject: Bug 1159589: migrate autocomplete from yui to jquery r=dylan,a=glob --- 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 - .../en/default/admin/products/create.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 | 31 ++++++++++------------ template/en/default/bug/show-header.html.tmpl | 4 +-- template/en/default/global/header.html.tmpl | 8 +++--- template/en/default/global/userselect.html.tmpl | 25 +++++++---------- template/en/default/list/list.html.tmpl | 2 +- template/en/default/request/queue.html.tmpl | 1 - template/en/default/search/field.html.tmpl | 23 +++++++--------- template/en/default/search/form.html.tmpl | 18 ++++--------- .../en/default/search/search-advanced.html.tmpl | 3 ++- .../default/search/search-create-series.html.tmpl | 2 +- .../default/search/search-report-graph.html.tmpl | 2 +- .../default/search/search-report-table.html.tmpl | 2 +- 20 files changed, 52 insertions(+), 81 deletions(-) (limited to 'template/en/default') 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 %]
x -
+ -
+  
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 @@ [% END %] [% END %] - [% CASE constants.FIELD_TYPE_KEYWORDS %] -
- -
-
- + [% CASE constants.FIELD_TYPE_KEYWORDS %] + + [% 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 %] [% 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 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'] %] [% 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 %] [% 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 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'] -- cgit v1.2.3-24-g4f1b