Skip to content

Commit

Permalink
Clear out cleanups_, in case the the functor is holding ownership of …
Browse files Browse the repository at this point in the history
…something that needs to die.
  • Loading branch information
John-LittleBearLabs committed Sep 24, 2024
1 parent 26e80e4 commit 8f4359a
Show file tree
Hide file tree
Showing 2 changed files with 279 additions and 0 deletions.
1 change: 1 addition & 0 deletions library/src/ipfs_client/ipfs_request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void Self::finish(ipfs::Response& r) {
for (auto& cleanup : cleanups_) {
cleanup();
}
cleanups_.clear();
}
void Self::new_path(std::string_view sv) {
path_.assign(sv);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">

<title>Can I Use Planet While Offline?</title>

<meta name="viewport" content="width=device-width, initial-scale=1">


<link rel="apple-touch-icon" href="../avatar.png" />
<link rel="shortcut icon" href="../favicon.ico" />


<link rel="stylesheet" href="../assets/normalize.css">
<link rel="stylesheet" href="../assets/style.css?sha256=8f6323850f49fa9e362c42dec161c3596047804431a73c368102a1b26d6f7dae">


<meta name="theme-color" content="#f4f1ec">

<script src="../assets/sepia.js" type="text/javascript"></script>
<script type="text/javascript">
let userAgentRegex = /Planet\/\S*/;
window.PLANET = {
visitedFromPlanetClient: !!navigator.userAgent.match(userAgentRegex),
assetsPrefix: '../',
};


var showDonate = true;
var address = "0x8d3CC5b1a5268Ff0C119c5c03252EB8c1bFEBbB2";


document.addEventListener('DOMContentLoaded', () => {
if (showDonate) {
document.getElementById('donate-nav-item').style.display = 'block';
initDonateModal(address);
} else {
document.getElementById('donate-nav-item').style.display = 'none';
}

if (window.PLANET.visitedFromPlanetClient) {
let aside = document.getElementById("aside-container");
if (aside) {
aside.style.display = "none";
}
let main = document.getElementById("main-container");
if (main) {
main.style.borderRight = "none";
main.style.borderBottom = "none";
main.style.marginRight = "0";
}
}

const todos = document.querySelectorAll('li:has(input[type="checkbox"])');
let i = 1;
todos.forEach(item => {
item.id = "todo-item-" + i;
i++;
});

const items = document.querySelectorAll('.item');
const item = items[0];
if (item) {
decorateItem(item);
// set time every 60 seconds
setInterval(() => {
setTime(item);
}, 60000);
}

// Select all video elements on the page
const videos = document.querySelectorAll('video');

videos.forEach(video => {
video.muted = true; // Mute the video to avoid autoplay restrictions
video.loop = true; // Enable video looping

// Initially, hide the controls
video.controls = false;

// Show controls when hovering over the video
video.addEventListener('mouseover', function () {
video.controls = true;
});

// Hide controls when the mouse leaves the video
video.addEventListener('mouseout', function () {
video.controls = false;
});
});

// Function to play/pause videos based on visibility
const videoObserver = new IntersectionObserver(entries => {
entries.forEach(entry => {
const video = entry.target;
if (entry.isIntersecting) {
// Video is in the viewport, start playing
video.play().catch(error => {
console.error("Video failed to play automatically:", error);
});
} else {
// Video is out of the viewport, pause playing
video.pause();
}
});
}, {
threshold: 0.5 // Adjust this threshold if needed
});

// Observe each video
videos.forEach(video => {
videoObserver.observe(video);
});

});
</script>
<style>
:root {

























}
</style>

<script defer data-domain="planetable.eth.limo" src="https://plausible.io/js/plausible.local.js"></script>

<meta name="google-site-verification" content="WM6_iKypJeZEG6Y0_-OpEPz_jcKkWm5y9QuWyw5kQJM" />
</head>

<body>
<div id="wrapper">
<div id="modal" onclick="dismissModal()">
<img id="modal-img" />
</div>
<div id="donate-modal" onclick="dismissDonateModal()">
<div class="donate-modal-content">
<div class="donate-modal-title">
<img src="../assets/eth.svg" style="width: 1em; height: 1em;" />
<div class="donate-modal-give-to">Give ETH to <span id="donate-to"></span> <img src="../assets/copy.svg"
style="width: 1em; height: 1em; cursor: pointer; filter: var(--icon-secondary-filter); vertical-align: top;"
alt="Copy Address" onclick="copyAddress()"></div>
</div>

<div class="donate-message">If you enjoy this open source software, you can support its development with ETH donations. Thank you very much!</div>

<div class="donate-amount-container"><input type="text" id="donate-amount" value="0.005" />
</div>
<div class="donate-button-container"><button id="donate-button" class="btn">Donate</button></div>
<div id="message-box"></div>
</div>
</div>

<div id="container">
<div id="main-container">

<div id="breadcrumb">
<img src="../avatar.png" class="breadcrumb-avatar" />
<div class="breadcrumb-title"><a href="../" class="site-title">planetable.eth</a></div>
</div>
<div class="item"
data-item-link="../B5B2F107-A455-4B5A-AA14-B60EB7179ABF/"
data-article-id="B5B2F107-A455-4B5A-AA14-B60EB7179ABF"
data-article-slug=""
data-article-created="1713344225.235362"
data-attachments="[&#34;online-0.png&#34;,]"
data-video-filename=""
data-audio-filename=""
data-hero-image-filename="online-0.png"
data-title-length="31"
data-content-length="984"
data-page-type="blog"
data-pinned=""
>
<div class="time-box">
<div class="dot"></div>
<div class="time">&nbsp;</div>
</div>
<!-- box for HTML content -->

<div class="title-box">
Can I Use Planet While Offline?
</div>


<div class="text-box content" id="main-content">

<p>Yes, you can write and generate a static website while offline and publish it later when you have connectivity.</p>
<p>You can also read articles from any Planet you follow while offline, as they are stored in the local repo. For example, if you fetched the latest articles from <a href="https://vitalik.eth.sucks">vitalik.eth</a>, you can read them during a long flight without Wi-Fi.</p>
<hr />
<p>When you start Planet in an offline environment, the IPFS status area shows <code>Online (0)</code> indicating that no peers are currently connected.</p>
<img width="442" alt="online-0" src="online-0.png">
<hr />
<p>These features are fully functional offline:</p>
<ul>
<li>Write or edit a post</li>
<li>Generate a website</li>
<li>Read retrieved articles from the Planets you are following</li>
</ul>
<p>These features need connectivity:</p>
<ul>
<li>Publish: Write CID to an IPNS and broadcast the update to your IPFS peers</li>
<li>Check for Update: Find new posts, or a new version of the app, from the Internet</li>
<li>Aggregation: Fetch posts from other IPNS, ENS, or RSS addresses</li>
</ul>


</div>


</div>

<style type="text/css">
.item {
margin-left: 7px;
}
</style>

</div>
<div id="aside-container">

<div class="nav">
<div class="nav-item">
<a href="../" class="nav-link">Home</a>
</div>

<div class="nav-item">
<a href="../insider/" class="nav-link">Insider Builds</a>
</div>

<div class="nav-item">
<a href="../templates/" class="nav-link">Templates</a>
</div>


<div class="nav-item">
<a href="../tags.html" class="nav-link">Tags</a>
</div>

<div class="nav-item">
<a href="../archive.html" class="nav-link">Archive</a>
</div>
<div class="nav-item" id="donate-nav-item">
<a href="javascript:showDonateModal()" class="nav-link">
<span>Donate <img style="width: calc(1em - 2px); height: calc(1em - 2px); vertical-align: baseline;" src="../assets/eth.svg" />
</span>
</a>
</div>
</div>

</div>
</div>
</div>
</body>
</html>

0 comments on commit 8f4359a

Please sign in to comment.