コード例 #1
0
class NewsTickerSettingsEditForm(controlpanel.RegistryEditForm):
    schema = INewsTickerSettings
    label = _(u'News Ticker Settings')
    description = _(u'Here you can modify the settings for '
                    'collective.newsticker.')

    def updateFields(self):
        super(NewsTickerSettingsEditForm, self).updateFields()

    def updateWidgets(self):
        super(NewsTickerSettingsEditForm, self).updateWidgets()
コード例 #2
0
class INewsTickerSettings(Interface):
    """Interface for the form on the control panel.
    """
    html_source = schema.Choice(
        title=_(u'News ticker source'),
        description=_('help_html_source',
                      default=u'Select a collection from the list. Query '
                      'results will be used as the source for the news '
                      'ticker.'),
        required=True,
        vocabulary=u'collective.newsticker.NewsSources',
    )

    titleText = schema.TextLine(
        title=_(u'Title text'),
        description=_('help_title_text',
                      default=u'To remove the title set this to an empty '
                      'string.'),
        required=True,
        defaultFactory=default_title_text,
        missing_value=u'',
    )

    speed = schema.Float(
        title=_(u'Display speed'),
        description=_(
            'help_speed', u'The speed at which the ticker items appear on the '
            'screen. Values go from 0.0 - 1.0.'),
        required=True,
        default=0.10,
        min=0.0,
        max=1.0,
    )

    pauseOnItems = schema.Int(
        title=_(u'Time items appear on screen'),
        description=_(
            'help_pause_on_items', u'The time, in miliseconds (ms), that each '
            'ticker item appears on the screen.'),
        required=True,
        default=2000,
        min=0,
    )

    controls = schema.Bool(
        title=_(u'Controls'),
        description=_('help_controls',
                      default=u'Whether or not to show the jQuery News '
                      'Ticker controls.'),
        default=False,
    )
コード例 #3
0
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm

from collective.newsticker import _

# based on jQuery News Ticker v1.7 (http://www.jquerynewsticker.com/)
SPEED = 0.10        # The speed of the reveal
AJAX_FEED = False   # Populate jQuery News Ticker via a feed
FEED_URL = ''       # The URL of the feed
                    # **Must be on the same domain as the ticker**
FEED_TYPE = 'xml'   # Currently only XML
HTML_FEED = not AJAX_FEED  # Populate jQuery News Ticker via HTML
DEBUG_MODE = True   # Show some helpful errors in the console or as alerts
                    # **Should be set to False for production sites**
CONTROLS = True     # Whether or not to show the jQuery News Ticker controls
TITLE_TEXT = _(u'Latest')  # To remove the title set this to an empty string

DISPLAY_TYPE = SimpleVocabulary([  # Animation type
    SimpleTerm(value='reveal', title=_(u'Reveal')),
    SimpleTerm(value='fade', title=_(u'Fade')),
    ])

DIRECTION = SimpleVocabulary([  # Ticker direction
    SimpleTerm(value='ltr', title=_(u'Left-to-Right')),
    SimpleTerm(value='rtl', title=_(u'Right-to-Left')),
    ])

PAUSE_ON_ITEMS = 2000   # The pause on a news item before being replaced
FADE_IN_SPEED = 600     # Speed of fade in animation
FADE_OUT_SPEED = 300    # Speed of fade out animation
コード例 #4
0
# -*- coding: utf-8 -*-
from collective.newsticker import _


PROJECTNAME = 'collective.newsticker'
TITLE_TEXT = _(u'Latest')  # To remove the title set this to an empty string
コード例 #5
0
class NewsTickerSettingsEditForm(controlpanel.RegistryEditForm):

    schema = INewsTickerSettings
    label = _(u'News Ticker')
    description = _(u'Here you can modify the settings for collective.newsticker.')
コード例 #6
0
class INewsTickerSettings(Interface):
    """Interface for the form on the control panel."""

    enabled = schema.Bool(
        title=_(u'Enabled?'),
        description=_(
            'help_enabled',
            default=u'Control whether or not the ticker will be shown.'),
        default=True,
    )

    html_source = schema.Choice(
        title=_(u'News Ticker Source'),
        description=_(
            'help_html_source',
            default=u'Select a collection from the list. '
                    u'Results will be used as the source for the News Ticker.'),
        required=True,
        vocabulary=u'collective.newsticker.NewsSources',
    )

    limit = schema.Int(
        title=_(u'Limit Results'),
        description=_(
            'help_limit',
            default=u'Specify the maximum number of items to show. '
                    u'Set to 0 to show all items in the collection.'),
        required=True,
        default=0,
        min=0,
    )

    titleText = schema.TextLine(
        title=_(u'Title Text'),
        description=_(
            'help_title_text',
            default=u'To remove the title set this to an empty string.'),
        required=False,
        default=TITLE_TEXT,
    )

    displayType = schema.Choice(
        title=_(u'Animation Type'),
        description=_(
            'help_display_type',
            default=u'Current options are "reveal" or "fade".'),
        required=True,
        default='reveal',
        values=['reveal', 'fade'],
    )

    speed = schema.Float(
        title=_(u'Display Speed'),
        description=_(
            'help_speed',
            default=u'The speed at which ticker items appear on the screen. '
                    u'Values go from 0.0 - 1.0.'),
        required=True,
        default=0.10,
        min=0.0,
        max=1.0,
    )

    pauseOnItems = schema.Int(
        title=_(u'Time items appear on screen'),
        description=_(
            'help_pause_on_items',
            default=u'The time, in miliseconds (ms), '
                    u'that each ticker item appears on the screen.'),
        required=True,
        default=2000,
        min=0,
    )

    controls = schema.Bool(
        title=_(u'Show Controls?'),
        description=_(
            'help_controls',
            default=u'Whether or not to show the ticker controls.'),
        default=False,
    )