/** * This document defines the functions for the summary to get the right pictogram */ /** * This function search for the right third party picture. * It gets a explaination for the icon and the id for the scroll animation. * It returns a div with the pictogram and a explaination. */ function getpictogramthird(explaination, id){ try{ let deflt = "thirdparty"; let src = "'pic_data_base/"+deflt+".png'"; let tmp = explaination.toLowerCase(); let potential_keys = tmp.split(" "); for(let i = 0; i < potential_keys.length;i++){ if(potential_keys[i] in keys_en){ src = "'"+browser.runtime.getURL("pic_data_base/"+keys_en[potential_keys[i]]+".png'"); } else { src = "'"+browser.runtime.getURL("pic_data_base/"+deflt+".png'"); } } //console.log(src); let btn = ""; return "
"+""+"

"+explaination+"
"+btn+"

"+"
"; } catch(e){ console.log(e); } } /** * This function search for the right collected data picture. * It gets a explaination for the icon and the id for the scroll animation. * It returns a div with the pictogram and a explaination. */ function getpictogramdata(explaination, id){ try{ let dflt = "dflt"; let src = ""; let tmp = explaination.toLowerCase(); let potential_keys = tmp.split(" "); for(let i = 0; i < potential_keys.length;i++){ console.log(potential_keys[i]); if(potential_keys[i] in keys_en){ src = "'"+browser.runtime.getURL("pic_data_base/"+keys_en[potential_keys[i]]+".png'"); break; } else { src = "'"+browser.runtime.getURL("pic_data_base/"+dflt+".png'"); } } let btn = ""; //let btn = "Go to Text"; //console.log("class='"+id+"button'"); return "
"+""+"

"+explaination+"
"+btn+"

"+"
"; } catch(e){ console.log(e); } } /** * This function returns a pictogram by a name */ function getpic(name){ try{ src = "'"+ browser.runtime.getURL("pic_data_base/"+name+".png")+"'"; //console.log(src); return ""; } catch(e){ console.log(e); } }