This is client API (go to server)

Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Index of values

ask_question [Ot_popup]

ask_question ?a ?a_hcf question buttons Prompt a user, wait for its response and return the selected value.

attach [Ot_noderesize]

bind [Ot_swipe]
bind [Ot_picture_uploader]

bind is a shortcut for bind_input and bind_submit actions

bind_arrow_keys [Ot_carousel]

Make arrow keys cause event change.

bind_input [Ot_picture_uploader]

bind_input input preview ?container ?reset () Bind input and preview so the file selected in input is the image displayed in preview.

bind_submit [Ot_picture_uploader]

bind_submit input button ?cropping ~upload ~after_submit () binds the following two actions to button when it is being clicked: call do_submit which uploads the file; then call after_submit

bottom [Ot_style]
bullets [Ot_carousel]

List of bullets for carousel.

click_outside [Ot_lib]

click_outside e returns when user clicks outside element e.

client_bottom [Ot_size]
client_height [Ot_size]
client_left [Ot_size]
client_page_bottom [Ot_size]
client_page_left [Ot_size]
client_page_right [Ot_size]
client_page_top [Ot_size]

position of an element relative to the document

client_right [Ot_size]

size of an element

client_top [Ot_size]

position of an element relative to the inner window; getClientBoundingRect does not include borders by default, use with_margin to take them into account.

client_width [Ot_size]
confirm [Ot_popup]

Shortcut using ask_question for prompting the user with a question and returning a boolean.

cropper [Ot_picture_uploader]

let (reset, cropping, cropper_dom) = cropper ~image () reset is function to call to reset the current cropper status cropping are current cropping parameters cropper_dom is the div containing cropping controllers

detach [Ot_noderesize]
display [Ot_style]
display' [Ot_style]
display_of_str [Ot_style]
display_to_str [Ot_style]
do_submit [Ot_picture_uploader]

do_submit input ?cropping ~upload () input is the input with file loaded cropping are cropping info upload function to upload the file

drawer [Ot_drawer]

Build a drawer menu on the left or right of the screen.

dropdown [Ot_buttons]

float_of_px [Ot_style]

get_document_size [Ot_size]
get_screen_orientation [Ot_size]
get_screen_size [Ot_size]
get_size [Ot_size]

hcf [Ot_popup]

Section with header, content and footer.

height [Ot_size]
height_to_bottom [Ot_size]

Compute the height of an element to the bottom of the page

in_ancestors [Ot_lib]
input [Ot_picture_uploader]

Create a file input element with good input type ot-pup-input class and wrap it into a label.

install_global_handler [Ot_page_transition.​Make]
install_global_handler_withURI [Ot_page_transition]

install_global_handler_withURI enables you to skip the step of creating a module of type PAGE_TRANSITION_CONF when screenshots are stored as a data uri.

invisible [Ot_style]

whether an element is currently invisible in the DOM (not the screen); you might want to do a Ot_nodeready.nodeready before.

is_position_sticky [Ot_sticky]

whether computed CSS attribute "position" equals "sticky"

is_sticky [Ot_sticky]

whether element is sticky, either due to CSS attribute position:sticky or due to position:sticky polyfill make_sticky

iteri2 [Ot_lib.​List]

keep_in_sight [Ot_sticky]

make sure an element gets never out of sight while scrolling by continuously (window scroll/resize) monitoring the position of the element and adjusting the top/left value.

left [Ot_style]

make [Ot_toggle]

make ?init_up ?up_txt ?down_txt () produces a binary toggle.

make [Ot_time_picker]

make ?action ?round_5 ?h24 () produces a clock-style time picker for hours and minutes.

make [Ot_range]

make ?txt_up ?txt_down ~f ~lb ub produces a widget for picking one of the values in [lb, ub) via "up" and "down" buttons marked with the text txt_up and txt_down.

make [Ot_carousel]

Creates a carousel from the elements of a list.

make [Ot_calendar]

make ?highlight ?click_any ?action produces a calendar.

make_date_picker [Ot_calendar]

make_date_picker ?init () returns a client-side reactive signal (y, m, d) corresponding to the date d:m:y that the user clicks on.

make_hours_minutes_seq [Ot_time_picker]

Alias of make.

make_lazy [Ot_carousel]

same as make except for the last argument.

make_sticky [Ot_sticky]

position:sticky polyfill which is not supported by some browsers.

marginBottom [Ot_style]
marginLeft [Ot_style]
marginRight [Ot_style]
marginTop [Ot_style]
mk_form [Ot_picture_uploader]

Ready-to-use form.

next [Ot_carousel]

Button to go to the next page (or more pages if offset is present).

nodeready [Ot_nodeready]
noderesize [Ot_noderesize]

When safe is set to true, noderesize will work whatever sized is the watched element.

num_active_spinners [Ot_spinner]

the number of spinners currently spinning

ocaml_service_upload [Ot_picture_uploader]
onloaded [Ot_spinner]

do an action once no spinners are spinning (could be right away)

onloads [Ot_lib]
onresizes [Ot_lib]

NOTE: be careful when using the functions onresizes, window_scroll, and window_scrolls.

pageYOffset [Ot_size]

Current vertical scroll position of the page.

parse_px [Ot_style]
popup [Ot_popup]

popup ?a ?close_button ?confirmation_onclose ?onclose gen_content Display a modal popup.

prevent_tab [Ot_form]

prevent_tab e prevents e (and its children) to be focused with tab key.

preview [Ot_picture_uploader]

Create a img element with no src, no alt and ot-pup-preview class.

previous [Ot_carousel]

Button to go to the previous page (or mores page if offset is present).

px_of_float [Ot_style]

ribbon [Ot_carousel]

Menu (or tabs) for carousel.

right [Ot_style]

screenshot_container [Ot_page_transition.​PAGE_TRANSITION_CONF]
set_adaptative_height [Ot_size]

set_adaptative_height elt f will make the width of the element recomputed using f everytime the height of the window changes.

set_adaptative_width [Ot_size]

set_adaptative_width elt f will make the width of the element recomputed using f everytime the width of the window changes.

set_bottom [Ot_style]
set_height [Ot_style]
set_left [Ot_style]
set_position_sticky [Ot_sticky]

try to set CSS attribute "position" to "sticky".

set_right [Ot_style]
set_top [Ot_style]
set_width [Ot_style]
setup_form [Ot_form]

Scan for focusable elements apply setup_tabcycle_auto to them and focus the first.

setup_tabcycle [Ot_form]

setup_tabcycle makes tab key loop over child elements of an element and only these elements.

setup_tabcycle_auto [Ot_form]

setup_tabcycle_auto scans an element for tabbable elements (buttons, inputs) and feeds them to setup_tabcycle

style [Ot_style]
submit [Ot_picture_uploader]

Create a button with ot-pup-sumit clas

supports_position_sticky [Ot_sticky]

top [Ot_style]

update_width_height [Ot_size]

visibility [Ot_style]

wheel [Ot_carousel]

Carousel with 3D effect.

when_loaded [Ot_spinner]
width [Ot_size]
width_height [Ot_size]

NOTE: mind to stop any signals derived from the following signals (using React.S.stop) on unload.

window_scroll [Ot_lib]
window_scrolls [Ot_lib]

If ios_html_scroll_hack then listen on window + html + body instead of only window.

with_spinner [Ot_spinner]

On client side, with_spinner th returns immediately a spinner while Lwt thread th is not finished, that will automatically be replaced by the result of th when finished.

with_spinner_no_lwt [Ot_spinner]

Same as with_spinner but returns immediately.