Source

tw2.util.html5shim /

Filename Size Date modified Message
docs
tests
tw2
138 B
95 B
840 B
26 B
1.3 KB
1.7 KB

HTML5 Shim for ToscaWidgets2

About

Allows HTML5-Shim to be added as a widget-specific or global resource for compatability with Internet Explorer versions lower than 9.0.

Using tw2.util.html5shim

Inside ToscaWidget2 Widgets

In the widgets.py file (or a resource declaration file if you use one) add following:

Top of file:

from tw2.util.html5shim import html5shim_js

In the widget declaration add html5shim_js to the resources attribute like so:

class YourWidget(tw2.core.Widget):
    resources = [html5shim_js, other_res, another_res]

Turbogears 2

If you need HTML5-Shim to be injected globally, add the following to projectname/base/lib.py

Top of file:

from tw2.util.html5shim import html5shim_js

Above the return statement in BaseController.__call__:

html5shim_js.inject()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.