Fixed targets

This commit is contained in:
Jim Shepich III 2022-02-09 05:03:16 -05:00
parent 759e6e5ddc
commit a663d9b3e8

View File

@ -148,10 +148,10 @@ function gen_item_html(item,type="default",subtype=null){
tooltip=lists[item]["description"]; tooltip=lists[item]["description"];
//When hovering over a list in the directory, display its description as a tooltip. //When hovering over a list in the directory, display its description as a tooltip.
} }
var link = `href='index.php?page=lists&list=${item}' target='self_'`; var link = `href='index.php?page=lists&list=${item}' target='_self'`;
//By default, lists have internal links that change the query value to that list's title. Internal links should open in the same tab. //By default, lists have internal links that change the query value to that list's title. Internal links should open in the same tab.
if(lists[id].hasOwnProperty("type") && lists[item].type=="external"){ if(lists[id].hasOwnProperty("type") && lists[item].type=="external"){
link = `href='${lists[item]["link"]}' target='blank_'`; link = `href='${lists[item]["link"]}' target='_blank'`;
//For external lists, use their link instead of an internal link. External links should open in a new tab. //For external lists, use their link instead of an internal link. External links should open in a new tab.
} }
item_html = `<li title="${tooltip}"><a ${link}>${lists[item].title}</a></li>`; item_html = `<li title="${tooltip}"><a ${link}>${lists[item].title}</a></li>`;
@ -207,7 +207,7 @@ function gen_item_html(item,type="default",subtype=null){
//If the item is an object containing a single key-value pair, then use that pair as the k and v for displaying. //If the item is an object containing a single key-value pair, then use that pair as the k and v for displaying.
} }
if(item.hasOwnProperty("link")){ if(item.hasOwnProperty("link")){
item_html = `<span class="list-key"><a href="${item.link}" target="blank_">${item["k"]}</a></span>`; item_html = `<span class="list-key"><a href="${item.link}" target="_blank">${item["k"]}</a></span>`;
} else { } else {
item_html = `<span class="list-key">${item["k"]}</span>`; item_html = `<span class="list-key">${item["k"]}</span>`;
} }
@ -301,7 +301,7 @@ function gen_item_html(item,type="default",subtype=null){
} }
//Gallery items must have an image. //Gallery items must have an image.
if(item.hasOwnProperty("link")){ if(item.hasOwnProperty("link")){
image = `<a href='${item.link}' target='blank_' class="${classes.a.join(" ")}">${image}</a>`; image = `<a href='${item.link}' target='_blank' class="${classes.a.join(" ")}">${image}</a>`;
//If there's a link associated with the exhibit, put it on the image. //If there's a link associated with the exhibit, put it on the image.
} }
item_html = (text=="") ? image : `${image}<br />${text}`; item_html = (text=="") ? image : `${image}<br />${text}`;