General

Files

Methods

Controller.js

controller.js - Controller Tidio RWD - Responsible for defining the basic elements, logo, menu, which items on which pages are to be shown.

Example use

// controller.js

tidioRWD.create({
    logo: {
    	// Logo type
        type: 'image',
        // Link to logo
        url: 'http://capwaste.co.uk/wp-content/themes/twentytwelve/images/grh/logo.png'
    },
    menu: {
    	// Here you can enter the address of a selector out of which can be automatically downloaded links.
        // You can also individually write links that will be displayed.
        link_list: '#menu-topmenu'
    },
    // You define whether the CSS styles of the site should be removed or not.
    remove_stylesheet: true,
    // The definition of which additional CSS files should be uploaded.
    import_css: []
});

// TidioRWD.route method is responsible for displaying depending on the address of appropriate models
// The first router is responsible for displaying the main page if (location.pathname == \'/\') and passes to the model tidioModel.homePage

tidioRWD.route(function () {

    if (location.pathname == '/')

        return true;

}, tidioModel.homePage);

// This router does not have any condition, always returns "true" so it will be executed when no other can be found
// The data is transmitted to the model of "defaultPage"
tidioRWD.route(function () {

    return true;

}, tidioModel.defaultPage);

// Run Tidio RWD
tidioRWD.exec();