{ "info": { "author": "Kevin Bieri", "author_email": "mailto:info@4teamwork.ch", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Framework :: Plone :: 4.3", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Introduction\n============\n\n.. contents:: Table of Contents\n\nThis package provides a javascript library to make gallery overlays such as `Lightbox `_.\nBut the main difference is that you have full control over the rendering and fetching of gallery items.\n\nThe gallery is able to notify if the user has reached the first or last item. This can be useful when more items\nshould be loaded as a batch.\n\nThe items of the gallery can be extended or reset.\n\nThe gallery always tracks the active item.\n\nAn API provides a way to control the gallery from outside.\n\n\nInstallation\n------------\n\nAdd the package as dependency to your setup.py:\n\n.. code:: python\n\n setup(...\n install_requires=[\n 'ftw.showroom',\n ])\n\nor to your buildout configuration:\n\n.. code:: ini\n\n [instance]\n eggs += ftw.showroom\n\nand rerun buildout.\n\nInstall the Generic Setup profile.\n\nCompatibility\n-------------\n\nPlone 4.3\n\n.. image:: https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Plone-logo.svg/2000px-Plone-logo.svg.png\n :target: https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Plone-logo.svg/2000px-Plone-logo.svg.png\n :height: 50px\n\nJavaScript development\n======================\n\nBuilding\n--------\n\nRebuilding the library (resources/javascript.js):\n\n.. code-block:: bash\n\n grunt build\n\nWatching for changes and rebuild the bundle automatically:\n\n.. code-block:: bash\n\n grunt watch\n\nor the default task\n\n.. code-block:: bash\n\n grunt watch\n\nTesting\n-------\n\nRunning all test:\n\n.. code-block:: bash\n\n npm test\n\nor\n\n.. code-block:: bash\n\n grunt test\n\nRunning a specific test:\n\n.. code-block:: bash\n\n grunt test --grep=\"Name of your test\"\n\nLinks\n-----\n\n- Github: https://github.com/4teamwork/ftw.showroom\n- Issues: https://github.com/4teamwork/ftw.showroom/issues\n- Pypi: http://pypi.python.org/pypi/ftw.showroom\n- Continuous integration: https://jenkins.4teamwork.ch/search?q=ftw.showroom\n\n\nCopyright\n----------\n\nThis package is copyright by `4teamwork `_.\n\n``ftw.showroom`` is licensed under GNU General Public License, version 2.\n\nClient library\n==============\n\nGetting Started\n---------------\n\nThe client library depends on `Grunt `_. Assuming\nyou already have **Node.js** installed on your system, run the following command:\n\n.. code:: bash\n\n sudo npm install -g grunt\n\nTo install the dependencies, run the following command:\n\n.. code:: bash\n\n npm install\n\nAnd with **npm** you get the following packages:\n\n- `Grunt `_ - JavaScript task runner.\n- `Babel `_ - ES6 Transpiler.\n- `Browserify `_ - Dependency Bundler\n- `Karma `_ - JavaScript test runner.\n- `Jasmine `_ - JavaScript test suite.\n- `Chai `_ - JavaScript Assertion Library.\n\nUsage\n-----\n\nRun the following command to re-build the library:\n\n.. code:: bash\n\n grunt build\n\nRun the following command to watch for changes which trigger a rebuild:\n\n.. code:: bash\n\n grunt\n\nBuild options\n-------------\n\nSee https://github.com/substack/browserify-handbook for more information about browserify.\n\nSource Maps\n-----------\n\nBrowserify comes with a built-in support to generate source maps. It is already enabled by default, but feel free to disable source maps. Refer to `this article `_\nto enable source maps in Google Chrome, if you haven't already done so.\n\nTests\n-----\n\nRun all tests\n\n.. code:: bash\n\n grunt test\n\nRun a specific test\n\n.. code:: bash\n\n grunt test --grep=\"Name of your test\"\n\nInitialization\n--------------\n\nCreates an empty showroom instance with default options\n\n.. code:: javascript\n\n let showroom = Showroom();\n\nThe showroom constructor accepts a `NodeList `_ or a `jQuery `_.\nThe items can provide a target as an HTML data attribute (**data-showroom-target**) to define the endpoint where the item will fetch its content from.\nTo make a title visible in the overlay provide a title as an HTML data attribute (**data-showroom-title**).\n\n.. code:: HTML\n\n \n\n.. code:: javascript\n\n let items = document.querySelectorAll(\".item\");\n let showroom = Showroom(items);\n\nor\n\n.. code:: javascript\n\n let items = $(\".item\");\n let showroom = Showroom(items);\n\nConfiguration\n-------------\n\nThe showrooms provide the following options.\n\n+---------------+--------------------------+--------------------------------------------------------------------------+\n| Option | Default | Description |\n+===============+==========================+==========================================================================+\n| cssClass | \"ftw-showroom\" | Class attribute on the root element of the gallery |\n+---------------+--------------------------+--------------------------------------------------------------------------+\n| render | See rendering_. section | Override the default render behavior |\n+---------------+--------------------------+--------------------------------------------------------------------------+\n| tail | Empty function | Called when the user reaches the last element of the gallery |\n+---------------+--------------------------+--------------------------------------------------------------------------+\n| head | Empty function | Is getting called when the user reaches the first element of the gallery |\n+---------------+--------------------------+--------------------------------------------------------------------------+\n| fetch | See fetching_. section | Override the default fetch behavior |\n+---------------+--------------------------+--------------------------------------------------------------------------+\n| beforeRender | noop | Hook to augment the item for example |\n+---------------+--------------------------+--------------------------------------------------------------------------+\n| template | See template section | Override the default gallery template |\n+---------------+--------------------------+--------------------------------------------------------------------------+\n| target | body Element | Define a selector where the gallery will be attached |\n+---------------+--------------------------+--------------------------------------------------------------------------+\n| offset | 0 | Offset for the current item counter, useful for batches |\n+---------------+--------------------------+--------------------------------------------------------------------------+\n\n.. _events:\n\nEvents\n------\n\nftw.showroom fires the following events on `document`:\n\n+---------------------+----------+-----------------------------------------------------------------------------------------------------------+\n| Event | Params | Description |\n+=====================+==========+===========================================================================================================+\n| showroom:item:shown | showroom | Invoked every time an item is shown, so if showroom opens, every time the selected showroom item changes. |\n+---------------------+----------+-----------------------------------------------------------------------------------------------------------+\n\nTo listen to an event use the following code:\n\n.. code:: javascript\n\n $(document).on('showroom:item:shown', function (showroom) {\n // do something with the showroom/item\n })\n\n\n.. _fetching:\n\nFetching\n--------\n\nThe default fetching function uses the target provided by each item to make an AJAX call to retrieve its content.\n\n.. code:: javascript\n\n function fetch(item) { return $.get(item.target); };\n\nThis function can be overridden, see Configuration_.\n\n.. code:: javascript\n\n let showroom = Showroom(items,\n {\n fetch: (item) => { return \"

Some other content

\"; }\n }\n );\n\n\n.. _rendering:\n\nRendering\n---------\n\nThe default rendering function returns an HTML string using the default `Handlebars `_ template\npadding the internal showroom data, the prefeteched content and the active item.\n\n.. code:: javascript\n\n function render(content) {\n return $.when(content).pipe((content) => {\n return $(template({ showroom: data, content: content, item: register.current }));\n });\n }\n\nThis function can be overridden, see Configuration_.\n\n.. code:: javascript\n\n let showroom = Showroom(items,\n {\n render: (content) => { return $(template()); }\n }\n );\n\nReferences\n----------\n\nReferences are useful if you want to open a showroom item that is referenced by more than one element on the same page.\nYou just have to add the **showroom-reference** class and the **data-showroom-target-item** attribute to make the connection.\nThe **data-showroom-target-item** attribute contains an id which references a showroom item on the page.\nYou have to set the **data-showroom-id** by manually on the showroom item to make the connection with the reference.\n\nThere is currently no interface to make the connection manually.\nBut you have to call `showroom.refresh()` to refresh the references.\n\n.. code:: html\n\n \n\n Example\n\n \n\n \n\nAPI\n---\n\n**Showroom.open**\n\nOpens a specific item. If no item is specified the showroom tries to show the first in the store\notherwise it does nothing.\n\n.. code:: javascript\n\n showroom.open();\n\nor\n\n.. code:: javascript\n\n showroom.open(item);\n\n------------\n\n**Showroom.close**\n\nCloses the overlay by hiding the element.\n\n.. code:: javascript\n\n showroom.close();\n\n------------\n\n**Showroom.next**\n\nOpens the next item in the item queue. When the pointer reaches the last item the showroom does nothing.\n\n.. code:: javascript\n\n showroom.next();\n\n------------\n\n**Showroom.prev**\n\nOpens the previous item in the item queue. When the pointer reaches the first item the showroom does nothing.\n\n.. code:: javascript\n\n showroom.prev();\n\n------------\n\n**Showroom.append**\n\nExtend the current item queue with new items. The items are appended at the end of the queue.\nThe pointer remains unaffected.\nThe append method accepts a `NodeList `_ or a `jQuery `_\n\n.. code:: javascript\n\n let newItems = document.querySelectorAll(\".newItems\");\n showroom.append(newItems);\n\nor\n\n.. code:: javascript\n\n let newItems = $(\".newItems\");\n showroom.append(newItems);\n\n------------\n\n**Showroom.prepend**\n\nExtend the current item queue with new items, similar to the ``append`` method, but the items are prepended at the beginning of the queue.\nThe pointer remains unaffected.\nThe prepend method accepts a `NodeList `_ or a `jQuery `_\n\n.. code:: javascript\n\n let newItems = document.querySelectorAll(\".newItems\");\n showroom.prepend(newItems);\n\nor\n\n.. code:: javascript\n\n let newItems = $(\".newItems\");\n showroom.prepend(newItems);\n\n------------\n\n**Showroom.reset**\n\nReset the current item store with new items. The overlay will be closed and the pointer set to `0`.\nTo empty the item store reset with no arguments.\n\n.. code:: javascript\n\n let newItems = document.querySelectorAll(\".newItems\");\n showroom.reset(newItems);\n\nor\n\n.. code:: javascript\n\n let newItems = document.querySelectorAll(\".newItems\");\n showroom.reset();\n\n------------\n\n**Showroom.destroy**\n\nAfter destroying the showroom is no longer able to open any items. The store will be reset and the marker class removed.\nThe overlay will be closed as well.\nAll items will loose their `data-showroom-id`.\n\n.. code:: javascript\n\n\n showroom.destroy();\n\n------------\n\n**Showroom.setTotal**\n\nUpdates the total value and rerenders the opened overlay.\nThe method does only allow numeric values.\n\n.. code:: javascript\n\n showroom.setTotal(34);\n\n------------\n\n**Showroom.setOffset**\n\nUpdates the offset. Prevents negative offsets.\nThe method does only allow numeric values.\n\n.. code:: javascript\n\n showroom.setOffset(42);\n\n------------\n\n**Showroom.refresh**\n\nRefreshes the showroom references.\n\n.. code:: javascript\n\n showroom.refresh();\n\nChangelog\n=========\n\n1.5.1 (2018-03-12)\n------------------\n\n- 1.5.0 Did not work properly, since the dist command was not executed. [mathias.leimgruber]\n\n\n1.5.0 (2018-03-08)\n------------------\n\n- Introduce \"showroom:item:shown\" event\n\n\n1.4.0 (2017-07-11)\n------------------\n\n- Introduce before render hook. [Kevin Bieri]\n\n\n1.3.1 (2016-11-02)\n------------------\n\n- Introduce uninstall profile\n [Kevin Bieri]\n\n- Introduce upgrade steps\n [Kevin Bieri]\n\n- Cleanup version pinnings\n [Kevin Bieri]\n\n\n1.3.0 (2016-10-18)\n------------------\n\n- Refactor event binding using event delegation.\n Since these changes all the showroom items must have `showroom-item` class\n Therefore manually refreshing events is no longer necessary\n [Kevin Bieri]\n\n\n1.2.1 (2016-08-29)\n------------------\n\n- Prevent register#set from calling tail twice\n [Kevin Bieri]\n\n\n1.2.0 (2016-08-23)\n------------------\n\n- Make template configurable\n [Kevin Bieri]\n\n- Introduce showroom references\n [Kevin Bieri]\n\n- Provide offset option for showroom.\n The offset is added to the current number and allows to display correct\n item number for batched items.\n [deiferni]\n\n\n1.1.1 (2016-07-04)\n------------------\n\n- Fix unordered list styles.\n [Kevin Bieri]\n\n\n1.1.0 (2016-06-27)\n------------------\n\n- Provide option to prepend items to the showroom queue.\n [phgross]\n\n\n1.0.0 (2016-05-24)\n------------------\n\n- Nothing changed yet", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/4teamwork/ftw.showroom", "keywords": "ftw plone showroom", "license": "GPL2", "maintainer": "", "maintainer_email": "", "name": "ftw.showroom", "package_url": "https://pypi.org/project/ftw.showroom/", "platform": "", "project_url": "https://pypi.org/project/ftw.showroom/", "project_urls": { "Homepage": "https://github.com/4teamwork/ftw.showroom" }, "release_url": "https://pypi.org/project/ftw.showroom/1.5.1/", "requires_dist": null, "requires_python": "", "summary": "Javascript library to make gallery overlays", "version": "1.5.1" }, "last_serial": 5823494, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "0929a95dc2991d1b0300cb9be0aed7ec", "sha256": "a957b14c8fe53dfc2f7eeaf6755562c1b9694381ad138562cc0de33ea63685d4" }, "downloads": -1, "filename": "ftw.showroom-1.0.0.tar.gz", "has_sig": false, "md5_digest": "0929a95dc2991d1b0300cb9be0aed7ec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 60647, "upload_time": "2016-05-24T16:12:31", "url": "https://files.pythonhosted.org/packages/39/84/a0a64fcae84233560c2d249bf5f2d3e9cfc7deed6a26de521dc438b69f7a/ftw.showroom-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "2a379c07f8a2df990c15f82a565079c9", "sha256": "6da3d9e40eb19d77a04db26bd2ab4933238e645ae6a8a10fd20115f9a6393e26" }, "downloads": -1, "filename": "ftw.showroom-1.1.0.zip", "has_sig": false, "md5_digest": "2a379c07f8a2df990c15f82a565079c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 77649, "upload_time": "2016-06-27T15:14:05", "url": "https://files.pythonhosted.org/packages/5b/e2/a1312c6483dca5bc552472f3d15055c148b17f3fd678d90beb4a3801fc46/ftw.showroom-1.1.0.zip" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "b608f0679f2159baedba4014598ae98f", "sha256": "b4ca11a260983e8a9c497b7854da0b4f5baa14ea97cfa629f814d47c1ab58529" }, "downloads": -1, "filename": "ftw.showroom-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b608f0679f2159baedba4014598ae98f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 65129, "upload_time": "2016-07-04T09:22:22", "url": "https://files.pythonhosted.org/packages/cb/7f/f306010e6c2ee620358d0e9ec63dfea273a9130cbe6829ffcf86905e3502/ftw.showroom-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "77f02c7588418647a07a447ca81db4cb", "sha256": "5f17746b1e1b1c1b48380b869ff9951f568ed737c28fa3ad9c12ffaa4dc506d0" }, "downloads": -1, "filename": "ftw.showroom-1.2.0.zip", "has_sig": false, "md5_digest": "77f02c7588418647a07a447ca81db4cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 81287, "upload_time": "2016-08-23T13:25:38", "url": "https://files.pythonhosted.org/packages/e2/95/ed2915bb4e6093e964dbfe5a38446ce61048e84210e185ff1d1cf9e6d0a7/ftw.showroom-1.2.0.zip" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "b7faedcfcb608ee7db51de818847a7d4", "sha256": "aa44711ee8456042ace1d8be1925d95f4c62ce71fe9de9c988be99216f27a393" }, "downloads": -1, "filename": "ftw.showroom-1.2.1.zip", "has_sig": false, "md5_digest": "b7faedcfcb608ee7db51de818847a7d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 81507, "upload_time": "2016-08-29T08:02:14", "url": "https://files.pythonhosted.org/packages/af/aa/0e36c2e93ab91db08eeb06eeb1e4bed338d0a5e833b5e22f92607024dd99/ftw.showroom-1.2.1.zip" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "95cb8f73d3a512447a5c2decd3d26a47", "sha256": "a6d93f5317b31f8c7e53dc6f946ba244b6ac79658ada1011597e61afa0c6cba0" }, "downloads": -1, "filename": "ftw.showroom-1.3.0.tar.gz", "has_sig": false, "md5_digest": "95cb8f73d3a512447a5c2decd3d26a47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67756, "upload_time": "2016-10-18T12:11:33", "url": "https://files.pythonhosted.org/packages/7e/a2/70f61dc17b72ef878a098634c528428cb482a713d130917c908eabbf8a0e/ftw.showroom-1.3.0.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "23623e0fca0f530777aadd3218500bb5", "sha256": "d2f73c7398c21d8dbf6c6e0bd9ef6e7d6eae49795213672e2a680b478495ef71" }, "downloads": -1, "filename": "ftw.showroom-1.3.1.tar.gz", "has_sig": false, "md5_digest": "23623e0fca0f530777aadd3218500bb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 64946, "upload_time": "2016-11-02T12:07:38", "url": "https://files.pythonhosted.org/packages/68/5f/7760dc6dc2295ea391a6574a213e6dc712668fb51a6ced4ea3be1ee38dab/ftw.showroom-1.3.1.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "21712be453f6e74b28263d600a44b096", "sha256": "bf3a4a09e754676e2a2b56c09810f2c5f3133f1221ec04e93c1b8f096951aefe" }, "downloads": -1, "filename": "ftw.showroom-1.4.0.tar.gz", "has_sig": false, "md5_digest": "21712be453f6e74b28263d600a44b096", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 66923, "upload_time": "2017-07-11T09:39:12", "url": "https://files.pythonhosted.org/packages/33/8f/5da118dd595356f1ad1bfb64012f21d68fa434d76192c225853aa550066c/ftw.showroom-1.4.0.tar.gz" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "d044a652ee6d7c68be5f97bd8ad7d6b9", "sha256": "df82f5b5272188c2a23abd23e68c0d625b9e2e2ed0db0753eb25cbd193ee1ad2" }, "downloads": -1, "filename": "ftw.showroom-1.5.0.tar.gz", "has_sig": false, "md5_digest": "d044a652ee6d7c68be5f97bd8ad7d6b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 69067, "upload_time": "2018-03-08T12:34:31", "url": "https://files.pythonhosted.org/packages/f1/e5/bffc6018ab785ee33146ee0427d0555f08ea31cda114d72023f555541bb0/ftw.showroom-1.5.0.tar.gz" } ], "1.5.1": [ { "comment_text": "", "digests": { "md5": "8ceea385f529fce2ae3d96dd6f08adf6", "sha256": "949f8bbf5fe0254919858132b6f0d897ec9370410cbb8bb5d50c29514c22ab30" }, "downloads": -1, "filename": "ftw.showroom-1.5.1.tar.gz", "has_sig": false, "md5_digest": "8ceea385f529fce2ae3d96dd6f08adf6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67392, "upload_time": "2018-03-12T14:30:20", "url": "https://files.pythonhosted.org/packages/f4/9c/a80723f08cdc2ca5cd4ea59512e52cdf95ebf9af91e614b6d8e81c2f5c3d/ftw.showroom-1.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8ceea385f529fce2ae3d96dd6f08adf6", "sha256": "949f8bbf5fe0254919858132b6f0d897ec9370410cbb8bb5d50c29514c22ab30" }, "downloads": -1, "filename": "ftw.showroom-1.5.1.tar.gz", "has_sig": false, "md5_digest": "8ceea385f529fce2ae3d96dd6f08adf6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 67392, "upload_time": "2018-03-12T14:30:20", "url": "https://files.pythonhosted.org/packages/f4/9c/a80723f08cdc2ca5cd4ea59512e52cdf95ebf9af91e614b6d8e81c2f5c3d/ftw.showroom-1.5.1.tar.gz" } ] }