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 16cb98549fab6a1af40438fa8561d0cadd9d0e38..a405a25ec42cc1ce1399686e62864e572081303a 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 5df11db76fb5e07e5feaefbae46456fdf2691d0b..e76d2882159f0167a4c8d558361f486ee6e92b87 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 c780ad597ca4105e68f0ee27e31b1f3f4c229518..c3ef332aecd6a999247c478f39525e894d8fd26e 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 9f31132ac2363165178e412e3a689cb5690257d6..2ec720540159b68bbf7b82f2237f3e784a1500e9 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 29ddbe10c480c282e9904f330cf7944b13e8169a..07cbd6a7b99d07194f38c32630895d77c6bb5843 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 f0daf8c8a3b8da430f2e34d91ca2d2e401b28e80..02d8904de392e34f118166fa05225b07bfcb4e5c 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>