dentolo v1.22.61
About
A JavaScript library for work with Dentolo quiz.
Installing
Using npm:
$ npm install dentolo
Using yarn:
$ yarn add dentolo
Using cdn:
<script src="https://unpkg.com/dentolo/dist/dentolo.min.js"></script>
Example
import DentoloQuiz from './api';
// Определение
var quiz = DentoloQuiz({
clientId: '5deb6g04f3739k75a45e3ad3',
loadingStrategy: 'shortlyBeforeAutopopup',
autopopupTimeout: 30000,
serviceList: ['implantation', 'braces', 'prosthetic', 'treatment'],
openOnScroll: true,
initialPageIndex: 0,
widget: {
mode: 'mini',
showMiniatureOnHide: true,
wideWidgetStyle: 'default',
hideOnOpenQuiz: true,
zIndex: 10000
}
});
// Иницализация
quiz.init();
// Динамическая смена номера в хедере с использованием CoMagic
var comagicPhone;
window.__cs_onReplacePhones = function(phones) {
if (comagicPhone) return;
// Получить нужный телефон
for(var i = 0; i < phones.length; i++) {
if(phones[i].id == ".required_class") comagicPhone = phones[i].text;
}
// Отпавить номер в опросник
quiz.transferDynamicPhoneNumber(comagicPhone);
};
// Обработчики событий
quiz.bind('open', () => {
console.log('quiz is opened');
});
quiz.bind('close', () => {
console.log('quiz is closed');
});
quiz.bind('get_lead', event => {
console.log(event);
});
// Управление виджетом
var button = document.getElementById('#show-dentolo-widget');
if (button) && button.onClick = () => {
if (quiz.widget && !quiz.widget.isDestroyed()) quiz.widget.show();
};
Dentolo API
Documentation is available on dentolo/doc
Typescript
dentolo includes TypeScript definitions.
import DentoloQuiz, { Dentolo } from 'dentolo';
const widgetOptions:Dentolo.WidgetOptions = {
mode: 'wide',
wideWidgetStyle: 'compact',
hideOnOpenQuiz: true,
showMiniatureOnHide: true
};
const serviceList:Dentolo.Service[] = ['implantation', 'pediatrics', 'veneers', 'remove', 'whitening'];
const strategy:Dentolo.LoadingStrategy = 'onDemand';
const dentoloOptions:Dentolo.Options = {
clientId: 'test2.ru',
serviceList: serviceList,
loadingStrategy: strategy,
widget: widgetOptions
};
const quiz:Dentolo.Api = DentoloQuiz(dentoloOptions);
quiz.init();
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago