Skip to content

Instantly share code, notes, and snippets.

Avatar

Igor Berdichevskiy Septdir

View GitHub Profile
@Septdir
Septdir / README-ru-RU.md
Last active Apr 15, 2021
Joomla Install Script
View README-ru-RU.md

Установочный скрипт для Joomla

Пример установочного скрипта для Joomla

@Septdir
Septdir / demo.html
Last active Feb 11, 2021
Numbers only
View demo.html
<input type="text" numbers-only >
<script>
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('input[numbers-only]').forEach(function (input) {
input.addEventListener('input', function () {
input.value = input.value.replace(/[^.\d]+/g, '').replace(/^([^.]*\.)|\./g, '$1');
});
});
});
</script>
@Septdir
Septdir / demo.html
Created Feb 11, 2021
Ratio height for ellements
View demo.html
<div class="block-1" ratio-height="4:3">
Block 4:3 width 250<br/>
<em>ratio-height="4:3"</em>
</div>
<div class="block-2" ratio-height="16:9">
Block 16:9 width 500<br/>
<em>ratio-height="16:9"</em>
</div>
<div class="block-3" ratio-height="1:1">
Block 1:1 width 750<br/>
@Septdir
Septdir / cluster.php
Last active Apr 29, 2020
Map cluster icon generator
View cluster.php
<?php
header('Content-type: image/svg+xml');
$fill = (!empty($_GET['fill'])) ? '#' . str_replace('#', '', $_GET['fill']) : '#000000';
$size = (isset($_GET['size']) && (int) $_GET['size']) ? (int) $_GET['size'] : 120;
?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-100 -100 200 200"
width="<?php echo $size; ?>" height="<?php echo $size; ?>">
<defs>
<g id="marker" transform="rotate(45)">
<path d="M0 47A47 47 0 0 0 47 0L62 0A62 62 0 0 1 0 62Z" fill-opacity="0.7"/>
@Septdir
Septdir / install_jyproextra.php
Created Feb 28, 2020
Install jYProExtra in insall script
View install_jyproextra.php
<?php
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Installer\InstallerAdapter;
use Joomla\CMS\Installer\InstallerHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
@Septdir
Septdir / yoothemepro-chosen.less
Last active Jan 4, 2020
Less for YOOtheme Pro chosen
View yoothemepro-chosen.less
.hook-form-misc() {
@internal-form-search-image: "../../images/icons/search.svg";
.chzn-container {
font: inherit;
}
.chzn-container-single .chzn-single {
display: inline-block;
vertical-align: middle;
width: 100%;
@Septdir
Septdir / joomla-form-uikit.php
Last active Oct 11, 2019
Set uikit classes to joomla form
View joomla-form-uikit.php
<?php
// Set uikit form
foreach ($this->form->getFieldsets() as $key => $fieldset)
{
foreach ($this->form->getFieldset($key) as $field)
{
$name = $field->fieldname;
$group = $field->group;
$type = strtolower($field->type);
$class = $this->form->getFieldAttribute($name, 'class', '', $group);
@Septdir
Septdir / popup.js
Last active Jul 21, 2019
Open popup window
View popup.js
document.addEventListener("DOMContentLoaded", function () {
let popups = document.querySelectorAll('[popup]');
if (popups) {
popups.forEach(function (element) {
// Get url
let url = '';
if (element.getAttribute('href')) {
url = element.getAttribute('href');
} else if (element.getAttribute('popup')) {
url = element.getAttribute('popup');
@Septdir
Septdir / default.php
Created Jul 15, 2019
com_content artcle for yootheme pro
View default.php
<?php
/**
* @package Septdir Workshop Package
* @version __DEPLOY_VERSION__
* @author Septdir Workshop - septdir.com
* @copyright Copyright (c) 2018 - 2019 Septdir Workshop. All rights reserved.
* @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
* @link https://www.septdir.com/
*/
@Septdir
Septdir / donate-solution.html
Last active Aug 16, 2019
Simple donate form for Yandex.Money and PayPal.Based on uikit3
View donate-solution.html
<div class="uk-form uk-form-horizontal" donate-form="form">
<div class="uk-margin">
<div class="uk-form-label">Сервис</div>
<div class="uk-form-controls">
<div class="uk-button-group">
<a class="uk-button uk-button-default" donate-form="service_button"
data-service="yandex">Яндекс.Деньги</a>
<a class="uk-button uk-button-default" donate-form="service_button" data-service="paypal">PayPal</a>
</div>
<input type="hidden" donate-form="service">