]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 291459: Make textareas zoom large when in use - Patch by Marc Schumann <wurblzap...
authorlpsolit%gmail.com <>
Wed, 22 Feb 2006 22:25:24 +0000 (22:25 +0000)
committerlpsolit%gmail.com <>
Wed, 22 Feb 2006 22:25:24 +0000 (22:25 +0000)
19 files changed:
checksetup.pl
template/en/default/admin/classifications/add.html.tmpl
template/en/default/admin/classifications/edit.html.tmpl
template/en/default/admin/components/create.html.tmpl
template/en/default/admin/components/edit.html.tmpl
template/en/default/admin/flag-type/edit.html.tmpl
template/en/default/admin/keywords/create.html.tmpl
template/en/default/admin/keywords/edit.html.tmpl
template/en/default/admin/users/userdata.html.tmpl
template/en/default/attachment/create.html.tmpl
template/en/default/attachment/edit.html.tmpl
template/en/default/bug/create/create-guided.html.tmpl
template/en/default/bug/create/create.html.tmpl
template/en/default/bug/edit.html.tmpl
template/en/default/global/setting-descs.none.tmpl
template/en/default/global/textarea.html.tmpl [new file with mode: 0644]
template/en/default/list/edit-multiple.html.tmpl
template/en/default/pages/linkify.html.tmpl
template/en/default/whine/schedule.html.tmpl

