Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

HTML5 widgets for Plone

Project Description

Introduction

This addon provide the following HTML5 widgets:

  • color
  • contenteditable (+wysiwyg)
  • datalist
  • date
  • datetime
  • datetime-local
  • email
  • month
  • number
  • password
  • range
  • search
  • tel
  • time
  • url
  • week

Status: young

TODO

  • less copy/paste where it’s possible
  • add tests
  • add support of datalist
  • add contenteditable widget for Text and TextLine

How to install

This addon can be installed has any other addons. please follow official documentation. It doesn’t provide any profile, so you juste have to add it to your zope install.

If you want to support theses widgets on incapable browser you must consider using polyfill.

Some addons which provide polyfills:

  • collective.js.webshims

Widgets review & support

datalist

color

Use it with zope.schema.ASCIILine field:

from zope import schema
from zope import interface
from z3c.form import form, field
from collective.z3cform.html5widgets.widget_color import ColorFieldWidget
class ExampleSchema(interface.Interface):
    color = schema.ASCIILine(title=u"Color", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)
    fields['color'].widgetFactory = ColorFieldWidget

contenteditable

browsers supports:

  • Chrome: 4.0+
  • Safari: 3.1+
  • Safari mobile: 5.0+
  • Firefox: 3.5+
  • Opera: 9.0+
  • Opera mini/mobile: N/A
  • Internet Explore: 5.5 (sic)
  • Android: 3.0+

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
class ExampleSchema(interface.Interface):
    pass
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)

date

Example:

from zope import schema
from zope import interface
from z3c.form import form, field

class ExampleSchema(interface.Interface):
    date = schema.Date(title=u"Date (created)", required=False)

class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)

datetime

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
class ExampleSchema(interface.Interface):
    datetime = schema.Datetime(title=u"Date time (modified)", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)

datetime-local

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
class ExampleSchema(interface.Interface):
    datetime = schema.Datetime(title=u"Date time (modified)", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)

email

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
from collective.z3cform.html5widgets.widget_email import EmailFieldWidget
class ExampleSchema(interface.Interface):
    email = schema.ASCIILine(title=u"Email", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)
    fields['email'].widgetFactory = EmailFieldWidget

month

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
from collective.z3cform.html5widgets.widget_month import MonthFieldWidget
class ExampleSchema(interface.Interface):
    month = schema.Date(title=u"Month", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)
    fields['month'].widgetFactory = MonthFieldWidget

number

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
from collective.z3cform.html5widgets.widget_number import NumberFieldWidget
class ExampleSchema(interface.Interface):
    number = schema.Int(title=u"Number", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)
    fields['number'].widgetFactory = NumberFieldWidget

password

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
class ExampleSchema(interface.Interface):
    password = schema.Password(title=u"Password", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)

range

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
from collective.z3cform.html5widgets.widget_range import RangeFieldWidget
class ExampleSchema(interface.Interface):
    range = schema.Int(title=u"Range", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)
    fields['range'].widgetFactory = RangeFieldWidget

tel

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
from collective.z3cform.html5widgets.widget_tel import TelFieldWidget
class ExampleSchema(interface.Interface):
    tel = schema.ASCIILine(title=u"Telephone", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)
    fields['tel'].widgetFactory = TelFieldWidget

time

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
class ExampleSchema(interface.Interface):
    time = schema.Time(title=u"Time", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)

url

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
class ExampleSchema(interface.Interface):
    url = schema.URI(title=u"URL", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)

week

Example:

from zope import schema
from zope import interface
from z3c.form import form, field
from collective.z3cform.html5widgets.widget_week import WeekFieldWidget
class ExampleSchema(interface.Interface):
    week = schema.Date(title=u"Week", required=False)
class ExampleForm(form.Form):
    fields = field.Fields(ExampleSchema)
    fields['week'].widgetFactory = WeekFieldWidget

Credits

People

Changelog

0.1 (2013-03-21)

  • Package created using templer [JeanMichel aka toutpt]
Release History

Release History

This version
History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
collective.z3cform.html5widgets-0.1.zip (50.6 kB) Copy SHA256 Checksum SHA256 Source Mar 21, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting