Skip to content

Instantly share code, notes, and snippets.

@venkateshwarv
venkateshwarv / inweb-throttling3.html
Created May 16, 2020 11:43
Hide after submission
<script>
_inweb.hideAfterSubmission = true;
</script>
@venkateshwarv
venkateshwarv / inweb-throttling2.html
Created May 16, 2020 11:40
Setting throttle duration
<script>
_inweb.throttleForDays = 30;
</script>
<script>
_inweb.cookieId="my-cookie-name";
</script>
@venkateshwarv
venkateshwarv / inweb-survey-events.html
Created May 16, 2020 10:49
Gist for listening to custom events.
<script>
document.addEventListener('cc-inweb-response', function ($event) {
if($event.target.attributes.id === 'widget-usability'){
<!-- react to response submission -->
}
})
</script>
<cc-inweb id="widget-usability" question="How are you today?" token="PC-56874" question-id='5c272306c3d98742b0f7d577'>
</cc-inweb>
@venkateshwarv
venkateshwarv / inweb-getting-started1.html
Created May 16, 2020 09:50
Inweb Survey as a node-module
<script type="module" src='node_modules/inweb-survey/dist/inweb/inweb.esm.js'></script>
<script nomodule src="node_modules/inweb-survey/dist/inweb/inweb.js"></script>
@venkateshwarv
venkateshwarv / inweb-getting-started.html
Created May 16, 2020 08:08
nanosurvey getting started
<script type="module" src='https://unpkg.com/inweb-survey/dist/inweb/inweb.esm.js'></script>`
<script nomodule src='https://unpkg.com/inweb-survey/dist/inweb/inweb.js'></script>
@venkateshwarv
venkateshwarv / babel.json
Created August 5, 2018 17:54
Bebel config
{
"presets": [
["env", {
"targets": {
"browsers": ["cover 99.5%", "ie 8-11"]
}
}]
],
"plugins": ["transform-es2017-object-entries", "transform-array-find"]
}
@venkateshwarv
venkateshwarv / step1.ts
Last active August 5, 2018 16:30
Typescript for step one
import { Portal, TemplatePortal } from '@angular/cdk/portal';
// [redacted]
showPopUp() {
if ( !this._overlayOpened) {
this._startAnimation();
this.input.setValue( '', { emitEvent: true } );
this._overlayOpened = true;
this._createOverlay().attach( this._portal );
}
@venkateshwarv
venkateshwarv / step1.html
Last active August 5, 2018 14:29
Step1 - Multiselect with WebWorker
<mat-form-field color="primary" class="search-box" [floatLabel]="floatPlaceholder">
<mat-icon class="input-icon" matPrefix fontSet="fa" fontIcon="fa-search"></mat-icon>
<input matInput [formControl]="input" [disabled]="disabled" autocomplete="off" (focus)="showPopUp()" [placeholder]="placeholder"
/>
</mat-form-field>
<ng-template #multiSelectFor>
<!-- Place where your options will go -->
</ng-template>