Skip to content

Commit

Permalink
renames plugin javascript files
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Apr 25, 2023
1 parent a6ccefd commit 38e3527
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct()
$this->_formScripts[] = "
function toggleEditor() {
if (tinymce.get('block_content') === null) {
tinymce.init({selector: 'textarea#block_content', branding: false, promotion: false, plugins: 'lists advlist directionality image link media nonbreaking preview quickbars openmagevariable'});
tinymce.init({selector: 'textarea#block_content', branding: false, promotion: false, plugins: 'lists advlist directionality image link media nonbreaking preview quickbars openmagevariable openmagewidget'});
} else {
tinymce.get('block_content').remove();
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function _prepareLayout()
$this->_formScripts[] = "
function toggleEditor() {
if (tinymce.get('page_content') === null) {
tinymce.init({selector: 'textarea#page_content', branding: false, promotion: false, plugins: 'lists advlist directionality image link media nonbreaking preview quickbars openmagevariable'});
tinymce.init({selector: 'textarea#page_content', branding: false, promotion: false, plugins: 'lists advlist directionality image link media nonbreaking preview quickbars openmagevariable openmagewidget'});
} else {
tinymce.get('page_content').remove();
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Model/Variable/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getWysiwygPluginSettings($config)
*/
public function getWysiwygJsPluginSrc()
{
return Mage::getBaseUrl('js') . 'mage/adminhtml/wysiwyg/tinymce/plugins/openmagevariable/editor_plugin.js';
return Mage::getBaseUrl('js') . 'mage/adminhtml/wysiwyg/tinymce/plugins/openmagevariable.js';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Widget/Model/Widget/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Mage_Widget_Model_Widget_Config extends Varien_Object
public function getPluginSettings($config)
{
return [
'widget_plugin_src' => Mage::getBaseUrl('js') . 'mage/adminhtml/wysiwyg/tinymce/plugins/openmagewidget/editor_plugin.js',
'widget_plugin_src' => Mage::getBaseUrl('js') . 'mage/adminhtml/wysiwyg/tinymce/plugins/openmagewidget.js',
'widget_images_url' => $this->getPlaceholderImagesBaseUrl(),
'widget_placeholders' => $this->getAvailablePlaceholderFilenames(),
'widget_window_url' => $this->getWidgetWindowUrl($config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
*/

tinymce.PluginManager.add('openmagewidget', (ed, url) => {
ed.addCommand('mceMagentowidget', function() {
widgetTools.openDialog(ed.settings.magentowidget_url + 'widget_target_id/' + ed.getElement().id + '/');
});

// Register Widget plugin button
ed.addButton('magentowidget', {
title : 'magentowidget.insert_widget',
cmd : 'mceMagentowidget',
image : url + '/img/icon.gif'
//TODO: the button doesn't show on the toolbar
ed.ui.registry.addButton('magentowidget', {
text : 'Insert Widget',
onAction: () => {
//TODO: the code of this method needs to be converted to tinymce6
widgetTools.openDialog(ed.settings.magentowidget_url + 'widget_target_id/' + ed.getElement().id + '/');
}
});

// Add a node change handler, selects the button in the UI when a image is selected
// TODO: is this needed? in case, needs to be converted
ed.onNodeChange.add(function(ed, cm, n) {
cm.setActive('magentowidget', false);
if (n.id && n.nodeName == 'IMG') {
Expand All @@ -36,6 +36,7 @@ tinymce.PluginManager.add('openmagewidget', (ed, url) => {
});

// Add a widget placeholder image double click callback
// TODO: all this method needs to be converted
ed.onDblClick.add(function(ed, e) {
var n = e.target;
if (n.id && n.nodeName == 'IMG') {
Expand Down

0 comments on commit 38e3527

Please sign in to comment.