-
Notifications
You must be signed in to change notification settings - Fork 6
[TinyMCE] [テーマ管理:テンプレート編集] カスタムプラグイン「テンプレートの挿入」追加&テーマ管理のテンプレート登録機能を復活 #2199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@gakigaki レビューお願いします。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ご対応ありがとうございます!
ご確認お願いします。
tinymce.PluginManager.add('cc_template', function(editor, url) { | ||
// アイコン定義 see) https://fontawesome.com/search?q=stamp&o=r ※svgコードそのままコピペでは表示されない為、widthとheightを指定 | ||
editor.ui.registry.addIcon( | ||
'clone', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
editor.ui.registry.addIcon()は使わないで、editor.ui.registry.addButton()のiconに 'template' を指定する方がいいかもしれません。
editor.ui.registry.addButton('cc_template', {
icon: 'template',
tooltip: 'テンプレートの挿入',
.......
}
addIcon()はTinyMCEのicon群に使いたいものがないときのカスタム用の関数のようです。
template用のiconは用意されているので、そちらを使っていいのではないかと思いました。
https://www.tiny.cloud/docs/tinymce/latest/editor-icon-identifiers/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なるほど、ありがとうございます。
このドキュメントは見落としてました。
const template = templates[selected_idx] || {}; | ||
preview.innerHTML = ` | ||
<div> | ||
<div>${template.description || ''}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (File::exists($templates_path)) { | ||
$templates_file = File::get($templates_path); | ||
} | ||
else if (File::exists($templates_group_default_path)) { | ||
$templates_file = File::get($templates_group_default_path); | ||
} | ||
else if (File::exists($templates_default_path)) { | ||
$templates_file = File::get($templates_default_path); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改行の仕方がコード規約違反ですが、他の個所もこうなっていましたね。
ここだけ直すかはお任せします!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bladeは上手く動作しないのかな?
ツールでポンなら直したかったけど、全部で22カ所あったので今回は見送ります。
指摘ありがとうございます。
> ./vendor/bin/phpcbf --standard=phpcs.xml C:\sites\connect_cms_php_8030\htdocs\resources\views\plugins\common\wysiwyg.blade.php
PHP Warning: Module "openssl" is already loaded in Unknown on line 0
Warning: Module "openssl" is already loaded in Unknown on line 0
No violations were found
Time: 103ms; Memory: 10MB
@gakigaki 確認ありがとうございます!再レビューおねしゃす! |
修正ありがとうございました! |
概要
主な変更点
補足
レビュー完了希望日
5/29(木)
関連Pull requests/Issues
#2190
参考
イメージ1(ウィジウィグのツールバー)
イメージ2(ダイアログ画面)
DB変更の有無
なし
チェックリスト