Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
langziyang committed May 21, 2023
0 parents commit 151ba80
Show file tree
Hide file tree
Showing 80 changed files with 3,626 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.idea
.DS_Store

/vendor/
/node_modules/
/composer.lock
/.php_cs.cache
/.phpunit.result.cache

/etc/build/*
!/etc/build/.gitignore

/tests/Application/yarn.lock

/behat.yml
/phpspec.yml
/phpunit.xml
Binary file added 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
### Sylius Tinymce plugin

## Description
#### Use tinymce edit product description and short_description

### version 1.0.0
#### this is first version
#### i am sylius plugin beginner, so make sure install on your dev environment test first
#### If you can point out any errors in my code or suggest a better way, please leave a comment.

## Screenshots
![image](1.png)
![image](2.png)

## Installation
1. Run `composer require jinber/sylius-tinymce-plugin`

2. Enable the plugin in bundles.php

```php
<?php
// config/bundles.php

return [
// ...
Jinber\SyliusTinymcePlugin\JinberSyliusTinymcePlugin::class => ['all' => true],
];
```

3. Import the plugin configurations

```yml
# config/packages/_sylius.yaml
imports:
# ...
- { resource: '@JinberSyliusTinymcePlugin/config/config.yaml' }
```
4. Add the shop and admin routes
```yml
# config/routes.yaml
sylius_jinber_tinymce_admin:
resource: '@JinberSyliusTinymcePlugin/config/routes/admin_route.yaml'
prefix: '/admin'
```
5. installing assets
```
php bin/console assets:install
php bin/console cache:clear
```

## Buy me coffee
[![paypal](https://www.paypalobjects.com/digitalassets/c/website/marketing/apac/C2/logos-buttons/optimize/44_Yellow_PayPal_Pill_Button.png)](https://www.paypal.me/jinbercom)
18 changes: 18 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "jinber/sylius-tinymce-plugin",
"type": "sylius-plugin",
"version": "1.0.0",
"license": "MIT",
"autoload": {
"psr-4": {
"Jinber\\SyliusTinymcePlugin\\": "src/"
}
},
"authors": [
{
"name": "langziyang",
"email": "[email protected]"
}
],
"require": {}
}
5 changes: 5 additions & 0 deletions config/admin/admin_ui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sylius_ui:
events:
sylius.admin.product.update.javascripts:
blocks:
jinber_tinymce_javascript: "@JinberSyliusTinymcePlugin/admin/product/javascript.html.twig"
3 changes: 3 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
imports:
- { resource: 'admin/admin_ui.yaml' }
- { resource: 'shop/sylius_ui.yaml'}
3 changes: 3 additions & 0 deletions config/routes/admin_route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
jinber_sylius_tinymce_admin:
resource: '../../src/Controller'
type: annotation
7 changes: 7 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
_defaults:
autowire: true
autoconfigure: true
public: true

Jinber\SyliusTinymcePlugin\Controller\FileManagerController: ~
9 changes: 9 additions & 0 deletions config/shop/sylius_ui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sylius_ui:
events:
sylius.shop.product.show.tab_details:
blocks:
description: '@JinberSyliusTinymcePlugin/shop/Show/Tabs/Details/_description.html.twig'

sylius.shop.product.show.right_sidebar:
blocks:
short_description: '@JinberSyliusTinymcePlugin/shop/Show/_shortDescription.html.twig'
31 changes: 31 additions & 0 deletions public/tinymce.init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// eslint-disable-next-line no-undef
tinymce.init({
selector: 'textarea',
plugins: 'preview importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons',
menubar: 'file edit view insert format tools table help',
toolbar: 'undo redo | bold italic underline strikethrough | fontfamily fontsize blocks | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl',
image_advtab: true,
importcss_append: true,
file_picker_callback(callback) {
// eslint-disable-next-line no-undef
tinymce.activeEditor.windowManager.openUrl({
title: 'Files',
url: '/admin/jinber/tinymce/file_list',
onMessage(api, detail) {
callback(detail.message.src);
// eslint-disable-next-line no-undef
tinymce.activeEditor.windowManager.close();
},
});
},
template_cdate_format: '[Date Created (CDATE): %m/%d/%Y : %H:%M:%S]',
template_mdate_format: '[Date Modified (MDATE): %m/%d/%Y : %H:%M:%S]',
height: 600,
image_caption: true,
quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
noneditable_class: 'mceNonEditable',
// toolbar_mode: 'sliding',
contextmenu: 'link image table',
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }',
convert_urls: false,
});
1 change: 1 addition & 0 deletions public/tinymce/icons/default/icons.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions public/tinymce/langs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is where language files should be placed.

Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/
21 changes: 21 additions & 0 deletions public/tinymce/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.

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.
4 changes: 4 additions & 0 deletions public/tinymce/models/dom/model.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions public/tinymce/plugins/advlist/plugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions public/tinymce/plugins/anchor/plugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions public/tinymce/plugins/autolink/plugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions public/tinymce/plugins/autoresize/plugin.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 151ba80

Please sign in to comment.