Skip to content

Instantly share code, notes, and snippets.

/**The MIT License (MIT)
Copyright (c) 2018 Rakesh Garib
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@keshcreations
keshcreations / eventcallback_specific_campaigns.txt
Created August 17, 2018 11:37
Target EventCallback on a specific Campaing
window.usabilla_live("setEventCallback", function (category, action, label, value) {
if(action == "Campaign:Open" && label == "db9094e12969") {
console.log("This is AWESOME");
}
})
@keshcreations
keshcreations / center_inpage.txt
Created July 26, 2018 15:10
Center content of InPage
<style>
#form > div.control-container.control-toggle > div > div > h3{
text-align:center
}
#form > div.control-container.control-toggle > div > div > ul{
text-align:center
}
</style>
// Set a specific custom form
var trigger = function(){
window.usabilla_live("setForm", "**NAMEOFCUSTOMFORM**");
setTimeout(function() {
window.usabilla_live("click");
}, 100)
};
window.usabilla_live("setCustomOptionClick", trigger);
// Set the default form
<a href='https://feedback.usabilla.com/index.html?id=29df1b3fad21&group=1925dfa73e51' style='color:#7266a6'>
<b>Did you find this email of interest to you?</b>
</a>
<table style='border-collapse: collapse; border-spacing: 0px; margin-top: 10px;' cellpadding='0' cellspacing='0'>
<tr>
<td>
<a href='https://feedback.usabilla.com/index.html?id=29df1b3fad21&group=1925dfa73e51&mood=1' style='display: block; width: 35px; height: 30px; max-height: 30px; border: 0px; color:#007CB1;'>
<img src='https://d6tizftlrpuof.cloudfront.net/themes/production/hollandandbarrett-h-b-sept-2017-mood-custom-sprite-url-1-69b3c21daa6f427a75323cfd53f5c6e9.png'
alt='1' border='0' style='display: block; width: 30px; height: 30px;'> </a>
</td>
window.usbl2 = lightningjs.require("usbl2", "//w.usabilla.com/20ccdb2116cb.js?api_name=usbl2");
window.usabilla_live("setEventCallback", function(category, action, label, value) {
var newURL = window.location.protocol + "//" + window.location.hostname;
var type = null;
switch (action) {
case "Campaign:Open":
type = "feedback";
history.replaceState(null, null, newURL);
(https\:\/\/www\.viking\.de.*\-c\-5802003.*\?q\=)
<!-- Usabilla Combicode for Pierce Ecom.-->
<!-- Begin Usabilla for Websites embed code -->
<script type="text/javascript">/*{literal}<![CDATA[*/window.lightningjs||function(c){function g(b,d){d&&(d+=(/\?/.test(d)?"&":"?")+"lv=1");c[b]||function(){var i=window,h=document,j=b,g=h.location.protocol,l="load",k=0;(function(){function b(){a.P(l);a.w=1;c[j]("_load")}c[j]=function(){function m(){m.id=e;return c[j].apply(m,arguments)}var b,e=++k;b=this&&this!=i?this.id||0:0;(a.s=a.s||[]).push([e,b,arguments]);m.then=function(b,c,h){var d=a.fh[e]=a.fh[e]||[],j=a.eh[e]=a.eh[e]||[],f=a.ph[e]=a.ph[e]||[];b&&d.push(b);c&&j.push(c);h&&f.push(h);return m};return m};var a=c[j]._={};a.fh={};a.eh={};a.ph={};a.l=d?d.replace(/^\/\//,(g=="https:"?g:"http:")+"//"):d;a.p={0:+new Date};a.P=function(b){a.p[b]=new Date-a.p[0]};a.w&&b();i.addEventListener?i.addEventListener(l,b,!1):i.attachEvent("on"+l,b);var q=function(){function b(){return["<head></head><",c,' onload="var d=',n,";d.getElementsByTagName('head')[0].",d,"(d.",g,"('scrip
<!-- Usabilla Combicode for Pierce Ecom-->
<!-- Begin Usabilla for Websites embed code -->
<script type="text/javascript">/*{literal}<![CDATA[*/window.lightningjs||function(c){function g(b,d){d&&(d+=(/\?/.test(d)?"&":"?")+"lv=1");c[b]||function(){var i=window,h=document,j=b,g=h.location.protocol,l="load",k=0;(function(){function b(){a.P(l);a.w=1;c[j]("_load")}c[j]=function(){function m(){m.id=e;return c[j].apply(m,arguments)}var b,e=++k;b=this&&this!=i?this.id||0:0;(a.s=a.s||[]).push([e,b,arguments]);m.then=function(b,c,h){var d=a.fh[e]=a.fh[e]||[],j=a.eh[e]=a.eh[e]||[],f=a.ph[e]=a.ph[e]||[];b&&d.push(b);c&&j.push(c);h&&f.push(h);return m};return m};var a=c[j]._={};a.fh={};a.eh={};a.ph={};a.l=d?d.replace(/^\/\//,(g=="https:"?g:"http:")+"//"):d;a.p={0:+new Date};a.P=function(b){a.p[b]=new Date-a.p[0]};a.w&&b();i.addEventListener?i.addEventListener(l,b,!1):i.attachEvent("on"+l,b);var q=function(){function b(){return["<head></head><",c,' onload="var d=',n,";d.getElementsByTagName('head')[0].",d,"(d.",g,"('script