Skip to content

Commit 30cfd3c

Browse files
committed
Replace owl.carousel with Swiper
1 parent 1824eb1 commit 30cfd3c

11 files changed

Lines changed: 32 additions & 70 deletions

File tree

framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/OwlCarousel/OwlCarouselScriptContributor.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/OwlCarousel/OwlCarouselStyleContributor.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System.Collections.Generic;
2+
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
3+
4+
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Swiper;
5+
6+
public class SwiperScriptContributor : BundleContributor
7+
{
8+
public override void ConfigureBundle(BundleConfigurationContext context)
9+
{
10+
context.Files.AddIfNotContains("/libs/swiper/swiper-bundle.min.js");
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System.Collections.Generic;
2+
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
3+
4+
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Swiper;
5+
6+
public class SwiperStyleContributor : BundleContributor
7+
{
8+
public override void ConfigureBundle(BundleConfigurationContext context)
9+
{
10+
context.Files.AddIfNotContains("/libs/swiper/swiper-bundle.min.css");
11+
}
12+
}

modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@page
22
@using Microsoft.AspNetCore.Authorization
33
@using Volo.Blogging.Areas.Blog.Helpers.TagHelpers
4-
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.OwlCarousel
54
@using Volo.Blogging
65
@inject IAuthorizationService Authorization
76
@model IndexModel
@@ -19,13 +18,11 @@
1918
@section scripts {
2019
<abp-script-bundle name="@typeof(IndexModel).FullName">
2120
<abp-script src="/client-proxies/blogging-proxy.js" />
22-
<abp-script type="@typeof(OwlCarouselScriptContributor)" />
2321
<abp-script src="/Pages/Blogs/Shared/Scripts/blog.js" />
2422
</abp-script-bundle>
2523
}
2624
@section styles {
2725
<abp-style-bundle name="@typeof(IndexModel).FullName">
28-
<abp-script type="@typeof(OwlCarouselStyleContributor)" />
2926
<abp-style src="/Pages/Blogs/Shared/Styles/blog.css" />
3027
</abp-style-bundle>
3128
}

modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,36 +18,8 @@
1818
//}
1919
}
2020

21-
function handleOwlCarousel() {
22-
$('.hero-section .owl-carousel').owlCarousel({
23-
loop: true,
24-
margin: 0,
25-
nav: false,
26-
dots: false,
27-
//center: true,
28-
autoplay: true,
29-
autoHeight: true,
30-
autoplaySpeed: 1000,
31-
items: 1,
32-
});
33-
$('.card-article-container .owl-carousel').owlCarousel({
34-
loop: true,
35-
margin: 0,
36-
nav: false,
37-
dots: false,
38-
autoplay: true,
39-
autoplaySpeed: 1000,
40-
responsive: {
41-
0: {
42-
items: 1,
43-
},
44-
},
45-
});
46-
}
47-
4821
$(function () {
4922
handleImages();
50-
handleOwlCarousel();
5123

5224
$('.nav-link').on('click', function () {
5325
$(this).parent().parent();

npm/packs/blogging/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
},
77
"dependencies": {
88
"@abp/aspnetcore.mvc.ui.theme.shared": "~10.7.0-rc.2",
9-
"@abp/owl.carousel": "~10.7.0-rc.2",
109
"@abp/prismjs": "~10.7.0-rc.2",
1110
"@abp/tui-editor": "~10.7.0-rc.2"
1211
},

npm/packs/owl.carousel/abp.resourcemapping.js

Lines changed: 0 additions & 5 deletions
This file was deleted.
File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
mappings: {
3+
"@node_modules/swiper/swiper-bundle.min.js*": "@libs/swiper/",
4+
"@node_modules/swiper/swiper-bundle.min.css": "@libs/swiper/"
5+
}
6+
}

0 commit comments

Comments
 (0)