Hush also provides some js helpers for frontend.
sluggableinput with this class will print slugified version of its value to field selector, which should be specified in
codemirrorwill transform textarea to code editing area.
wysiwygwill transform textarea to WYSIWYG editor.
delete-itemshould be attached to
<a>element and when it will be clicked, show user warning window and after confirming will send delete request to url, specified in
in-modalshould be attached to
<a>element and when it will be clicked, ajax will try to get modal from the url given in
hrefand show it to the user.
submitable- serve for sending form data without page reloading, also it process a validation errors.
All js functions are stored in global
Commonly used functions:
functions.initialize()will init most of plugins in case, if you draw it after document's ready jquery event.
functions.initializeDeleter()will init delete buttons in case, if you draw it after document's ready jquery event.
functions.initializeInModal()will init in-modal buttons in case, if you draw it after document's ready jquery event.
functions.initializeSubmitter()will init submitable forms in case, if you draw it after document's ready jquery event.
functions.openDynamicModal(link)will open a modal from the given link.
functions.request(type, url, data, success, error)will send ajax request and process request as described in Page actions return formats section.
functions.notify(text, type, position)will show small notification, more about supported types and positions you can find in noty.js docs.