Browse Source

Accessibility improvements

spaghetti 7 years ago
parent
commit
bbfdde836a

+ 12
- 36
design/privateheader.php View File

@@ -144,7 +144,7 @@ if ($NotificationsManager->is_skipped(NotificationsManager::SUBSCRIPTIONS)) {
144 144
     <h1 class="hidden"><?=SITE_NAME?></h1>
145 145
     <div id="header">
146 146
       <div id="logo">
147
-        <a href="index.php"></a>
147
+        <a href="index.php" aria-label="Front page"></a>
148 148
       </div>
149 149
       <div id="menu">
150 150
         <ul>
@@ -215,56 +215,32 @@ if (isset(G::$LoggedUser['SearchType']) && G::$LoggedUser['SearchType']) { // Ad
215 215
       <div id="searchbars">
216 216
         <form class="search_form" name="torrents" action="torrents.php" method="get">
217 217
 <?  if ($UseAdvancedSearch) { ?>
218
-          <input type="hidden" name="action" value="advanced" />
218
+          <input type="hidden" name="action" value="advanced">
219 219
 <?  } ?>
220
-          <input id="torrentssearch" accesskey="t" spellcheck="false"
221
-              onfocus="if (this.value == 'Torrents') { this.value = ''; }"
222
-              onblur="if (this.value == '') { this.value = 'Torrents'; }"
223
-              value="Torrents" placeholder="Torrents" type="text" name="<?=$UseAdvancedSearch ? 'advgroupname' : 'searchstr' ?>" size="17" />
220
+          <input id="torrentssearch" aria-label="Search torrents" accesskey="t" spellcheck="false" autocomplete="off" placeholder="Torrents" type="text" name="<?=$UseAdvancedSearch ? 'advgroupname' : 'searchstr' ?>" size="17">
224 221
         </form>
225 222
         <form class="search_form" name="artists" action="artist.php" method="get">
226
-          <input id="artistsearch"<?=Users::has_autocomplete_enabled('search');
227
-              ?> accesskey="a"
228
-              spellcheck="false" autocomplete="off"
229
-              onfocus="if (this.value == 'Artists') { this.value = ''; }"
230
-              onblur="if (this.value == '') { this.value = 'Artists'; }"
231
-              value="Artists" placeholder="Artists" type="text" name="artistname" size="17" />
223
+          <input id="artistsearch"<?=Users::has_autocomplete_enabled('search')?> aria-label="Search artists" accesskey="a" spellcheck="false" autocomplete="off" placeholder="Artists" type="text" name="artistname" size="17">
232 224
         </form>
233 225
         <form class="search_form" name="requests" action="requests.php" method="get">
234
-          <input id="requestssearch" spellcheck="false"
235
-              onfocus="if (this.value == 'Requests') { this.value = ''; }"
236
-              onblur="if (this.value == '') { this.value = 'Requests'; }"
237
-              value="Requests" placeholder="Requests" type="text" name="search" size="17" />
226
+          <input id="requestssearch" aria-label="Search requests" spellcheck="false" autocomplete="off" placeholder="Requests" type="text" name="search" size="17">
238 227
         </form>
239 228
         <form class="search_form" name="forums" action="forums.php" method="get">
240
-          <input value="search" type="hidden" name="action" />
241
-          <input id="forumssearch"
242
-              onfocus="if (this.value == 'Forums') { this.value = ''; }"
243
-              onblur="if (this.value == '') { this.value = 'Forums'; }"
244
-              value="Forums" placeholder="Forums" type="text" name="search" size="17" />
229
+          <input value="search" type="hidden" name="action">
230
+          <input id="forumssearch" aria-label="Search forums" spellcheck="false" autocomplete="off" placeholder="Forums" type="text" name="search" size="17">
245 231
         </form>
246 232
 <!--
247 233
         <form class="search_form" name="wiki" action="wiki.php" method="get">
248
-          <input type="hidden" name="action" value="search" />
249
-          <input
250
-              onfocus="if (this.value == 'Wiki') { this.value = ''; }"
251
-              onblur="if (this.value == '') { this.value = 'Wiki'; }"
252
-              value="Wiki" placeholder="Wiki" type="text" name="search" size="17" />
234
+          <input type="hidden" name="action" value="search">
235
+          <input value="Wiki" placeholder="Wiki" type="text" name="search" size="17">
253 236
         </form>
254 237
 -->
255 238
         <form class="search_form" name="log" action="log.php" method="get">
256
-          <input id="logsearch"
257
-              onfocus="if (this.value == 'Log') { this.value = ''; }"
258
-              onblur="if (this.value == '') { this.value = 'Log'; }"
259
-              value="Log" placeholder="Log" type="text" name="search" size="17" />
239
+          <input id="logsearch" aria-label="Search log" spellcheck="false" autocomplete="off" placeholder="Log" type="text" name="search" size="17">
260 240
         </form>
261 241
         <form class="search_form" name="users" action="user.php" method="get">
262
-          <input type="hidden" name="action" value="search" />
263
-          <input
264
-              id="userssearch"
265
-              onfocus="if (this.value == 'Users') { this.value = ''; }"
266
-              onblur="if (this.value == '') { this.value = 'Users'; }"
267
-              value="Users" placeholder="Users" type="text" name="search" size="20" />
242
+          <input type="hidden" name="action" value="search">
243
+          <input id="userssearch" aria-label="Search users" spellcheck="false" autocomplete="off" placeholder="Users" type="text" name="search" size="20">
268 244
         </form>
269 245
       </div>
270 246
       <div id="userinfo">

+ 1
- 1
sections/forums/main.php View File

@@ -56,7 +56,7 @@ foreach ($Forums as $Forum) {
56 56
         <a href="forums.php?action=viewthread&amp;threadid=<?=$LastTopicID?>" class="tooltip" data-title-plain="<?=display_str($LastTopic)?>"><?=display_str(Format::cut_string($LastTopic, 50, 1))?></a>
57 57
       </span>
58 58
 <? if (!empty($LastRead[$LastTopicID])) { ?>
59
-      <a class="tooltip last_read" title="Jump to last read" href="forums.php?action=viewthread&amp;threadid=<?=$LastTopicID?>&amp;page=<?=$LastRead[$LastTopicID]['Page']?>#post<?=$LastRead[$LastTopicID]['PostID']?>">
59
+      <a class="tooltip last_read" aria-label="Jump to last read" title="Jump to last read" href="forums.php?action=viewthread&amp;threadid=<?=$LastTopicID?>&amp;page=<?=$LastRead[$LastTopicID]['Page']?>#post<?=$LastRead[$LastTopicID]['PostID']?>">
60 60
         <svg width="15" height="11"><polygon points="0,3 0,8 8,8 8,11 15,5.5 8,0 8,3"/></svg>
61 61
       </a>
62 62
 <? } ?>

+ 7
- 7
sections/torrents/browse.php View File

@@ -300,13 +300,13 @@ View::show_header('Browse Torrents', 'browse');
300 300
         <tr id="search_terms" class="ftr_basic<?=$HideBasic?>">
301 301
           <td class="label"><!--Search terms:--></td>
302 302
           <td class="ftb_searchstr">
303
-            <input type="search" spellcheck="false" size="48" name="searchstr" class="inputtext fti_basic" placeholder="Search terms" value="<?Format::form('searchstr')?>" />
303
+            <input type="search" spellcheck="false" size="48" name="searchstr" class="inputtext fti_basic" placeholder="Search terms" value="<?Format::form('searchstr')?>" aria-label="Terms to search">
304 304
           </td>
305 305
         </tr>
306 306
         <tr id="tagfilter">
307 307
           <td class="label"><!--<span title="Use !tag to exclude tag" class="tooltip">Tags (comma-separated):</span>--></td>
308 308
           <td class="ft_taglist">
309
-            <input type="search" size="37" id="tags" name="taglist" class="inputtext smaller tooltip_left" title="Use !tag to exclude tag" placeholder="Tags (comma separated)" value="<?=display_str($Search->get_terms('taglist'))?>"<? Users::has_autocomplete_enabled('other'); ?> />&nbsp;
309
+            <input type="search" size="37" id="tags" name="taglist" class="inputtext smaller tooltip_left" title="Use !tag to exclude tag" placeholder="Tags (comma separated)" value="<?=display_str($Search->get_terms('taglist'))?>"<? Users::has_autocomplete_enabled('other'); ?> aria-label="Tags to search">&nbsp;
310 310
             <input type="radio" name="tags_type" id="tags_type0" value="0"<?Format::selected('tags_type', 0, 'checked')?> /><label for="tags_type0"> Any</label>&nbsp;&nbsp;
311 311
             <input type="radio" name="tags_type" id="tags_type1" value="1"<?Format::selected('tags_type', 1, 'checked')?> /><label for="tags_type1"> All</label>
312 312
           </td>
@@ -314,7 +314,7 @@ View::show_header('Browse Torrents', 'browse');
314 314
         <tr id="order">
315 315
           <td class="label">Order by:</td>
316 316
           <td class="ft_order">
317
-            <select name="order_by" style="width: auto;" class="ft_order_by">
317
+            <select name="order_by" style="width: auto;" class="ft_order_by" aria-label="Property to order by">
318 318
               <option value="time"<?Format::selected('order_by', 'time')?>>Time added</option>
319 319
               <option value="year"<?Format::selected('order_by', 'year')?>>Year</option>
320 320
               <option value="size"<?Format::selected('order_by', 'size')?>>Size</option>
@@ -324,7 +324,7 @@ View::show_header('Browse Torrents', 'browse');
324 324
               <option value="cataloguenumber"<?Format::selected('order_by', 'cataloguenumber')?>>Catalogue Number</option>
325 325
               <option value="random"<?Format::selected('order_by', 'random')?>>Random</option>
326 326
             </select>
327
-            <select name="order_way" class="ft_order_way">
327
+            <select name="order_way" class="ft_order_way" aria-label="Direction to order">
328 328
               <option value="desc"<?Format::selected('order_way', 'desc')?>>Descending</option>
329 329
               <option value="asc"<?Format::selected('order_way', 'asc')?>>Ascending</option>
330 330
             </select>
@@ -463,17 +463,17 @@ View::show_header('Browse Torrents', 'browse');
463 463
       <td><a href="<?=header_link('time')?>">Time</a></td>
464 464
       <td><a href="<?=header_link('size')?>">Size</a></td>
465 465
       <td class="sign snatches">
466
-        <a href="<?=header_link('snatched')?>">
466
+        <a href="<?=header_link('snatched')?>" aria-label="Sort by snatches">
467 467
           <svg width="15" height="15" fill="white" class="tooltip" alt="Snatches" title="Snatches" viewBox="3 0 88 98"><path d="M20 20 A43 43,0,1,0,77 23 L90 10 L55 10 L55 45 L68 32 A30.27 30.27,0,1,1,28 29"></path></svg>
468 468
         </a>
469 469
       </td>
470 470
       <td class="sign seeders">
471
-        <a href="<?=header_link('seeders')?>">
471
+        <a href="<?=header_link('seeders')?>" aria-label="Sort by seeders">
472 472
           <svg width="11" height="15" fill="white" class="tooltip" alt="Seeders" title="Seeders"><polygon points="0,7 5.5,0 11,7 8,7 8,15 3,15 3,7"></polygon></svg>
473 473
         </a>
474 474
       </td>
475 475
       <td class="sign leechers">
476
-        <a href="<?=header_link('leechers')?>">
476
+        <a href="<?=header_link('leechers')?>" aria-label="Sort by leechers">
477 477
           <svg width="11" height="15" fill="white" class="tooltip" alt="Leechers" title="Leechers"><polygon points="0,8 5.5,15 11,8 8,8 8,0 3,0 3,8"></polygon></svg>
478 478
         </a>
479 479
       </td>

+ 1
- 0
static/functions/validate_upload.js View File

@@ -26,4 +26,5 @@ $(() => {
26 26
       soft_error('You did not include a cover image, which is mandatory if one exists')
27 27
     }
28 28
   })
29
+  $('#tags').on('blur', e => $('#tags').raw().value = $('#tags').raw().value.split(',').map(t=>t.trim()).filter(t=>t).join(', '))
29 30
 })

+ 6
- 8
static/styles/global.css View File

@@ -823,14 +823,12 @@ div.torrent_artists {
823 823
 /* Ratio Colors */
824 824
 .r00           { color: #FF0000; }
825 825
 .r01,.r02      { color: #FF1300; }
826
-.r03           { color: #FF2600; }
827
-.r04           { color: #FF4C00; }
828
-.r05,.r06      { color: #FF5E00; }
829
-.r07           { color: #FF7100; }
830
-.r08           { color: #FF9700; }
831
-.r09           { color: #FFAA00; }
832
-.r10           { color: #74C42E; }
833
-.r20,.r50,.r99 { color: #418B00; }
826
+.r03           { color: #b70000; }
827
+.r04           { color: #a20000; }
828
+.r05,.r06      { color: #8e0000; }
829
+.r07           { color: #983100; }
830
+.r08           { color: #8c4802; }
831
+.r09           { color: #7b5200; }
834 832
 
835 833
 #coverCont.left {
836 834
   left: 20px;

+ 1
- 1
static/styles/oppai/style.css View File

@@ -563,7 +563,7 @@ td, th {
563 563
 .colhead {
564 564
   background: #E197E5;
565 565
   font-weight: bold;
566
-  color: #ffffff;
566
+  color: #000;
567 567
 }
568 568
 
569 569
 td.colhead, .colhead td, .colhead th {

Loading…
Cancel
Save