-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
from collective.cover.logger import logger | ||
from plone import api | ||
|
||
|
||
SCRIPTS = [ | ||
'++resource++collective.cover/js/contentchooser.js', | ||
'++resource++collective.cover/js/vendor/jquery.endless-scroll.js', | ||
'++resource++collective.cover/js/layout_edit.js', | ||
'++resource++collective.cover/js/main.js', | ||
] | ||
STYLES = [ | ||
'++resource++collective.cover/css/contentchooser.css', | ||
'++resource++collective.cover/css/cover.css', | ||
] | ||
|
||
|
||
def deprecate_resource_registries(setup_tool): | ||
"""Deprecate resource registries.""" | ||
js_tool = api.portal.get_tool('portal_javascripts') | ||
for js in SCRIPTS: | ||
js_tool.unregisterResource(id=js) | ||
assert js not in js_tool.getResourceIds() # nosec | ||
logger.info('Scripts removed') | ||
|
||
css_tool = api.portal.get_tool('portal_css') | ||
for css in STYLES: | ||
css_tool.unregisterResource(id=css) | ||
assert css not in css_tool.getResourceIds() # nosec | ||
logger.info('Styles removed') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
xmlns:genericsetup="http://namespaces.zope.org/genericsetup" | ||
xmlns:i18n="http://namespaces.zope.org/i18n" | ||
i18n_domain="collective.cover"> | ||
|
||
<genericsetup:upgradeSteps | ||
source="22" | ||
destination="23" | ||
profile="collective.cover:default"> | ||
|
||
<genericsetup:upgradeStep | ||
title="Deprecate resource registries" | ||
description="Remove static resources from registries; use a viewlet instead." | ||
handler=".deprecate_resource_registries" | ||
/> | ||
|
||
<genericsetup:upgradeStep | ||
title="Cook CSS resources" | ||
description="There were changes in the CSS files, so we need to cook the resources." | ||
handler="..cook_css_resources" | ||
/> | ||
|
||
<genericsetup:upgradeStep | ||
title="Cook JS resources" | ||
handler="..cook_javascript_resources" | ||
/> | ||
|
||
</genericsetup:upgradeSteps> | ||
|
||
</configure> |