You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Dylan's edit to check if query is a potential question or if query is longer than usual
273
+
// there is a bool flag to stop other warnings
274
+
consthasQuestion=/\?/.test(preWordsParse);
275
+
letstopOtherWarnings=false;
276
+
if(preWordsParse.length>=40){
277
+
stopOtherWarnings=true;
278
+
279
+
}elseif(hasQuestion){
280
+
stopOtherWarnings=true;
281
+
}else{
282
+
stopOtherWarnings=false;
283
+
}
270
284
271
-
// Back to the original functionality
285
+
// Back to the original functionality - this was before my edits above
272
286
varwords=preWordsParse.trim().split(" ");
273
287
for(vari=0;i<words.length;i++){
274
288
consts=words[i].trim();
@@ -281,6 +295,7 @@ function handleSearchMessage(data, searchFn) {
281
295
varquery=words.join(' ').trim();
282
296
try{
283
297
results=searchFn(query);
298
+
284
299
if(!results.length){
285
300
warning="<li><strong>No results</strong> found matching all of your terms. Results found matching <em>any</em> term:</li>";
286
301
results=searchFn(data.q.trim());
@@ -310,6 +325,9 @@ function handleSearchMessage(data, searchFn) {
310
325
});
311
326
});
312
327
}
328
+
if(stopOtherWarnings){
329
+
warning="Are you querying a question? You can check for potential answers in the Sutta Central Community chat as well."+"<li>"+suttaCentralCommunity+"</li>"
0 commit comments