With so many channels to communicate through; it’s hard to follow the conversation sometimes. We’ve made it easy for you by putting everything in one spot so you can catch up on all the #ThrowbackThursday you missed.
')
$cont.before($errCont);
$errCont.find('.ff-err-info').html(original == '' ? 'Empty response from server' : original)
}
return;
}
if (!FlowFlowOpts.dependencies) FlowFlowOpts.dependencies = {}
var requests = [];
var request, extension, style;
for ( extension in FlowFlowOpts.dependencies ) {
if ( FlowFlowOpts.dependencies[extension] && FlowFlowOpts.dependencies[extension] !== 'loaded') {
request = $.getScript( opts.plugin_base + '-' + extension + '/js/ff_' + extension + '_public.js');
requests.push(request);
// load styles async with without waiting
style = document.createElement('link');
style.type = "text/css";
style.rel = "stylesheet";
style.id = "ff_ad_style";
style.href = opts.plugin_base + '-' + extension + '/css/ff_' + extension + '_public.css';
style.media = "screen";
document.getElementsByTagName("head")[0].appendChild(style);
FlowFlowOpts.dependencies[extension] = 'loaded';
}
}
var resourcesLoaded = $.when.apply($, requests);
resourcesLoaded.done(function(){
var $stream, width;
$stream = FlowFlow.buildStreamWith(response, $streamOpts, moderation, FlowFlowOpts.dependencies);
if (isLS && response.items.length > 0 && response.hash.length > 0) sessionStorage.setItem(response.hash, original);
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); // todo remove hardcode
}
$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');
}, 0);
if (FlowFlowOpts.dependencies['ads'] && response['ads']){
var deferred = jQuery.post(opts.ajaxurl, {
'action' : 'flow_flow_ad_action',
'status' : 'view',
'id' : response['ads']
});
$.when( deferred ).always(function(data) {});
}
}).fail(function(){
console.log('Flow-Flow: resource loading failed')
});
var isErr = response.status === "errors";
// debugger
if ((opts.isAdmin || opts.isLog) && isErr) {
$errCont = $('
If you see this then you\'re administrator and Flow-Flow got errors from APIs while requesting data. Please go to plugin\'s admin and after refreshing page check for error(s) on stream settings page. Please provide error message info if you\'re doing support request.
')
$cont.before($errCont);
}
if (opts.isAdmin && response.status === 'building') {
window.console && window.console.log(response);
$cont.prepend($('
ADMIN INFO: Feeds cache is being built in background. Please wait for changes to apply. Page reload is required.
'));
}
});
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));