This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let msg = new SpeechSynthesisUtterance(); | |
let voices = speechSynthesis.getVoices(); | |
msg.voice = voices[0]; | |
let tags = document.querySelectorAll('p,a,h1,h2,h3'); // add more tags for you project | |
tags.forEach((tag) => { | |
tag.addEventListener('click', (e) => { | |
msg.text = e.target.innerText; | |
tag.style.backgroundColor = "yellow"; | |
speechSynthesis.speak(msg); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in page search filter with callback if no result found// | |
jQuery(document).ready(function($){ | |
var $search = $("#inpsearch-bar").on('input',function(){ | |
var matcher = new RegExp($(this).val(), 'gi'); | |
$('.filter-box').show().not(function(){ | |
return matcher.test($(this).find('.name').text()) | |
}).hide(); | |
if($('.filter-box:visible').length===0){ | |
$('.noresult').show(); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//list of RegExp | |
/* Pattern for Matching Search Filter */ | |
var pattern1 = /^[\w\s\-]*$/; | |
var pattern2 = /^[\a-Z\w\’£\s]*$/; | |
var pattern3 = /^[\a-Z\w\'’£\s]*$/; /* Uncaught range change to */ /^[\a-zA\w\-\’£®™\s]*$/ | |
var pattern4 = /^[\a-Z\w\’£®™\s]*$/; | |
var pattern5 = /^[\w\-\.+,;:='’£%™®\s]*$/; //Used and best approach for custom alphanumerical |
OlderNewer