mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Split Mac and iOS specific javascript into individual files.
This commit is contained in:
19
Mac/MainWindow/Detail/main_mac.js
Normal file
19
Mac/MainWindow/Detail/main_mac.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// These mouse functions are used by NetNewsWire for Mac to display link previews
|
||||
function mouseDidEnterLink(anchor) {
|
||||
window.webkit.messageHandlers.mouseDidEnter.postMessage(anchor.href);
|
||||
}
|
||||
function mouseDidExitLink(anchor) {
|
||||
window.webkit.messageHandlers.mouseDidExit.postMessage(anchor.href);
|
||||
}
|
||||
|
||||
// Add the mouse listeners for the above functions
|
||||
function linkHover() {
|
||||
document.querySelectorAll("a").forEach(element => {
|
||||
element.addEventListener("mouseenter", function() { mouseDidEnterLink(this) });
|
||||
element.addEventListener("mouseleave", function() { mouseDidExitLink(this) });
|
||||
});
|
||||
}
|
||||
|
||||
function postRenderProcessing() {
|
||||
linkHover()
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
<style>
|
||||
</style>
|
||||
<script src="main.js"></script>
|
||||
<script src="main_mac.js"></script>
|
||||
<script src="newsfoot.js" async="async"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user