]> git.ktnx.net Git - icedeb.git/blobdiff - icedeb.js
add vim modeline
[icedeb.git] / icedeb.js
index b9e8460c89ce92cf118f867a4d57abe03f75a3ec..81e5f0afa758280f1b1258b1bfbf75733a7d56dd 100644 (file)
--- a/icedeb.js
+++ b/icedeb.js
@@ -174,12 +174,15 @@ function link_clicked(e) {
 function check_likely_inputs(q) {
   let cnt = document.getElementById('button-list-container').classList;
 
-  cnt.remove('like-b', 'like-p', 'like-m', 'like-i');
+  cnt.remove('like-b', 'like-p', 'like-m', 'like-i', 'like-s');
   document.querySelectorAll('.likely')
     .forEach((el) => {
         el.classList.remove('likely');
     });
 
+  q = q.replace(/^\s+/, '');
+  q = q.replace(/\s+$/, '');
+
   if ( /^#?\d+$/.test(q) || /^CVE-/.test(q) )
     cnt.add('like-b');
 
@@ -192,7 +195,10 @@ function check_likely_inputs(q) {
   if ( /^<.+@.+>$/.test(q) )
     cnt.add('like-i');
 
-  document.querySelectorAll('.like-b .hint.b, .like-p .hint.p, .like-m .hint.m, .like-i .hint.i')
+  if ( /^d[sl]a[- ]\d+(-\d+)?$/i.test(q) )
+    cnt.add('like-s');
+
+  document.querySelectorAll('.like-b .hint.b, .like-p .hint.p, .like-m .hint.m, .like-i .hint.i, .like-s .hint.s')
     .forEach((el) => {
       el.parentElement.parentElement.classList.add('likely');
     } );
@@ -234,3 +240,5 @@ window.addEventListener('DOMContentLoaded', (e) => {
     window.requestAnimationFrame(get_clipboard_contents);
   });
 });
+
+// vim: sw=2