Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
Added share link to posting body.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocrdu committed May 16, 2019
1 parent e1426aa commit 5796f41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A working demo can be found at https://ocrdu.nl/sosbtest/example.html.
Note that: - the user must enter their private publishing key, not any other key;
- there is only minimal input checking, but it keeps the worst crud out;
- the categories/tags of the posting made are in pagetags.txt;
- the blurb you want to show for the shared page is in pageblurb.txt;
- the blurb you want to show for the shared pages is in pageblurb.txt;
- the slugifier that makes the permlink only does Latin, Greek, and Cyrillic alphabets;
- a preview of the posting is activated by editing the body of the posting.

Expand Down
8 changes: 4 additions & 4 deletions Remote/shareonsteemit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ function pasteParams() {
var path = window.opener.document.location.toString();
path = path.substr(0, path.lastIndexOf("\/")) + "/";
document.getElementById("title").setAttribute("value", window.opener.document.title);
document.getElementById("article").value = window.opener.location.href;
document.getElementById("article").innerHTML = window.opener.location.href;
document.getElementById("article").value = "<hr>\n\n*Shared from: " + window.opener.location.href + "*\n\n<hr>";
document.getElementById("article").innerHTML = document.getElementById("article").value;
try {
var blurbRequest = new XMLHttpRequest(); //Should probably be implemented with fetch and promises these days,
blurbRequest.open("GET", path + "pageblurb.txt", true); //but I couldn't get that to work consistently in all browsers
Expand All @@ -12,8 +12,8 @@ function pasteParams() {
function processBlurb() {
if (blurbRequest.readyState == 4 && blurbRequest.status == 200) {
var blurbtext = blurbRequest.responseText;
document.getElementById("article").value = blurbtext;
document.getElementById("article").innerHTML = blurbtext;
document.getElementById("article").value += "\n\n" + blurbtext;
document.getElementById("article").innerHTML += "\n\n" + blurbtext;
}
}
} catch(error){
Expand Down
2 changes: 1 addition & 1 deletion pageblurb.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h4>This is a placeholder text.</h4>

You can put the text you want to see shared for your page in the file *pageblurb.txt.*
You can put the text you want to see shared for your pages in the file *pageblurb.txt.*

*If you delete pageblurb.txt, the article will only automatically show the URL of the page the button is on.*

0 comments on commit 5796f41

Please sign in to comment.