Merge pull request #6 from ab-gh/master

Adds direct post link to contribution modal
This commit is contained in:
Stefano 2022-04-04 15:58:13 +02:00 committed by GitHub
commit 66b5bcc5d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 3 deletions

View file

@ -202,6 +202,10 @@ function initDraw(){
exportOverlay.style.display = "none";
});
exportCloseButton.addEventListener("click", function(e){
exportDirectPost();
})
document.getElementById("highlightUncharted").addEventListener("click", function(e){
highlightUncharted = this.checked;
render(path);
@ -223,6 +227,9 @@ function initDraw(){
jsonString = jsonString.join("\n ");
jsonString = " "+jsonString;
textarea.value = jsonString;
console.log("a");
var directPostUrl = "https://www.reddit.com/r/placeAtlas2/submit?selftext=true&title=New%20Submission&text="+encodeURIComponent(document.getElementById("exportString").value);
document.getElementById("exportDirectPost").href=directPostUrl;
exportOverlay.style.display = "flex";
@ -230,6 +237,7 @@ function initDraw(){
textarea.select();
}
function calculateCenter(path){
var area = 0,

View file

@ -176,6 +176,10 @@ <h1 id="title">The /r/place Atlas</h1>
<p>Click anywhere on the image to start drawing a shape.
When you're happy with the result, click the "Finish" button above or press the Enter key.</p>
<p>You can then add more information about your object.</p>
<div style="background-color: #666666; padding:20px">
<p><b>Handy with GitHub?</b></p>
<p>You can contribute directly with a Pull Request <a href="https://github.com/Codixer/place-atlas/blob/master/web/_js/atlas.js">here!</a></p>
</div>
</div>
</div>
@ -188,8 +192,17 @@ <h1 id="title">The /r/place Atlas</h1>
<p>Please copy the text below and submit it as a<br>
new text post to <a target="_blank" href="https://www.reddit.com/r/placeAtlas2/">/r/placeAtlas2</a> on Reddit.</p>
<p>I will then check it and add it to the atlas.</p>
<div style="background-color: #666666; padding:5px">
<p><b>Handy with GitHub?</b></p>
<p>You can contribute directly with a Pull Request <a href="https://github.com/Codixer/place-atlas/blob/master/web/_js/atlas.js">here!</a></p>
</div>
<textarea cols="50" rows="5" id="exportString"></textarea>
<button id="exportCloseButton">Done</button>
<div style="display:flex;flex-direction:column;align-items: center;">
<a href="_blank" id="exportDirectPost">Post Direct to Reddit</a>
<button id="exportCloseButton">Done</button>
</div>
</div>
</div>
@ -229,14 +242,13 @@ <h2>His Bitcoin Address</h2>
<script type="text/javascript" src="./_js/overlap.js?version=1.0.4"></script>
<script type="text/javascript" src="./_js/draw.js?version=1.0.3"></script>
<script type="text/javascript" src="./_js/main.js?version=1.0.3"></script>
-->
<!--
<script type="text/javascript" src="./_js/stats.js?version=1.0.0"></script>
-->
<script type="text/javascript" src="./_js/minified.js?version=1.0.102"></script>
</body>
</html>