Skip to content

Commit

Permalink
Applying formatting changes through GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 13, 2023
1 parent f0227a4 commit c05e1a4
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 66 deletions.
82 changes: 41 additions & 41 deletions src/TagzApp.Providers.TwitchChat/StartTwitchChat.cs
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using TagzApp.Common.Exceptions;

namespace TagzApp.Providers.TwitchChat;

public class StartTwitchChat : IConfigureProvider
{

private const string _ConfigurationKey = "providers:twitchchat";

public IServiceCollection RegisterServices(IServiceCollection services, IConfiguration configuration)
{

IConfiguration config = null;
try
{
config = configuration.GetSection(_ConfigurationKey);
services.Configure<TwitchChatConfiguration>(config);
}
catch (Exception ex)
{

// Was not able to configure the provider
throw new InvalidConfigurationException(ex.Message, _ConfigurationKey);

}

if (config is null || string.IsNullOrEmpty(config.GetValue<string>("ClientId")))
{
// No configuration provided, no registration to be added
return services;
}

services.AddSingleton<ISocialMediaProvider, TwitchChatProvider>();


return services;

}
}
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using TagzApp.Common.Exceptions;

namespace TagzApp.Providers.TwitchChat;

public class StartTwitchChat : IConfigureProvider
{

private const string _ConfigurationKey = "providers:twitchchat";

public IServiceCollection RegisterServices(IServiceCollection services, IConfiguration configuration)
{

IConfiguration config = null;
try
{
config = configuration.GetSection(_ConfigurationKey);
services.Configure<TwitchChatConfiguration>(config);
}
catch (Exception ex)
{

// Was not able to configure the provider
throw new InvalidConfigurationException(ex.Message, _ConfigurationKey);

}

if (config is null || string.IsNullOrEmpty(config.GetValue<string>("ClientId")))
{
// No configuration provided, no registration to be added
return services;
}

services.AddSingleton<ISocialMediaProvider, TwitchChatProvider>();


return services;

}
}
58 changes: 33 additions & 25 deletions src/TagzApp.Web/wwwroot/js/masonry.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
(function () {

const m = {

resizeGridItem: function (item) {
grid = document.getElementById("taggedContent");
rowHeight = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-auto-rows'));
rowGap = parseInt(window.getComputedStyle(grid).getPropertyValue('grid-row-gap'));
var imageSize = (item.querySelector('.contentcard')?.getBoundingClientRect().height ?? 0) + (item.querySelector('.contentcard') ? 6 : 0);
rowSpan = Math.ceil((item.querySelector('.content').getBoundingClientRect().height + imageSize + 100 + rowGap) / (rowHeight + rowGap));
item.style.gridRowEnd = "span " + rowSpan;
},

resizeAllGridItems: function () {
allItems = document.querySelectorAll("article");
for (x = 0; x < allItems.length; x++) {
m.resizeGridItem(allItems[x]);
}
}

};

window.Masonry = m;

})();
(function () {
const m = {
resizeGridItem: function (item) {
grid = document.getElementById('taggedContent');
rowHeight = parseInt(
window.getComputedStyle(grid).getPropertyValue('grid-auto-rows'),
);
rowGap = parseInt(
window.getComputedStyle(grid).getPropertyValue('grid-row-gap'),
);
var imageSize =
(item.querySelector('.contentcard')?.getBoundingClientRect().height ??
0) + (item.querySelector('.contentcard') ? 6 : 0);
rowSpan = Math.ceil(
(item.querySelector('.content').getBoundingClientRect().height +
imageSize +
100 +
rowGap) /
(rowHeight + rowGap),
);
item.style.gridRowEnd = 'span ' + rowSpan;
},

resizeAllGridItems: function () {
allItems = document.querySelectorAll('article');
for (x = 0; x < allItems.length; x++) {
m.resizeGridItem(allItems[x]);
}
},
};

window.Masonry = m;
})();

0 comments on commit c05e1a4

Please sign in to comment.