【问题标题】:Does a Magento update overwrite changes in the js folder?Magento 更新会覆盖 js 文件夹中的更改吗?
【发布时间】:2013-09-26 21:30:30
【问题描述】:

我对 /js/mage/adminhtml/wysiwyg/tiny_mce 目录中的 setup.js 设置文件进行了一些更改。 升级后这些更改会丢失吗?有没有办法像创建前端主题一样复制这个文件夹?

谢谢

【问题讨论】:

  • 是的,/app、/lib、/js、/skin 在升级中都会看到它们的关键文件被覆盖。

标签: magento tinymce upgrade


【解决方案1】:

是的, 您可以在JS文件夹中添加您的自定义文件夹,创建您自己的js并粘贴下面的代码,它是覆盖js函数,并在您需要的地方调用它

if (typeof tinyMceWysiwygSetup != 'undefined') {
  tinyMceWysiwygSetup.addMethods({
      //here is example for you, suppose if you have changed something in below function
      initialize: function(htmlId, config)
    {
        this.id = htmlId;
        this.config = config;
        varienGlobalEvents.attachEventHandler('tinymceChange', this.onChangeContent.bind(this));
        this.notifyFirebug();
        if(typeof tinyMceEditors == 'undefined') {
            tinyMceEditors = $H({});
        }
        tinyMceEditors.set(this.id, this);

        // Paste here your custom code
    }
  });
}

这可能对你有帮助。

【讨论】:

    猜你喜欢
    • 2012-11-12
    • 2013-08-28
    • 1970-01-01
    • 2015-06-16
    • 1970-01-01
    • 1970-01-01
    • 2022-01-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多