Browse Source

Add short delay to allow more typing before requesting new barcode; minor changes to license page.

Matt Clark 8 months ago
parent
commit
c5dfc358c6

+ 0 - 3
resources/VERSION

@@ -1,3 +0,0 @@
-${project.name}
-${project.description}
-${project.version}

+ 1 - 1
resources/index.html

@@ -73,7 +73,7 @@
 						<div class="row start-xs middle-xs">
 							<div class="col-xs-9">
 								<input id="text" class="barcode-text-input pulse-bg"
-									onkeyup="genCode()" type="text" placeholder="TRY ME!"
+									onkeyup="delayGenCode()" type="text" placeholder="TRY ME!"
 									autocomplete="off" maxlength="200"
 									title="Enter a code for anything" />
 							</div>

+ 16 - 11
resources/license.html

@@ -25,9 +25,8 @@
 		<div class="header row middle-xs between-xs">
 			<div class="col-xs-12 col-sm-3">
 				<div class="logo">
-					<a href="/">
-						<img src="/img/barcodeapi-logo.svg" alt="BarcodeAPI Logo"
-							aria-label="Logo">
+					<a href="/"> <img src="/img/barcodeapi-logo.svg"
+						alt="BarcodeAPI Logo" aria-label="Logo">
 					</a>
 				</div>
 			</div>
@@ -35,17 +34,14 @@
 				<div class="row end-xs middle-xs">
 					<div class="col-xs">
 						<h4>
-							GOT FEEDBACK?
-							<br />
-							<span class="feedback">feedback@barcodeapi.org</span>
+							GOT FEEDBACK? <br /> <span class="feedback">feedback@barcodeapi.org</span>
 						</h4>
 					</div>
 					<div class="share-icon email">
 						<a
 							href="mailto:feedback@barcodeapi.org?body=I%20love%20the%20new%20UI%21&amp;subject=Feedback%20about%20BarcodeAPI"
-							target="_blank">
-							<img src="/img/email.svg" alt="Share via Email"
-								aria-label="Share Icon">
+							target="_blank"> <img src="/img/email.svg"
+							alt="Share via Email" aria-label="Share Icon">
 						</a>
 					</div>
 				</div>
@@ -59,10 +55,19 @@
 						<div class="col-xs-12">
 							<h2>
 								<img src="/img/barcode.svg" height="20" class="icon-first" />BarcodeAPI.org
-								Licenses
 							</h2>
+							<div>
+								Built with love by MClarkDev.com<br /> <br />Services provided
+								by BarcodeAPI.org are provided free for all.<br /> <br /> <br />
+							</div>
+
+							<h2>License</h2>
+							<pre id="license"></pre>
+							<br />
+							<h2>Special Thanks</h2>
+							<pre id="thanks"></pre>
+							<br /> <br /> Since 2017.<br />
 						</div>
-						<pre id="license"></pre>
 					</div>
 				</div>
 			</div>

+ 5 - 0
resources/robots.txt

@@ -1,4 +1,9 @@
 User-agent: *
 Allow: /
 Allow: /index.html
+Allow: /license.html
+Allow: /bulk.html
+Allow: /manual.pdf
+Disallow: /admin.html
+Disallow: /multi.html
 Disallow: /api/

+ 11 - 0
resources/static/index.js

@@ -61,6 +61,17 @@ function createBarcodeTypes(types) {
     addTooltips();
 }
 
+function delayGenCode() {
+	const textInput = document.getElementById("text");
+	const textValue = textInput.value;
+
+	setTimeout(function(){
+		if(textInput.value == textValue) {
+			genCode();
+		}
+	}, 350);
+}
+
 /**
  * Called each time we should generate a new barcode.
  * 

+ 6 - 6
resources/static/license.js

@@ -1,12 +1,12 @@
 function loadLicense() {
 
-	var url = "/static/license.txt";
-	loadFile(url, onloadLicense);
-}
-
-function onloadLicense(data) {
+	loadFile("/static/license.txt", function(data) {
+		document.getElementById("license").innerHTML = data;
+	});
 
-	document.getElementById("license").innerHTML = data;
+	loadFile("/static/thanks.txt", function(data) {
+		document.getElementById("thanks").innerHTML = data;
+	});
 }
 
 function loadFile(path, callback) {

+ 4 - 0
resources/static/thanks.txt

@@ -0,0 +1,4 @@
+Amazon Robotics, Amazon.com
+Eclipse Jetty
+Barcode4J
+Google ZXing