facebook-login-javascript

window.fbAsyncInit = function() {
    FB.init({
        appId      : '185972185972',
        cookie     : true,
        xfbml      : true,  
        version    : 'v2.8' 
    });
    FB.getLoginStatus(function(response) {
        FBstatusChangeCallback(response);
    });
};

(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

function FBstatusChangeCallback(response) {
    if (response.status === 'connected') {
        FBresponseFromGraph(response.authResponse.accessToken);
    } else {
        document.getElementById('FBerror').innerHTML =  'not connected';
    }
}

function FBcheckFacebookLoginState() {
    FB.getLoginStatus(function(response) {
        FBstatusChangeCallback(response);
    });
}

function FBresponseFromGraph(accessToken) {
	document.getElementById('accessToken').value =  accessToken;
    FB.api('/me?fields=id,email,first_name,last_name', function(response) {
        document.getElementById('first_name').value =  response.first_name;
        document.getElementById('last_name').value =  response.last_name;
        document.getElementById('email').value =  response.email;        
    });
}
<fb:login-button scope="public_profile,email" onlogin="FBcheckFacebookLoginState();">
</fb:login-button>
<div id="accessToken"></div>
<div id="first_name"></div>
<div id="last_name"></div>
<div id="email"></div>
<div id="FBerror"></div>

Fluid Iterator + Modulo

<f:for each="{example.collection}" as="item"  iteration="iterator"  >
   <f:if condition="{iterator.index} % 2">
     <f:then>Rest</f:then>
      <f:else>
          <f:if condition="{iterator.index}==0">
              <f:then>First</f:then>
              <f:else>kein Rest</f:else>
          </f:if>
      </f:else>
   </f:if>
</f:for>

Widget->PaginateViewHelper

plugin.tx_infochy_example{
    view {
        widget {
            TYPO3\CMS\Fluid\ViewHelpers\Widget\PaginateViewHelper {
                templateRootPath = {$plugin.tx_infochy_example.view.templateRootPath}
            }
        }
    }
}

RealURL Autoconf

https://docs.typo3.org/typo3cms/extensions/realurl/Realurl/AutomaticConfiguration/AutomaticConfigurationOfExtensions/Index.html

ext_localconf.php

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/realurl/class.tx_realurl_autoconfgen.php']['extensionConfiguration'][$_EXTKEY] = 
'EXT:' . $_EXTKEY . '/Classes/Hooks/RealurlAutoconf.php:Infochy\\InfochyExample\\Hooks\\RealurlAutoconf->pluginConfiguration';

HOOK

class RealurlAutoconf {

    /**
     * @param array $params
     * @param \DmitryDulepov\Realurl\Configuration\AutomaticConfigurator $pObj
     * @return array
     */
    public function pluginConfiguration($params, &$pObj) {
        return array_merge_recursive($params['config'], array(
                'postVarSets' => array(
                    '_DEFAULT' => array(
                        'plugin' => array(
                            array(
                                'GETvar' => 'tx_infochy_example[action]',
                                'valueMap' => array(
                                    'show' => 'show',
                                    'list' => 'list',
                                ),
                                'noMatch' => 'bypass',
                            ),
                            array(
                                'GETvar' => 'tx_infochy_example[controller]',
                                'valueMap' => array(
                                    'Example' => 'controller',
                                ),
                                'noMatch' => 'bypass',
                            ),
                            array(
                                'GETvar' => 'tx_infochy_example[item]',
                                'lookUpTable' => array(
                                    'table' => 'tx_infochy_domain_model_example',
                                    'id_field' => 'uid',
                                    'alias_field' => 'title',
                                    'useUniqueCache' => 1,
                                    'useUniqueCache_conf' => array(
                                        'strtolower' => 1,
                                        'spaceCharacter' => '-',
                                    ),
                                ),
                            ),
                        ),
                        'paginate' => array(
                            array(
                                'GETvar' => 'tx_infochy_example[@widget_0][currentPage]',
                                //'noMatch' => 'bypass',
                            ),
                            array(
                                'GETvar' => 'tx_infochy_example[action]',
                                'valueMap' => array(
                                    'show' => 'show',
                                    'list' => 'list',
                                ),
                                'noMatch' => 'bypass',
                            ),
                            array(
                                'GETvar' => 'tx_infochy_example[controller]',
                                'valueMap' => array(
                                    'Example' => 'controller',
                                ),
                                'noMatch' => 'bypass',
                            ),
                        ),

                    ),
                ),
            )
        );
    }


}

Simple jQuery Slider

https://github.com/wallpageNET/jquery_example/tree/master/slider

$(document).ready(() => {  
	let slideCount = $('#slider ul li').length;
	let slideWidth = $('#slider ul li').width();
	let slideHeight = $('#slider ul li').height();
	let sliderUlWidth = slideCount * slideWidth; 
	$('#slider ul').css({ width: sliderUlWidth, marginLeft: - slideWidth });
	$('#slider ul li:last-child').prependTo('#slider ul');
	$('a.right').on('click',(e) => { 
		$('#slider ul').animate({
		    left: + slideWidth
		}, 500, () => {
		    $('#slider ul li:last-child').prependTo('#slider ul');
		    $('#slider ul').css('left', '');
		});
	});
	$('a.left').on('click',(e) => { 
		$('#slider ul').animate({
		    left: - slideWidth
		}, 500, () => {
		    $('#slider ul li:first-child').appendTo('#slider ul');
		    $('#slider ul').css('left', '');
		});
        });
});

jQuery scrolling fixen

$(() => {
$('a').on('click', (event) => {
  var $anchor = $(this);
  if($anchor.attr('href').substr(0, 9)==='#section_'){
    $('html, body').stop().animate({
      scrollTop: ($($anchor.attr('href')).offset().top - 150)
    }, 1250, 'easeInOutExpo');
   }
});
});

f:widget.paginate – Suchparameter übergeben

addQueryStringMethod: ‚POST,GET‘

<f:widget.paginate objects="{DomainObjs}" as="paginatedDomainObjs" configuration="{itemsPerPage: 1, insertAbove: 1, insertBelow: 0, maximumNumberOfLinks: 5, addQueryStringMethod: 'POST,GET'}">

addQueryString=“1″

<f:link.action action="show" arguments="{DomainObj : DomainObj}" addQueryString="1">