diff options
author | lpsolit%gmail.com <> | 2005-08-22 01:16:40 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-08-22 01:16:40 +0000 |
commit | f4966aeb0e7a655c986aeb285c1a220274ddbfd9 (patch) | |
tree | 70fc81865b58b54e97da10c8cc824ae9fb641672 /template | |
parent | d055246d2010e546bbad8c65d99496d53eee0bff (diff) | |
download | bugs-f4966aeb0e7a655c986aeb285c1a220274ddbfd9.tar bugs-f4966aeb0e7a655c986aeb285c1a220274ddbfd9.tar.gz bugs-f4966aeb0e7a655c986aeb285c1a220274ddbfd9.tar.bz2 bugs-f4966aeb0e7a655c986aeb285c1a220274ddbfd9.tar.xz bugs-f4966aeb0e7a655c986aeb285c1a220274ddbfd9.zip |
Bug 70907: QuickSearch: port the JS code to perl (make it server-side) - Patch by Marc Schumann <wurblzap@gmail.com> r=wicked a=myk
Diffstat (limited to 'template')
-rw-r--r-- | template/en/default/config.js.tmpl | 3 | ||||
-rw-r--r-- | template/en/default/global/useful-links.html.tmpl | 11 | ||||
-rw-r--r-- | template/en/default/index.html.tmpl | 31 | ||||
-rw-r--r-- | template/en/default/pages/quicksearch.html.tmpl | 190 | ||||
-rw-r--r-- | template/en/default/pages/quicksearchhack.html.tmpl | 377 | ||||
-rw-r--r-- | template/en/default/sidebar.xul.tmpl | 8 |
6 files changed, 589 insertions, 31 deletions
diff --git a/template/en/default/config.js.tmpl b/template/en/default/config.js.tmpl index a74c5d34d..e3ec91435 100644 --- a/template/en/default/config.js.tmpl +++ b/template/en/default/config.js.tmpl @@ -19,8 +19,7 @@ # Contributor(s): Myk Melez <myk@mozilla.org> #%] // -// This file contains the installation specific values for QuickSearch -// and other Bugzilla clients. See quicksearch.js for more details. +// This file contains installation specific values for third-party clients. // // Note: this interface is experimental and under development. // We may and probably will make breaking changes to it in the future. diff --git a/template/en/default/global/useful-links.html.tmpl b/template/en/default/global/useful-links.html.tmpl index 38b193cf5..5a01a5703 100644 --- a/template/en/default/global/useful-links.html.tmpl +++ b/template/en/default/global/useful-links.html.tmpl @@ -25,7 +25,6 @@ [% PROCESS global/variables.none.tmpl %] -<form method="get" action="show_bug.cgi"> <div id="useful-links"> <div id="links-actions"> <div class="label">Actions:</div> @@ -34,8 +33,13 @@ <a href="enter_bug.cgi">New</a> | <a href="query.cgi">Search</a> | - [% terms.bug %] # <input class="txt" name="id" size="6"> - <input class="btn" type="submit" value="Find"> | + <form action="buglist.cgi" method="get" + onsubmit="if (this.quicksearch.value == '') + { alert('Please enter one or more search terms first.'); + return false; } return true;"> + <input class="txt" type="text" name="quicksearch"> + <input class="btn" type="submit" value="Find"> + </form> | <a href="report.cgi">Reports</a> @@ -127,4 +131,3 @@ [%# Sections of links to more things users can do on this installation. %] [% Hook.process("end") %] </div> -</form> diff --git a/template/en/default/index.html.tmpl b/template/en/default/index.html.tmpl index eb1cbbd58..a19334c30 100644 --- a/template/en/default/index.html.tmpl +++ b/template/en/default/index.html.tmpl @@ -28,11 +28,12 @@ [% PROCESS global/variables.none.tmpl %] -[% title = BLOCK %] -[% terms.Bugzilla %] Main Page -[% END %] -[% style_urls = [ "skins/standard/index.css" ] %] -[% PROCESS global/header.html.tmpl %] + +[% PROCESS global/header.html.tmpl + title = "$terms.Bugzilla Main Page" + style_urls = [ 'skins/standard/index.css' ] + onload = 'document.forms[\'f\'].quicksearch.focus();' +%] <script type="text/javascript"> @@ -84,25 +85,19 @@ function addSidebar() { </ul> - <form id="show-bug" name="f" action="show_bug.cgi" method="get" - onsubmit="QuickSearch(f.id.value); return false;"> + <form id="show-bug" name="f" action="buglist.cgi" method="get" + onsubmit="if (this.quicksearch.value == '') + { alert('Please enter one or more search terms first.'); + return false; } return true;"> <div> <p>Enter [% terms.abug %] # or some search terms:</p> - <input id="text" type="text" name="id"> - <input id="show" type="submit" value="Show"> - <a href="quicksearch.html">[Help]</a> + <input id="quicksearch" type="text" name="quicksearch"> + <input id="find" type="submit" value="Find"> + <a href="page.cgi?id=quicksearch.html">[Help]</a> </div> </form> <div class="outro"></div> </div> -<script type="text/javascript" src="localconfig.js"></script> -<script type="text/javascript" src="quicksearch.js"></script> -<script type="text/javascript"> -<!-- -document.forms['f'].id.focus(); -//--> -</script> - [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/pages/quicksearch.html.tmpl b/template/en/default/pages/quicksearch.html.tmpl new file mode 100644 index 000000000..73a0172ee --- /dev/null +++ b/template/en/default/pages/quicksearch.html.tmpl @@ -0,0 +1,190 @@ +[%# 1.0@bugzilla.org %] +[%# 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/ + # + # 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): N.N. + # Marc Schumann <wurblzap@gmail.com> + #%] + +[% PROCESS global/variables.none.tmpl %] + +[% INCLUDE global/header.html.tmpl + title = "$terms.Bugzilla QuickSearch", + style = 'ul {margin-bottom: 2ex} + ul li {margin-top: 2ex} + ul li ul li {margin-top: 0}' + onload = 'document.forms[\'f\'].quicksearch.focus()' + %] + +<p style="font-size: 80%"> + If you are already familiar with the original + <a href="query.cgi">[% terms.Bugzilla %] Search Form</a>, + you may prefer <a href="page.cgi?id=quicksearchhack.html">this form</a>. +</p> + +<p> + Type in one or more words (or word fragments) to search for: +</p> + +<form name="f" action="buglist.cgi" method="get" + onsubmit="if (this.quicksearch.value == '') + { alert('Please enter one or more search terms first.'); + return false; } return true;"> + <input type="text" size="40" name="quicksearch"> + <input type="submit" value="Find"> +</form> + +<h2>Getting Started</h2> + +<ul> + <li> + This is <strong>case-insensitive</strong> search:<br /> + <ul> + <li><tt>table</tt>, <tt>Table</tt> and <tt>TABLE</tt> are all the same.</li> + </ul> + </li> + <li> + This is <strong>all words as substrings</strong> + search.<br /> + Therefore you should <strong>use stems</strong> to get better results: + <ul> + <li> + Use <tt>localiz</tt> instead of <tt>localize</tt> or + <tt>localization</tt>. + </li> + <li> + Use <tt>bookmark</tt> instead of <tt>bookmarks</tt> or + <tt>bookmarking</tt>. + </li> + </ul> + </li> +</ul> + +<h2><a name="features">Features</a></h2> + +<ul> + <li> + Boolean operations: “<tt>-foo</tt>” (NOT), + “<tt>foo bar</tt>” (AND), + “<tt>foo|bar</tt>” (OR). + <ul> + <li> + <strong>NOT</strong>:<br /> + Use <tt><b>-</b><i>foo</i></tt> to exclude [% terms.bugs %] + with <tt><i>foo</i></tt> in the summary. + </li> + <li> + <strong>AND</strong>:<br /> + Space-separated words are treated as a conjunction. + </li> + <li> + <strong>OR</strong>:<br /> + Within a word, "|"-separated parts denote alternatives. + </li> + <li> + Besides "|", a comma can be used to separate alternatives. + </li> + <li> + OR has higher precedence than AND; AND is the top level operation. + </li> + </ul> + <i>Example:</i> + <tt>url,location bar,field -focus</tt> means + (<tt>url</tt> OR <tt>location</tt>) AND (<tt>bar</tt> OR <tt>field</tt>) + AND (NOT <tt>focus</tt>) + </li> + <li> + Use <tt>+foo</tt> to search for [% terms.bugs %] where the + <strong>summary</strong> contains <tt>foo</tt> as a + <strong>substring</strong>.<br/> + Use <tt>#foo</tt> to search for [% terms.bugs %] where the + <strong>summary</strong> contains the <strong>word</strong> <tt>foo</tt>. + <ul> + <li> + <tt>+brow</tt> does not find all [% terms.bugs %] in the + <tt>Browser</tt> product. + </li> + <li> + <tt>#title</tt> does not find [% terms.bugs %] with <tt>titlebar</tt> + or <tt>titled</tt>. + </li> + </ul> + Phrases with special chars (space, comma, +, -, #, …) can be + <strong>quoted</strong>: + <ul> + <li> + <tt>"lock icon"</tt> + </li> + </ul> + </li> + <li> + <strong>Open vs. Resolved [% terms.Bugs %]</strong>:<br /> + By default, only open (i.e. unresolved) [% terms.bugs %] are shown. + Use <tt>+DUP</tt> as first word in your search to include duplicate + [%+ terms.bugs %] in your search, + <tt>FIXED</tt> to search for fixed [%+ terms.bugs %] only, + or <tt>ALL</tt> to search all [% terms.bugs %], + regardless of status or resolution. + Searching for duplicates is recommended if you can't find an open + [%+ terms.bug %] directly. + <ul> + <li> + <tt>+DUP,FIXED table border</tt> + </li> + <li> + <tt>ALL mouse wheel</tt> + </li> + </ul> + </li> + <li> + <strong>Focus the Search with Products & + Components</strong>:<br /> + To search for [% terms.bugs %] in product "Foo Bar" only, add + <tt>:foo</tt> or <tt>:bar</tt> or both to your search. + You can do this with any substring of a + <a href="describecomponents.cgi">product or component</a> to focus the + search. + </li> +</ul> + +<h2>More Tips</h2> + +<ul> + <li> + You can also use this tool to <strong>lookup</strong> a [% terms.bug %] by + its number:<br /> + <ul> + <li><tt>12345</tt></li> + </ul> + </li> + <li> + A comma-separated list of [% terms.bug %] numbers gives you a list of these + [%+ terms.bugs %]:<br /> + <ul> + <li><tt>12345,23456,34567</tt></li> + </ul> + </li> +</ul> + +<p> + By default, the following fields are searched: Summary, Keywords, Product, + Component, Status Whiteboard. If a word looks like a part of a URL, that field + is included in the search, too. +</p> +<hr> + +<p> + Use the powerful <a href="query.cgi">[% terms.Bugzilla %] Search Form</a> + for advanced queries. +</p> + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/pages/quicksearchhack.html.tmpl b/template/en/default/pages/quicksearchhack.html.tmpl new file mode 100644 index 000000000..529484991 --- /dev/null +++ b/template/en/default/pages/quicksearchhack.html.tmpl @@ -0,0 +1,377 @@ +[%# 1.0@bugzilla.org %] +[%# 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/ + # + # 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): N.N. + # Marc Schumann <wurblzap@gmail.com> + #%] + +[% PROCESS global/variables.none.tmpl %] + +[% INCLUDE global/header.html.tmpl + title = "$terms.Bugzilla QuickSearch (for Hackers)", + style = 'th {text-align: left}' + onload = 'document.forms[\'f\'].quicksearch.focus()' + %] + +<p> + Type in one or more words (or word fragments) to search for: +</p> + +<form name="f" action="buglist.cgi" method="get" + onsubmit="if (this.quicksearch.value == '') + { alert('Please enter one or more search terms first.'); + return false; } return true;"> + <input type="text" size="40" name="quicksearch"> + <input type="submit" value="Find"> + <input type="submit" name="load" value="Load Search Form"> +</form> + +<p> + This is a case-insensitive “all words as substrings” search; + words are separated by spaces. + By default, the following fields are relevant: Summary, Keywords, + Product, Component, Status Whiteboard. + If a word looks like a part of a URL, that field is included in the search, + too. +</p> +<p> + The generic format for a “word” is + <tt>field1,…,fieldN:value1,…,valueM</tt>. + A [% terms.bug %] qualifies if at least one of the values occurs as a + substring in at least one of the fields. + For example, <tt>assignee,reporter,qa:ibm,sun</tt> will give you + [%+ terms.bugs %] where the assignee, reporter, or qa contact has a login + that contains <tt>ibm</tt> or <tt>sun</tt>. + If only <tt>value1,…,valueM</tt> is given, the prefix (roughly) defaults to + <tt>summary,keywords,product,component,statuswhiteboard:</tt> as noted above. + You can use <tt>-<i>word</i></tt> to express the logical negation of + <tt><i>word</i></tt>. +</p> +<p> + Here is a complete listing of available fields (the Shortcut column is just + for access speed): +</p> + +<table border="1"> +<thead> +<tr> + <th>Searched by default</th> + <th>Shortcut</th> + <th>Field Name</th> + <th>Aliases</th> + <th>Description</th> +</tr> +</thead> + +<!-- Status, Resolution, Platform, OS, Priority, Severity --> + +<tr> + <td> </td> + <td rowspan="2"> + <tt>UNCO,NEW,…,CLOS,<br>FIX,DUP,…<i>(as first word)</i></tt> + </td> + <td><tt>status</tt></td> + <td> </td> + <td> + <a href="page.cgi?id=fields.html#status">Status</a> + <i>(“bug_status”)</i> + </td> +</tr> +<tr> + <td> </td> + <td><tt>resolution</tt></td> + <td> </td> + <td><a href="page.cgi?id=fields.html#resolution">Resolution</a></td> +</tr> +<tr> + <td> </td> + <td><i>as-is</i></td> + <td><tt>platform</tt></td> + <td> </td> + <td> + <a href="page.cgi?id=fields.html#rep_platform">Platform</a> + <i>(“rep_platform”)</i> + </td> +</tr> +<tr> + <td> </td> + <td> </td> + <td><tt>os</tt></td> + <td><tt>opsys</tt></td> + <td> + <a href="page.cgi?id=fields.html#op_sys">OS</a> + <i>(“op_sys”)</i> + </td> +</tr> +<tr> + <td> </td> + <td><tt>p1,p2</tt> <i>or</i> <tt>p1-2</tt></td> + <td><tt>priority</tt></td> + <td><tt>pri</tt></td> + <td><a href="page.cgi?id=fields.html#priority">Priority</a></td> +</tr> +<tr> + <td> </td> + <td><tt>blo,cri,…,enh</tt></td> + <td><tt>severity</tt></td> + <td><tt>sev</tt></td> + <td> + <a href="page.cgi?id=fields.html#bug_severity">Severity</a> + <i>(“bug_severity”)</i> + </td> +</tr> + +<!-- People: AssignedTo, Reporter, QA Contact, CC, Added comment --> +<!-- Added comment is missing!!!! --> + +<tr> + <td> </td> + <td><b>@</b><i>assignee</i></td> + <td><tt>assignedto</tt></td> + <td><tt>assignee</tt></td> + <td> + <a href="page.cgi?id=fields.html#assigned_to">Assignee</a> + <i>(“assigned_to”)</i> + </td> +</tr> +<tr> + <td> </td> + <td> </td> + <td><tt>reporter</tt></td> + <td><tt>rep</tt></td> + <td>Reporter (login)</td> +</tr> +<tr> + <td> </td> + <td> </td> + <td><tt>qa</tt></td> + <td><tt>qacontact</tt></td> + <td>QA Contact (login) <i>(“qa_contact”)</i></td> +</tr> +<tr> + <td> </td> + <td> </td> + <td><tt>cc</tt></td> + <td> </td> + <td>CC (login)</td> +</tr> + +<!-- Product, Version, Component, Target Milestone --> + +<tr> + <td><i>yes</i></td> + <td rowspan="2"><b>:</b><i>area</i></td> + <td><tt>product</tt></td> + <td><tt>prod</tt></td> + <td>Product (enum)</td> +</tr> +<tr> + <td><i>yes</i></td> + <td><tt>component</tt></td> + <td><tt>comp</tt></td> + <td><a href="describecomponents.cgi">Component</a></td> +</tr> +<tr> + <td> </td> + <td> </td> + <td><tt>version</tt></td> + <td><tt>ver</tt></td> + <td>Version (enum)</td> +</tr> +<tr> + <td> </td> + <td> </td> + <td><tt>milestone</tt></td> + <td><tt>target, targetmilestone</tt></td> + <td>Target Milestone <i>(“target_milestone”)</i></td> +</tr> + +<!-- Summary, Description, URL, Status whiteboard, Keywords --> + +<tr> + <td><i>yes</i></td> + <td> </td> + <td><tt>summary</tt></td> + <td><tt>shortdesc</tt></td> + <td> + [% terms.Bug %] Summary (short text) + <i>(“short_desc”)</i> + </td> +</tr> +<tr> + <td> </td> + <td> </td> + <td><tt>description</tt></td> + <td><tt>desc, longdesc<!--, comment--></tt></td> + <!-- reserve "comment" for "added comment" login search?! --> + <td>[% terms.Bug %] Description / Comments (long text)</td> +</tr> +<tr> + <td><i>depends</i></td> + <td> </td> + <td><tt>url</tt></td> + <td> </td> + <td>URL <i>(“bug_file_loc”)</i></td> +</tr> +<tr> + <td><i>yes</i></td> + <td> </td> + <td><tt>statuswhiteboard</tt></td> + <td><tt>sw, whiteboard</tt></td> + <td>Status Whiteboard <i>(“status_whiteboard”)</i></td> +</tr> +<tr> + <td><i>yes</i></td> + <td><b>!</b><i>keyword</i></td> + <td><tt>keywords</tt></td> + <td><tt>kw</tt></td> + <td><a href="describekeywords.cgi">Keywords</a></td> +</tr> + +<!-- Attachments --> + +<tr> + <td> </td> + <td> </td> + <td><tt>attachmentdesc</tt></td> + <td><tt>attachdesc</tt></td> + <td> + Attachment Description + <i>(“attachments.description”)</i> + </td> +</tr> +<tr> + <td> </td> + <td> </td> + <td><tt>attachmentdata</tt></td> + <td><tt>attachdata</tt></td> + <td>Attachment Data <i>(“attachments.thedata”)</i></td> +</tr> +<tr> + <td> </td> + <td> </td> + <td><tt>attachmentmimetype</tt></td> + <td><tt>attachmimetype</tt></td> + <td>Attachment mime-type <i>(“attachments.mimetype”)</i></td> +</tr> + +</table> + +<p> + Examples for some useful abbreviations: +</p> +<table border="1"> +<thead> +<tr> + <th>Syntax</th> + <th>Semantics and Examples</th> +</tr> +</thead> + +<!-- +<tr> + <td><i>STAT</i> <i>(as first word)</i></td> + <td><b>status,resolution:</b> <i>STAT</i></td> +</tr> +<tr> + <td></td> + <td></td> +</tr> +<tr> + <td><tt>ALL</tt> <i>(as first word)</i></td> + <td><i>include all resolved [% terms.bugs %] in your search</i></td> +</tr> +<tr> + <td><tt>+DUP,FIXED</tt> <i>(as first word)</i></td> + <td><i>include DUPLICATE and FIXED [% terms.bugs %] in your search</i></td> +</tr> +--> + +<tr> + <td><b>:</b><i>area</i></td> + <td><b>product,component:</b><i>area</i></td> +</tr> +<!-- +<tr> + <td><tt>:browser</tt></td> + <td><i>[% terms.bugs %] in the Browser product</i></td> +</tr> + <td><tt>:mail</tt></td> + <td><i>[% terms.bugs %] in the MailNews product</td> +</tr> +<tr> + <td><tt>:xbl</tt></td> + <td><i>[% terms.bugs %] in the XBL component</i></td> +</tr> + --> +<tr> + <td><i>sev</i></td> + <td><b>severity:</b><i>sev</i></td> +</tr> +<tr> + <td><tt>blo,cri,maj</tt></td> + <td><i>severe [% terms.bugs %]</i></td> +</tr> +<tr> + <td><tt>enh</tt></td> + <td><i>enhancement requests</i></td> +</tr> +<tr> + <td><b>p</b><i>level</i></td> + <td><b>priority:</b><i>level</i></td> +</tr> +<tr> + <td><tt>p1</tt></td> + <td><i>very high-priority [% terms.bugs %]</i></td> +</tr> +<tr> + <td><tt>p1-2</tt></td> + <td><i>high-priority [% terms.bugs %]</i></td> +</tr> +<tr> + <td><b>@</b><i>assignee</i></td> + <td><b>assignedto:</b><i>assignee</i></td> +</tr> +<!-- +<tr> + <td><tt>@nobody</tt></td> + <td><i>assigneeless [% terms.bugs %]</i></td> +</tr> +<tr> + <td><tt>@mozilla.org</tt></td> + <td><i>[% terms.bugs %] assigned to mozilla.org members</i></td> +</tr> + --> +<tr> + <td><b>!</b><i>keyword</i></td> + <td><b>keywords:</b><i>keyword</i></td> +</tr> +<!-- +<tr> + <td><tt>!crash</tt></td> + <td><i>crasher [% terms.bugs %]</i></td> +</tr> +<tr> + <td><tt>!helpwanted</tt></td> + <td><i>[% terms.bugs %] waiting for your help</i></td> +</tr> + --> +</table> + +<p> + More information can be found in the + <a href="page.cgi?id=quicksearch.html#features">“Features”</a> + section on the <a href="page.cgi?id=quicksearch.html">introductory page</a>. +</p> + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/sidebar.xul.tmpl b/template/en/default/sidebar.xul.tmpl index b04aa08dc..31f0a2c6b 100644 --- a/template/en/default/sidebar.xul.tmpl +++ b/template/en/default/sidebar.xul.tmpl @@ -34,14 +34,8 @@ orient="vertical" onload="document.getElementById('query-field').addEventListener('keypress', initial_keypress_handler, true)"> -<!-- Load QuickSearch libraries --> -<script type="application/x-javascript" src="localconfig.js"/> -<script type="application/x-javascript" src="quicksearch.js"/> <script type="application/x-javascript"><![CDATA[ -// Tell QuickSearch that the source of this is the sidebar -var sidebar = 1; - function load_absolute_url( aAbsoluteURL ) { content.location = aAbsoluteURL; } @@ -59,7 +53,7 @@ function initial_keypress_handler( aEvent ) { function normal_keypress_handler( aEvent ) { if ( aEvent.keyCode == 13 ) - QuickSearch(this.value); + load_relative_url('buglist.cgi?quicksearch=' + this.value); } ]]></script> |