View contentModule.gql
import gql from 'graphql-tag' | |
import { print } from 'graphql/language/printer' | |
import richTextFragment from './contentModules/richText.gql' | |
import logoBlockFragment from './contentModules/logoBlock.gql' | |
import embedBlockFragment from './contentModules/embedBlock.gql' | |
import videoBlockFragment from './contentModules/videoBlock.gql' | |
import imageCollageFragment from './contentModules/imageCollage.gql' | |
import imageGridFragment from './contentModules/imageGrid.gql' | |
import slideshowBlockFragment from './contentModules/slideshowBlock.gql' | |
import singleImageFragment from './contentModules/singleImage.gql' |
View steps.vue
<template> | |
<div | |
ref="stepsApp" | |
class="steps" | |
> | |
<div class="step-item is-active is-success"> | |
<div class="step-marker"> | |
1 | |
</div> | |
<div class="step-details"> |
View modal-video.vue
/* Based on https://github.com/appleple/react-modal-video/ */ | |
<template> | |
<div v-if="isOpen"> | |
<div | |
:class="classNames.modalVideo" | |
tabIndex='-1' | |
role='dialog' | |
:aria-label="aria.openMessage" | |
@click="$emit('update:isOpen', false)" |
View debounce.js
/* https://gist.github.com/nmsdvid/8807205#gistcomment-3168449 */ | |
var debounce = (callback, wait = 250) => { | |
let timer; | |
let last_call = 0; | |
return (...args) => { | |
clearTimeout(timer); | |
const now = Date.now(), time_from_last_call = now - last_call; | |
if (time_from_last_call > wait) { |
View module.php
<?php | |
use yii\base\Event; | |
use Craft; | |
use craft\elements\Entry; | |
Event::on( | |
Entry::class, | |
Entry::EVENT_AFTER_SAVE, | |
function(ModelEvent $event) { |
View twig-filters.php
<?php | |
add_filter( 'timber/twig', 'add_to_twig' ); | |
function add_to_twig( $twig ) { | |
$twig->addFilter( new Timber\Twig_Filter( 'noWidows', 'twigNoWidow' ) ); | |
return $twig; | |
} | |
function twigNoWidow($text = "", $numberOfWords = 1, $outputRaw = true ) { |
View img-macros.twig
{# | |
# USAGE: | |
# (transform can either be an object, or an array of objects, aka srcset) | |
# | |
# {{ macro.regular(entry.image.one(), { width: 50, height: 50 }, 'class="block"') }} | |
# ➡️ <img src="..." width="50" height="50" alt="..." class="block" /> | |
# | |
# {{ macro.url(entry.image.one(), { width: 50, height: 50 }) }} | |
# ➡️ /uploads_c/../{...}.jpg | |
# |
View email.js
//Based on https://www.jackbarber.co.uk/blog/2019-04-26-email-address-plugin-for-redactor with small improvements | |
(function ($R) { | |
$R.add('plugin', 'email', { | |
modals: { | |
// this is variable with modal HTML body | |
'emailmodal': '<form action=""><div class="form-item"><label>Email Address</label><input type="text" name="emailaddress"><label>Text</label><input type="text" name="anchortext"></div></form>' | |
}, | |
// set translations | |
translations: { | |
en: { |
View timezoneField.json
[ | |
{ | |
"name":"Time Zone", | |
"handle":"timeZone", | |
"instructions":"", | |
"required":null, | |
"translationMethod":"none", | |
"translationKeyFormat":null, | |
"type":"craft\\fields\\Dropdown", | |
"settings":{ |
NewerOlder