@dipcode/dj-plugins
v0.4.1
Published
Plugins to be used along with @dipcode/dj-core.
Downloads
37
Readme
Plugins - Javascript module
Module with common and usefull plugins to be used along with @dipcode/dj-core
.
Exported plugins usage examples
Django Messages
const querySelector: string = '[data-django-messages-plugin]';
const messagesPlugin: DjangoMessagesPlugin = new DjangoMessagesPlugin(querySelector);
Infinite Scroll
const querySelector: string = '[data-infinite-scroll]';
const infiniteScrollPlugin: InfiniteScrollPlugin = new InfiniteScrollPlugin(querySelector);
Live Results
const querySelector: string = '[data-live-results]';
const liveResultsPlugin: LiveResultsPlugin = new LiveResultsPlugin(querySelector);
Back to Top
const querySelector: string = '[data-back-to-top]';
const backtoTopPlugin: BackToTopPlugin = new BackToTopPlugin(querySelector);
Forms / Form Validation
const querySelector: string = '[data-form-validation]';
const formValidationPlugin: FormValidationPlugin = new FormValidationPlugin(querySelector);
Forms / Formset Plugin
const querySelector: string = '[data-formset]';
const formSetPlugin: FormSetPlugin = new FormSetPlugin(querySelector);
Forms / Submit on Form Change
const querySelector: string = '[data-submit-form-on-change]';
const submitOnFormChangePlugin: SubmitOnFormChangePlugin = new SubmitOnFormChangePlugin(querySelector);
Integrations / Autosize Textarea
const querySelector: string = 'textarea';
const autosizeTextAreaPlugin: AutosizeTextAreaPlugin = new AutosizeTextAreaPlugin(querySelector);
Integrations / Google Recaptcha
const querySelector: string = '.g-recaptcha';
const recaptchaPlugin: RecaptchaPlugin = new RecaptchaPlugin(querySelector, {
publicKey: settings.get('RECAPTCHA_PUBLIC_KEY'),
language: settings.get('LANGUAGE'),
});