chiark / gitweb /
Macroize submit buttons so we can mess with them more easily
authorRichard Kettlewell <rjk@greenend.org.uk>
Wed, 4 Jun 2008 09:31:45 +0000 (10:31 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Wed, 4 Jun 2008 09:31:45 +0000 (10:31 +0100)
templates/choose.tmpl
templates/disorder.css
templates/login.tmpl
templates/macros.tmpl
templates/playing.tmpl
templates/prefs.tmpl

index 16cb985..a405a25 100644 (file)
@@ -94,11 +94,7 @@ USA
      <p class=search>Enter search terms:
        <input class=query name=query type=text value="@argq{query}"
               size=50>
-       <span class=button>
-        <button class=search name=submit type=submit>
-          @label{search.search}
-        </button>
-       </span>
+       @submit{@label{search.search}}
        <input name=action type=hidden value=choose>
        <a class=button
           href="@url?action=choose">
index 5df11db..e76d288 100644 (file)
@@ -193,7 +193,7 @@ button {
 }
 
 /* Buttons and links that look like buttons share the same formatting */
-span.button, a.button {
+span.buttonouter, a.button {
   padding-top: 2px;
   border-width: 3px;
   border-color: #fefefe;       /* Off-white */
index c780ad5..c3ef332 100644 (file)
@@ -63,11 +63,7 @@ USA
        </tr>
        <tr>
          <td colspan=2>
-          <span class=button>
-           <button class=login name=button type=submit>
-             @label{login.login}
-           </button>
-          </span>
+          @submit{@label{login.login}}
          </td>
        </tr>
      </table>
@@ -92,11 +88,7 @@ USA
        </tr>
        <tr>
          <td colspan=2>
-          <span class=button>
-           <button class=login name=button type=submit>
-            @label{login.reminder}
-           </span>
-          </button>
+          @submit{@label{login.reminder}}
          </td>
        </tr>
      </table>
@@ -148,11 +140,7 @@ USA
        </tr>
        <tr>
          <td colspan=3>
-          <span class=button>
-            <button class=register name=button type=submit>
-             @label{login.register}
-            </button>
-          </span>
+          @submit{@label{login.register}}
          </td>
        </tr>
      </table>
@@ -165,11 +153,7 @@ USA
    <form class=logout action="@url" method=POST
          enctype="multipart/form-data" accept-charset=utf-8>
      <div class=logout>
-       <span class=button>
-        <button class=logout name=submit type=submit>
-         @label{login.logout}
-        </button>
-       </span>
+       @submit{@label{login.logout}}
      </div>
      <input name=action type=hidden value=logout>
    </form>
@@ -205,11 +189,7 @@ USA
        </tr>
        <tr>
          <td colspan=3>
-         <span class=button>
-           <button class=edituser name=submit type=submit>
-            @label{login.edituser}
-           </button>
-         </span>
+         @submit{@label{login.edituser}}
          </td>
        </tr>
      </table>
index 9f31132..2ec7205 100644 (file)
@@ -277,6 +277,11 @@ and then redefines macros as desired.
    </table>
 }
 
+@# Expand to a submit button
+@#  @text is the text to put inside the button
+@define {submit} {text}
+        {<span class=buttonouter><button class=button name=submit type=submit><span class=buttoninner>@text</span></button></span>}
+
 Local variables:
 mode:sgml
 sgml-always-quote-attributes:nil
index 29ddbe1..07cbd6a 100644 (file)
@@ -94,11 +94,7 @@ USA
           <input size=3 name=right type=text value="@volume{right}">
           <input name=back type=hidden value="@quote{@thisurl}">
           @right{volume}{
-             <span class=button>
-             <button class=volume name=submit type=submit>
-               @label{volume.set}
-             </button>
-             </span>
+             @submit{@label{volume.set}}
             <input name=action type=hidden value=volume>
           }
           @vbutton{down}{-}
index f0daf8c..02d8904 100644 (file)
@@ -39,11 +39,7 @@ USA
       {@tracks{@arg{dir}}
               {@mprefs{@index}{@track}}}
    <p>
-    <span class=button>
-     <button type=submit name=submit>
-      @label{prefs.set}
-     </button>
-    </span>
+    @submit{@label{prefs.set}}
    </p>
   </form>