-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Applying formatting changes through GitHub Actions
- Loading branch information
1 parent
f0227a4
commit c05e1a4
Showing
2 changed files
with
74 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
})(); |