Page tree

 

Contents

 

This is a comprehensive list of all Evergage-created JavaScript functions that fall under one of two categories:

1. Evergage Catalog functions, which are used in the Site-Wide JavaScript that integrates your site with the Evergage catalog

2. Evergage's "safe" functions, which are safer functions to be used in place of their corresponding JavaScript and JQuery functions when working in your Site-Wide JavaScript.

The purpose of Promote functions is to make complex processes like "add to cart" into easy-to-use and easy-to-read functions like "addToCart".

The purpose of "safe" functions is to ensure that no matter what is put into your Site-Wide JavaScript (like bad syntax or bad logic), an error in one part of the code will still leave the rest intact.

 

EVERGAGE CATALOG FUNCTIONS

The syntax for implementing these functions is Evergage.functionName(parameters). The specific functions are:

setCurrentPageLocale: function setCurrentPageLocale(pageLocale) {},

viewItem: function viewItem(item, opts) {},

viewItemDetail: function viewItemDetail(item, opts) {},

viewCategory: function viewCategory(category, opts) {},

viewTag: function viewTag(tag, opts) {},

addToCart: function addToCart(addedLineItem, order, opts) {},

purchase: function purchase(order, opts) {},

review: function review(item, opts) {},

share: function share(item, opts) {},

comment: function comment(item, opts) {},

favorite: function favorite(item, opts) {},

ItemType: ItemType = {
                Category: 'c',
                Product: 'p',
                Article: 'a',
                Blog: 'b',
                Tag: 't'
            },

hideSections: function hideSections() {},

 

EVERGAGE "SAFE" FUNCTIONS

(Make sure you check the examples further below)

The syntax for implementing these functions is Evergage.safeFunction("css/JQuery selector", normal JavaScript parameters). The specific functions are:

safeBlur(selector, {optional arguments}, function() {});
safeChange(selector, {optional arguments}, function() {});
safeClick(selector, {optional arguments}, function() {});
safeDblclick(selector, {optional arguments}, function() {});
safeFocus(selector, {optional arguments}, function() {});
safeFocusin(selector, {optional arguments}, function() {});
safeFocusout(selector, {optional arguments}, function() {});
safeHover(selector, {optional arguments}, function() {});
safeKeydown(selector, {optional arguments}, function() {});
safeKeypress(selector, {optional arguments}, function() {});
safeKeyup(selector, {optional arguments}, function() {});
safeLoad(selector, {optional arguments}, function() {});
safeMousedown(selector, {optional arguments}, function() {});
safeMouseenter(selector, {optional arguments}, function() {});
safeMouseleave(selector, {optional arguments}, function() {});
safeMousemove(selector, {optional arguments}, function() {});
safeMouseout(selector, {optional arguments}, function() {});
safeMouseover(selector, {optional arguments}, function() {});
safeReady(selector, {optional arguments}, function() {});
safeResize(selector, {optional arguments}, function() {});
safeScroll(selector, {optional arguments}, function() {});
safeSelect(selector, {optional arguments}, function() {});
safeSubmit(selector, {optional arguments}, function() {});
safeTouchstart(selector, {optional arguments}, function() {});
safeTouchmove(selector, {optional arguments}, function() {});
safeTouchend(selector, {optional arguments}, function() {});
safeTouchCancel(selector, {optional arguments}, function() {});
safeTimeout(function() {}, time);
safeInterval(function() {}, time);

Examples:

If using more parameters than just the selector and the function(event) { //callback }, then put them in place of { } below:

        Evergage.safeClick("#selector", { }, function(event) {
            console.log("clicked");
        });

Otherwise, the { } can be omitted:

        Evergage.safeClick("#selector", function(event) {
            console.log("clicked");
        });

This page has no comments.