1.22.61 • Published 2 years ago

dentolo v1.22.61

Weekly downloads
98
License
ISC
Repository
-
Last release
2 years ago

About

A JavaScript library for work with Dentolo quiz.

Documentation

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();
1.22.59

2 years ago

1.22.58

2 years ago

1.22.61

2 years ago

1.22.60

2 years ago

1.22.57

2 years ago

1.22.56

2 years ago

1.22.55

2 years ago

1.22.54

2 years ago

1.22.53

2 years ago

1.22.49

3 years ago

1.22.48

3 years ago

1.22.52

3 years ago

1.22.51

3 years ago

1.22.50

3 years ago

1.22.47

3 years ago

1.22.39

3 years ago

1.22.38

3 years ago

1.22.37

3 years ago

1.22.36

3 years ago

1.22.35

3 years ago

1.22.34

3 years ago

1.22.33

3 years ago

1.22.32

3 years ago

1.22.31

3 years ago

1.22.46

3 years ago

1.22.45

3 years ago

1.22.44

3 years ago

1.22.43

3 years ago

1.22.42

3 years ago

1.22.41

3 years ago

1.22.40

3 years ago

1.22.30

3 years ago

1.22.17

4 years ago

1.22.16

4 years ago

1.22.15

4 years ago

1.22.14

4 years ago

1.22.13

4 years ago

1.22.12

4 years ago

1.22.19

4 years ago

1.22.18

4 years ago

1.22.28

3 years ago

1.22.27

3 years ago

1.22.26

3 years ago

1.22.25

3 years ago

1.22.24

4 years ago

1.22.23

4 years ago

1.22.22

4 years ago

1.22.21

4 years ago

1.22.29

3 years ago

1.22.20

4 years ago

1.22.11

4 years ago

1.22.10

4 years ago

1.22.4

4 years ago

1.22.7

4 years ago

1.22.8

4 years ago

1.22.5

4 years ago

1.22.6

4 years ago

1.22.9

4 years ago

1.22.3

4 years ago

1.22.2

4 years ago

1.22.1

4 years ago

1.22.0

4 years ago

1.21.8

4 years ago

1.21.6

5 years ago

1.21.7

5 years ago

1.21.4

5 years ago

1.21.5

5 years ago

1.21.3

5 years ago

1.21.2

5 years ago

1.21.1

5 years ago

1.21.0-patch

5 years ago

1.21.0

5 years ago

1.20.2

5 years ago

1.20.1

5 years ago

1.20.0

5 years ago

1.19.0

5 years ago

1.18.0

5 years ago

1.17.2

5 years ago

1.17.1

5 years ago

1.17.0

5 years ago

1.16.2

5 years ago

1.16.1

5 years ago

1.16.0

5 years ago

1.15.4

5 years ago

1.15.3

5 years ago

1.15.2

5 years ago

1.15.5

5 years ago

1.15.1

5 years ago

1.15.0

5 years ago

1.14.0

5 years ago

1.13.1

5 years ago

1.13.0

5 years ago

1.12.2

5 years ago

1.12.1

5 years ago

1.12.0

5 years ago

1.10.4

5 years ago

1.10.3

5 years ago

1.10.2

5 years ago

1.10.1

5 years ago

1.10.0

5 years ago

1.9.0

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.6.4

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.0.2

5 years ago

1.0.3

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago