Skip to content

Instantly share code, notes, and snippets.

View iamrobert's full-sized avatar

Robert Stark iamrobert

View GitHub Profile
@iamrobert
iamrobert / upload.php
Last active August 26, 2021 13:01
FLEXIContent Upload FIle - handle Chinese/remove spaces
<?php
//components/com_flexicontent/classes/helpers/upload.php
//Handles Chinese
defined( '_JEXEC' ) or die( 'Restricted access' );
class flexicontent_upload
{
static function makeSafe($file, $language = null)
{
@iamrobert
iamrobert / item-video-image.php
Last active August 30, 2021 09:05
Flexicontent Serve unique image or video content
<?php
// No direct access
defined( '_JEXEC' )or die( 'Restricted access' );
$detailsField_id = 999;
$detailsFieldName = 'field_image';
$detailsImgVid = '';
FlexicontentFields::getFieldDisplay( $item, "$detailsFieldName" );
@iamrobert
iamrobert / item-gallery.php
Last active August 23, 2021 16:34
FLEXIContent glightbox item-gallery.php
@iamrobert
iamrobert / joomla-messages.php
Last active July 15, 2021 20:29
Test Your Joomla System Messages - Put in your template /index.php
JFactory::getApplication()->enqueueMessage('Blue Message', 'notice');
JFactory::getApplication()->enqueueMessage('Error Message', 'error');
JFactory::getApplication()->enqueueMessage('Warning Message', 'warning');
JFactory::getApplication()->enqueueMessage('Message Message', 'message');
JFactory::getApplication()->enqueueMessage('Success Message', 'success');
JFactory::getApplication()->enqueueMessage('Blank Message', '');
@iamrobert
iamrobert / playr-v2.html
Last active July 6, 2021 05:23
plyr.jo + lazyload youtube
(function(){
//PRECONNECT TO YOUTUBE
var linkTag = document.createElement('link');
linkTag.rel = 'preconnect';
linkTag.href = 'https://img.youtube.com';
//inject tag in the head of the document
document.head.appendChild(linkTag);
@iamrobert
iamrobert / t-transition.js
Created June 23, 2021 18:06
Barba Until Animation is done!
pageTransition: Barba.BaseTransition.extend({
start: function () {
Promise.all([this.newContainerLoading, this.animIn()])
.then(this.animOut.bind(this))
.then(function () {
app.onPageTransitionCompleted();
});
},
animIn: function () {
@iamrobert
iamrobert / getCSS-getJS.js
Created May 31, 2021 15:42
Vanilla JS | Get CSS & JS Example
/* + GET JS
-----------------------------------------------------------------------
https://stackoverflow.com/questions/16839698/jquery-getscript-alternative-in-native-javascript
==========================================================================*/
var getJS = function getJS(url) {
return new Promise(function(resolve, reject) {
var script = document.createElement("script");
script.src = url;
script.async = true;
@iamrobert
iamrobert / codyhouse-mega-menu.js
Created May 23, 2021 12:48
CodyHouse Mega Menu with level 1 click, and disable on mobile
// File#: _3_mega-site-navigation
// Usage: codyhouse.co/license
// iamrobert code to prevent click on touch
(function () {
var MegaNav = function (element) {
this.element = element;
this.search = this.element.getElementsByClassName('js-mega-nav__search');
this.searchActiveController = false;
this.menu = this.element.getElementsByClassName('js-mega-nav__nav');
this.menuItems = this.menu[0].getElementsByClassName('js-mega-nav__item');
@iamrobert
iamrobert / zurb-prepros.js
Last active May 23, 2021 08:19
Prepros Zurb FIle
/* + FOUNDATION 6.6.3 JS PREPOS FILE
======================================================================
1. Copy Files From dist/js/plugins folder on github
2. Remove @prepend for unneeded files
3. Probably best to start from bottom for uneeded files
----------------------------------------------------------------------
*/
//CORE FILES
//@prepend zf/foundation.core.min.js
//@prepend zf/foundation.util.box.min.js
@iamrobert
iamrobert / select.txt
Created March 29, 2021 12:22
TAIWAN AREA and REGIONS (FLEXIContent Select FIelds)
001_keelung_city::基隆市%%
002_taipei_city::台北市%%
003_new_taipei_city::新北市%%
004_hsinchu_city::新竹市%%
005_hsinchu_county::新竹縣%%
006_taoyuan_city::桃園市%%
007_miaoli_county::苗栗縣%%
008_taichung_city::台中市%%
009-changhua_county::彰化縣%%
010_nantou_county::南投縣%%