index 4c1455d45fa5f4c02eb0db277e76132cc388106b..f5cf909d54414624b4aeb2f2fabf8482d6e9401c 100755 (executable)
@@ -4416,6 +4416,9 @@ add_setting ("post_bug_submit_action", {"next_bug" => 1,
 # 2005-06-29 wurblzap@gmail.com -- Bug 257767
 add_setting ('csv_colsepchar', {',' => 1, ';' => 2 }, ',' );
 
+# 2005-10-26 wurblzap@gmail.com -- Bug 291459
+add_setting ("zoom_textareas", {"on" => 1, "off" => 2 }, "on" );
+
 # 2005-10-21 LpSolit@gmail.com -- Bug 313020
 add_setting('per_bug_queries', {'on' => 1, 'off' => 2}, 'on');
 
index d6a7c388039e225dde6bd5fa6efc82cb8a9f953e..d11a8d36c0f4748319e1ba3287fbc953d80fab03 100644 (file)
     </tr>
     <tr>
       <th align="right">Description:</th>
-      <td><textarea rows=4 cols=64 wrap=virtual name="description"></textarea></td>
+      <td>
+        [% INCLUDE global/textarea.html.tmpl
+          name    = 'description'
+          minrows = 4
+          cols    = 64
+          wrap    = 'virtual'
+        %]
+      </td>
     </tr>
   </table>
   <hr>
index 24ec9dacfccaf41cff3e748e5851cbeb9efa4592..b00ea685325f86f2f3ce2412dfeb9b6bd14b6657 100644 (file)
     </tr>
     <tr>
       <th align="right">Description:</th>
-      <td><textarea rows=4 cols=64 name="description">
-            [% classification.description FILTER none %]</textarea>
+      <td>
+        [% INCLUDE global/textarea.html.tmpl
+          name           = 'description'
+          minrows        = 4
+          cols           = 64
+          defaultcontent = classification.description
+        %]
       </td>
     </tr>
     <tr valign=top>
index fcb57bb03cc92f8ddf0dc1a5ab555b897e6f31c5..ea4380d5078ffc0612ef37ad171954741e442591 100644 (file)
     <tr>
       <th align="right">Description:</th>
       <td>
-        <textarea rows="4" cols="64" wrap="virtual"
-                  name="description"></textarea>
+        [% INCLUDE global/textarea.html.tmpl
+          name    = 'description'
+          minrows = 4
+          cols    = 64
+          wrap    = 'virtual'
+        %]
       </td>
     </tr>
     <tr>
index 8b350d9e8570f382338445cb220896c5a231d379..920ad1ff61e25cd80a167d4f71dfede079d80c5c 100644 (file)
     </tr>
     <tr>
       <td valign="top">Component Description:</td>
-      <td><textarea rows="4" cols="64" wrap="virtual"
-        name="description">[% comp.description FILTER html %]</textarea>
+      <td>
+        [% INCLUDE global/textarea.html.tmpl
+          name           = 'description'
+          minrows        = 4
+          cols           = 64
+          wrap           = 'virtual'
+          defaultcontent = comp.description
+        %]
       </td>
     </tr>
     <tr>
index ad41576cb25ecb6478190aac4ff4ec8eb237118d..dc49890b77cbf8dc0c689fd2eca74d3c33666e54 100644 (file)
       <th>Description:</th>
       <td>
         a comprehensive description of this type<br>
-        <textarea name="description" rows="4" cols="80">[% type.description FILTER html %]</textarea>
+        [% INCLUDE global/textarea.html.tmpl
+          name           = 'description'
+          minrows        = 4
+          cols           = 80
+          defaultcontent = type.description
+        %]
       </td>
     </tr>
 
index 006b4b3447ef70814f13f7edac85c9a5cd87a99b..3f9f5aecfc1fa5385b213f8e55ca0278743ebe13 100755 (executable)
     <tr>
       <th align="right">Description:</th>
       <td>
-        <textarea rows="4" cols="64" wrap="virtual"
-        name="description"></textarea>
+        [% INCLUDE global/textarea.html.tmpl
+          name    = 'description'
+          minrows = 4
+          cols    = 64
+          wrap    = 'virtual'
+        %]
       </td>
     </tr>
   </table>
index 3809563c2c33b13884b7def8c15675666ee5c948..74cef3d55c07864386501f1d372416e973489a3a 100755 (executable)
     <tr>
       <th align="right">Description:</th>
       <td>
-        <textarea rows="4" cols="64" wrap="virtual"
-        name="description">[% description FILTER html %]</textarea>
+        [% INCLUDE global/textarea.html.tmpl
+          name           = 'description'
+          minrows        = 4
+          cols           = 64
+          wrap           = 'virtual'
+          defaultcontent = description
+        %]
       </td>
     </tr>
     <tr>
index 672e180bfaf3073eed1412eb9b04bae88960c26b..afb4025542af89021b4257d76c98aea4ef10cda7 100644 (file)
   <tr>
     <th><label for="disabledtext">Disable text:</label></th>
     <td>
-      <textarea name="disabledtext" rows="10"
-                id="disabledtext"
-                cols="60">[% otheruser.disabledtext FILTER html %]</textarea><br />
+      [% INCLUDE global/textarea.html.tmpl
+         name           = 'disabledtext'
+         id             = 'disabledtext'
+         minrows        = 2
+         maxrows        = 10
+         defaultrows    = 10
+         cols           = 60
+         defaultcontent = otheruser.disabledtext
+       %]<br>
       (If non-empty, then the account will be disabled, and this text should
       explain why.)
       [% IF editform %]
index c3ef855d492dd35ac2ed033bbe50216a3fc7fbb9..4de1e5a08d010d3933291402f395575d70abb6fb 100644 (file)
       <th><label for="comment">Comment:</label></th>
       <td>
         <em>(optional) Add a comment about this attachment to the [% terms.bug %].</em><br>
-        <textarea wrap="soft" id="commment" name="comment" rows="6" cols="80"></textarea>
+        [% INCLUDE global/textarea.html.tmpl
+          name    = 'comment'
+          id      = 'comment'
+          minrows = 6
+          maxrows = 15
+          cols    = 80
+          wrap    = 'soft'
+        %]
       </td>
     </tr>
     <tr>
index eefe141f8044f1de32a45b9aa6dcc21470ba6081..53eb44d9e07a96bd77a9ab3a7ceb32a3531b2932 100644 (file)
       <td width="25%">
         <small>
         <b>Description:</b><br>
-          <textarea rows="3" cols="25" name="description" wrap="soft">
-            [%- attachment.description FILTER html %]</textarea><br>
+          [% INCLUDE global/textarea.html.tmpl
+            name           = 'description'
+            minrows        = 3
+            cols           = 25
+            wrap           = 'soft'
+            defaultcontent = attachment.description
+          %]<br>
 
         [% IF attachment.isurl %]
             <input type="hidden" name="filename"
 
         <div id="smallCommentFrame">
           <b>Comment (on the [% terms.bug %]):</b><br>
-            <textarea name="comment" rows="5" cols="25" wrap="soft"></textarea><br>
+            [% INCLUDE global/textarea.html.tmpl
+              name    = 'comment'
+              minrows = 5
+              cols    = 25
+              wrap    = 'soft'
+            %]<br>
         </div>
 
         <input type="submit" value="Submit"><br><br>
 
       [% IF isviewable %]
         <td width="75%">
-          <textarea id="editFrame" name="comment" wrap="soft" cols="80"
-                    style="height: 400px; width: 100%; display: none;"></textarea>
+          [% INCLUDE global/textarea.html.tmpl
+            id      = 'editFrame'
+            name    = 'comment'
+            style   = 'height: 400px; width: 100%; display: none'
+            minrows = 10
+            cols    = 80
+            wrap    = 'soft'
+          %]
           <iframe id="viewFrame" src="attachment.cgi?id=[% attachment.id %]" style="height: 400px; width: 100%;">
             <b>You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
             <a href="attachment.cgi?id=[% attachment.id %]">View the attachment on a separate page</a>.</b>
index 712f27948ce123c92d66e84e1f00b7a25207de11..3c29791e5c1fc22f36cc92372dcf68491447f460 100644 (file)
@@ -333,7 +333,11 @@ function PutDescription() {
       <b>Details</b>
     </td>
     <td valign="top">
-      <textarea rows="6" cols="80" name="comment"></textarea>
+      [% INCLUDE global/textarea.html.tmpl
+        name    = 'comment'
+        minrows = 6
+        cols    = 80
+      %]
       <p>
         Expand on the Summary. Please be
         as specific as possible about what is wrong.
@@ -381,11 +385,12 @@ function PutDescription() {
       <b>Steps to Reproduce</b>
     </td>
     <td valign="top">
-<textarea rows="4" cols="80" name="reproduce_steps">
-1.
-2.
-3.
-</textarea>
+      [% INCLUDE global/textarea.html.tmpl
+        name           = 'reproduce_steps'
+        minrows        = 4
+        cols           = 80
+        defaultcontent = "1.\n2.\n3."
+      %]
       <p>
         Describe how to reproduce the problem, step by
         step. Include any special setup steps.
@@ -398,7 +403,11 @@ function PutDescription() {
       <b>Actual Results</b>
     </td>
     <td valign="top">
-      <textarea rows="4" cols="80" name="actual_results"></textarea>
+      [% INCLUDE global/textarea.html.tmpl
+        name    = 'actual_results'
+        minrows = 4
+        cols    = 80
+      %]
       <p>
         What happened after you performed the steps above?
       </p>
@@ -410,7 +419,11 @@ function PutDescription() {
       <b>Expected Results</b>
     </td>
     <td valign="top">
-      <textarea rows="4" cols="80" name="expected_results"></textarea>
+      [% INCLUDE global/textarea.html.tmpl
+        name    = 'expected_results'
+        minrows = 4
+        cols    = 80
+      %]
       <p>
         What should the software have done instead?
       </p>
@@ -422,7 +435,11 @@ function PutDescription() {
       <b>Additional Information</b>
     </td>
     <td valign="top">
-      <textarea rows="8" cols="80" name="additional_info"></textarea>
+      [% INCLUDE global/textarea.html.tmpl
+        name    = 'additional_info'
+        minrows = 8
+        cols    = 80
+      %]
       <p>
         Add any additional information you feel may be
         relevant to this [% terms.bug %], such as the <b>theme</b> you were
index 21bfb6104e7f753fd522cc29603913282101406b..d5e0081d90ba0b39dc037f556599dcce09f66376 100644 (file)
@@ -307,13 +307,21 @@ function set_assign_to() {
 
   <tr><td align="right" valign="top"><strong>Description:</strong></td>
     <td colspan="3">
-      <textarea name="comment" rows="10" cols="80">
+      [% defaultcontent = BLOCK %]
         [% IF cloned_bug_id %]
 +++ This [% terms.bug %] was initially created as a clone of [% terms.Bug %] #[% cloned_bug_id %] +++
 
 
         [% END %]
-        [% comment FILTER html %]</textarea>
+        [% comment FILTER html %]
+      [%- END %]
+      [% INCLUDE global/textarea.html.tmpl
+         name           = 'comment'
+         minrows        = 10
+         maxrows        = 25
+         cols           = 80
+         defaultcontent = defaultcontent
+       %]
       <br>
     </td>
   </tr>
index 349b050491ee2413c90eefeae3fb4adffcbde677..3c647b67d4003cd17d4ae2e2380f8b3420bf0988 100644 (file)
   [% END %]
   <br>
   <a name="add_comment"></a>
-  <textarea name="comment" id="comment" rows="10" cols="80"
-            accesskey="c"></textarea>
+  [% INCLUDE global/textarea.html.tmpl
+    name      = 'comment'
+    id        = 'comment'
+    minrows   = 10
+    maxrows   = 25
+    cols      = 80
+    accesskey = 'c'
+  %]
 
   [% IF NOT bug.cc || NOT bug.cc.contains(user.login) %]
     <br>
index 3ca7fe3f38650d13aad06285ddab98ef435bcb30..a0dbeb1a380def77838226475e353cfb7cde5eac 100644 (file)
@@ -23,6 +23,7 @@
    "comment_sort_order"               => "When viewing $terms.abug, show comments in this order",
    "csv_colsepchar"                   => "Field separator character for CSV files",
    "display_quips"                    => "Show a quip at the top of each bug list",
+   "zoom_textareas"                   => "Zoom textareas large when in use (requires JavaScript)",
    "newest_to_oldest"                 => "Newest to Oldest",
    "newest_to_oldest_desc_first"      => "Newest to Oldest, but keep Description at the top",
    "off"                              => "Off",
diff --git a/template/en/default/global/textarea.html.tmpl b/template/en/default/global/textarea.html.tmpl
new file mode 100644 (file)
index 0000000..e96721b
--- /dev/null
@@ -0,0 +1,50 @@
+[%# 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): Marc Schumann <wurblzap@gmail.com>
+  #%]
+
+[%# INTERFACE:
+  #
+  # id:             (optional) The "id"-attribute of the textarea.
+  # name:           (optional) The "name"-attribute of the textarea.
+  # accesskey:      (optional) The "accesskey"-attribute of the textarea.
+  # style:          (optional) The "style"-attribute of the textarea.
+  # wrap:           (deprecated; optional) The "wrap"-attribute of the textarea.
+  # minrows:        (required) Number of rows the textarea shall have initially
+  #                 and when not having focus.
+  # maxrows:        (optional) Number of rows the textarea shall have if
+  #                 maximized (which happens on getting focus). If not given,
+  #                 the textarea doesn't maximize when getting focus.
+  # defaultrows:    (optional) Number of rows the textarea shall have if
+  #                 the zoom_textareas user preference if off. If not given,
+  #                 minrows will be used.
+  # cols:           (required) Number of columns the textarea shall have.
+  # defaultcontent: (optional) Default content for the textarea.
+  #%]
+
+<textarea [% IF name %]name="[% name FILTER html %]"[% END %]
+          [% IF id %] id="[% id FILTER html %]"[% END %]
+          [% IF accesskey %] accesskey="[% accesskey FILTER html %]"[% END %]
+          [% IF style %] style="[% style FILTER html %]"[% END %]
+          [% IF wrap %] wrap="[% wrap FILTER html %]"[% END %]
+          [% IF defaultrows && user.settings.zoom_textareas.value == 'off' %]
+            rows="[% defaultrows FILTER html %]"
+          [% ELSE %]
+            rows="[% minrows FILTER html %]"
+          [% END %]
+          cols="[% cols FILTER html %]"
+          [% IF maxrows && user.settings.zoom_textareas.value == 'on' %]
+            onFocus="this.rows=[% maxrows FILTER html %]"
+            onBlur="this.rows=[% minrows FILTER html %]"
+          [% END %]>[% defaultcontent FILTER html %]</textarea>
index d55a4e2db63746a2966484221ea53395d6125fed..dbf73b354b259b92ca7bfad89540708ff08a6d47 100644 (file)
 </table>
 
 <b><label for="comment">Additional Comments:</label></b><br>
-<textarea id="comment" name="comment" rows="5" cols="80"></textarea><br>
+[% INCLUDE global/textarea.html.tmpl
+  name    = 'comment'
+  id      = 'comment'
+  minrows = 5
+  maxrows = 25
+  cols    = 80
+%]<br>
 
 [% IF groups.size > 0 %]
 
index 896f7d41f5ea87e4915756fc2ed44cc20509858a..9ad92a0d0332a70f30e65c7050412cdcb334aecf 100644 (file)
 </p>
 
 <form action="page.cgi" method="post">
-  <textarea cols="80" rows="20" name="text"></textarea>
+  [% INCLUDE global/textarea.html.tmpl
+    name    = 'text'
+    minrows = 20
+    cols    = 80
+  %]
   <br>
   <input type="hidden" name="id" value="linked.html">
   <input value="Linkify" type="submit">
index b49f713a8f2a292fe258da593041652051aad721..4f94b4d711ac16d23ee37484de8d63e2a6dbcf1e 100644 (file)
       Descriptive text sent within whine message:
     </td>
     <td>
-      <textarea name="event_[% event.key %]_body"
-                rows="5" cols="80">
-          [% event.value.body FILTER html %]</textarea>
+      [% INCLUDE global/textarea.html.tmpl
+         name           = "event_${event.key}_body"
+         minrows        = 3
+         maxrows        = 10
+         defaultrows    = 5
+         cols           = 80
+         defaultcontent = event.value.body
+       %]
     </td>
   </tr>