dictionary.getGlobal()

dictionary.getGlobal() Returns: null Description:  Used to retrieve the values directly from the global scope. The values retrieved will still belong to the global scope and not will be part of the local scope. For example consider that global is {test: “test”} :

dictionary.mergeFromGlobal()

dictionary.mergeFromGlobal() Returns: dictionary Description:  Used to retrieve the values from the global scope and merge it over the local scope. If a key is already present in the local scope with a different value it will be overridden by the value in the global scope. Example

Dictionary engine

Description:  The dictionary engine is the one used by multiple other engines to hold and retrieve data in a key/value format. Available interfaces: getGlobal – gets the global stored elements mergeToGlobal – retrieves the elements from local and merges them into the global storage elements overrideGlobal – retrieves the elements from local and overrides them…

Cache engine

Description:  Stores a key-value map ,the engine keys do not have to be of string type but can be any object , similar to MAP Any value (both objects and primitive values) may be used as either a key or a value. The engine is used to store individual query request/response. The scope of the cache…

Klevu Chains

Klevu Chains Description:  All chains are a list of callback functions that can be manipulated at any point in the execution. As objects are sent as a reference to a function we utilize this core js functionality to achieve the desired effect. Understanding Chains The concept of Chaining is derived from the promise and callback…

Klevu Chains – Elements

Klevu chain elements Description:  Chain elements are attached to chains. These elements are the callback functions to be executed. Some extra options allow the modification of order the callback functions have at the time of execution. A chain element has the following possible parameters: name: <str> – defines name of the element, it has to…

Template Engine

Description:  The template engine allows easy access to rendering tools that are present in the Klevu library. Core template functions: setData – sets the data variable of the template getData – gets the data variable of the template getHelpers – get a full list of available template helpers setHelper – set new template helper or override existing one dependent…

Klevu Events

Description:  Klevu framework provides multiple type of events and event interfaces. At the time the Klevu lib becomes ready to be used a function klevuInit is searched and executed from the main document. When including the library via Dynamic loading take this in account.

Core events

Description:  Core events are custom build and executed events. The event will generate a klevuChain there is no data or scope on the created chain. The chain will execute from the time of creation for  maxCount times with an interval of delay or until the event evaluates to true via the fire function. If the event has already executed any promise…

Search events

Description:  Klevu framework comes with a list of search events and functions that help the power up of the search box and landing page These are stored as part of the klevu.searchEvents formatted as follows klevu.searchEvents box focus – responsible for preprocessing the focus event and executing the scope chain chains.events.focus keyup – responsible for preprocessing…

DOM events

Description:  Klevu framework comes with a interface to execute functions when DOM is fully loaded klevu.ready(object or functionSource) – when the document is in ready state , when DOM is in this state klevu.isReady will be true object contains : name: name of the function to be executed – unique per event fire: source code of the…

Defined events

Description:  Bind an event handler to the JavaScript event. klevu.event.attach : function ( target , event , callBack , useCapture ) target – dom node target event – js event name , refer to event list for support callBack – function to be executed when event is fired useCapture –  default false – A Boolean indicating whether events of this type will be dispatched to the…

Dictionary engine – Global Storage engines

Description:  The global storage of a dictionary can be saved out of memory and be persistent by using one of 4 types of storage engines. Once a storage engine is set it will automatically retrieve the data stored in that engine for that scope inside the global data. Any push of local data after that…

Currency engine

Description:  The currency engine is an implementation of the dictionary engine  refer to the dictionary docs for an in-depth view. The map of a currency element, with defaults: atEnd: false – controls if the symbol is after the value code: “<string>” – same as the global name decimal: “.” – symbol to be used in the…

Translator Engine

Description:  The translator engine is an implementation of the dictionary engine  refer to the dictionary docs for an in-depth view The translator engine is used to group a specific language and the currency engine used in that language. Specific functions for the engine: translate – used to reverse check a string from the dictionary, the…