third_party
4 years ago
IQuery.php
4 years ago
LICENSE
4 years ago
gan_formatter.php
4 years ago
gan_node_html.php
4 years ago
gan_parser_html.php
4 years ago
gan_selector_html.php
4 years ago
gan_tokenizer.php
4 years ago
gan_xml2array.php
4 years ago
ganon.php
4 years ago
index.php
4 years ago
pQuery.php
4 years ago
IQuery.php
155 lines
| 1 | <?php |
| 2 | |
| 3 | namespace MailPoetVendor\pQuery; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | interface IQuery extends \Countable { |
| 9 | /// Methods /// |
| 10 | |
| 11 | /** |
| 12 | * Adds the specified class(es) to each of the set of matched elements. |
| 13 | * @param string $classname The name of the class to add. You can add multiple classes by separating them with spaces. |
| 14 | * @return IQuery |
| 15 | */ |
| 16 | function addClass($classname); |
| 17 | |
| 18 | /** |
| 19 | * Insert content, specified by the parameter, after each element in the set of matched elements. |
| 20 | * @param string $content The content to add. |
| 21 | * @return IQuery |
| 22 | */ |
| 23 | function after($content); |
| 24 | |
| 25 | /** |
| 26 | * Insert content, specified by the parameter, to the end of each element in the set of matched elements. |
| 27 | * @param string $content The content to append. |
| 28 | * @return IQuery |
| 29 | */ |
| 30 | function append($content); |
| 31 | |
| 32 | /** |
| 33 | * Get the value of an attribute for the first element in the set of matched elements or set one |
| 34 | * or more attributes for every matched element. |
| 35 | * @param string $name The name of the attribute. |
| 36 | * @param null|string $value The value to set or null to get the current attribute value. |
| 37 | * @return string|IQuery |
| 38 | */ |
| 39 | function attr($name, $value = null); |
| 40 | |
| 41 | /** |
| 42 | * Insert content, specified by the parameter, before each element in the set of matched elements. |
| 43 | * @param string $content The content to add. |
| 44 | * @return IQuery |
| 45 | */ |
| 46 | function before($content); |
| 47 | |
| 48 | /** |
| 49 | * Remove all child nodes of the set of matched elements from the DOM. |
| 50 | * @return IQuery; |
| 51 | */ |
| 52 | function clear(); |
| 53 | |
| 54 | /** |
| 55 | * Get the value of a style property for the first element in the set of matched elements or |
| 56 | * set one or more CSS properties for every matched element. |
| 57 | */ |
| 58 | // function css($name, $value = null); |
| 59 | |
| 60 | /** |
| 61 | * Determine whether any of the matched elements are assigned the given class. |
| 62 | * @param string $classname The name of the class to check. |
| 63 | */ |
| 64 | function hasClass($classname); |
| 65 | |
| 66 | /** |
| 67 | * Get the HTML contents of the first element in the set of matched elements |
| 68 | * or set the HTML contents of every matched element. |
| 69 | * @param string|null $value The value to set. |
| 70 | */ |
| 71 | function html($value = null); |
| 72 | |
| 73 | /** |
| 74 | * Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. |
| 75 | * @param string $content The content to add. |
| 76 | */ |
| 77 | function prepend($content); |
| 78 | |
| 79 | /** |
| 80 | * Get the value of a property for the first element in the set of matched elements |
| 81 | * or set one or more properties for every matched element. |
| 82 | * @param string $name The name of the property. |
| 83 | * The currently supported properties are `tagname`, `selected`, and `checked`. |
| 84 | * @param null|string $value The value to set or null to get the current property value. |
| 85 | */ |
| 86 | function prop($name, $value = null); |
| 87 | |
| 88 | /** |
| 89 | * Remove the set of matched elements from the DOM. |
| 90 | * @param null|string $selector A css query to filter the set of removed nodes. |
| 91 | */ |
| 92 | function remove($selector = null); |
| 93 | |
| 94 | /** |
| 95 | * Remove an attribute from each element in the set of matched elements. |
| 96 | * @param string $name The name of the attribute to remove. |
| 97 | */ |
| 98 | function removeAttr($name); |
| 99 | |
| 100 | /** |
| 101 | * Remove a single class, multiple classes, or all classes from each element in the set of matched elements. |
| 102 | * @param string $classname The name of the class to remove. |
| 103 | */ |
| 104 | function removeClass($classname); |
| 105 | |
| 106 | /** |
| 107 | * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. |
| 108 | * @param string $content The content that will replace the nodes. |
| 109 | */ |
| 110 | function replaceWith($content); |
| 111 | |
| 112 | /** |
| 113 | * Returns the name of the element. |
| 114 | * @param null|string $tagName A new tag name or null to return the current tag name. |
| 115 | */ |
| 116 | function tagName($value = null); |
| 117 | |
| 118 | /** |
| 119 | * 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. |
| 120 | * @param null|string $value A string to set the text or null to return the current text. |
| 121 | */ |
| 122 | function text($value = null); |
| 123 | |
| 124 | /** |
| 125 | * Add or remove one or more classes from each element in the set of matched elements, |
| 126 | * depending on either the class’s presence or the value of the switch argument. |
| 127 | * @param string $classname |
| 128 | * @param bool|null |
| 129 | */ |
| 130 | function toggleClass($classname, $switch = null); |
| 131 | |
| 132 | /** |
| 133 | * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. |
| 134 | */ |
| 135 | function unwrap(); |
| 136 | |
| 137 | /** |
| 138 | * Get the current value of the first element in the set of matched elements or set the value of every matched element. |
| 139 | * @param string|null $value The new value of the element or null to return the current value. |
| 140 | */ |
| 141 | function val($value = null); |
| 142 | |
| 143 | /** |
| 144 | * Wrap an HTML structure around each element in the set of matched elements. |
| 145 | * @param string A tag name or html string specifying the structure to wrap around the matched elements. |
| 146 | */ |
| 147 | function wrap($wrapping_element); |
| 148 | |
| 149 | /** |
| 150 | * Wrap an HTML structure around the content of each element in the set of matched elements. |
| 151 | * @param string A tag name or html string specifying the structure to wrap around the content of the matched elements. |
| 152 | */ |
| 153 | function wrapInner($wrapping_element); |
| 154 | } |
| 155 |