Skip to content

Commit 28ffd4f

Browse files
author
Mercurio
committed
Initial commit
0 parents  commit 28ffd4f

File tree

7 files changed

+181
-0
lines changed

7 files changed

+181
-0
lines changed

Diff for: .gitattributes

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.gitattributes export-ignore
2+
.gitignore export-ignore
3+
.gitmodules export-ignore
4+
.github export-ignore
5+
.travis export-ignore
6+
.travis.yml export-ignore
7+
.editorconfig export-ignore
8+
.styleci.yml export-ignore
9+
10+
phpunit.xml export-ignore
11+
tests export-ignore
12+
13+
js/dist/* -diff
14+
js/dist/* linguist-generated
15+
js/dist-typings/* linguist-generated
16+
js/yarn.lock -diff
17+
js/package-lock.json -diff
18+
19+
* text=auto eol=lf

Diff for: .gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/vendor
2+
composer.lock
3+
composer.phar
4+
5+
.DS_Store
6+
Thumbs.db
7+
tests/.phpunit.result.cache
8+
/tests/integration/tmp
9+
.vagrant
10+
.idea/*
11+
.vscode
12+
js/coverage-ts

Diff for: LICENSE.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) <year> <copyright holders>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Diff for: README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Sticky Sidenav
2+
3+
![License](https://img.shields.io/badge/license-MIT-blue.svg) [![Latest Stable Version](https://img.shields.io/packagist/v/ecnu-im/sticky-sidenav.svg)](https://packagist.org/packages/ecnu-im/sticky-sidenav) [![Total Downloads](https://img.shields.io/packagist/dt/ecnu-im/sticky-sidenav.svg)](https://packagist.org/packages/ecnu-im/sticky-sidenav)
4+
5+
A [Flarum](http://flarum.org) extension. Make the sidenav section sticky and scrollable. Also support hot-discussions widget.
6+
7+
## Installation
8+
9+
Install with composer:
10+
11+
```sh
12+
composer require ecnu-im/sticky-sidenav:"*"
13+
```
14+
15+
## Updating
16+
17+
```sh
18+
composer update ecnu-im/sticky-sidenav:"*"
19+
php flarum migrate
20+
php flarum cache:clear
21+
```
22+
23+
## Links
24+
25+
- [Packagist](https://packagist.org/packages/ecnu-im/sticky-sidenav)
26+
- [GitHub](https://github.com/ecnu-im/sticky-sidenav)
27+
- [Discuss](https://discuss.flarum.org/d/PUT_DISCUSS_SLUG_HERE)

Diff for: composer.json

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "ecnu-im/sticky-sidenav",
3+
"description": "Make the sidenav section sticky and scrollable. Also support hot-discussions widget.",
4+
"keywords": [
5+
"flarum"
6+
],
7+
"type": "flarum-extension",
8+
"license": "MIT",
9+
"require": {
10+
"flarum/core": "^1.2.0"
11+
},
12+
"authors": [
13+
{
14+
"name": "merc",
15+
"email": "[email protected]",
16+
"role": "Developer"
17+
}
18+
],
19+
"extra": {
20+
"flarum-extension": {
21+
"title": "Sticky Sidenav",
22+
"category": "",
23+
"icon": {
24+
"name": "",
25+
"color": "",
26+
"backgroundColor": ""
27+
}
28+
},
29+
"flarum-cli": {
30+
"modules": {
31+
"admin": false,
32+
"forum": true,
33+
"js": false,
34+
"jsCommon": false,
35+
"css": true,
36+
"locale": false,
37+
"gitConf": true,
38+
"githubActions": false,
39+
"prettier": false,
40+
"typescript": false,
41+
"bundlewatch": false,
42+
"backendTesting": false,
43+
"editorConfig": false,
44+
"styleci": false
45+
}
46+
}
47+
},
48+
"minimum-stability": "dev",
49+
"prefer-stable": true
50+
}

Diff for: extend.php

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of ecnu-im/sticky-sidenav.
5+
*
6+
* Copyright (c) 2022 merc.
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace ECNUIM\StickySidenav;
13+
14+
use Flarum\Extend;
15+
16+
return [
17+
(new Extend\Frontend('forum'))
18+
19+
->css(__DIR__.'/less/forum.less'),
20+
21+
22+
];

Diff for: less/forum.less

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@media (min-width: 992px) {
2+
.sideNav>ul {
3+
height: 100%;
4+
position: sticky;
5+
}
6+
7+
.sideNav>ul>.item-nav {
8+
position: sticky;
9+
top: 70px;
10+
max-height: 90vh;
11+
overflow-x: hidden;
12+
overflow-y: hidden;
13+
/* For iOS */
14+
cursor: pointer;
15+
/* For Firefox */
16+
scrollbar-width: thin;
17+
18+
&:hover {
19+
overflow-y: auto;
20+
}
21+
}
22+
23+
.App {
24+
overflow-x: visible;
25+
}
26+
}
27+
28+
.hotDiscussions-widget {
29+
position: sticky;
30+
top: 70px;
31+
max-height: 90vh;
32+
}
33+
34+
::-webkit-scrollbar {
35+
width: 5px;
36+
background-color: #e0e0e0;
37+
}
38+
39+
::-webkit-scrollbar-thumb {
40+
background: #9e9e9e;
41+
border-radius: 5px;
42+
}

0 commit comments

Comments
 (0)