コード例 #1
0
class IHistoryPlugin(Interface):
    """ Enable/Disable History plugin
        http://galleria.io/docs/1.2/plugins/picasa/
    """

    history = schema.Bool(
        title=_(u"Enable history plugin"),
        description=_(u""),
        default=False,
    )
コード例 #2
0
class GalleriaSettingsEditForm(controlpanel.RegistryEditForm):
    """ Control Panel """
    schema = IGalleriaSettings
    fields = field.Fields(IGeneralSettings)
    groups = FormGroup1, FormGroup2, FormGroup3, FormGroup4
    label = _(u"Galleria settings")
    description = _(u"""""")

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

    def updateWidgets(self):
        super(GalleriaSettingsEditForm, self).updateWidgets()

    def getContent(self):
        return AbstractRecordsProxy(self.schema)
コード例 #3
0
class IPicasaPlugin(Interface):
    """ Enable/Disable Picasa plugin
        http://galleria.io/docs/1.2/plugins/picasa/
    """

    picasa = schema.Bool(
        title=_(u"Enable picasa plugin"),
        description=_(u""),
        default=False,
    )

    picasa_max = schema.Int(
        title=_(u"Maximum number of photos."),
        description=_(
            u"Maximum number of photos to return (maximum value 100)."),
        default=20,
        required=True,
    )

    picasa_desc = schema.Bool(
        title=_(u"Show Description"),
        description=
        _(u"The plugin fetches the title per default. If you also wish to fetch the description, set this option to true."
          ),
        default=False)
コード例 #4
0
class IFaceBookPlugin(Interface):
    """ Enable/Disable FaceBook plugin
    """

    facebook = schema.Bool(
        title=_(u"Enable facebook plugin"),
        description=_(u""),
        default=False,
    )

    facebook_max = schema.Int(
        title=_(u"Maximum number of photos."),
        description=_(
            u"Maximum number of photos to return (maximum value 100)."),
        default=20,
        required=True,
    )

    facebook_desc = schema.Bool(
        title=_(u"Show Description"),
        description=
        _(u"The plugin fetches the title per default. If you also wish to fetch the description, set this option to true."
          ),
        default=False)
コード例 #5
0
    from plone.app.folder.folder import IATUnifiedFolder as IFolder
    from Products.ATContentTypes.interfaces.link import IATLink as ILink
    from Products.ATContentTypes.interfaces.topic import IATTopic as ITopic
    from Products.ATContentTypes.interfaces.image import IATImage as IImage
except ImportError, e:
    logger.info('switch to plone3 %s' % e)
    #plone3
    from Products.ATContentTypes.interface import IATFolder as IFolder
    from Products.ATContentTypes.interface import IATLink as ILink
    from Products.ATContentTypes.interface import IATTopic as ITopic
    from Products.ATContentTypes.interface import IATImage as IImage

from sc.galleria.support import MessageFactory as _

transitionsvoc = SimpleVocabulary(
    [SimpleTerm(value='fade', title=_(u'Fade')),
     SimpleTerm(value='flash', title=_(u'Flash')),
     SimpleTerm(value='pulse', title=_(u'Pulse')),
     SimpleTerm(value='slide', title=_(u'Slide')),
     SimpleTerm(value='fadeslide', title=_(u'FadeSlide')), ]
)

thumbnailsvoc = SimpleVocabulary(
    [SimpleTerm(value='show', title=_(u"Show thumbnails")),
     SimpleTerm(value='empty', title=_(u"Don't show thumbnails")), ]
)


