Skip to content

Commit 4fe8914

Browse files
committed
Merge pull request #9 from uploadcare/ditch-php
get rid of php
2 parents 2f080a5 + 50cd5c3 commit 4fe8914

File tree

6 files changed

+51
-341
lines changed

6 files changed

+51
-341
lines changed

.gitmodules

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

README.md

Lines changed: 39 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,64 @@
1-
# Uploadcare CKEDITOR Plugin
1+
# Uploadcare CKEditor Plugin
22

3-
This is a plugin for [CKEDITOR][4] to work with [Uploadcare][1].
3+
This is a plugin for [CKEditor][3] to work with [Uploadcare][1].
44

5-
It's based on a [uploadcare-php][3] library.
5+
## Demo
66

7-
## Requirements
8-
9-
- CKEDITOR 4.0+
10-
11-
## Optional for PHP version.
7+
Minimalistic demo can be found [here][7].
128

13-
- [iframedialog][5] plugin for CKEDITOR
14-
- PHP 5.2+
15-
- php-curl
9+
## Requirements
1610

17-
**Note!** PHP implementation is optional by now and we higly recommend not to use it.
11+
CKEditor 4.0+
1812

1913
## Install
2014

21-
**Warning**: You **must** enable "Automatic file storing" in your account settings.
22-
Please follow https://uploadcare.com/accounts/settings/ to enable feature.
23-
24-
Clone plugin from git to your plugins directory:
25-
26-
git clone git://github.com/uploadcare/uploadcare-ckeditor.git plugins/uploadcare --recursive
15+
Add [plugin](http://ckeditor.com/addon/uploadcare) to CKBuilder or
16+
clone plugin from git to your plugins directory:
2717

28-
Initialize a CKEDITOR plugin with additional params:
18+
git clone git://github.com/uploadcare/uploadcare-ckeditor.git plugins/uploadcare
2919

30-
<script>
31-
UPLOADCARE_PUBLIC_KEY = "demopublickey"; //set publick key for Uploadcare
32-
UPLOADCARE_LOCALE = 'ru'; //set locale if you wish
33-
CKEDITOR.replace( 'editor1', {
34-
extraPlugins: 'uploadcare', // this will enable plugin
35-
toolbar: [
36-
[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', '-', 'Uploadcare' ]
37-
]
38-
});
20+
## Configure
3921

40-
</script>
22+
Initialize a CKEditor plugin with additional params:
4123

42-
## PHP (Optional)
24+
```javascript
25+
UPLOADCARE_PUBLIC_KEY = "demopublickey"; // set public key for Uploadcare
26+
UPLOADCARE_LOCALE = 'ru'; // set locale if you wish
27+
CKEDITOR.replace( 'editor1', {
28+
extraPlugins: 'uploadcare', // this will enable plugin
29+
toolbar: [
30+
// add Uploadcare button to toolbar, e.g.:
31+
['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', '-', 'Uploadcare']
32+
]
33+
});
34+
```
4335

44-
Install iframedialog plugin.
36+
You can heavily customize widget behavior, i.e. file sources, file validation and much more, please
37+
read Uploadcare [widget][5] and [javascript API][6] documentation.
4538

46-
Find a "config.php" file inside plugin directory and edit it:
39+
## File Autostore
4740

48-
<?php
49-
define('UC_PUBLIC_KEY', 'demopublickey');
50-
define('UC_SECRET_KEY', 'demoprivatekey');
41+
"Automatic file storing" **should** be enabled in your project settings.
42+
Please follow https://uploadcare.com/dashboard/ to ensure.
5143

52-
Initialize a CKEDITOR plugin:
53-
54-
<script>
55-
UPLOADCARE_PUBLIC_KEY = "demopublickey"; //set publick key for Uploadcare
56-
UPLOADCARE_LOCALE = 'ru'; //set locale if you wish
57-
CKEDITOR.replace( 'editor1', {
58-
extraPlugins: 'uploadcare,iframedialog', // this will enable plugin. Iframedialog must be enabled in this case!
59-
USE_PHP: true, //this will enable outdated PHP dialog
60-
toolbar: [
61-
[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', '-', 'Uploadcare' ]
62-
]
63-
});
64-
65-
</script>
66-
67-
PHP Version provides an outdated custom dialog. This dialog is used to store files and images and
68-
provides some additional image operations.
44+
If you do not want to enable "Autostore", you can try to use *deprecated* [php-based version][4]
6945

7046
## Usage
7147

72-
### if USE_PHP = false
73-
7448
1. Press "Uploadcare" button.
7549
2. Select a file to upload and press "Upload"
7650
3. Wait for file to be uploaded.
7751
4. Crop an image as you wish.
78-
5. Press "Upload" again. A cropped image will be available inside editor.
52+
5. Click "Done". A cropped image will be available inside editor.
7953

80-
### If USE_PHP = true
54+
## Feedback
8155

82-
1. Press "Uploadcare" button.
83-
2. Select a file to upload.
84-
3. Wait for file to be uploaded. An "Uploadcare" icon will show upload progress.
85-
4. Change any parameters you like.
86-
5. Press "Insert" and an image will be available inside editor.
87-
88-
[1]: http://uploadcare.com/
89-
[2]: https://uploadcare.com/documentation/reference/basic/cdn.html
90-
[3]: https://github.com/uploadcare/uploadcare-php
91-
[4]: http://www.ckeditor.com
92-
[5]: http://www.ckeditor.com/addon/iframedialog
56+
Send any feedback or request support at [email protected]
57+
58+
[1]: https://uploadcare.com/
59+
[2]: https://uploadcare.com/documentation/cdn/
60+
[3]: http://ckeditor.com
61+
[4]: https://github.com/uploadcare/uploadcare-ckeditor/tree/php-dialog
62+
[5]: https://uploadcare.com/documentation/widget/
63+
[6]: https://uploadcare.com/documentation/javascript_api/
64+
[7]: https://uploadcare.com/demos/ckeditor/

config.php

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

dialog.php

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

0 commit comments

Comments
 (0)