-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from collective/hvelarde-pin-responsivevoice
Use version 1.4 of the ResponsiveVoice API
- Loading branch information
Showing
9 changed files
with
91 additions
and
55 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
from plone import api | ||
|
||
|
||
PROJECTNAME = 'collective.texttospeech' | ||
|
||
# by default, all standard content types will be enabled | ||
DEFAULT_ENABLED_CONTENT_TYPES = [ | ||
'Document', | ||
'News Item' | ||
] | ||
|
||
IS_PLONE_5 = api.env.plone_version().startswith('5') |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
from collective.texttospeech.config import IS_PLONE_5 | ||
from collective.texttospeech.logger import logger | ||
from plone import api | ||
|
||
|
||
NEW_JS = '//code.responsivevoice.org/1.4/responsivevoice.js' | ||
OLD_JS = '//code.responsivevoice.org/responsivevoice.js' | ||
|
||
|
||
def pin_responsivevoice(setup_tool): | ||
"""Use version 1.4 of the ResponsiveVoice API.""" | ||
if IS_PLONE_5: | ||
return # upgrade step not supported under Plone 5 | ||
|
||
portal_js = api.portal.get_tool('portal_javascripts') | ||
if OLD_JS in portal_js.getResourceIds(): | ||
# HACK: can not use portal_js.renameResource | ||
# see: https://github.com/plone/Products.ResourceRegistries/pull/20 | ||
portal_js.getResource(OLD_JS)._data['id'] = NEW_JS | ||
assert NEW_JS in portal_js.getResourceIds() | ||
logger.info('ResponsiveVoice version updated to 1.4.') |
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