Hive coding #8

How to set post/comment options

by hive_coding

HTML

<html>
      <head>
        <script src="https://cdn.jsdelivr.net/npm/@hiveio/hive-js/dist/hive.min.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
         </head>
<body>
<textarea id="mybody"></textarea>
<button id="post">Post</button>
<button id="postoptions">set Options</button>
<script>

	  $("#postoptions").click(function() {
		var wif="YourPrivatePostingKeyNevverUseronJSFiddleNiemalsAufJSFiddleEingeben";
		var author="hive-coding";
		var permlink="hivejs-how-to-set-post-or-comment-options"; 	
		var maxAcceptedPayout="1000000.000 HBD";
		var percentHiveDollars=10000;//0=100% Powerup, 10000 = 100% HBD
		var allowVotes=true;
		var allowCurationRewards=true;

		var extensions=[[0,{beneficiaries:[{account:"mein-senf-dazu",weight:500}]}]];
	

		hive.broadcast.commentOptions(wif, author, permlink, maxAcceptedPayout, percentHiveDollars, allowVotes, allowCurationRewards, extensions, function(err, result) {
		  console.log(err, result);
		});
	});

	  $("#post").click(function() {
	
		//publish a post - Einen Beitrag veröffentlichen
	
		var wif="YourPrivatePostingKeyNevverUseronJSFiddleNiemalsAufJSFiddleEingeben";
		var title="Hivejs: How to set post/comment options - Wie man Beitrags-/Kommentareinstellungen setzt. #8";
		var body=$("#mybody").val();
		var tags="hive coding deutsch hive-engine hivejs hive-coding pob hive-js";
		var taglist=tags.split(' ');
		var parentPermlink=taglist[0];
		var author="hive-coding";
		var permlink="use-whatyou-want-but-unique-per-post"; 
		//permlink=Math.random().toString(36).substring(2);
	
		permlink="hivejs-how-to-set-post-or-comment-options"; 	
	
		var jsonMetadata= new Object();
		jsonMetadata.tags= taglist;
		jsonMetadata.app="hive-coding/ 1.0";
		jsonMetadata.format="markdown+html";
		
		hive.broadcast.comment(wif, "", parentPermlink, author, permlink, title, body, jsonMetadata, function(err, result) {
		  console.log(err,...