Skip to content

Instantly share code, notes, and snippets.

View md604's full-sized avatar

Maxim Dyuzhinov md604

View GitHub Profile
...
<script>
var theme = {
vue: {
availableApps: []
},
breakpoints: {
medium: 750,
large: 990,
...
{%- assign app_type = 'vue-quotes' -%}
<div class="vue-quote-app"
data-app-type="{{ app_type }}"
data-app-id="{{ section.id }}">
<script id="{{ section.id }}-{{ app_type }}">
window.theme.vue.availableApps.push({
type: "{{ app_type }}",
id: "{{ section.id }}",
import './vue-section-quotes.scss';
import Vue from 'vue';
import Quotes from './quotes.vue';
export class QuotesApp {
constructor(id, data) {
this._sectionId = id;
this._appType = 'vue-quotes';
this._appInstance = null;
this._appData = data;
<template>
<div class="vue-quote-app">
<div v-if="settings.title.length > 0" class="section-header text-center">
<h2>{{ settings.title }}</h2>
</div>
<div class="quotes-wrapper">
<div class="quotes-slider" :data-count="`${blocks.length}`">
<div v-for="(block, index) in blocks" :key="`block-id-${index}`">
<blockquote class="quotes-slider__text text-center">
<span class="quote-icon">
...
if (Shopify.designMode) {
// editor mode helper function
const registerNewApps = function(event) {
const eventSectionId = event.detail.sectionId;
event
.target
.querySelectorAll(`div[data-app-id="${eventSectionId}"]`)
.forEach(appElement => {
@md604
md604 / trekkie.min.js
Last active January 2, 2021 19:18
Lines 664–674
(t.prototype.initialize = function (e) {
(this.pageCalled = !1), this.loadGAScript();
var n = this.options;
"localhost" === c.hostname() && (n.domain = "none"),
n.enhancedEcommerce && this.enhancedEcommerce(),
window.ga("create", n.trackingId, { cookieDomain: n.domain || t.defaultOptions.domain, siteSpeedSampleRate: n.siteSpeedSampleRate, sampleRate: n.sampleRate, allowLinker: !0 }),
n.doubleClick && window.ga("require", "displayfeatures"),
n.enhancedLinkAttribution && window.ga("require", "linkid"),
n.anonymizeIp && window.ga("set", "anonymizeIp", !0),
e();
@md604
md604 / trekkie.min.js
Created January 2, 2021 22:28
Lines 688-693
(t.prototype.enhancedEcommerce = function () {
(this.viewedProduct = this.viewedProductEnhanced),
(this.addedProduct = this.addedProductEnhanced),
(this.startedOrder = this.startedOrderEnhanced),
(this.completedOrder = this.completedOrderEnhanced);
}),
@md604
md604 / trekkie.min.js
Created January 3, 2021 15:36
Lines 716-719
(t.prototype.enhancedEcommerceTrackProduct = function (e) {
var t = {
id: e.sku || e.variantId,
name: e.name,
category: e.category,
quantity: this.getProductQuantity(e),
price: e.price,
brand: e.brand,
variant: e.variant,
currency: this.getCurrency(e.currency)
@md604
md604 / trekkie.min.js
Created January 3, 2021 15:52
Lines 614-663
(t.prototype.viewedProductEnhanced = function (e) {
var t = e.properties;
this.loadEnhancedEcommerce(e);
var n = this.enhancedEcommerceTrackProduct(t);
window.ga("ec:setAction", "detail");
var r = this.pushEnhancedEcommerce(e);
this.addMonorailBatchEvent({ eventName: a.ANALYTICS_VIEWED_PRODUCT, eventProperties: JSON.stringify({ item: n, event: r }) });
}),
(t.prototype.addedProductEnhanced = function (e) {
var t = e.properties;
@md604
md604 / trekkie.min.js
Created January 3, 2021 16:24
Additional order information
var v = {
id: t.orderName || t.checkoutId,
affiliation: t.affiliation,
revenue: t.total || t.revenue || 0,
tax: t.tax,
shipping: t.shipping,
coupon: t.coupon
};