Plone: Upgrading jQuery

蓝咒 提交于 2019-12-10 16:15:03

问题


Using the jQuery SlickGrid plugin with Plone 4.1 and trying to resize a grid column trips up this jQuery 1.4.4 error, which has been fixed in more recent versions.

Is it possible to upgrade the core version of jQuery as used by Plone, and if so, how can this be done?


回答1:


Updating jQuery in Plone is not trivial because many scripts (including the integration of JQueryTools) depend on jQuery 1.4. JQuery is part of Products.CMFPlone. Thus, the update may break features.

Discussions are underway on the Plone developers mailing list about jQuery and jQuery UI.

Links on the Plone developers mailing list:

  • http://plone.293351.n2.nabble.com/Upgrading-jQuery-and-jQueryTools-for-Plone-4-3-tt7070514.html#none - Upgrading jQuery and jQueryTools for Plone 4.3
  • http://plone.293351.n2.nabble.com/JQueryUI-history-and-futur-and-sunburst-s-important-td7054219.html - JQueryUI history and futur and sunburst's !important



回答2:


You can override the library jquery.js quite easly (like any other file in a skin layer). You have 3 options for doing that:

  1. the fast one: go to Zope Management Interface -> portal_skins -> custom and using the dropdown menu in the top-right corner add a new "File". Id = jquery.js, File = your desired jquery library.

  2. the correct one: create a new package, register a new skin layer and put your jquery library in there (taking care of renaming it in "jquery.js" if necessary).

  3. the other: override that file using z3c.jbot.

Do not edit the file in the file system directly as someone suggested: this is unnecessary and it's a very bad practice.

More info:

  • http://collective-docs.readthedocs.org/en/latest/templates_css_and_javascripts/skin_layers.html


来源:https://stackoverflow.com/questions/8427663/plone-upgrading-jquery

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!