djangosnippets.org: Latest snippets tagged with 'html5'https://djangosnippets.org/tags/html5/2015-09-11T11:23:45.310231-05:00Make HTML5 appcache manifest slice work with django-compress compressed files
2015-09-11T11:23:45.310231-05:00PetrDlouhyhttps://djangosnippets.org/snippets/10529/<p>I needed to make appcache for my application which used django-compress for JS and CSS compression. This is, how I solved the problem with putting compressed files into the manifest.</p>
<p>I went for offline compression (with <code>COMPRESS_OFFLINE=True</code>). This snippet shows code of command file (put it in <code>apps/cyklomapa/management/commands/compress_create_manifest.py</code>), …</p>
Freely redistributableHTML5 Placeholder from FormField label
2012-10-24T17:11:25.973890-05:00Hillshumhttps://djangosnippets.org/snippets/2837/<p>This allows for easy generation of HTML5 placeholders based on a form_field's label. Use like so:</p>
<p>{% form_placeholder form.username %}</p>
Freely redistributablePrettify HTML5 middleware
2011-07-08T08:15:22.039890-05:00runejuhlhttps://djangosnippets.org/snippets/2482/<p>Slightly updated version of http://djangosnippets.org/snippets/172/ .
Supports new HTML5 tags (even though tidy doesn't).</p>
Freely redistributableShare button
2011-01-14T19:00:19.427246-06:00carlosvinhttps://djangosnippets.org/snippets/2323/<p>This template can be included by other template passing the vars page_url and title:
{% with content.get_url as page_url %}
{% with content.title as title %}
{% include 'share.html' %}
{% endwith %}
{% endwith %} </p>
Freely redistributableCustom Widget Types for HTML5 Form Fields
2010-05-18T20:56:01.161574-05:00leveillejhttps://djangosnippets.org/snippets/2027/<p>I recently needed an easy way to add different input types to form fields based on the type of input. So, I created a widgets.py file and added varying input classes to meet my needs.</p>
Freely redistributableHTML 5 Firefox 2 Hack
2009-11-16T17:01:28.861419-06:00epicservehttps://djangosnippets.org/snippets/1802/<p>This is a hack to get HTML 5 to work for Firefox 2. It Sends the xhtml content-type to all Gecko based browsers where version is less than 1.9, or "rv:1.9pre" or "rv:1.9a" or "rv:1.9bx" where x is less than 5. I created this hack based on the information I …</p>
Freely redistributable