This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// convert qa string to slug in JS | |
const toSlug = function (str) { | |
str = str.replace(/^\s+|\s+$/g, ""); // trim | |
str = str.toLowerCase(); | |
// remove accents, swap ñ for n, etc | |
const from = "âăãàáäâẽèéëêìíïîõòóöôùúüûñçșț·/_,:;"; | |
const to = "aaaaaaaeeeeeiiiiooooouuuuncst------"; | |
for (let i = 0, l = from.length; i < l; i++) { | |
str = str.replace(new RegExp(from.charAt(i), "g"), to.charAt(i)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Directus\Application\Http\Request; | |
use Directus\Application\Http\Response; | |
use Directus\Services\ItemsService; | |
use Zend\Db\Adapter\Adapter; | |
return [ | |
// The endpoint path: | |
// '' means it is located at: `/custom/<endpoint-id>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_gform_confirmation( $confirmation, $form, $entry, $ajax ) { | |
if (!function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage') && !function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) { | |
return $confirmation . "<br> not translated"; | |
} else { | |
$confirmation = function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage') ? qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($confirmation) : qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($confirmation); | |
return $confirmation . "<br> translated"; | |
} | |
} | |
add_filter( 'gform_confirmation', 'custom_gform_confirmation', 10, 4 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Determines the way of scrolling up or down: | |
* by 'automatically' scrolling a section or by using the default and normal scrolling. | |
*/ | |
function scrolling(type, scrollable){ | |
if (!isScrollAllowed.m[type]) { | |
return; | |
} | |
var firstTimeToTop = typeof scrollable.data('firstTimeToTop') === "undefined" ? true : scrollable.data('firstTimeToTop'), // get variable from data instance if it's set, otherwise set default. |