package ocsigen-start

Build not yet checked
  1. Overview
  2. Docs
Higher-level library for developing Web and mobile applications with users, registration, notifications, etc

Install

dune-project
 Dependency

Authors

Maintainers

Sources

9.0.0.tar.gz
md5=dfd00a648f0d5f64fcfc893427afc996
sha512=d7c77a9f9b617291ea8c49f4e77fcad8187c39e41d6cb2942ad1c8f45ba620ac261d25a3e75c1b2ce1fd429dad009abb45fab670542e722ab336dc681b99330a

doc/ocsigen-start.server/Os/Tips/index.html

Module Os.Tips

Tips for new users and new features.

val bubble : ?a:[< Html_types.div_attrib Class ] Eliom.Content.Html.D.attrib list -> ?recipient:[> `All | `Connected | `Not_connected ] -> ?arrow: [ `left of int | `right of int | `top of int | `bottom of int ] Eliom.Client_value.t -> ?top:int Eliom.Client_value.t -> ?left:int Eliom.Client_value.t -> ?right:int Eliom.Client_value.t -> ?bottom:int Eliom.Client_value.t -> ?height:int Eliom.Client_value.t -> ?width:int Eliom.Client_value.t -> ?parent_node:[< `Body | Html_types.body_content ] Eliom.Content.Html.elt -> ?delay:float -> ?onclose:(unit -> unit Lwt.t) Eliom.Client_value.t -> name:string -> content: ((unit -> unit Lwt.t) -> Html_types.div_content Eliom.Content.Html.elt list Lwt.t) Eliom.Client_value.t -> unit -> unit Lwt.t

Display tips in pages, as a speech bubble.

One tip is displayed at a time.

Tips can be inserted in page using function display, that may be called anywhere during the generation of a page. The tip will be actually sent and displayed on client side only if the user has not already seen it.

  • ~name is a unique name you must choose for your tip
  • ?arrow is the position of the arrow if you want one
  • ?top, ?bottom, ?left, ?right, ?width, ?right correspond to the eponymous CSS properties.
  • ~content takes the function closing the tip as parameter and return the content of the tip div.
  • ?recipient makes it possible to decide whether the tip will be displayed for connected users only, non-connected users only, or all (default). Tips for non-connected users will reappear every time the session is closed.
  • ?delay adds a delay before displaying the tip (in seconds)
val block : ?a:[< Html_types.div_attrib Class ] Eliom.Content.Html.D.attrib list -> ?recipient:[> `All | `Connected | `Not_connected ] -> ?onclose:(unit -> unit Lwt.t) Eliom.Client_value.t -> name:string -> content: ((unit -> unit Lwt.t) Eliom.Client_value.t -> Html_types.div_content Eliom.Content.Html.elt list Lwt.t) -> unit -> [> `Div ] Eliom.Content.Html.elt option Lwt.t

Return a box containing a tip, to be inserted where you want in a page. The box contains a close button. Once it is closed, it is never displayed again for this user. In that case the function returns None.

val reset_tips : unit -> unit Lwt.t

Call this function to reset tips for current user. Tips will be shown again from the beginning.

val set_tip_seen : string -> unit Lwt.t

Call this function to mark a tip as "already seen" by current user. This is done automatically when a tip is closed.

val unset_tip_seen : string -> unit Lwt.t

Counterpart of set_tip_seen. Does not fail if the tip has not been seen yet

val tip_seen : string -> bool Lwt.t

Returns whether a tip has been seen or not.

A non-attached service that will reset tips. Call it with Eliom.Client.exit_to to restart the application and see tips again.