Browse Source

Merge pull request #26005 from abpframework/maliming/replace-owl-carousel-with-swiper

Replace owl.carousel with Swiper
pull/26036/head
Ma Liming 2 weeks ago
committed by GitHub
parent
commit
1389800200
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Swiper/SwiperScriptContributor.cs
  2. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Swiper/SwiperStyleContributor.cs
  3. 3
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Posts/Index.cshtml
  4. 40
      modules/blogging/src/Volo.Blogging.Web/Pages/Blogs/Shared/Scripts/blog.js
  5. 1
      npm/packs/blogging/package.json
  6. 129
      npm/packs/swiper/README.md
  7. 6
      npm/packs/swiper/abp.resourcemapping.js
  8. 30
      npm/packs/swiper/package.json

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Swiper/SwiperScriptContributor.cs

@ -0,0 +1,12 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Swiper;
public class SwiperScriptContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/swiper/swiper-bundle.min.js");
}
}

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Swiper/SwiperStyleContributor.cs

@ -0,0 +1,12 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Swiper;
public class SwiperStyleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/swiper/swiper-bundle.min.css");
}
}

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

@ -1,7 +1,6 @@
@page
@using Microsoft.AspNetCore.Authorization
@using Volo.Blogging.Areas.Blog.Helpers.TagHelpers
@using Volo.Abp.AspNetCore.Mvc.UI.Packages.OwlCarousel
@using Volo.Blogging
@inject IAuthorizationService Authorization
@model IndexModel
@ -19,13 +18,11 @@
@section scripts {
<abp-script-bundle name="@typeof(IndexModel).FullName">
<abp-script src="/client-proxies/blogging-proxy.js" />
<abp-script type="@typeof(OwlCarouselScriptContributor)" />
<abp-script src="/Pages/Blogs/Shared/Scripts/blog.js" />
</abp-script-bundle>
}
@section styles {
<abp-style-bundle name="@typeof(IndexModel).FullName">
<abp-script type="@typeof(OwlCarouselStyleContributor)" />
<abp-style src="/Pages/Blogs/Shared/Styles/blog.css" />
</abp-style-bundle>
}

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

@ -1,11 +1,4 @@
(function () {
function handleArrows() {
var herosWidth = $('.hero-articles').width();
var arrowsPosition = herosWidth / 2 - 90;
$('.owl-next').css('right', arrowsPosition);
$('.owl-prev').css('left', arrowsPosition);
}
function handleImages() {
//if ($(window).width() > 767) {
// $(".box-articles .img-container").each(function () {
@ -18,36 +11,8 @@
//}
}
function handleOwlCarousel() {
$('.hero-section .owl-carousel').owlCarousel({
loop: true,
margin: 0,
nav: false,
dots: false,
//center: true,
autoplay: true,
autoHeight: true,
autoplaySpeed: 1000,
items: 1,
});
$('.card-article-container .owl-carousel').owlCarousel({
loop: true,
margin: 0,
nav: false,
dots: false,
autoplay: true,
autoplaySpeed: 1000,
responsive: {
0: {
items: 1,
},
},
});
}
$(function () {
handleImages();
handleOwlCarousel();
$('.nav-link').on('click', function () {
$(this).parent().parent();
@ -55,13 +20,8 @@
$(window).resize(function () {
setTimeout(function () {
handleArrows();
handleImages();
}, 500);
});
setTimeout(function () {
handleArrows();
}, 500);
});
})();

1
npm/packs/blogging/package.json

@ -6,7 +6,6 @@
},
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.shared": "~10.7.0-rc.3",
"@abp/owl.carousel": "~10.7.0-rc.3",
"@abp/prismjs": "~10.7.0-rc.3",
"@abp/tui-editor": "~10.7.0-rc.3"
},

129
npm/packs/swiper/README.md

@ -0,0 +1,129 @@
## ℹ️ Description
ABP Framework is a complete open-source infrastructure to create modern web applications by following the best practices and conventions of software development. This package is a part of the [ABP Framework](https://abp.io) and contains client-side files.
For more information, check out the below links:
🔗Official Website: https://abp.io
🔗Commercial Website: https://commercial.abp.io
🔗Commercial Demo: https://commercial.abp.io/demo
🔗GitHub Repository: https://github.com/abpframework/abp
🔗Official Theme: https://www.LeptonTheme.com
🔗Documentation: https://docs.abp.io
🔗Community: https://community.abp.io
🔗Blog: https://blog.abp.io
🔗Books: https://abp.io/books
🔗Twitter: https://twitter.com/abpframework
🔗Discord: https://community.abp.io/discord
🔗Stackoverflow: https://stackoverflow.com/questions/tagged/abp
🔗YouTube: https://www.youtube.com/@Volosoft
## 🤔 Why ABP Platform?
Why should you use the ABP.IO Platform instead of creating a new solution from scratch?
You can find the answer here 👉🏻 [Why ABP Platform?](https://docs.abp.io/en/commercial/latest/why-abp-io-platform)
## 🚀 Key Features of the ABP Framework
🟡 Modularity
🟡 Multi-Tenancy
🟡 Bootstrap Tag Helpers
🟡 Dynamic Forms
🟡 Authentication
🟡 Authorization
🟡 Distributed Event Bus
🟡 BLOB Storing
🟡 Text Templating
🟡 Tooling: ABP CLI
🟡 Cross-Cutting Concerns
🟡 Bundling & Minification
🟡 Virtual File System
🟡 Theming
🟡 Background Jobs
🟡 DDD Infrastructure
🟡 Auto REST APIs
🟡 Dynamic Client Proxies
🟡 Multiple Database Providers
🟡 Data filtering
🟡 Test Infrastructure
🟡 Audit Logging
🟡 Object to Object Mapping
🟡 Email & SMS Abstractions
🟡 Localization
🟡 Setting Management
🟡 Extension Methods
🟡 Aspect Oriented Programming
🟡 Dependency Injection
## 🧐 How It Works?
The following page explains how you use the ABP.IO Platform as a .NET developer 👉 [How it works?](https://commercial.abp.io/how-it-works)
### 📘 Supported Database Providers
🔵 Entity Framework Core
🔵 MongoDB
🔵 Dapper
### 🎴 Supported UI Frameworks
🔵 Angular
🔵 Razor Pages
🔵 Blazor Web Assembly
🔵 Blazor Server
🔵 MAUI with Blazor Hybrid
## 📫 Bug & Support
Support for open-source ABP Framework client-side packages is available at [GitHub Issues](https://github.com/abpframework/abp/issues), and the commercial support is available at [support.abp.io](https://support.abp.io).

6
npm/packs/swiper/abp.resourcemapping.js

@ -0,0 +1,6 @@
module.exports = {
mappings: {
"@node_modules/swiper/swiper-bundle.min.js*": "@libs/swiper/",
"@node_modules/swiper/swiper-bundle.min.css": "@libs/swiper/"
}
}

30
npm/packs/swiper/package.json

@ -0,0 +1,30 @@
{
"version": "10.7.0-rc.3",
"name": "@abp/swiper",
"publishConfig": {
"access": "public"
},
"dependencies": {
"swiper": "^14.1.0"
},
"gitHead": "bb4ea17d5996f01889134c138d00b6c8f858a431",
"homepage": "https://abp.io",
"repository": {
"type": "git",
"url": "https://github.com/abpframework/abp.git"
},
"license": "LGPL-3.0",
"keywords": [
"aspnetcore",
"boilerplate",
"framework",
"web",
"best-practices",
"angular",
"maui",
"blazor",
"mvc",
"csharp",
"webapp"
]
}
Loading…
Cancel
Save