Skip to content

Instantly share code, notes, and snippets.

@dfparker2002
dfparker2002 / Function hook
Created June 6, 2019 09:00 — forked from visiongeist/Function hook
This plugin hooks into an existing jQuery function and calls a user defined function after a jQuery function was called.
/*
* Function hook jQuery plugin
* version 1.0
* author: Damien Antipa
* http://github.com/dantipa/
*/
(function(window, $, undefined){
/**
* Hooks into a given method
@dfparker2002
dfparker2002 / curve-example.png
Created June 6, 2019 08:56 — forked from kevinweber/curve-example.png
d3.js: Custom curve with rounded steps. Based on d3.curveStep.
curve-example.png
@dfparker2002
dfparker2002 / this.js
Created June 6, 2019 08:55 — forked from kevinweber/this.js
JavaScript: Ways to use `this` in callback function
// The old way (before ES6)
var _self = this;
this.element.addEventListener('click', function (event) {
_self.doSomething(event);
});
// The new way (ES6)
this.element.addEventListener('click', (event) => {
this.doSomething(event);
});
@dfparker2002
dfparker2002 / example.html
Created June 6, 2019 08:55 — forked from kevinweber/example.html
AEM: Include another resource + modify tag and class name #data-sly-resource
<!--/* More: https://docs.adobe.com/docs/en/htl/docs/block-statements.html#resource */-->
<!--/* By default, the AEM decoration tags are disabled, the decorationTagName option allows to bring them back, and the cssClassName to add classes to that element. */-->
<div data-sly-resource="${'headline' @
resourceType='about-project/components/content/c34-section-headline',
decorationTagName='span',
cssClassName='className'
}"></div>
<!--/* More about the decoration tag: https://docs.adobe.com/docs/en/aem/6-3/develop/components/decoration-tag.html */-->

AEM 6.2 Authoring Editor to Site messaging API

API

/**
 *
 * @param group {String} group identifier name
 * @param [targetWindow=window.parent]
 * @param [origin='*']
 * @constructor
@dfparker2002
dfparker2002 / built-in-tools.md
Created June 6, 2019 08:38 — forked from kevinweber/built-in-tools.md
Collection of AEM Links, Commands & Tips / Cheat Sheet

Web Consoles & Tools

@dfparker2002
dfparker2002 / jcr-locations.md
Created June 6, 2019 08:38 — forked from knennigtri/jcr-locations.md
Useful JCR Locations for AEM Templates and components
@dfparker2002
dfparker2002 / examples.sql2
Created June 6, 2019 08:09 — forked from frieder/examples.sql2
JCR-SQL2 examples (AEM6)
Find all videos below a specific DAM path
-----------------------------------------
SELECT * FROM [dam:Asset] AS asset
WHERE ISDESCENDANTNODE(asset, '/content/dam')
AND asset.[jcr:content/metadata/dc:format] LIKE 'video/%'
Find all pages with a specific template and an alias
----------------------------------------------------
@dfparker2002
dfparker2002 / table-summary-rte.js
Created June 6, 2019 08:08
A sample of how to modify an existing RTE Plugin
(function ($) {
"use strict";
var _ = window._,
Class = window.Class,
CUI = window.CUI,
EAEM_TABLE = null,
COLUMN_CONTAINER = ".coral-RichText-dialog-columnContainer",
SUMMARY_SEL = ".coral-RichText-dialog--tableprops textarea[data-type=\"summary\"]",
SUMMARY_HTML = '<div class="coral-RichText-dialog-columnContainer">'
@dfparker2002
dfparker2002 / smartrestize.js
Created June 6, 2019 08:08 — forked from rogerblanton/smartrestize.js
Taken from Paul Irish taken from John Hann
(function($,sr){
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {