zotero/chrome/content/zotero/about.xul
Dan Stillman 3880687d2b
Merge pull request #2039 from HollandeP/master
Made About page text visible across default Linux themes
2021-05-16 04:15:17 -04:00

86 lines
No EOL
3 KiB
XML

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/about.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero-platform/content/zotero-react-client.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://zotero/locale/about.dtd">
<dialog
id="zotero-about"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
orient="vertical"
buttons="accept"
buttonlabelaccept="&zotero.about.close;"
onload="moveToAlertPosition(); sizeToContent(); document.documentElement.getButton('accept').focus();"
ondialogaccept="return true;">
<script src="include.js"/>
<vbox id="aboutcontent">
<div xmlns="http://www.w3.org/1999/xhtml">
<img id="logo" src="chrome://zotero/skin/zotero.svg" alt="Zotero" />
</div>
<hbox>
<label id="version"/>
<label id="changelog" class="zotero-text-link" value="&zotero.whatsNew;"/>
</hbox>
<script>
document.getElementById('version').textContent = Zotero.version;
</script>
<vbox>
<div id="about-text" xmlns="http://www.w3.org/1999/xhtml">
<p id="created-by"></p>
<p id="third-party-software"></p>
<p id="get-involved"></p>
<script><![CDATA[
Components.utils.import("resource://zotero/config.js");
document.getElementById('changelog').href = ZOTERO_CONFIG.CHANGELOG_URL;
// Replace [links] in localized strings with spans with onclick handlers
//
// TODO: Use helper function in common with intro text in itemTreeView.js
document.getElementById('created-by').innerHTML =
Zotero.Utilities.htmlSpecialChars(
Zotero.getString(
'about.createdBy',
[Zotero.appName, `[${ZOTERO_CONFIG.PRODUCER}]`]
),
)
.replace(
/\[([^\]]+)](.+)\[([^\]]+)]/,
`<span data-href="${ZOTERO_CONFIG.PRODUCER_URL}">$1</span>`
+ '$2'
+ `<span data-href="${ZOTERO_CONFIG.CREDITS_URL}">$3</span>`
);
document.getElementById('third-party-software').innerHTML =
Zotero.Utilities.htmlSpecialChars(
Zotero.getString('about.openSource', Zotero.appName)
)
.replace(
/\[([^\]]+)](.+)\[([^\]]+)]/,
`<span data-href="${ZOTERO_CONFIG.LICENSING_URL}">$1</span>`
+ '$2'
+ `<span data-href="${ZOTERO_CONFIG.CREDITS_URL}#third-party_software">$3</span>`
);
document.getElementById('get-involved').innerHTML =
Zotero.Utilities.htmlSpecialChars(Zotero.getString('about.getInvolved'))
.replace(
/\[([^\]]+)]/,
`<span data-href="${ZOTERO_CONFIG.GET_INVOLVED_URL}">$1</span>`
);
// Activate text links
for (let span of document.getElementById('about-text').getElementsByTagName('span')) {
span.className = 'text-link';
span.onclick = function () {
Zotero.launchURL(this.getAttribute('data-href'));
};
}
]]></script>
</div>
</vbox>
</vbox>
</dialog>