class IGalleriaLayer(Interface):
    """
    Marker Default browser layer this product.
コード例 #6
0
class IGeneralSettings(Interface):
    """Some general settings.
       These fields will appear on the 'Default' tab.
       Option informations: http://galleria.io/docs/1.2/options/
    """

    autoplay = schema.Bool(
        title=_(u"Auto Play."),
        description=_(u"Sets Galleria to play slidehow when initialized."),
        default=True,
        required=True,
    )

    gallery_wait = schema.Int(
        title=_(u"Gallery Wait"),
        description=
        _(u"Sets how long Galleria should wait when trying to extract measurements."
          ),
        default=5000,
        required=True,
    )

    showInf = schema.Bool(
        title=_(u"Show informations"),
        description=_(u"Toggles the caption."),
        default=True,
        required=True,
    )

    gallery_width = schema.Int(
        title=_(u"Gallery width"),
        description=_(u"Manually set a gallery width."),
        default=500,
        required=True,
    )

    gallery_height = schema.Int(
        title=_(u"Gallery height"),
        description=_(u"Manually set a gallery height."),
        default=500,
        required=True,
    )

    imagePosition = schema.TextLine(
        title=_(u"Image css position"),
        description=_(u"Eg. 'top right' or '20% 100%'"),
        default=_(u'center'),
        required=True,
    )

    lightbox = schema.Bool(
        title=_(u"Enable lightbox"),
        default=False,
        required=True,
    )

    showCounting = schema.Bool(
        title=_(u"Show counting"),
        description=_(u"Toggles the counter."),
        default=True,
        required=True,
    )

    transitions = schema.Choice(
        title=_(u"Transitions"),
        description=_(u"Defines what transition to use."),
        default=_(u'fade'),
        vocabulary=transitionsvoc,
        required=True,
    )

    transitionSpeed = schema.Int(
        title=_(u"Transition Speed"),
        description=_(u"Defines the speed of the transition."),
        default=400,
        required=True,
    )

    showimagenav = schema.Bool(
        title=_(u"show image navigation"),
        description=_(u"toggles the image navigation arrows."),
        default=True,
        required=True,
    )

    swipe = schema.Bool(
        title=_(u"swipe"),
        description=
        _(u"Enables a swipe movement for flicking through images on touch devices."
          ),
        default=True,
        required=True,
    )

    selector = schema.TextLine(
        title=_(u"Selector jQuery"),
        description=
        _(u"Eg. '#content-core' or '#content' or '.galleria'. Do not change if you do not know what I mean."
          ),
        default=u"#content-galleria",
        required=True,
    )

    thumbnails = schema.Choice(
        title=_(u"Show Thumbnails"),
        description=_(u"Sets the creation of thumbnails"),
        default=_(u'show'),
        vocabulary=thumbnailsvoc,
        required=True,
    )

    imagecrop = schema.Bool(
        title=_(u"Enable image crop"),
        description=
        _(u"Defines how the main image will be cropped inside it is container."
          ),
        default=True,
        required=True,
    )

    responsive = schema.Bool(
        title=_(u"Sets Gallery in responsive mode"),
        description=
        _(u"Means that it will resize the entire container in dynamic proportions added in your CSS."
          ),
        default=True,
        required=True,
    )

    debug = schema.Bool(
        title=_(u"Enable debug mode"),
        description=_(u"Set this to false to prevent debug messages."),
        default=False,
        required=True,
    )
コード例 #7
0
class FormGroup4(group.Group):
    label = _(u"FaceBook Plugin")
    fields = field.Fields(IFaceBookPlugin)
コード例 #8
0
class FormGroup3(group.Group):
    label = _(u"History Plugin")
    fields = field.Fields(IHistoryPlugin)
コード例 #9
0
class FormGroup2(group.Group):
    label = _(u"Picasa Plugin")
    fields = field.Fields(IPicasaPlugin)
コード例 #10
0
class FormGroup1(group.Group):
    label = _(u"Flickr Plugin")
    fields = field.Fields(IFlickrPlugin)
コード例 #11
0
    from plone.app.folder.folder import IATUnifiedFolder as IFolder
    from Products.ATContentTypes.interfaces.link import IATLink as ILink
    from Products.ATContentTypes.interfaces.topic import IATTopic as ITopic
    from Products.ATContentTypes.interfaces.image import IATImage as IImage
except ImportError, e:
    logger.info('switch to plone3 %s' % e)
    #plone3
    from Products.ATContentTypes.interface import IATFolder as IFolder
    from Products.ATContentTypes.interface import IATLink as ILink
    from Products.ATContentTypes.interface import IATTopic as ITopic
    from Products.ATContentTypes.interface import IATImage as IImage

from sc.galleria.support import MessageFactory as _

transitionsvoc = SimpleVocabulary([
    SimpleTerm(value='fade', title=_(u'Fade')),
    SimpleTerm(value='flash', title=_(u'Flash')),
    SimpleTerm(value='pulse', title=_(u'Pulse')),
    SimpleTerm(value='slide', title=_(u'Slide')),
    SimpleTerm(value='fadeslide', title=_(u'FadeSlide')),
])

thumbnailsvoc = SimpleVocabulary([
    SimpleTerm(value='show', title=_(u"Show thumbnails")),
    SimpleTerm(value='empty', title=_(u"Don't show thumbnails")),
])


class IGalleriaLayer(Interface):
    """
    Marker Default browser layer this product.
コード例 #12
0
    from Products.ATContentTypes.interfaces.topic import IATTopic as ITopic
    from Products.ATContentTypes.interfaces.image import IATImage as IImage
    from Products.ZCatalog.interfaces import ICatalogBrain
except ImportError, e:
    logger.info("switch to plone3 %s" % e)
    # plone3
    from Products.ATContentTypes.interface import IATFolder as IFolder
    from Products.ATContentTypes.interface import IATLink as ILink
    from Products.ATContentTypes.interface import IATTopic as ITopic
    from Products.ATContentTypes.interface import IATImage as IImage

from sc.galleria.support import MessageFactory as _

transitionsvoc = SimpleVocabulary(
    [
        SimpleTerm(value="fade", title=_(u"Fade")),
        SimpleTerm(value="flash", title=_(u"Flash")),
        SimpleTerm(value="pulse", title=_(u"Pulse")),
        SimpleTerm(value="slide", title=_(u"Slide")),
        SimpleTerm(value="fadeslide", title=_(u"FadeSlide")),
    ]
)

thumbnailsvoc = SimpleVocabulary(
    [
        SimpleTerm(value="show", title=_(u"Show thumbnails")),
        SimpleTerm(value="empty", title=_(u"Don't show thumbnails")),
    ]
)