{ "info": { "author": "Zope Foundation and Contributors", "author_email": "zope-dev@zope.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "This package contains support for editing HTML and XHTML inside a web\npage using the FCKeditor as a widget. This is a fairly simple\napplication of FCKeditor, and simply instantiates a pre-configured\neditor for each widget. There are no options to control the editors\nindividually.\n\n\nDetailed Documentation\n======================\n\n\n\n=========================\nHTML file editing support\n=========================\n\nThis package contains support for editing HTML and XHTML inside a web\npage using the FCKeditor as a widget. This is a fairly simple\napplication of FCKeditor, and simply instantiates a pre-configured\neditor for each widget. There are no options to control the editors\nindividually.\n\nIn creating this, we ran into some limitations of the editor that are\nworth being aware of. Noting these as limitations does not mean that\nother editors do any better; what's available seems to be a mixed bag.\n\n- The editor only deals with what can be contained inside a \n element; anything that goes outside that, including the and\n tags, get lost or damaged. If there's any way to configure\n FCKeditor to deal with such material, it isn't documented.\n\n- There's no real control of the HTML source; whitespace is not\n preserved as a programmer would expect. That's acceptable in many\n use cases, but not all. Applications should avoid using this widget\n if the original whitespace must be maintained.\n\nImplementation problems\n-----------------------\n\nThese are problems with the widget used to integrate FCKeditor rather\nthan problems with FCKeditor itself. These should be dealt with.\n\n- The width of the editor is hardcoded; this should be either\n configurable or the editor should stretch to fill the available\n space. The sample uses of the FCKeditor don't seem to exhibit this\n problem, so it can be better than it is.\n\n- The height of the editor should be configurable in a way similar to\n the configuration of the basic textarea widget.\n\nIdeas for future development\n----------------------------\n\nThese ideas might be interesting to pursue, but there are no specific\nplans to do so at this time:\n\n- Categorize the applications of the editor and provide alternate\n toolbar configurations for those applications. There's a lot of\n configurability in the editor itself, so it can be made to do\n different things.\n\n- Add support for some of the other fancy client-side HTML editors,\n and allow a user preference to select which to use for what\n applications, including the option of disabling the GUI editors when\n detailed control over the HTML is needed (or for luddite users who\n don't like the GUI editors).\n\n XINHA (http://xinha.python-hosting.com/) appears to be an\n interesting option as well, and may be more usable for applications\n that want more than editing of small HTML fragments, especially if\n the user is fairly HTML-savvy.\n\n HTMLArea (http://www.dynarch.com/projects/htmlarea/) may become\n interesting at some point, but a rough reading at this time\n indicates that XINHA may be a more reasonable route.\n\nMore information about FCKeditor\n--------------------------------\n\n- http://www.fckeditor.net/\n\n- http://discerning.com/topics/software/ttw.html\n\n- http://www.phpsolvent.com/wordpress/?page_id=330\n\n\n======================================\nManagement of supplemental information\n======================================\n\nThe `zope.html` package provides additional views on files containing\nHTML and XHTML data that allow editing the files over the web. The\nfiles may contain either complete documents or fragments that may be\ncomposed into larger documents. Preview views are also provided.\n\nThe editing and preview views rely on getting supplemental information\nabout the file being edited using the `IEditableHtmlInformation`\nadapter for the file. That adapter uses annotations on the content\nobject to store information that needs to be persisted.\n\nThe `IEditableHtmlInformation` interface is very simple; there's only\none field defined, and it's a simple boolean value: whether the file\nshould be treated as a fragment or not. Let's create a simple content\nobject that we can use for testing::\n\n >>> import zope.file.file\n >>> import zope.interface\n >>> import zope.annotation\n\n >>> class File(zope.file.file.File):\n ... zope.interface.implements(\n ... zope.annotation.IAttributeAnnotatable)\n ...\n ... def __init__(self, text=None):\n ... super(File, self).__init__(\"text/html\", {\"charset\": \"utf-8\"})\n ... f = self.open(\"w\")\n ... f.write(text)\n ... f.close()\n\nLet's create a file and the corresponding `IEditableHtmlInformation`\nobject::\n\n >>> import zope.html.docinfo\n\n >>> file = File(\"This is a fragment.\")\n >>> info = zope.html.docinfo.EditableHtmlInformation(file)\n\nWe can now check that the initial value of the `isFragment` attribute\nis computed reasonably::\n\n >>> info.isFragment\n True\n\nThe user can cause the `isFragment` flag to be toggled from the UI, so\nit should remember the current state of the flag::\n\n >>> info.isFragment = False\n >>> info.isFragment\n False\n\nA new instance of the `IEditableHtmlInformation` instance should also remember the last value of the setting::\n\n >>> zope.html.docinfo.EditableHtmlInformation(file).isFragment\n False\n\n\n==============================\n(X)HTML fragment editor widget\n==============================\n\nThe widget included in this package is a simple application of the\nFCKeditor control. It is only expected to work for fragments, not for\narbitrary documents. Let's create a field and a widget::\n\n >>> from zope.html import field\n >>> from zope.html import widget\n >>> from zope.publisher import browser\n\n >>> class Context(object):\n ... sample = u\"\"\n\n >>> myfield = field.XhtmlFragment(\n ... __name__=\"sample\",\n ... title=u\"Sample Field\",\n ... ).bind(Context())\n\n >>> request = browser.TestRequest()\n >>> mywidget = widget.FckeditorWidget(myfield, request)\n >>> mywidget.setPrefix(\"form\")\n\n >>> mywidget.configurationPath = \"/myconfig.js\"\n >>> mywidget.editorWidth = 360\n >>> mywidget.editorHeight = 200\n >>> mywidget.toolbarConfiguration = \"mytoolbars\"\n\n >>> print mywidget()\n \n \n \n\nWe should also test the CkeditorWidget.\n\n >>> ckwidget = widget.CkeditorWidget(myfield, request)\n >>> ckwidget.configurationPath = \"/myconfig.js\"\n >>> ckwidget.editorHeight = 200\n\nThe \"fckVersion\" attribute holds the version of CKEditor library.\n\n >>> ckwidget.fckVersion\n '3.6.2'\n\n >>> print ckwidget()\n \n \n \n\n\n======================\nViews on editable HTML\n======================\n\nLet's start by uploading some HTML to create a file object::\n\n >>> import StringIO\n >>> sio = StringIO.StringIO(\"This is a fragment.\"\n ... \" There's one 8-bit Latin-1 character: \\xd8.\")\n\n >>> from zope.testbrowser.testing import Browser\n >>> browser = Browser()\n >>> browser.addHeader(\"Authorization\", \"Basic user:userpw\")\n >>> browser.addHeader(\"Accept-Language\", \"en-US\")\n >>> browser.open(\"http://localhost/@@+/zope.file.File\")\n\n >>> ctrl = browser.getControl(name=\"form.data\")\n >>> ctrl.mech_control.add_file(sio, \"text/html\", \"sample.html\")\n >>> browser.getControl(\"Add\").click()\n\nWe can see that the MIME handlers have marked this as HTML content::\n\n >>> import zope.mimetype.types\n >>> file = getRootFolder()[\"sample.html\"]\n >>> zope.mimetype.types.IContentTypeTextHtml.providedBy(file)\n True\n\nThe \"Edit\" view can be used to check and modify the \"Is fragment?\"\nfield, which is stored by the views in an annotation on the object.\nThe particular fragment we uploaded here should be see as a fragment\nby default::\n\n >>> browser.getLink(\"sample.html\").click()\n >>> browser.getLink(\"Edit\").click()\n\n >>> browser.open(\"http://localhost/sample.html/@@htmledit.html\")\n >>> ctrl = browser.getControl(name=\"form.isFragment\")\n >>> ctrl.value\n True\n\nThe setting can be toggle by unchecking the checkbox and clicking\n\"Save\"::\n\n >>> ctrl.value = False\n >>> browser.getControl(\"Save\").click()\n >>> ctrl = browser.getControl(name=\"form.isFragment\")\n >>> ctrl.value\n False\n\nThe edit view also allows editing of the HTML content if the document\ncan be decoded. If the encoding of the document is not known, the\ndocument cannot be edited by the user is prompted to select an\nencoding that should be used.\n\nOur example document does not have a specified encoding, so we expect\nthe form to indicate that the encoded is needed, and to allow the user\nto select and encoding. Let's reload the form to get rid of the\n\"Updated...\" message so we can see what the user is told::\n\n >>> browser.getLink(\"Edit\").click()\n\n >>> print browser.contents\n <...Can't decode text for editing; please specify the document encoding...\n\n >>> ctrl = browser.getControl(name=\"form.encoding\")\n >>> ctrl.value\n ['']\n\nThe user can then select an encoding::\n\n >>> ctrl.value = [\"utf-8\"]\n >>> browser.getControl(\"Save\").click()\n\nSince we just selected an encoding that doesn't work with the Latin-1\ndata we uploaded for the file, we're told that that encoding is not\nacceptable::\n\n\n >>> print browser.contents\n <...Selected encoding cannot decode document...\n\nWe need to select an encoding that actually makes sense for the data\nthat we've uploaded::\n\n >>> ctrl = browser.getControl(name=\"form.encoding\")\n >>> ctrl.value = [\"iso-8859-1\"]\n >>> browser.getControl(\"Save\").click()\n\nNow that the encoding has been saved, the document can be encoded and\nedited, and the encoding selection will no longer be available on the\nform::\n\n >>> browser.getControl(name=\"form.encoding\")\n Traceback (most recent call last):\n ...\n LookupError: name 'form.encoding'...\n\nSince our selected encoding does not support all Unicode characters,\nthere is an option available to allow re-encoding of the document if\nthe content being saved after editing cannot be encoded in the\noriginal encoding of the document. The value of this option defaults\nto False since the user needs to be aware that the document encoding\nmay be modified::\n\n >>> browser.getControl(name=\"form.reencode\").value\n False\n\nIf we edit the text such that characters are included that cannot be\nencoded in the current encoding and try to save our changes without\nallowing re-encoding, we see a notification that the document can't be\nencoded in the original encoding and that re-encoding is needed::\n\n >>> ctrl = browser.getControl(name=\"form.text\")\n >>> ctrl.value = u\"\\u3060\\u3051\\u306e\\u30b5\\u30a4\\u30c8\".encode(\"utf-8\")\n\n >>> browser.getControl(\"Save\").click()\n\n >>> print browser.contents\n <...Can't encode text in current encoding...\n\nAt this point, we can select the \"Re-encode\" option to allow the text\nto be saved in an encoding other than the original; this would allow\nus to save any text::\n\n >>> browser.getControl(name=\"form.reencode\").value = True\n >>> browser.getControl(\"Save\").click()\n\n >>> print browser.contents\n <...Updated on ...\n\nIf we now take a look at the \"Content Type\" view for the file, we see\nthat the encoding has been updated to UTF-8::\n\n >>> browser.getLink(\"Content Type\").click()\n\n >>> browser.getControl(name=\"form.encoding\").value\n ['utf-8']\n\n\n=======\nCHANGES\n=======\n\n2.4.2 (2014-04-17)\n------------------\n\n- Remove unneeded zope.app.authentication/debugskin/server test dependencies.\n- Support for test output changed in zope.testbrowser 4.0.3\n\n\n2.4.1 (2012-01-26)\n------------------\n\n- Fix path of CKEditor resources.\n\n\n2.4.0 (2012-01-26)\n------------------\n\n- Use CKEditor 3.6.2\n- Using Python's ``doctest`` module instead of deprecated\n ``zope.testing.doctest``.\n\n\n2.3.0 (2011-02-22)\n------------------\n\n- Use CKEditor 3.5.2\n\n\n2.2.0 (2010-11-19)\n------------------\n\n- Make the use of un-minified ckeditor source explicit\n\n\n2.1.0 (2010-05-25)\n------------------\n\n- Use CKEditor 3.2.1\n\n- Added configuration to use un-minified version of CKEditor when using dev\n mode.\n\n- Fixed import that caused test failures.\n\n\n2.0.0 (2009-09-04)\n------------------\n\n- Add CKeditor 3.0 widget.\n\n\n1.2.0 (2009-07-06)\n------------------\n\n- Use FCKeditor 2.6.4.1\n\n- Remove _samples directory and erect a barrier to its resurrection\n\n\n1.1.0 (2008-06-18)\n------------------\n\n- Use FCKeditor 2.6\n\n- Use versioned directories for javascript to cache-bust\n\n\n1.0.1 (2007-11-02)\n------------------\n\n- Package data update.\n\n- Updated code to work with packages in Zope 3.4 release.\n\n\n1.0.0 (2007-10-29)\n------------------\n\n- Initial release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://cheeseshop.python.org/pypi/zope.html", "keywords": "zope3 html widget fsck editor", "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "zope.html", "package_url": "https://pypi.org/project/zope.html/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zope.html/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://cheeseshop.python.org/pypi/zope.html" }, "release_url": "https://pypi.org/project/zope.html/2.4.2/", "requires_dist": null, "requires_python": null, "summary": "HTML and XHTML Editing Support", "version": "2.4.2" }, "last_serial": 1063620, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "86c9f5844d587e60e55c5035821d4e65", "sha256": "9ddde6df283fc7d0721a996bffe6cc8a8eafdf5223a8b7a59f0b34250e1c3b93" }, "downloads": -1, "filename": "zope.html-1.0.0.tar.gz", "has_sig": false, "md5_digest": "86c9f5844d587e60e55c5035821d4e65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 669317, "upload_time": "2007-10-29T16:29:42", "url": "https://files.pythonhosted.org/packages/2c/1f/bee3329eb9c3ac9945e59aa52daf7a70b6254489311e5f502bdc34ea7335/zope.html-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "cceaa30e61348ee6b022f6c16b254ce9", "sha256": "34ecb063a019750e9a3ff0005b228685094837c4d95e3832b268f69b7adcc11d" }, "downloads": -1, "filename": "zope.html-1.0.1.tar.gz", "has_sig": false, "md5_digest": "cceaa30e61348ee6b022f6c16b254ce9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 677712, "upload_time": "2007-11-03T05:19:15", "url": "https://files.pythonhosted.org/packages/3d/a6/1acfb2c344a9ace5216a2e856ea728b9b66cedef5cc9e50e4747d304a725/zope.html-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "fee2bcc0c68277ccf45fcb6e4f53fb8c", "sha256": "6ba96d4ba5b54e3c3a35500ecc3c4120f685ac211aa4b48167758ccfb3a37b42" }, "downloads": -1, "filename": "zope.html-1.1.0.tar.gz", "has_sig": false, "md5_digest": "fee2bcc0c68277ccf45fcb6e4f53fb8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 898506, "upload_time": "2008-06-18T17:31:31", "url": "https://files.pythonhosted.org/packages/3c/e8/5a5eb4c52e685d58139220702aa754fd43ca4d95a58812edcd4040a34047/zope.html-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "940256a749c3b306b31c506fb7ae8769", "sha256": "b9de87433572932aa0cdaad65cde75d3141ea0eea812be139ab824352de85a92" }, "downloads": -1, "filename": "zope.html-1.2.0.zip", "has_sig": false, "md5_digest": "940256a749c3b306b31c506fb7ae8769", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1346942, "upload_time": "2009-07-06T20:34:14", "url": "https://files.pythonhosted.org/packages/e4/4d/9bf54e209f45f06a79dccfcf1a353cebcdd1a3a6d0b597ce264806a35ec5/zope.html-1.2.0.zip" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "02ad9f9e54dad65af0ed09ce8d16dfb9", "sha256": "cadf45e32f619169a1ef6e70054e9bba738843bc7c896cab1ef1c7d7cf03cdb7" }, "downloads": -1, "filename": "zope.html-2.0.0.zip", "has_sig": false, "md5_digest": "02ad9f9e54dad65af0ed09ce8d16dfb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3233859, "upload_time": "2009-09-04T16:29:35", "url": "https://files.pythonhosted.org/packages/51/19/e671df94682217b3baa8eb41961d4dceea83359a83ccd1a252145121519b/zope.html-2.0.0.zip" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "868cb987e400b9a290355a1207d47143", "sha256": "480ab87e9bceff37fe13a84b4439ed2b8d821739509900ca1c342cebbb75927a" }, "downloads": -1, "filename": "zope.html-2.1.0.tar.gz", "has_sig": false, "md5_digest": "868cb987e400b9a290355a1207d47143", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2149078, "upload_time": "2010-05-25T20:22:30", "url": "https://files.pythonhosted.org/packages/a7/fa/50d10d0629a51f11174628313717ff0536b5c645250496accc9c6ba56970/zope.html-2.1.0.tar.gz" } ], "2.2.0": [ { "comment_text": "", "digests": { "md5": "f4435b65597027a74cb7ee33d9842834", "sha256": "55f9912d7dc2685ba6e9be994c80a7cbf9f45099d1362a4be02f585712a64071" }, "downloads": -1, "filename": "zope.html-2.2.0.tar.gz", "has_sig": false, "md5_digest": "f4435b65597027a74cb7ee33d9842834", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2222551, "upload_time": "2010-11-23T22:35:34", "url": "https://files.pythonhosted.org/packages/db/fa/6b3b3032899178c58da8038078b541847a106b2027295a2a0202ccf9763e/zope.html-2.2.0.tar.gz" } ], "2.3.0": [ { "comment_text": "", "digests": { "md5": "7863c93aecb996f7329ba6c2be9c941c", "sha256": "76dde610c3358e6a6fcf32ff2db3274b8e16764386a260294f969e699d2e8405" }, "downloads": -1, "filename": "zope.html-2.3.0.tar.gz", "has_sig": false, "md5_digest": "7863c93aecb996f7329ba6c2be9c941c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2462204, "upload_time": "2011-02-23T15:59:39", "url": "https://files.pythonhosted.org/packages/49/f3/052fe0f5133cf436df9d58b92081c189224fca9459e4f4177831ddb284cc/zope.html-2.3.0.tar.gz" } ], "2.4.0": [ { "comment_text": "", "digests": { "md5": "53460bca76c6b5c3e9595615644c1a27", "sha256": "d9820ca3901cc8b7fdf927f6f3ea6237c053e1f7df0501052384a15adc91cd60" }, "downloads": -1, "filename": "zope.html-2.4.0.tar.gz", "has_sig": false, "md5_digest": "53460bca76c6b5c3e9595615644c1a27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2594266, "upload_time": "2012-01-26T18:53:57", "url": "https://files.pythonhosted.org/packages/cb/e7/6951b6b5a7bbd46b4accc105b5d43f3be1fe06a7a980e6fb47bd779a1955/zope.html-2.4.0.tar.gz" } ], "2.4.1": [ { "comment_text": "", "digests": { "md5": "7a98f1fffbd02167731d597fb2af2253", "sha256": "2e1eac15cde60793bf6a5597a1d61bf7b538c43f4f62e303625c8373eac56e0f" }, "downloads": -1, "filename": "zope.html-2.4.1.tar.gz", "has_sig": false, "md5_digest": "7a98f1fffbd02167731d597fb2af2253", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2594924, "upload_time": "2012-01-26T21:08:44", "url": "https://files.pythonhosted.org/packages/1c/c0/814bcb7849768c8647d21cf8dfdec15e989aaf0f640ebfdaf8c2730c1237/zope.html-2.4.1.tar.gz" } ], "2.4.2": [ { "comment_text": "", "digests": { "md5": "b47564cef47997cc4dab03ff66111ef0", "sha256": "635d0a672847f0a9c30fb6919cc727c819746994b18b101639779bbee78de9ac" }, "downloads": -1, "filename": "zope.html-2.4.2.zip", "has_sig": false, "md5_digest": "b47564cef47997cc4dab03ff66111ef0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3694234, "upload_time": "2014-04-17T16:14:08", "url": "https://files.pythonhosted.org/packages/3c/8a/3dfbf2cf94d8ceea883950f9561effe140d01d0f9080afb15761c967b57a/zope.html-2.4.2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b47564cef47997cc4dab03ff66111ef0", "sha256": "635d0a672847f0a9c30fb6919cc727c819746994b18b101639779bbee78de9ac" }, "downloads": -1, "filename": "zope.html-2.4.2.zip", "has_sig": false, "md5_digest": "b47564cef47997cc4dab03ff66111ef0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3694234, "upload_time": "2014-04-17T16:14:08", "url": "https://files.pythonhosted.org/packages/3c/8a/3dfbf2cf94d8ceea883950f9561effe140d01d0f9080afb15761c967b57a/zope.html-2.4.2.zip" } ] }