From: mkanat%bugzilla.org <> Date: Thu, 18 Sep 2008 04:55:41 +0000 (+0000) Subject: Bug 452734: Remove the keyword chooser, because it's a usability regression X-Git-Tag: bugzilla-3.2rc2~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=983b3f9fb2beeda96486c3a6358676f3c2a0509a;p=thirdparty%2Fbugzilla.git Bug 452734: Remove the keyword chooser, because it's a usability regression Patch By Max Kanat-Alexander r=LpSolit, a=mkanat --- diff --git a/attachment.cgi b/attachment.cgi index 2520c00320..b2a5b61637 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -421,7 +421,6 @@ sub insert { $vars->{'bugs'} = [new Bugzilla::Bug($bugid)]; $vars->{'header_done'} = 1; $vars->{'contenttypemethod'} = $cgi->param('contenttypemethod'); - $vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)]; $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); print $cgi->header(); @@ -627,7 +626,6 @@ sub update { # since the object was created. $vars->{'bugs'} = [new Bugzilla::Bug($bug->id)]; $vars->{'header_done'} = 1; - $vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)]; $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); print $cgi->header(); @@ -700,7 +698,6 @@ sub delete_attachment { # Required to display the bug the deleted attachment belongs to. $vars->{'bugs'} = [$bug]; $vars->{'header_done'} = 1; - $vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)]; $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $template->process("attachment/updated.html.tmpl", $vars) diff --git a/buglist.cgi b/buglist.cgi index 358e16d100..d40cbaa7ae 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -1184,7 +1184,6 @@ if ($dotweak && scalar @bugs) { object => 'multiple_bugs'}); } $vars->{'dotweak'} = 1; - $vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)]; $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $vars->{'products'} = Bugzilla->user->get_enterable_products; diff --git a/enter_bug.cgi b/enter_bug.cgi index 54b11823cc..08f3280354 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -368,7 +368,6 @@ $vars->{'bug_severity'} = get_legal_field_values('bug_severity'); $vars->{'rep_platform'} = get_legal_field_values('rep_platform'); $vars->{'op_sys'} = get_legal_field_values('op_sys'); -$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)]; $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $vars->{'assigned_to'} = formvalue('assigned_to'); diff --git a/js/util.js b/js/util.js index 98bafb664b..ce7ea4caeb 100644 --- a/js/util.js +++ b/js/util.js @@ -134,82 +134,6 @@ function bz_overlayBelow(item, parent) { item.style.top = elemY + elemH + 1 + "px"; } -/** - * Create wanted options in a select form control. - * - * @param aSelect Select form control to manipulate. - * @param aValue Value attribute of the new option element. - * @param aTextValue Value of a text node appended to the new option - * element. - * @param aOwnerDocument Owner document of the new option element. If not - * specified then "document" will be used. - * @return Created option element. - */ -function bz_createOptionInSelect(aSelect, aValue, aTextValue, aOwnerDocument) -{ - if (!aOwnerDocument) { - aOwnerDocument = document; - } - - var myOption = aOwnerDocument.createElement("option"); - myOption.setAttribute("value", aValue); - - var myTextNode = aOwnerDocument.createTextNode(aTextValue) - myOption.appendChild(myTextNode); - - aSelect.appendChild(myOption); - - return myOption; -} - -/** - * Clears all options from a select form control. - * - * @param aElm Select form control of which options to clear. - * @param aSkipFirst Boolean; true to skip (not clear) first option in the - * select and false to remove all options. - */ -function bz_clearOptions(aElm, aSkipFirst) -{ - var start = 0; - - // Skip the first element? (for 'Choose One' type foo) - if (aSkipFirst) { - start = 1; - } - - var length = aElm.options.length; - - for (var run = start; run < length; run++) { - aElm.removeChild(aElm.options[start]); - } -} - -/** - * Takes an array and moves all the values to an select. - * - * @param aSelect Select form control to populate. Will be cleared - * before array values are created in it. - * @param aArray Array with values to populate select with. - * @param aSkipFirst Boolean; true to skip (not touch) first option in the - * select and false to remove all options. - * @param aUseNameAsValue Boolean; true if name is used as value and false if - * not. - */ -function bz_populateSelectFromArray(aSelect, aArray, aSkipFirst, aUseNameAsValue) -{ - // Clear the field - bz_clearOptions(aSelect, aSkipFirst); - - for (var run = 0; run < aArray.length; run++) { - if (aUseNameAsValue) { - bz_createOptionInSelect(aSelect, aArray[run], aArray[run]); - } else { - bz_createOptionInSelect(aSelect, aArray[run][0], aArray[run][0]); - } - } -} - /** * Checks if a specified value is in the specified array. * diff --git a/post_bug.cgi b/post_bug.cgi index 957e7b75f0..a9910e83a8 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -264,7 +264,6 @@ if ($cgi->cookie("BUGLIST")) { @bug_list = split(/:/, $cgi->cookie("BUGLIST")); } $vars->{'bug_list'} = \@bug_list; -$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)]; $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); if ($token) { diff --git a/process_bug.cgi b/process_bug.cgi index cf24c96c91..7e484d2b04 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -68,7 +68,6 @@ my $cgi = Bugzilla->cgi; my $dbh = Bugzilla->dbh; my $template = Bugzilla->template; my $vars = {}; -$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)]; $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); ###################################################################### diff --git a/show_bug.cgi b/show_bug.cgi index 782293af5a..59e2286c34 100755 --- a/show_bug.cgi +++ b/show_bug.cgi @@ -97,7 +97,6 @@ eval { $vars->{'bugs'} = \@bugs; $vars->{'marks'} = \%marks; -$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)]; $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); my @bugids = map {$_->bug_id} grep {!$_->error} @bugs; diff --git a/skins/standard/global.css b/skins/standard/global.css index 938575eb57..8b24069dad 100644 --- a/skins/standard/global.css +++ b/skins/standard/global.css @@ -427,16 +427,3 @@ form#Create .comment { padding: 0.3em; height: 4ex; } - -#keyword-chooser { - padding: 10px; - position: absolute; - z-index: 25; - top: 50px; - left: 50px; - border: 2px solid #404D6C; - -moz-border-radius: 5px; - background: white; -} - - diff --git a/template/en/default/attachment/created.html.tmpl b/template/en/default/attachment/created.html.tmpl index 1f5bdb6ac5..faf1b87c09 100644 --- a/template/en/default/attachment/created.html.tmpl +++ b/template/en/default/attachment/created.html.tmpl @@ -39,7 +39,7 @@ [% PROCESS global/header.html.tmpl title = "Attachment $attachment.id added to $terms.Bug $attachment.bug_id" bodyclasses = bodyclasses - javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js", + javascript_urls = [ "js/util.js", "js/field.js", "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] doc_section = "bug_page.html" diff --git a/template/en/default/attachment/updated.html.tmpl b/template/en/default/attachment/updated.html.tmpl index f7252e5c8d..bc22b46667 100644 --- a/template/en/default/attachment/updated.html.tmpl +++ b/template/en/default/attachment/updated.html.tmpl @@ -43,7 +43,7 @@ subheader = filtered_desc header_addl_info = "Last modified: $filtered_timestamp" bodyclasses = bodyclasses - javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js", + javascript_urls = [ "js/util.js", "js/field.js", "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] doc_section = "bug_page.html" diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 9b522f2a7a..d9eab0e04a 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -32,7 +32,7 @@ title = title style_urls = [ 'skins/standard/create_attachment.css', 'skins/standard/yui/calendar.css' ] - javascript_urls = [ "js/attachment.js", "js/util.js", "js/keyword-chooser.js", + javascript_urls = [ "js/attachment.js", "js/util.js", "js/yui/yahoo-dom-event.js", "js/yui/calendar.js", "js/field.js" ] %] @@ -531,7 +531,8 @@ function handleWantsAttachment(wants_attachment) { Keywords: - (optional) + (optional) [% END %] @@ -600,12 +601,6 @@ function handleWantsAttachment(wants_attachment) { -[% IF use_keywords %] - [% PROCESS "bug/keyword-chooser.html.tmpl" - sel_keywords = keywords.split(', ') - %] -[% END %] - [%# Links or content with more information about the bug being created. %] [% Hook.process("end") %] diff --git a/template/en/default/bug/create/created.html.tmpl b/template/en/default/bug/create/created.html.tmpl index 1cf2a14f7e..6226fdc643 100644 --- a/template/en/default/bug/create/created.html.tmpl +++ b/template/en/default/bug/create/created.html.tmpl @@ -36,7 +36,7 @@ [% PROCESS global/header.html.tmpl title = "$terms.Bug $id Submitted" - javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js", + javascript_urls = [ "js/util.js", "js/field.js", "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 89d5319fac..6d60d8eb93 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -280,12 +280,6 @@ -[% IF use_keywords %] - [% PROCESS "bug/keyword-chooser.html.tmpl" - sel_keywords = bug.keywords.split(', ') - %] -[% END %] - [%############################################################################%] [%# Block for the Title (alias and short desc) #%] [%############################################################################%] @@ -631,8 +625,7 @@ Keywords: [% PROCESS input inputname => "keywords" size => 40 colspan => 2 - value => bug.keywords.join(', ') - onfocus => "this.chooser.open()" %] + value => bug.keywords.join(', ') %] [% END %] [% END %] @@ -1097,7 +1090,6 @@ [% ELSE %] [% IF size && val.length > size %] @@ -1116,7 +1108,6 @@ [% colspan = 0 %] [% size = 0 %] [% value = undef %] - [% onfocus = undef %] [% spellcheck = undef %] [% END %] diff --git a/template/en/default/bug/process/header.html.tmpl b/template/en/default/bug/process/header.html.tmpl index 5472aa7ddf..4aecfc1b81 100644 --- a/template/en/default/bug/process/header.html.tmpl +++ b/template/en/default/bug/process/header.html.tmpl @@ -42,7 +42,7 @@ [% END %] [% PROCESS global/header.html.tmpl - javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js", + javascript_urls = [ "js/util.js", "js/field.js", "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] doc_section = "bug_page.html" diff --git a/template/en/default/bug/show.html.tmpl b/template/en/default/bug/show.html.tmpl index 373cfa327b..cf6127413a 100644 --- a/template/en/default/bug/show.html.tmpl +++ b/template/en/default/bug/show.html.tmpl @@ -44,7 +44,7 @@ subheader = filtered_desc header_addl_info = "Last modified: $filtered_timestamp" bodyclasses = bodyclasses - javascript_urls = [ "js/util.js", "js/keyword-chooser.js", "js/field.js", + javascript_urls = [ "js/util.js", "js/field.js", "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] doc_section = "bug_page.html" diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index 200f7d4625..0588366027 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -312,7 +312,6 @@ '" colspan=\"$colspan\"" IF colspan', '" size=\"$size\"" IF size', '" maxlength=\"$maxlength\"" IF maxlength', - '" onfocus=\"$onfocus\"" IF onfocus', 'flag.status', '" spellcheck=\"$spellcheck\"" IF spellcheck', ], diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl index 238763e067..190628fa9d 100644 --- a/template/en/default/list/edit-multiple.html.tmpl +++ b/template/en/default/list/edit-multiple.html.tmpl @@ -220,8 +220,7 @@ - +