Skip to main content

Plone Mockup is an ongoing effort to modernize Plone’s javascript story. Check out examples and documentation at http://plone.github.io/mockup/

The Goals of Mockup

  1. Standardize configuration of patterns implemented in js to use HTML data attributes, so they can be developed without running a backend server.

  2. Use modern AMD approach to declaring dependencies on other js libs.

  3. Full unit testing of js

Install & Run Tests

Install Node version 0.10 or greater

Install using package manager, e.g. apt or yum

Install without using package manager

Install PhantomJS

Download and install PhantomJS

Maybe use your package manager:

$ apt-get install phantomjs

Now git clone & build Mockup:

$ git clone https://github.com/plone/mockup.git
$ cd mockup
$ make bootstrap

Run tests with PhantomJS:

$ make test

Run tests with Chrome:

$ make test-dev

Generate widgets.pot file in the working directory for Plone translations:

$ make i18n-dump

If you are currently in the buildout.coredev/src/mockup folder and want to update the translations in plone.app.locales, first go back in the buildout.coredev folder, copy widgets.pot in the plone.app.locales package and resync the po files like this:

$ cd ../..
$ cp src/mockup/widgets.pot src/plone.app.locales/plone/app/locales/locales/widgets.pot
$ bin/buildout -c experimental/i18n.cfg  # to have the bin/i18n command
$ bin/i18n widgets

If you did some changes in the js files and want to test them live in Plone:

  • go to Site Setup -> Resource Registries

  • click on the “Development Mode (only logged in users)” checkbox

  • click on the “Develop Javascript” button for the plone-editor-tools bundle (for folder contents changes, may be another bundle for an other pattern)

  • click the “Save” button

  • refresh your page (folder contents for example)

To have the js changes in the next Plone release, you need to build the bundles, see README of plone.staticresources You may be interested reading JavaScript For Plone Developers and Resource Registry documentation too.

To test a translation, for example French:

  • edit the po file src/plone.app.locales/plone/app/locales/locales/fr/LC_MESSAGES/widgets.po

  • restart your instance to rebuild the mo file from the po file

  • purge your localStorage and refresh the page to trigger a new download of the translations

The translations are handled by mockup/js/i18n.js that calls the plonejsi18n view defined in plone.app.content to generate a json of the translations from the mo file. The plonejsi18n view is called one time for a given domain and language and the result is cached in localStorage for 24 hours. The only way to test the new translations is to restart the instance to update the mo file from the po file, and then to purge the localStorage to trigger a new download of the translations.

License

The BSD 3-Clause License. Copyrights hold the Plone Foundation. See LICENSE.rst for details.

Credits

Originally created by Rok Garbas using parts of Patterns library. Now maintained by the Plone Foundation.

Status of builds

Travis CI Coveralls Bitdeli

Release files for mockup 4.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mockup 4.0.2
File Size Uploaded
mockup-4.0.2.tar.gz 531.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mockup 4.0.2
File Interpreter ABI Platform
mockup-4.0.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 1.2 MB

Release files / mockup-4.0.2.tar.gz

Download URL mockup-4.0.2.tar.gz
Size 531.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8139aff6ee0698eedfbc6526a6916f358ff5e1253d087e5e3d6f8a0f7e3c4677
BLAKE2b-256 checksum
How to use checksums
7ed9b5e8ad14fd6445660e1956a6f071c58f19e9ee622985b5b14c82901742ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

Release files / mockup-4.0.2-py2.py3-none-any.whl

Download URL mockup-4.0.2-py2.py3-none-any.whl
Size 701.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
06f620d0ff0a7cf2154c5797567ead34dc923beeb8ba2958189553d4e1ca7217
BLAKE2b-256 checksum
How to use checksums
1228704c1c14794fe8adfb592b08a209e592e8924d9ac8109662b3d0dc2ade50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

Release history Release notifications | RSS feed

This release

4.0.2 This release

2 release files

4.0.1

2 release files

4.0.0

2 release files

3.2.8

2 release files

3.2.7

2 release files

3.2.6

2 release files

3.2.5

2 release files

3.2.4

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.7.9

2 release files

2.7.8

2 release files

2.7.7

2 release files

2.7.6

2 release files

2.7.5

2 release files

2.7.4

2 release files

2.7.3

2 release files

2.7.2

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.2

1 release file

2.6.1

1 release file

2.6.0

1 release file

2.5.1

1 release file

2.5.0

1 release file

2.4.1

1 release file

2.4.0

1 release file

2.3.0

1 release file

2.2.0

1 release file

2.1.9

1 release file

2.1.8

1 release file

2.1.7

1 release file

2.1.6

1 release file

2.1.5

1 release file

2.1.4

1 release file

2.1.3

1 release file

2.1.2

1 release file

2.1.1

1 release file

2.1.0

1 release file

2.0.12

1 release file

2.0.11

1 release file

2.0.10

1 release file

2.0.9

1 release file

2.0.8

1 release file

2.0.7

1 release file

2.0.6

1 release file

2.0.5

1 release file

2.0.4

1 release file

2.0.3

1 release file

2.0.2

1 release file

1.8.2

1 release file

1.8.2dev

1.8.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page