Main > Stakeholder Proposals

How to make "approve" buttons

(1/1)

8bit:

--- Quote ---> I can't tell for sure as I don't run the GUI client

Well there's your problem, the hooks are only installed when you install the GUI.
--- End quote ---

Yeah, I was just confused because I wrote it client side and got a more descriptive error from the browser when I did that.


--- Quote from: toast on July 23, 2014, 05:42:16 am ---The "code" is this line in apache config:


--- Code: ---RedirectMatch ^/scheme/btsx/(.*)$ btsx:$1
--- End code ---

--- End quote ---

Ah, that's clever!

toast:
> I can't tell for sure as I don't run the GUI client

Well there's your problem, the hooks are only installed when you install the GUI.

> Btw, where is the repo for your version? I had trouble finding it, and I'd like to read through your code to see where the problem might be.

The "code" is this line in apache config:


--- Code: ---RedirectMatch ^/scheme/btsx/(.*)$ btsx:$1
--- End code ---

8bit:
I'm in Firefox 30 and this doesn't seem to do anything for me. I just get a whitescreen, no redirect to btsx://etc... However I came up with this idea independently and created a slightly different implementation that might work in browsers that yours does not work in:


--- Quote ---Approve me on the forums!

The syntax is:


--- Code: ---[url=http://the8thbit.github.io/bitshares.html?name=NAMEt&action=ACTION]TEXT[/url]

--- End code ---

With the stuff in caps replaced with whatever you want. So for example, this is how I did the one above:


--- Code: ---[url=http://the8thbit.github.io/bitshares.html?name=eightbit&action=approve]Approve me on the forums![/url]
--- End code ---


--- End quote ---

Instead of using multiple directories as you seem to be doing, I'm using a single html file with inline js that extracts URL parameters and then uses them to construct a new URL which you are then redirected to. It's all very basic js, so it should work in most browsers. That said, I can't tell for sure as I don't run the GUI client, but it gives me the redirect to the btsx URL. At that point, your browser/wallet should figure out the rest.

Anyone want to try this one and tell me if it works?

Btw, where is the repo for your version? I had trouble finding it, and I'd like to read through your code to see where the problem might be.

toast:
The client has support for direct-linking to actions.

Replace "NAME" with an account name.

Anywhere outside of simplemachines forum:

Link to account:

--- Code: ---<a href="btsx:NAME">Visit my account page</a>
--- End code ---

One-click approve:

--- Code: ---<a href="btsx:NAME/approve">Approve my delegate</a>
--- End code ---

One-click unapprove:

--- Code: ---<a href="btsx:NAME/disapprove">Vote out this bad delegate!</a>
--- End code ---


In simplemachines forum (including bitsharestalk.org) or anywhere it hijacks non-http schemes:
(thanks nathanhrout for the redirect idea)

--- Code: ---[url=daslab.io/scheme/btsx/NAME]Visit my account page.[/url]
[url=daslab.io/scheme/btsx/NAME/approve]Approve my delegate.[/url]
[url=daslab.io/scheme/btsx/NAME/disapprove]Vote out this bad delegate![/url]

--- End code ---


Try it out


Approve my delegate!

Vote out this unreliable delegate!
And this one!
This one too!

(note that the app's thumb does not reflect the true state directly after using approve/disapprove url - we'll fix this for next release)

Navigation

[0] Message Index

Go to full version