-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wikipedia link icon on main toolbar.
- Loading branch information
Showing
4 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
|
||
////////////////////////////// | ||
// | ||
// makeWikipediaIcon -- | ||
// output += "class='nav-icon fas fa-file-video-o'></div>"; | ||
// | ||
|
||
function makeWikipediaIcon(url, title) { | ||
title = title.replace(/"/g, "'"); | ||
if (!title || title === "View PDF of score") { | ||
title = "Wikipedia entry for work"; | ||
} | ||
var output = "<div title=\"" + title + "\" "; | ||
output += "style='margin-left:10px !important; margin-right:0px !important; font-size:60%' "; | ||
output += `onclick="openOrReplaceWikipedia('${url}')" `; | ||
|
||
output += `<span style="opacity:0.6; margin:0 !important" class="nav-icon fa-stack fa-1x">`; | ||
output += `<i style="margin:0 !important; color:white;" class="fas fa-square fa-stack-2x"></i>`; | ||
output += `<i style="margin:0 !important; color:#01313f;" class="fab fa-wikipedia-w fa-stack-1x fa-inverse"></i>`; | ||
output += `</span>`; | ||
|
||
output += "</div>"; | ||
return output; | ||
} | ||
|
||
|
||
|
||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% comment %} | ||
// | ||
// Programmer: Craig Stuart Sapp <[email protected]> | ||
// Creation Date: Tue Jun 4 11:45:16 PDT 2024 | ||
// Last Modified: Tue Jun 4 11:45:20 PDT 2024 | ||
// Filename: _includes/vhv-scripts/main/openOrReplaceWikipedia.js | ||
// Included in: _includes/vhv-scripts/main.js | ||
// Syntax: ECMAScript 6; Jekyll/Liquid | ||
// vim: ts=3:nowrap | ||
// | ||
// Description: Open a window for wikipedia, but try to replace the wikipedia | ||
// content if a "wikipedia" window is already open. | ||
// Does not replace the old wikipedia window's content, | ||
// probably due to browse security feature. | ||
// | ||
{% endcomment %} | ||
|
||
// Reference to the opened wikipedia window, if any: | ||
var wikipediaWindow = null; | ||
|
||
function openOrReplaceWikipedia(url) { | ||
// If the window is already open and hasn't been closed | ||
if (wikipediaWindow && !wikipediaWindow.closed) { | ||
wikipediaWindow.location.href = url; | ||
wikipediaWindow.focus(); | ||
} else { | ||
wikipediaWindow = window.open(url, 'wikipedia'); | ||
wikipediaWindow.focus(); | ||
} | ||
} | ||
|
||
|
||
|