Triggers: Difference between revisions

11 bytes added ,  20 September 2016
m
no edit summary
mNo edit summary
mNo edit summary
Line 111: Line 111:
:Result: Object Library, the library identified
:Result: Object Library, the library identified


=== Object Library ===
=== Object ''Library'' ===
This object provides access to library entries. You can work with the current library — the lib() or any other library database — libByName(). This method provides ability to update existing entries and to create new ones.
This object provides access to library entries. You can work with the current library — the lib() or any other library database — libByName(). This method provides the ability to update existing entries and create new ones.


==== Methods ====
==== Methods ====
Line 121: Line 121:
===== find(query) =====
===== find(query) =====
: Search for entries in the library matching given field values. This search is similar to searching via Memento's user interface.
: Search for entries in the library matching given field values. This search is similar to searching via Memento's user interface.
: Parameters: query — the search string
:; Parameters: query — the search string
: Result: Array of matching entries. Entries are sorted by time of their creation, from newest to oldest.
:; Result: Array of matching entries. Entries are sorted by time of their creation, from newest to oldest.


===== findByKey(name) =====
===== findByKey(name) =====
: Search for all entries by the Entry Name field value. The library must be enabled for unique names.
: Search for all entries by the Entry Name field value. The library must be enabled for unique names.
: Parameters: name — the Entry Name field value
:; Parameters: name — the Entry Name field value
: Result: Object Entry
:; Result: Object Entry


===== create(values) =====
===== create(values) =====
: Create a new entry in the library.
: Create a new entry in the library.
: Parameters: [https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object '''Object'''] containing the field values
:; Parameters: [https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object '''Object'''] containing the field values
: Result: Object Entry, the new entry in the library
:; Result: Object Entry, the new entry in the library


==== Properties ====
==== Properties ====