-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy patheliommod_dom.mli
More file actions
104 lines (84 loc) · 3.31 KB
/
Copy patheliommod_dom.mli
File metadata and controls
104 lines (84 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
(* Ocsigen
* http://www.ocsigen.org
* Copyright (C) 2011 Pierre Chambart, Grégoire Henry
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*)
(** Cross browser dom manipulation functions *)
open Js_of_ocaml
class type ['element] get_tag = object
method getElementsByTagName :
Js.js_string Js.t -> 'element Dom.nodeList Js.t Js.meth
end
val get_body : 'element #get_tag Js.t -> 'element Js.t
val get_head : 'element #get_tag Js.t -> 'element Js.t
(** [select_nodes root] finds the nodes below [root]
in the page annotated to be:
* eliom links
* eliom forms
* process unique nodes
* nodes with closures ( events )
* nodes with attributes *)
val select_nodes :
Dom_html.element Js.t
-> Dom_html.anchorElement Dom.nodeList Js.t
* Dom_html.formElement Dom.nodeList Js.t
* Dom_html.element Dom.nodeList Js.t
* Dom_html.element Dom.nodeList Js.t
* Dom_html.element Dom.nodeList Js.t
val select_request_nodes :
Dom_html.element Js.t
-> Dom_html.element Dom.nodeList Js.t
(** [select_request_nodes root] finds the nodes below [root]
in the page annotated to be:
* request unique nodes *)
val ancessor : #Dom.node Js.t -> #Dom.node Js.t -> bool
(** [ancessor n1 n2] is true if [n1] is an ancessor of [n2] *)
val createEvent : Js.js_string Js.t -> #Dom_html.event Js.t
val copy_element :
Dom.element Js.t
-> (Js.js_string Js.t -> bool)
-> Dom_html.element Js.t
(** [copy_element e] creates recursively a fresh html from any xml
element avoiding browser bugs *)
val html_document :
Dom.element Dom.document Js.t
-> (Js.js_string Js.t -> bool)
-> Dom_html.element Js.t
(** Assuming [d] has a body and head element, [html_document d] will
return the same document as html *)
val preload_css : Dom_html.element Js.t -> unit
(** [preload_css e] downloads every css included in every link
elements that is a descendant of [e] and replace it and its linked
css by inline [<style>] elements *)
val iter_nodeList : 'a Dom.nodeList Js.t -> ('a Js.t -> unit) -> unit
val iter_attrList :
Dom.attr Dom.namedNodeMap Js.t
-> (Dom.attr Js.t -> unit)
-> unit
(** Window scrolling. *)
type position =
{html_top : float; html_left : float; body_top : float; body_left : float}
[@@deriving json]
val top_position : position
val getDocumentScroll : unit -> position
val setDocumentScroll : position -> unit
(* Test if the "pageshow" and "pagehide" event exists. *)
val test_pageshow_pagehide : unit -> bool
val onhashchange : (Js.js_string Js.t -> unit) -> unit
(**/**)
val touch_base : unit -> unit
val add_formdata_hack_onclick_handler : unit -> unit
val section : Logs.src