gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] branch master updated: doc: better presenc


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: doc: better presence detection
Date: Sun, 11 Mar 2018 14:57:10 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new e2d2269  doc: better presence detection
e2d2269 is described below

commit e2d22698c486386000908768ec7db7bbeda390fa
Author: Florian Dold <address@hidden>
AuthorDate: Sun Mar 11 14:56:52 2018 +0100

    doc: better presence detection
---
 doc/merchant-api.content.texi | 110 +++++++++++++++---------------------------
 1 file changed, 40 insertions(+), 70 deletions(-)

diff --git a/doc/merchant-api.content.texi b/doc/merchant-api.content.texi
index 6a8fafd..0c613b6 100644
--- a/doc/merchant-api.content.texi
+++ b/doc/merchant-api.content.texi
@@ -57,7 +57,6 @@ Texts.  A copy of the license is included in the section 
entitled
 * Accepting a Simple Payment::                    How to accept simple payments
 * Back-office-integration::                       How to integrate with the 
back office
 * Advanced topics::                               Detailed solutions to 
specific issues
-* Reference::                                     Merchant integration 
reference
 
 
 Appendices
@@ -375,13 +374,35 @@ See how to run it, on its own documentaion: 
@url{https://docs.taler.net/backoffi
 @section Detecting the Presence of the Taler Wallet
 @cindex wallet
 
-Taler offers the way to the frontend developer to detect whether
-a user has the wallet installed in their browser, and take actions
-accordingly.
+Taler offers ways to detect whether a user has the wallet installed in their
+browser, and take actions accordingly.  Note that not all platforms can do
+presence detection reliably.  Some platforms might have a Taler wallet 
installed,
+but the browser is not aware of its presence.
 
address@hidden The no-JavaScript way
-The follwing example shows all that is needed to perform the detection
-without using JavaScript:
address@hidden Presence detection without JavaScript
+Presence detection without JavaScript is based on CSS classes.  You can hide or
+show elements selectively depending on whether the wallet is detected or not.
+
+In order to work correctly, a special fallback stylesheet must be included that
+will be used when the wallet is not present.  The stylesheet can be put into
+any file, but must be included via a @code{link} tag with the @code{id}
+attribute set to @code{taler-presence-stylesheet}.  If a wallet is present, it
+will ``hijack'' this stylesheet to change how elements with the following
+classes are rendered:
+
+The following CSS classes can be used:
address@hidden @code
address@hidden taler-installed-hide
+A CSS rule will set the @code{display} property for this class to @code{none} 
once the Taler wallet is installed and enabled.
+If the wallet is not installed, @code{display} will be @code{inherit}.
+
address@hidden taler-installed-show
+A CSS rule will set the @code{display} property for this class to 
@code{inherit} once the Taler wallet is installed and enabled.
+If the wallet is not installed, @code{display} will be @code{none}.
+
address@hidden table
+
+The following is a complete example:
 
 @smallexample
 <!DOCTYPE html>
@@ -408,28 +429,23 @@ The @code{taler-fallback.css} is part of the Taler's 
@emph{web-common} repositor
 available at @code{https://git.taler.net/web-common.git}.  Please adjust the 
@code{href}
 attribute in order to make it work with your Web site.
 
-The detection works by @code{taler-fallback.css} hiding any tag from the
address@hidden class, in case no wallet is installed.  If otherwise
-the wallet is installed, the wallet takes action by hiding any tag from the
address@hidden class and overriding @code{taler-fallback.css} logic
-by showing any tag from the @code{taler-installed-show} class.
address@hidden Detection with JavaScript
 
address@hidden The JavaScript way
+The following functions are defined in the @code{taler} namespace of the 
@code{taler-wallet-lib} helper library
+available at 
@url{https://git.taler.net/web-common.git/tree/taler-wallet-lib.js}.
 
address@hidden helps the frontend, by providing the way to register two
-callbacks: one to be executed if a wallet is present, the other if it is not.
-See the example below:
address@hidden @code
address@hidden onPresent(callback: () => void)
+Add a callback to be called when support for Taler payments is detected.
 
address@hidden
address@hidden smallexample
address@hidden onAbsent(callback: () => void)
+Add a callback to be called when support for Taler payments is disabled.
 
address@hidden exports the @code{taler} object that
-exposes the @code{onPresent} and the @code{onAbsent} functions needed
-to register the frontend's callbacks.  Thus the function @code{walletInstalled}
-will be executed whenever a wallet is installed, and @code{walletNotInstalled}
-if not.  Note that since now we can use JavaScript we can register
-callbacks that do more than just showing and hiding elements.
address@hidden table
 
+Note that the registered callbacks can be called more than once, since a user
+can disable/enable the wallet in the browser's setting while a shop frontend
+page is open.
 
 @c Section describing the format of Taler contracts/proposals in detail
 
@@ -617,52 +633,6 @@ that they do not understand as a key-value list.
 @end table
 
 
address@hidden Reference
address@hidden Reference
-
address@hidden
-* JavaScript API::                       JavaScript API to communicate with 
the wallet
-* Stylesheet-based presence detection::  Presence detection using CSS style 
sheets and no JavaScript
address@hidden menu
-
address@hidden JavaScript API
address@hidden JavaScript API
-
-The following functions are defined in the @code{taler} namespace of the 
@code{taler-wallet-lib} helper library
-available at 
@url{https://git.taler.net/web-common.git/tree/taler-wallet-lib.js}.
-
address@hidden @code
address@hidden onPresent(callback: () => void)
-Add a callback to be called when support for Taler payments is detected.
-
address@hidden onAbsent(callback: () => void)
-Add a callback to be called when support for Taler payments is disabled.
-
address@hidden table
-
address@hidden Stylesheet-based presence detection
address@hidden Stylesheet-based presence detection
-
-Stylesheet-based presence detection will be applied on all pages that have the
address@hidden attribute of the @code{html} element set @code{true}.
-The default/fallback stylesheet, that will be taken over by the wallet once
-installed, must be included with the id @code{taler-presence-stylesheet}, like
-this:
-
-The following CSS classes can be used:
address@hidden @code
address@hidden taler-installed-hide
-A CSS rule will set the @code{display} property for this class to @code{none} 
once the Taler wallet is installed and enabled.
-If the wallet is not installed, @code{display} will be @code{inherit}.
-
address@hidden taler-installed-show
-A CSS rule will set the @code{display} property for this class to 
@code{inherit} once the Taler wallet is installed and enabled.
-If the wallet is not installed, @code{display} will be @code{none}.
-
address@hidden table
-
-
-
 @c **********************************************************
 @c *******************  Appendices  *************************
 @c **********************************************************

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]