Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaucau committed Jul 18, 2021
0 parents commit 9dd3c89
Show file tree
Hide file tree
Showing 23 changed files with 12,169 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
js/src export-ignore
.git* export-ignore

js/dist/*.js -diff
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build production JS
uses: flarum/action-build@2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build
package_manager: yarn
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint

on:
workflow_dispatch:
push:
paths:
- 'js/src/**'
pull_request:
paths:
- 'js/src/**'

jobs:
prettier:
name: JS / Prettier
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@master

- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: "14"

- name: Check JS formatting
run: npx prettier --check src
working-directory: ./js
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
vendor
composer.lock
js/dist
.idea
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 150,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright (c) <year> <copyright holders>

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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Mobiel tab

![License](https://img.shields.io/badge/license-MIT-blue.svg) [![Latest Stable Version](https://img.shields.io/packagist/v/acpl/mobile-tab.svg)](https://packagist.org/packages/acpl/mobile-tab) [![Total Downloads](https://img.shields.io/packagist/dt/acpl/mobile-tab.svg)](https://packagist.org/packages/acpl/mobile-tab) ![Supports latest Flarum](https://flarum-badge-api.davwheat.dev/v1/compat-latest/acpl/mobile-tab)

A [Flarum](https://flarum.org) extension.

### Installation

Install with composer:

```sh
composer require acpl/mobile-tab:"*"
```

### Updating

```sh
composer update acpl/mobile-tab:"*"
php flarum cache:clear
```

### Extending
You can add, modify and delete items.
Read: https://docs.flarum.org/extend/extending-extensions.html#extending-extensions

Examples:
```js
import { components } from '@acpl/mobile-tab';
import { extend } from 'flarum/common/extend';

const { MobileTab, MobileTabItem } = components;

export default () => {
extend(MobileTab.prototype, 'items', (items) => {
// Add new item
items.add('following', <MobileTabItem href={app.route('following')} icon="fas fa-star" />, 90);

// Add new item using custom HTML
items.add('my-item', <div>...This is my custom item</div>, 70);

// Remove item
items.remove('home');
});
};

```

### Links

- [Packagist](https://packagist.org/packages/acpl/mobile-tab)
- [GitHub](https://github.com/android-com-pl/mobile-tab)
- [Discuss](https://discuss.flarum.org/d/PUT_DISCUSS_SLUG_HERE)
42 changes: 42 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "acpl/mobile-tab",
"keywords": [
"flarum"
],
"type": "flarum-extension",
"license": "MIT",
"require": {
"flarum/core": "^1.0"
},
"authors": [
{
"name": "Rafał Całka",
"email": "[email protected]",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"Acpl\\MobileTab\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Acpl\\MobileTab\\Tests\\": "tests/"
}
},
"extra": {
"flarum-extension": {
"title": "Mobile tab",
"category": "theme",
"icon": {
"name": "fas fa-ellipsis-h",
"backgroundColor": "#0F9D58",
"color": "#fff"
}
},
"optional-dependencies": [
"flarum/tags"
]
}
}
20 changes: 20 additions & 0 deletions extend.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* This file is part of acpl/mobile-tab.
*
* Copyright (c) 2021 forum.android.com.pl.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/

namespace Acpl\MobileTab;

use Flarum\Extend;

return [
(new Extend\Frontend('forum'))->js(__DIR__ . '/js/dist/forum.js')->css(__DIR__ . '/less/forum.less'),

new Extend\Locales(__DIR__ . '/locale'),
];
1 change: 1 addition & 0 deletions js/forum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src/forum';
Loading

0 comments on commit 9dd3c89

Please sign in to comment.