forked from tburry/pquery
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIQuery.php
More file actions
152 lines (127 loc) · 5.27 KB
/
IQuery.php
File metadata and controls
152 lines (127 loc) · 5.27 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
namespace pQuery;
interface IQuery extends \Countable {
/// Methods ///
/**
* Adds the specified class(es) to each of the set of matched elements.
* @param string $classname The name of the class to add. You can add multiple classes by separating them with spaces.
* @return IQuery
*/
function addClass($classname);
/**
* Insert content, specified by the parameter, after each element in the set of matched elements.
* @param string $content The content to add.
* @return IQuery
*/
function after($content);
/**
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
* @param string $content The content to append.
* @return IQuery
*/
function append($content);
/**
* Get the value of an attribute for the first element in the set of matched elements or set one
* or more attributes for every matched element.
* @param string $name The name of the attribute.
* @param null|string $value The value to set or null to get the current attribute value.
* @return string|IQuery
*/
function attr($name, $value = null);
/**
* Insert content, specified by the parameter, before each element in the set of matched elements.
* @param string $content The content to add.
* @return IQuery
*/
function before($content);
/**
* Remove all child nodes of the set of matched elements from the DOM.
* @return IQuery;
*/
function clear();
/**
* Get the value of a style property for the first element in the set of matched elements or
* set one or more CSS properties for every matched element.
*/
// function css($name, $value = null);
/**
* Determine whether any of the matched elements are assigned the given class.
* @param string $classname The name of the class to check.
*/
function hasClass($classname);
/**
* Get the HTML contents of the first element in the set of matched elements
* or set the HTML contents of every matched element.
* @param string|null $value The value to set.
*/
function html($value = null);
/**
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
* @param string $content The content to add.
*/
function prepend($content);
/**
* Get the value of a property for the first element in the set of matched elements
* or set one or more properties for every matched element.
* @param string $name The name of the property.
* The currently supported properties are `tagname`, `selected`, and `checked`.
* @param null|string $value The value to set or null to get the current property value.
*/
function prop($name, $value = null);
/**
* Remove the set of matched elements from the DOM.
* @param null|string $selector A css query to filter the set of removed nodes.
*/
function remove($selector = null);
/**
* Remove an attribute from each element in the set of matched elements.
* @param string $name The name of the attribute to remove.
*/
function removeAttr($name);
/**
* Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
* @param string $classname The name of the class to remove.
*/
function removeClass($classname);
/**
* Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
* @param string $content The content that will replace the nodes.
*/
function replaceWith($content);
/**
* Returns the name of the element.
* @param null|string $tagName A new tag name or null to return the current tag name.
*/
function tagName($value = null);
/**
* Get the combined text contents of each element in the set of matched elements, including their descendants, or set the text contents of the matched elements.
* @param null|string $value A string to set the text or null to return the current text.
*/
function text($value = null);
/**
* Add or remove one or more classes from each element in the set of matched elements,
* depending on either the class’s presence or the value of the switch argument.
* @param string $classname
* @param bool|null
*/
function toggleClass($classname, $switch = null);
/**
* Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
*/
function unwrap();
/**
* Get the current value of the first element in the set of matched elements or set the value of every matched element.
* @param string|null $value The new value of the element or null to return the current value.
*/
function val($value = null);
/**
* Wrap an HTML structure around each element in the set of matched elements.
* @param string A tag name or html string specifying the structure to wrap around the matched elements.
*/
function wrap($wrapping_element);
/**
* Wrap an HTML structure around the content of each element in the set of matched elements.
* @param string A tag name or html string specifying the structure to wrap around the content of the matched elements.
*/
function wrapInner($wrapping_element);
}