Skip to content

Instantly share code, notes, and snippets.

View stevedrobinson's full-sized avatar

Steve Robinson stevedrobinson

  • Brilliant Metrics
  • Milwaukee, WI
View GitHub Profile
@stevedrobinson
stevedrobinson / enableTidyDWC.js
Last active September 7, 2022 18:25
Mautic Dynamic Web Content Class & Style Cleanup
/* enableTidyDWC is a function to enable
a series of scripts that tidy up Mautic dynamic
web content when a mutation is detected.
It performs three main functions:
* strips all inline css if it finds the attribute
data-param-slot-strip-inline="yes". Otherwise, it
restores the inline css stripped by the buggy
froala editor
@stevedrobinson
stevedrobinson / mautic-form-preload.js
Last active June 15, 2023 20:45 — forked from shawncarr/mautic-form-preload.js
Pre-populate Mautic Form Data from Query String Parameters
(function(document){
function populateForms(){
if (document.readyState == 'interactive') {
if (document.forms.length !== 0 && location.search) {
var query = location.search.substr(1);
query.split('&').forEach(function (part) {
if (part.indexOf('=') !== -1) {
var item = part.split('=');
var key = item[0];
var value = decodeURIComponent(item[1]);