{ "info": { "author": "4teamwork GmbH", "author_email": "mailto:info@4teamwork.ch", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Framework :: Plone :: 4.1", "Framework :: Plone :: 4.2", "Framework :: Plone :: 4.3", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Introduction\n============\n\nWith ``ftw.tooltip`` you are able to dynamically add tooltips to every DOM\nelement, which is selectable by jQuery and allows the title attribute.\n\n.. figure:: http://onegov.ch/approved.png/image\n :align: right\n :target: http://onegov.ch/community/zertifizierte-module/ftw.tooltip\n\n Certified: 01/2013\n\n\nInstalling\n==========\n\nAdd ``ftw.tooltip`` to your buildout configuration:\n\n::\n\n [instance]\n eggs =\n ftw.tooltip\n\nImport ``ftw.tooltip`` default profile.\n\n\nUsage\n=====\n\nBasically you have to register named ``ITooltipSource`` adapters.\nThey will be queried by a view, which generates the necessary JS code.\n\nThere are two example tooltip-source adapter, to show how they work\n\n- Static text example.\n- Dynamic text example, which reads the title attribute of the selected DOM element.\n\nYou can load both examples on your site by register the following adapters::\n\n >>> from ftw.tooltip.demo_tooltip_source import (DemoStaticTooltipSource,\n ... DemoDynamicTooltipSource)\n >>> from zope.component import provideAdapter\n >>> provideAdapter(DemoStaticTooltipSource, name=\"demo1\")\n >>> provideAdapter(DemoDynamicTooltipSource, name=\"demo2\")\n\n\nOr if you are using zcml::\n\n \n \n\n- \"demo1\" puts a tooltip on #portal-logo.\n- \"demo2\" puts tooltips on every global-nav element and show the given title attribute as tooltip.\n\nExample\n=======\n\nIt's easy to define a new ``ITooltipSource`` adapter.\nThe following example will show a tooltip \"This is the edit bar\" only on\nfolderish types (check global_condition) and of course only if \"documentEditable\"\ncss class is available::\n\n >>> from zope.component import adapts\n >>> from zope.interface import implements, Interface\n >>> from ftw.tooltip.interfaces import ITooltipSource\n >>> from plone.app.layout.navigation.interfaces import INavigationRoot\n >>> from Products.CMFCore.interfaces import IFolderish\n\n >>> class EditBarTooltip(object):\n ... \"\"\"Base demo static tooltip source. Use a given text\"\"\"\n ... implements(ITooltipSource)\n ... adapts(Interface, Interface)\n ...\n ... def __init__(self, context, request):\n ... self.context = context\n ... self.request = request\n ...\n ... def global_condition(self):\n ... return bool(IFolderish.providedBy(self.context))\n ...\n ... def tooltips(self):\n ... return [{\n ... 'selector': u'#edit-bar',\n ... 'text': u'This is the edit bar',\n ... 'condition': 'div.documentEditable'}]\n\n\nRegister the adapter with ZCML::\n\n >>> \n\n\nYou may want to use your own tooltip layout:\nJust register a BrowserView named \"ftw_tooltip_layout\" and return the tooltip layout you prefere.\n\nOr you can fully customize the tooltip paramters by register a BrowserView\nnamed \"ftw_tooltip_custom_config\" - check jquerytools documentation for more details.\n\nSmall customization example::\n\n {\n offset: [-10, 10],\n position: 'right center',\n opacity: '0.7',\n }\n\n\nExample: tooltip using exsting html\n===================================\nIt's also possible to use an html-tag as data source(must be a sibling of the selctor) instead of the title attribute. For this case only a small adjustment is necessary:\n\nThe ``ITooltipSource`` adapter should return a js-selector in the ``content``\nattribute instead of a text attribute::\n\n >>> from zope.component import adapts\n >>> from zope.interface import implements, Interface\n >>> from ftw.tooltip.interfaces import ITooltipSource\n >>> from plone.app.layout.navigation.interfaces import INavigationRoot\n >>> from Products.CMFCore.interfaces import IFolderish\n\n >>> class EditBarTooltip(object):\n ... \"\"\"Base demo static tooltip source. Use a given text\"\"\"\n ... implements(ITooltipSource)\n ... adapts(Interface, Interface)\n ...\n ... def __init__(self, context, request):\n ... self.context = context\n ... self.request = request\n ...\n ... def global_condition(self):\n ... return bool(IFolderish.providedBy(self.context))\n ...\n ... def tooltips(self):\n ... return [{\n ... 'selector': u'#edit-bar',\n ... 'condition': 'div.documentEditable',\n ... 'content': u'.tabbedview-tooltip-data'}]\n\n\nThe only constraint in the html structure, wich must receive attention, is that the content tag must be a sibling of the selector tag. For example::\n\n ... \n ...
\n ...
\n ...
Tooltip Headeer
\n ...
Lorem ipsum ...
\n ...
\n ...
\n\n\nCompatibility\n-------------\n\nRuns with `Plone `_ `4.1`, `4.2` or `4.3`.\n\nLinks\n=====\n\n- Main github project repository: https://github.com/4teamwork/ftw.tooltip\n- Issue tracker: https://github.com/4teamwork/ftw.tooltip/issues\n- Package on pypi: http://pypi.python.org/pypi/ftw.tooltip\n- Continuous integration: https://jenkins.4teamwork.ch/search?q=ftw.tooltip\n\n\nCopyright\n=========\n\nThis package is copyright by `4teamwork `_.\n\n``ftw.tooltip`` is licensed under GNU General Public License, version 2.\n\n.. image:: https://cruel-carlota.pagodabox.com/97b8423f2b907162d48e5a8315fed8ad\n :alt: githalytics.com\n :target: http://githalytics.com/4teamwork/ftw.tooltip\n\nChangelog\n=========\n\n1.1.4 (2014-03-27)\n------------------\n\n- Do not render dynamic_tooltips.js inline.\n [mathias.leimgruber]\n\n\n1.1.3 (2014-02-10)\n------------------\n\n- Activate dynamic tooltips to reposition it, so that they are always visible\n [elio.schmutz]\n\n\n1.1.2 (2013-10-21)\n------------------\n\n- Nothing changed yet.\n\n\n1.1.1 (2013-01-21)\n------------------\n\n- Change behaviour of initialize tooltips on ajax calls.\n\n- onegov.ch approved: add badge to readme.\n [jone]\n\n\n1.1 (2012-11-28)\n----------------\n\n- Add translations.\n [jone]\n\n- Adjust javscripts: Use $ instead of deprecated jq.\n [phgross]\n\n- Added functionality wich allows using html tags as tooltip data.\n [phgross]\n\n\n1.0.5 (2012-10-16)\n------------------\n\n- Wrapped