Skip to content
This repository has been archived by the owner on Nov 16, 2024. It is now read-only.

Support Beta 14? #10

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
82e0327
name changes
matteocontrini Sep 10, 2017
ad11fc4
indentation
matteocontrini Sep 10, 2017
09ca23d
indentation
matteocontrini Sep 10, 2017
5b6013d
updated dependencies
matteocontrini Sep 10, 2017
3d3f403
indentation
matteocontrini Sep 10, 2017
9eed050
refactoring
matteocontrini Sep 10, 2017
0bff5e0
big refactoring
matteocontrini Sep 10, 2017
0529f06
Rename LICENSE to LICENSE.md
matteocontrini Sep 10, 2017
d9ca8e7
Update README.md
matteocontrini Sep 10, 2017
49ae9ed
don't scroll to preview after upload (confusing on mobile)
matteocontrini Sep 10, 2017
602694a
add beta 8 compatibility
matteocontrini Jan 5, 2019
2db41f2
refactor using components and improve UI
matteocontrini Jan 16, 2019
095e652
switch to markdown
matteocontrini Jan 16, 2019
16a7005
add support for paste to upload
matteocontrini Jan 16, 2019
a7a0e2a
update readme and namespaces
matteocontrini Jan 16, 2019
69b66d2
Update README.md
matteocontrini Jan 17, 2019
f00904a
update README
matteocontrini Jan 17, 2019
8edc57d
switch back to BBCode
matteocontrini Jan 17, 2019
c2189e1
update version in composer.json
matteocontrini Jan 17, 2019
50fc02b
move demo GIF above in the readme
matteocontrini Jan 17, 2019
57ba7d3
update configuration instruction
matteocontrini Jan 17, 2019
bac4155
update composer description
matteocontrini Jan 17, 2019
bb427ef
update GIF
matteocontrini Jan 17, 2019
687d56c
Added hungarian translation
manaszon Jan 18, 2019
1cd14b2
Merge pull request #1 from manaszon/master
matteocontrini Jan 18, 2019
5ac5913
update composer.json
matteocontrini Jan 18, 2019
d5b929e
Add Russian translation
matteocontrini Jun 13, 2019
b5efd4a
Resolve SettingsRepositoryInterface as late as possible
clarkwinkelmann Apr 24, 2020
02fa2ad
Merge pull request #4 from clarkwinkelmann/resolve-settings-later
matteocontrini Apr 26, 2020
7c1c009
Update for Flarum beta14
matteocontrini Nov 1, 2020
9acbaf5
Fix paste feature not working
matteocontrini Nov 1, 2020
5d8e535
Update for beta.15
matteocontrini Dec 26, 2020
7b34e46
Add option embed type
matteocontrini Feb 17, 2021
ab543cd
Update for beta.16
matteocontrini Mar 15, 2021
379a6a8
Add compatibility with text editor drivers
matteocontrini Apr 1, 2021
7447b07
Add paste to upload setting
matteocontrini Apr 1, 2021
e70aab7
Update for Flarum 1.0
matteocontrini Jun 25, 2021
a478a84
Update translations
matteocontrini Jul 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 107 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,108 @@
js/forum/node_modules
js/admin/node_modules

# Created by https://www.gitignore.io/api/node,composer,visualstudiocode
# Edit at https://www.gitignore.io/?templates=node,composer,visualstudiocode

### Composer ###
composer.phar
composer.lock
vendor
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### VisualStudioCode Patch ###
# Ignore all local history of files
.history

# End of https://www.gitignore.io/api/node,composer,visualstudiocode

