Skip to content

Commit 9954083

Browse files
committed
- updated to current version
1 parent fd018f6 commit 9954083

File tree

2 files changed

+104
-10
lines changed

2 files changed

+104
-10
lines changed

documentation/api.md

Lines changed: 103 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,31 @@ This documentation is organized as following:
1919
* [API](#api)
2020
* Breinify.activity(user, type, category, description, sign, onReady)
2121
* Breinify.lookup(user, dimensions, sign, onLookUp)
22-
* [Utilities (UTL)]()
23-
* [Breinify.UTL (general functions)]()
24-
* [Breinify.UTL.events]()
25-
* [Breinify.UTL.loc]()
26-
* [Breinify.UTL.cookie]()
22+
* [Utilities (UTL)](#utilities-utl)
23+
* [Breinify.UTL (general functions)](#breinifyutl-general-functions)
24+
* Breinify.UTL.texts(selector, excludeChildren)
25+
* Breinify.UTL.text(selector, excludeChildren)
26+
* Breinify.UTL.setText(selector, value)
27+
* Breinify.UTL.md5(value)
28+
* Breinify.UTL.isEmpty(value)
29+
* [Breinify.UTL.events](#breinifyutlevents)
30+
* Breinify.UTL.events.click(selector, func, onlyOnce)
31+
* Breinify.UTL.events.pageloaded(func)
32+
* [Breinify.UTL.loc](#breinifyutlloc)
33+
* Breinify.UTL.loc.params(paramListSeparator, paramSeparator, paramSplit, url)
34+
* Breinify.UTL.loc.hasParam(param, paramListSeparator, paramSeparator, paramSplit, url)
35+
* Breinify.UTL.loc.isParam(param, params)
36+
* Breinify.UTL.loc.paramIs(expected, param, paramListSeparator, paramSeparator, paramSplit, url)
37+
* Breinify.UTL.loc.parsedParam(expectedType, param, paramListSeparator, paramSeparator, paramSplit, url)
38+
* Breinify.UTL.loc.param(param, paramListSeparator, paramSeparator, paramSplit, url)
39+
* Breinify.UTL.loc.url()
40+
* Breinify.UTL.loc.matches(regEx)
41+
* [Breinify.UTL.cookie](#breinifyutlcookie)
42+
* Breinify.UTL.cookie.all()
43+
* Breinify.UTL.cookie.reset(name)
44+
* Breinify.UTL.cookie.set(name, value, expiresInDays)
45+
* Breinify.UTL.cookie.get(name)
46+
* Breinify.UTL.cookie.check(name)
2747

2848
#### General Attributes
2949

@@ -152,12 +172,85 @@ The utility library provides general functionality, which makes it easy to retri
152172

153173
##### Breinify.UTL (general functions)
154174

175+
* {[string]} **Breinify.UTL.texts(selector, excludeChildren)**:<br/>
176+
Gets the text of the elements selected by the specified *selector*.
155177

178+
**Parameters**:
179+
180+
{string} **selector**: The CSS-selector to specify the element(s) to read from (see [jQuery Selectors](https://api.jquery.com/category/selectors/) for a detailed overview of available selectors). In addition, the selector can also be a DOM-element.
181+
182+
{boolean|null} **excludeChildren**: true, if the result for an element should also include the text of the children (concatenated by newline if needed), or false, if only the text of the selected element should be read (default true).
183+
184+
**Example Usage**:
185+
```javascript
186+
var texts = Breinify.UTL.texts('ul li', false);
187+
console.log(texts);
188+
```
189+
<br/>
190+
191+
* {string} **Breinify.UTL.text(selector, excludeChildren)**:<br/>
192+
Gets the concatenated text of the specified element(s).
193+
194+
**Parameters**:
195+
196+
{string} **selector**: The CSS-selector to specify the element(s) to read from (see [jQuery Selectors](https://api.jquery.com/category/selectors/) for a detailed overview of available selectors). In addition, the selector can also be a DOM-element.
197+
198+
{boolean|null} **excludeChildren**: true, if the result for an element should also include the text of the children (concatenated by newline if needed), or false, if only the text of the selected element should be read (default true).
199+
200+
**Example Usage**:
201+
```javascript
202+
var text = Breinify.UTL.text('input[attr="name"]', false);
203+
console.log(text);
204+
```
205+
<br/>
206+
207+
* {string} **Breinify.UTL.setText(selector, value)**:<br/>
208+
Sets the text for the selected element(s).
209+
210+
**Parameters**:
211+
212+
{string} **selector**: The CSS-selector to specify the element(s) to read from (see [jQuery Selectors](https://api.jquery.com/category/selectors/) for a detailed overview of available selectors). In addition, the selector can also be a DOM-element.
213+
214+
{string} **value**: The text to be set.
156215

157-
texts: function() { return []; },
158-
text: function() { return null; },
159-
md5: function () { return null; },
160-
isEmpty: function() { return false; }
216+
**Example Usage**:
217+
```javascript
218+
var text = Breinify.UTL.text('input[attr="name"]', false);
219+
console.log(text);
220+
```
221+
<br/>
222+
223+
* {string} **Breinify.UTL.md5(value)**:<br/>
224+
Gets the hashed value for the passed *value*.
225+
226+
**Parameters**:
227+
228+
{string} **value**: The value to be hashed.
229+
230+
**Example Usage**:
231+
```javascript
232+
var md5 = Breinify.UTL.text('HELLO', false);
233+
window.alert('The hashed value of "HELLO" is ' + md5);
234+
```
235+
<br/>
236+
237+
* {boolean} **Breinify.UTL.isEmpty(value)**:<br/>
238+
Checks if the passed *value* is empty. Empty has a different meaning for different types. An *object* is assumed to be empty:
239+
* if it is plain and has no attributes
240+
* if it is a string equal to *''* after it is trimmed
241+
* if it is *null*
242+
243+
**Parameters**:
244+
245+
{mixed} **value**: The value to be checked.
246+
247+
**Example Usage**:
248+
```javascript
249+
Breinify.UTL.isEmpty({}); // returns true
250+
Breinify.UTL.isEmpty(' '); // returns true
251+
Breinify.UTL.isEmpty(null); // returns true
252+
```
253+
<br/>
161254

162255
##### Breinify.UTL.events
163256

@@ -168,7 +261,7 @@ For simplicity the library provides the possibility to handle/react to specific
168261

169262
**Parameters**:
170263

171-
{string} **selector**: The CSS-selector to specify the element(s) to listen for click-events (see [jQuery Selectors](https://api.jquery.com/category/selectors/) for a detailled overview of available selectors).
264+
{string} **selector**: The CSS-selector to specify the element(s) to listen for click-events (see [jQuery Selectors](https://api.jquery.com/category/selectors/) for a detailed overview of available selectors).
172265

173266
{function} **func**: The function to execute when the event is captured. The function retrieves an *event* object which can be used to control the further processing. In addition, the handling function also has access to the DOM-element that the handler was bound to using *this*. For further details, have a look at [jQuery Event Handling](https://learn.jquery.com/events/inside-event-handling-function/).
174267

src/snippets/suffix-global.js.snippet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
},
7171
texts: function() { return []; },
7272
text: function() { return null; },
73+
setText: function() {},
7374
md5: function () { return null; },
7475
isEmpty: function() { return false; }
7576
};

0 commit comments

Comments
 (0)