Nieuws – Mindfulbizz
(function ( $ ) {
"use strict";
var hash = '1487510425.a278d6b7a57639da9f817efc48fbf9f3736258c627a61fbd174a551e2f04aa380614efa4ad4da017624bf75afaf368a1';
if (/MSIE 8/.test(navigator.userAgent)) return;
var opts = window.FlowFlowOpts;
var isLS = isLocalStorageNameSupported();
if (!opts) {
window.console && window.console.log('Flow-Flow Social Stream: no options available on moment of script execution');
return;
}
if (!window.FF_resource) {
window.console && window.console.log('Flow-Flow Social Stream: required script has not been loaded. Please check if all resources in place or loaded in correct order.');
return
}
var data = {
'action': 'fetch_posts',
'stream-id': '1',
'disable-cache': '',
'hash': hash,
'page': '0',
'preview': '0'
};
var isMobile = /android|blackBerry|iphone|ipad|ipod|opera mini|iemobile/i.test(navigator.userAgent);
var streamOpts = {"name":"linked","moderation":"nope","order":"smartCompare","posts":"30","days":"","page-posts":"15","cache":"yep","cache_lifetime":"10","gallery":"yep","private":"nope","hide-on-desktop":"nope","hide-on-mobile":"nope","show-only-media-posts":"nope","titles":"nope","hidemeta":"nope","hidetext":"nope","heading":"","headingcolor":"rgb(154, 78, 141)","subheading":"","subheadingcolor":"rgb(114, 112, 114)","hhalign":"center","bgcolor":"rgb(229, 229, 229)","filter":"yep","filtercolor":"rgb(205, 205, 205)","mobileslider":"yep","viewportin":"yep","width":"260","margin":"20","theme":"flat","gc-style":"style-1","cardcolor":"rgb(255, 255, 255)","namecolor":"rgb(154, 78, 141)","textcolor":"rgb(85, 85, 85)","linkscolor":"rgb(94, 159, 202)","restcolor":"rgb(132, 118, 129)","shadow":"rgba(0, 0, 0, 0.05)","bcolor":"rgba(240, 237, 231, 0.4)","talign":"left","gf-style":"style-3","fcardcolor":"rgb(64, 68, 71)","fscardcolor":"rgb(44, 45, 46)","ftextcolor":"rgb(255, 255, 255)","fnamecolor":"rgb(94, 191, 255)","frestcolor":"rgb(175, 195, 208)","fbcolor":"rgba(255, 255, 255, 0.4)","mborder":"nope","ftalign":"center","compact-style":"c-style-1","cnamecolor":"rgb(154, 78, 141)","ctextcolor":"rgb(85, 85, 85)","clinkscolor":"rgb(94, 159, 202)","crestcolor":"rgb(132, 118, 129)","cbcolor":"rgb(226, 226, 226)","cmeta":"upic","calign":"left","cards-num":"3","scrolltop":"yep","css":"","tv":"nope","tv-int":"5","tv-logo":"","tv-bg":"","big":"nope","id":"1","status":"1","layout":"grid","last_changes":1476957727,"feeds":[{"id":"sz65493","errors":[],"status":"1","enabled":"yep","last_update":"mrt 4 23:10","cache_lifetime":"30","system_enabled":"1","content":"10165580","event-type":"any","posts":"10","mod":"nope","type":"linkedin","filter-by-words":""}],"preview":false};
opts.streams['stream' + streamOpts.id] = streamOpts;
var $cont = $("#ff-stream-"+data['stream-id']);
var ajaxDeferred;
var script, style;
if (FF_resource.scriptDeferred.state() === 'pending' && !FF_resource.scriptLoading) {
script = document.createElement('script');
script.src = "http://mindfulbizz.nl/wp-content/plugins/flow-flow/js/public.js";
script.onload = function( script, textStatus ) {
FF_resource.scriptDeferred.resolve();
};
document.body.appendChild(script);
FF_resource.scriptLoading = true;
}
if (FF_resource.styleDeferred.state() === 'pending' && !FF_resource.styleLoading) {
style = document.createElement('link');
style.type = "text/css";
style.id = "ff_style";
style.rel = "stylesheet";
style.href = "http://mindfulbizz.nl/wp-content/plugins/flow-flow/css/public.css";
style.media = "screen";
style.onload = function( script, textStatus ) {
FF_resource.styleDeferred.resolve();
};
document.getElementsByTagName("head")[0].appendChild(style);
FF_resource.styleLoading = true;
}
$cont.addClass('ff-layout-' + streamOpts.layout);
if (streamOpts.layout == 'grid' && !isMobile) $cont.css('minHeight', '1000px');
ajaxDeferred = isLS && sessionStorage.getItem(hash) ? {} : $.get(opts.ajaxurl, data)
;
$.when( ajaxDeferred, FF_resource.scriptDeferred, FF_resource.styleDeferred ).done(function ( data ) {
var response, $errCont, err;
var moderation = 0;
var original = (isLS && sessionStorage.getItem(hash)) ? sessionStorage.getItem(hash) : data[0];
try {
response = JSON.parse(original);
} catch (e) {
window.console && window.console.log('Flow-Flow gets invalid data from server');
if (opts.isAdmin || opts.isLog) {
$errCont = $('
var num = streamOpts.layout === 'compact' || (streamOpts.mobileslider === 'yep' && isMobile)? (streamOpts.mobileslider === 'yep' ? 3 : streamOpts['cards-num']) : false;
if (streamOpts.layout === 'compact') {
width = $cont.parent().width();
FlowFlow.adjustImgHeight($stream, (width > 300 ? 300 : width) - 72);
}
$cont.append($stream);
if (typeof $stream !== 'string') {
FlowFlow.setupGrid($cont.find('.ff-stream-wrapper'), num, streamOpts.scrolltop === 'yep', streamOpts.gallery === 'yep', streamOpts, $cont);
}
setTimeout(function(){
$cont.find('.ff-header').removeClass('ff-loading').end().find('.ff-loader').addClass('ff-squeezed').delay(300).hide();
}, 0);
}).fail(function(){
console.log('Flow-Flow: resource loading failed')
});
var isErr = response.status === "errors";
if ((opts.isAdmin || opts.isLog) && isErr) {
$errCont = $('
'));
}
});
function isLocalStorageNameSupported() {
var testKey = 'test', storage = window.sessionStorage;
try {
storage.setItem(testKey, '1');
storage.removeItem(testKey);
return true;
} catch (error) {
return false;
}
};
return false;
}(jQuery));