.idea/
File renamed without changes.
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
# flarum-imgur-upload
**flarum-imgur-upload** is a [Flarum](https://github.com/flarum/flarum/) extension to support the upload of images to the popular website [Imgur](https://imgur.com/), and include the direct link of the image in the post.
# flarum-imgur-upload [![Packagist](https://img.shields.io/packagist/v/matteocontrini/flarum-imgur-upload.svg)](https://packagist.org/packages/matteocontrini/flarum-imgur-upload)

>Flarum is a free, open-source forum software built with PHP and Mithril.js.

>Imgur is the best place to share and enjoy the most awesome images on the Internet.
**flarum-imgur-upload** is a [Flarum](https://github.com/flarum/flarum/) extension that allows posting images in Flarum posts using [Imgur](https://imgur.com/) for image hosting.

## Features
With flarum-imgur-upload you can **attach** as many images as you want while writing your post, and it will automatically add the link to the uploaded image in your post!

It uses the Markdown language to include images, so you can also copy the link for other purposes.
With flarum-imgur-upload you can upload images to Imgur while writing your post, and the extension will automatically embed the images in your post. You can also paste from clipboard to upload an image file.

![Demo GIF](https://i.imgur.com/46VYGzz.gif)

## Installation

You can also choose to resize images down to a maximum size before upload, reducing uploading times!
```
composer require matteocontrini/flarum-imgur-upload
```

## Install
The only way to get flarum-imgur-upload is with composer: in your flarum folder run
```
composer require matpompili/flarum-imgur-upload
```
If you previously used `matpompili/flarum-imgur-upload` (the original work on this extension by Matteo Pompili) or `botfactoryit/flarum-imgur-upload`, you should disable and remove those extensions when you upgrade to beta 8.

## Configuration
Since **flarum-imgur-upload** uses Imgur API to upload your images, you will need an Imgur Client-ID. To get one simply register to the [Imgur](https://imgur.com/) website, and register an application [here](https://api.imgur.com/oauth2/addclient).
You need to choose a name for your application (e.g. My Forum), and select *OAuth 2 authorization without a callback URL* (as shown below).
![Imgur application configuration demo](https://i.imgur.com/WIcoUHW.png)

Once your application, which can be even your own website, has been registered, your Client-ID will be available [here](https://imgur.com/account/settings/apps). Simply put it in the configuration of the extension, in your admin page.
Since **flarum-imgur-upload** uses Imgur API to upload your images, you will need an Imgur Client ID.

To get one simply signup to [Imgur](https://imgur.com/), then register an application [here](https://api.imgur.com/oauth2/addclient).
You need to choose a name for your application (e.g. My Forum), and select *Anonymous usage without user authorization*. If the form requires you to set an *Authorization callback URL*, that's a bug. Select *OAuth 2 authorization without a callback URL* to avoid that, or play with the radio buttons a bit.

Once your application has been registered, your Client ID will be available [here](https://imgur.com/account/settings/apps). Copy and paste it in the configuration panel of the extension, through your forum's admin page.

From there you can also set the maximum image size. If images are bigger than that they will be resized (keeping aspect raio) before being uploaded.
## Credits

## Usage
While writing a post, or opening a new discussion, click on the *Attach* button. This will prompt the file chooser, if you're on a computer, or the gallery and/or camera if you're on mobile. After the image to upload has been selected, the uploading process will start (which may take some time, based on the image size and on connection quality). Once the process will be completed, the code to include the image will be automatically added in your composer. Have fun!
The original work for this extension was done by @matpompili.
17 changes: 0 additions & 17 deletions bootstrap.php

This file was deleted.

30 changes: 18 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
{
"name": "matpompili/flarum-imgur-upload",
"description": "Enable the upload of images to imgur directly from the composer",
"version": "v1.0.0",
"name": "matteocontrini/flarum-imgur-upload",
"description": "Simple image upload from the Flarum editor",
"type": "flarum-extension",
"license": "MIT",
"license": "GPL-3.0",
"authors": [
{
"name": "Matteo Pompili",
"email": "[email protected]"
"name": "Matteo Contrini",
"email": "[email protected]"
}
],
"require": {
"flarum/core": "^0.1.0-beta.3"
"flarum/core": "^1.0.0"
},
"extra": {
"flarum-extension": {
"title": "Imgur Upload",
"category": "feature",
"icon": {
"name": "upload",
"backgroundColor": "#000",
"color": "#87d37c"
}
"name": "fas fa-circle",
"backgroundColor": "#272727",
"color": "#85BF25"
},
"optional-dependencies": ["flarum/markdown"]
}
},
"support": {
"issues": "https://github.com/matteocontrini/flarum-imgur-upload/issues",
"source": "https://github.com/matteocontrini/flarum-imgur-upload",
"forum": "https://discuss.flarum.org/d/18491"
},
"autoload": {
"psr-4": {
"Matpompili\\Imgur\\Upload\\": "src/"
"ImgurUpload\\": "src/"
}
}
}
Loading