Skip to content

Widget doesn't work: keeps reloading #10

Description

@sprinterwind

I also tried to run it with

plasmawindowed org.kde.plasma.bitcoinprice

command and got

file:///home/user/.local/share/plasma/plasmoids/org.kde.plasma.bitcoinprice/contents/code/bitcoin.js:71: SyntaxError: JSON.parse: Parse error

error.

I also tried to run the

console.log("hello world!");
let rate = getRate("Blockchain.info", "$",
	 function(rate) {
		if(!plasmoid.configuration.showDecimals) rate = Math.floor(rate);

		var rateText = Number(rate).toLocaleCurrencyString(Qt.locale(), Bitcoin.currencySymbols[plasmoid.configuration.currency]);

		if(!plasmoid.configuration.showDecimals) rateText = rateText.replace(Qt.locale().decimalPoint + '00', '');

		root.bitcoinRate = rateText;

		var toolTipSubText = '<b>' + root.bitcoinRate + '</b>';
		toolTipSubText += '<br />';
		toolTipSubText += i18n('Market:') + ' ' + plasmoid.configuration.source;

		plasmoid.toolTipSubText = toolTipSubText;

		root.updatingRate = false;
	});
console.log(rate);

inside Webstorm (pasted at the end of the bitcoin.js file), but having issues with line 147:

 var xhr =  new XMLHttpRequest();
                   ^

ReferenceError: XMLHttpRequest is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions