Skip to content

Instantly share code, notes, and snippets.

View pelid's full-sized avatar

Evgeny Evseev pelid

View GitHub Profile
@pelid
pelid / cjs.js
Last active December 19, 2016 15:35
MyMechanic widget integration to car.ru
// код для встраивания на страницу car.ru
// используется chrome extension https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija
var buttonsHTML = (
'<p><button onclick="widget.expand()">Expand</button> <button onclick="widget.collapse()">Collapse</button></p>'+
'<p>'+
'<button onclick="widget.requestForQuote({presets: {carMake: \'BMW\', services: [85702, 52658]}})">Заказать диагностику BMW - button onclick</button>'+
'<a href="#" class="js-activate-mymechanic" data-car-make="Ford" data-car-model="Focus" data-service-area="Москва" data-services="[85702, 52658]">ТО для Ford Focus в Москве - auto bind</a>'+
'<button class="js-activate-mymechanic" data-car-make="Ford" data-car="Toyota Camry 2010">ремонт Toyota Camry 2010 - auto bind with car info as a string</button>'+
'<button class="js-activate-mymechanic">Предпродажный осмотр</button>'+