Commit 427ca003 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 452734: Remove the keyword chooser, because it's a usability regression

Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
parent 249bd21a
...@@ -419,7 +419,6 @@ sub insert { ...@@ -419,7 +419,6 @@ sub insert {
$vars->{'bugs'} = [new Bugzilla::Bug($bugid)]; $vars->{'bugs'} = [new Bugzilla::Bug($bugid)];
$vars->{'header_done'} = 1; $vars->{'header_done'} = 1;
$vars->{'contenttypemethod'} = $cgi->param('contenttypemethod'); $vars->{'contenttypemethod'} = $cgi->param('contenttypemethod');
$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)];
$vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
print $cgi->header(); print $cgi->header();
...@@ -607,7 +606,6 @@ sub update { ...@@ -607,7 +606,6 @@ sub update {
# since the object was created. # since the object was created.
$vars->{'bugs'} = [new Bugzilla::Bug($bug->id)]; $vars->{'bugs'} = [new Bugzilla::Bug($bug->id)];
$vars->{'header_done'} = 1; $vars->{'header_done'} = 1;
$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)];
$vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
print $cgi->header(); print $cgi->header();
...@@ -680,7 +678,6 @@ sub delete_attachment { ...@@ -680,7 +678,6 @@ sub delete_attachment {
# Required to display the bug the deleted attachment belongs to. # Required to display the bug the deleted attachment belongs to.
$vars->{'bugs'} = [$bug]; $vars->{'bugs'} = [$bug];
$vars->{'header_done'} = 1; $vars->{'header_done'} = 1;
$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)];
$vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
$template->process("attachment/updated.html.tmpl", $vars) $template->process("attachment/updated.html.tmpl", $vars)
......
...@@ -1200,7 +1200,6 @@ if ($dotweak && scalar @bugs) { ...@@ -1200,7 +1200,6 @@ if ($dotweak && scalar @bugs) {
object => 'multiple_bugs'}); object => 'multiple_bugs'});
} }
$vars->{'dotweak'} = 1; $vars->{'dotweak'} = 1;
$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)];
$vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
$vars->{'products'} = Bugzilla->user->get_enterable_products; $vars->{'products'} = Bugzilla->user->get_enterable_products;
......
...@@ -368,7 +368,6 @@ $vars->{'bug_severity'} = get_legal_field_values('bug_severity'); ...@@ -368,7 +368,6 @@ $vars->{'bug_severity'} = get_legal_field_values('bug_severity');
$vars->{'rep_platform'} = get_legal_field_values('rep_platform'); $vars->{'rep_platform'} = get_legal_field_values('rep_platform');
$vars->{'op_sys'} = get_legal_field_values('op_sys'); $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->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
$vars->{'assigned_to'} = formvalue('assigned_to'); $vars->{'assigned_to'} = formvalue('assigned_to');
......
...@@ -135,82 +135,6 @@ function bz_overlayBelow(item, parent) { ...@@ -135,82 +135,6 @@ function bz_overlayBelow(item, parent) {
} }
/** /**
* 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. * Checks if a specified value is in the specified array.
* *
* @param aArray Array to search for the value. * @param aArray Array to search for the value.
......
...@@ -264,7 +264,6 @@ if ($cgi->cookie("BUGLIST")) { ...@@ -264,7 +264,6 @@ if ($cgi->cookie("BUGLIST")) {
@bug_list = split(/:/, $cgi->cookie("BUGLIST")); @bug_list = split(/:/, $cgi->cookie("BUGLIST"));
} }
$vars->{'bug_list'} = \@bug_list; $vars->{'bug_list'} = \@bug_list;
$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)];
$vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
if ($token) { if ($token) {
......
...@@ -68,7 +68,6 @@ my $cgi = Bugzilla->cgi; ...@@ -68,7 +68,6 @@ my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = {}; my $vars = {};
$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)];
$vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
###################################################################### ######################################################################
......
...@@ -94,7 +94,6 @@ eval { ...@@ -94,7 +94,6 @@ eval {
$vars->{'bugs'} = \@bugs; $vars->{'bugs'} = \@bugs;
$vars->{'marks'} = \%marks; $vars->{'marks'} = \%marks;
$vars->{'valid_keywords'} = [map($_->name, Bugzilla::Keyword->get_all)];
$vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count(); $vars->{'use_keywords'} = 1 if Bugzilla::Keyword::keyword_count();
my @bugids = map {$_->bug_id} grep {!$_->error} @bugs; my @bugids = map {$_->bug_id} grep {!$_->error} @bugs;
......
...@@ -433,17 +433,6 @@ form#Create .comment { ...@@ -433,17 +433,6 @@ form#Create .comment {
height: 4ex; 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;
}
.image_button { .image_button {
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
...@@ -465,4 +454,4 @@ form#Create .comment { ...@@ -465,4 +454,4 @@ form#Create .comment {
#down_button { #down_button {
background-image: url(global/down.png); background-image: url(global/down.png);
} }
\ No newline at end of file
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "Attachment $attachment.id added to $terms.Bug $attachment.bug_id" title = "Attachment $attachment.id added to $terms.Bug $attachment.bug_id"
bodyclasses = bodyclasses 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" ] "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
doc_section = "bug_page.html" doc_section = "bug_page.html"
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
subheader = filtered_desc subheader = filtered_desc
header_addl_info = "Last modified: $filtered_timestamp" header_addl_info = "Last modified: $filtered_timestamp"
bodyclasses = bodyclasses 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" ] "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
doc_section = "bug_page.html" doc_section = "bug_page.html"
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
title = title title = title
style_urls = [ 'skins/standard/create_attachment.css', style_urls = [ 'skins/standard/create_attachment.css',
'skins/standard/yui/calendar.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/yui/yahoo-dom-event.js", "js/yui/calendar.js",
"js/field.js" ] "js/field.js" ]
%] %]
...@@ -531,7 +531,8 @@ function handleWantsAttachment(wants_attachment) { ...@@ -531,7 +531,8 @@ function handleWantsAttachment(wants_attachment) {
<tr> <tr>
<th><a href="describekeywords.cgi">Keywords</a>:</th> <th><a href="describekeywords.cgi">Keywords</a>:</th>
<td colspan="3"> <td colspan="3">
<input id="keywords" name="keywords" size="60" value="[% keywords FILTER html %]" onfocus="this.chooser.open();"> (optional) <input id="keywords" name="keywords" size="60"
value="[% keywords FILTER html %]"> (optional)
</td> </td>
</tr> </tr>
[% END %] [% END %]
...@@ -600,12 +601,6 @@ function handleWantsAttachment(wants_attachment) { ...@@ -600,12 +601,6 @@ function handleWantsAttachment(wants_attachment) {
<input type="hidden" name="form_name" value="enter_bug"> <input type="hidden" name="form_name" value="enter_bug">
</form> </form>
[% 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. %] [%# Links or content with more information about the bug being created. %]
[% Hook.process("end") %] [% Hook.process("end") %]
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "$terms.Bug $id Submitted" 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" ] "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
......
...@@ -280,12 +280,6 @@ ...@@ -280,12 +280,6 @@
</table> </table>
</form> </form>
[% IF use_keywords %]
[% PROCESS "bug/keyword-chooser.html.tmpl"
sel_keywords = bug.keywords.split(', ')
%]
[% END %]
[%############################################################################%] [%############################################################################%]
[%# Block for the Title (alias and short desc) #%] [%# Block for the Title (alias and short desc) #%]
[%############################################################################%] [%############################################################################%]
...@@ -631,8 +625,7 @@ ...@@ -631,8 +625,7 @@
<b><a href="describekeywords.cgi"><u>K</u>eywords</a></b></label>: <b><a href="describekeywords.cgi"><u>K</u>eywords</a></b></label>:
</td> </td>
[% PROCESS input inputname => "keywords" size => 40 colspan => 2 [% PROCESS input inputname => "keywords" size => 40 colspan => 2
value => bug.keywords.join(', ') value => bug.keywords.join(', ') %]
onfocus => "this.chooser.open()" %]
</tr> </tr>
[% END %] [% END %]
[% END %] [% END %]
...@@ -1097,7 +1090,6 @@ ...@@ -1097,7 +1090,6 @@
<input id="[% inputname %]" name="[% inputname %]" <input id="[% inputname %]" name="[% inputname %]"
value="[% val FILTER html %]"[% " size=\"$size\"" IF size %] value="[% val FILTER html %]"[% " size=\"$size\"" IF size %]
[% " maxlength=\"$maxlength\"" IF maxlength %] [% " maxlength=\"$maxlength\"" IF maxlength %]
[% " onfocus=\"$onfocus\"" IF onfocus %]
[% " spellcheck=\"$spellcheck\"" IF spellcheck %]> [% " spellcheck=\"$spellcheck\"" IF spellcheck %]>
[% ELSE %] [% ELSE %]
[% IF size && val.length > size %] [% IF size && val.length > size %]
...@@ -1116,7 +1108,6 @@ ...@@ -1116,7 +1108,6 @@
[% colspan = 0 %] [% colspan = 0 %]
[% size = 0 %] [% size = 0 %]
[% value = undef %] [% value = undef %]
[% onfocus = undef %]
[% spellcheck = undef %] [% spellcheck = undef %]
[% END %] [% END %]
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
[% END %] [% END %]
[% PROCESS global/header.html.tmpl [% 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" ] "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
doc_section = "bug_page.html" doc_section = "bug_page.html"
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
subheader = filtered_desc subheader = filtered_desc
header_addl_info = "Last modified: $filtered_timestamp" header_addl_info = "Last modified: $filtered_timestamp"
bodyclasses = bodyclasses 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" ] "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ] style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/show_bug.css" ]
doc_section = "bug_page.html" doc_section = "bug_page.html"
......
...@@ -301,7 +301,6 @@ ...@@ -301,7 +301,6 @@
'" colspan=\"$colspan\"" IF colspan', '" colspan=\"$colspan\"" IF colspan',
'" size=\"$size\"" IF size', '" size=\"$size\"" IF size',
'" maxlength=\"$maxlength\"" IF maxlength', '" maxlength=\"$maxlength\"" IF maxlength',
'" onfocus=\"$onfocus\"" IF onfocus',
'flag.status', 'flag.status',
'" spellcheck=\"$spellcheck\"" IF spellcheck', '" spellcheck=\"$spellcheck\"" IF spellcheck',
], ],
......
...@@ -220,8 +220,7 @@ ...@@ -220,8 +220,7 @@
</label> </label>
</th> </th>
<td colspan="3"> <td colspan="3">
<input id="keywords" name="keywords" size="32" <input id="keywords" name="keywords" size="32">
onfocus = "this.chooser.open();">
<select name="keywordaction"> <select name="keywordaction">
<option value="add">Add these keywords</option> <option value="add">Add these keywords</option>
<option value="delete">Delete these keywords</option> <option value="delete">Delete these keywords</option>
...@@ -257,12 +256,6 @@ ...@@ -257,12 +256,6 @@
</table> </table>
[% IF use_keywords %]
[% PROCESS "bug/keyword-chooser.html.tmpl"
sel_keywords = keywords.split(', ')
%]
[% END %]
<b><label for="comment">Additional Comments:</label></b><br> <b><label for="comment">Additional Comments:</label></b><br>
[% INCLUDE global/textarea.html.tmpl [% INCLUDE global/textarea.html.tmpl
name = 'comment' name = 'comment'
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
title = title title = title
style = style style = style
atomlink = "buglist.cgi?$urlquerypart&title=$title&ctype=atom" atomlink = "buglist.cgi?$urlquerypart&title=$title&ctype=atom"
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" ] "js/yui/yahoo-dom-event.js", "js/yui/calendar.js" ]
style_urls = [ "skins/standard/buglist.css", "skins/standard/yui/calendar.css" ] style_urls = [ "skins/standard/buglist.css", "skins/standard/yui/calendar.css" ]
doc_section = "query.html#list" doc_section = "query.html#list"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment