Browse Source

Updated todo.md and nojs.njk

Added another todo entry.

Added required attribute to input file in No-JS uploader. This should
prevent submission when clicking Upload button before selecting any
files.

Removed built-in "safe" filter from some fields in nojs.njk, cause they
were unnecessary.
Bobby Wibowo 3 weeks ago
parent
commit
6803eb0812
2 changed files with 4 additions and 3 deletions
  1. 1 0
      todo.md
  2. 3 3
      views/nojs.njk

+ 1 - 0
todo.md

@@ -21,6 +21,7 @@ Normal priority:
 * [ ] Add a copy all links to clipboard when there are more than 2 uploads in history.
 * [x] Update fb_share.png.
 * [ ] Support [fragments](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Identifying_resources_on_the_Web#Fragment) for dashboard sidebar menus.
+* [ ] I forsaked all `Promise.all()` in favor of `await-in-for-loop` a while back. I personally think it was fine, considering a lot of them were tasks that required serial processing (continuation be dependant on previous iterations), but maybe I should review the current codes to find any sections that would do just fine, or maybe even great, with `Promise.all()`.
 
 Low priority:
 

+ 3 - 3
views/nojs.njk

@@ -45,7 +45,7 @@
           <form id="form" class="field" action="" method="post" enctype="multipart/form-data">
             <div class="field">
               <p class="control">
-                <input type="file" class="is-fullwidth" name="files[]" multiple="multiple">
+                <input type="file" class="is-fullwidth" name="files[]" multiple="multiple" required="required">
               </p>
             </div>
             <div class="field">
@@ -64,11 +64,11 @@
             <div class="field">
               <p class="name">{{ file.original }}</p>
               {% if errorMessage -%}
-              <p class="error">{{ errorMessage | safe }}</p>
+              <p class="error">{{ errorMessage }}</p>
               {%- endif %}
               {% if file.url -%}
               <p class="link">
-                <a href="{{ file.url }}" target="_blank" rel="noopener">{{ file.url | safe }}</a>
+                <a href="{{ file.url }}" target="_blank" rel="noopener">{{ file.url }}</a>
               </p>
               {%- endif %}
             </div>