Changeset 5958 for main/waeup.sirp/trunk
- Timestamp:
- 22 Apr 2011, 02:00:44 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/resources.py
r5929 r5958 22 22 """Special JavaScript and CSS resources provided by waeup.sirp. 23 23 """ 24 from hurry import yui 24 25 from hurry.resource import Library, ResourceInclusion 25 from hurry.jqueryui import jqueryui 26 from hurry.jqueryui import jqueryui, base, blitzer, ui_lightness, humanity 27 from hurry.jquery import jquery 28 26 29 27 30 #: All local resources are registered under the name ``waeup_sirp``. … … 82 85 #: <input type="submit" name="xyz" value="abc"/> 83 86 #: onclick="return confirmPost('Are you sure?')"> 84 85 87 warning = ResourceInclusion(waeup_sirp, 'warning.js') 88 89 #: A resource that binds jQueryUI tabs to <div> tags with class 90 #: ``tabs``. 91 #: 92 #: 93 #: If you want jQuery tabs for some <div>s in your page then you 94 #: have to perform two steps: 95 #: 96 #: * In the `update()` method of the responsible view/page/form 97 #: require the JavaScript code to be rendered into the page: 98 #: 99 #: from waeup.sirp.browser.resources import tabs 100 #: ... 101 #: class MyPage(...): 102 #: ... 103 #: def update(self): 104 #: tabs.need() 105 #: 106 #: This way all required JavaScripts will be rendered correctly 107 #: into the HTML page generated. 108 #: 109 #: * In your HTML code add some ``<div>`` tag with ``class`` set to 110 # ``tabs``, like this:: 111 #: 112 #: <div id="tabs"> 113 #: <ul> 114 #: <li><a href="#tab-1"><span>Tab 1 Heading</span></a></li> 115 #: <li><a href="#tab-2"><span>Tab 2 Heading</span></a></li> 116 #: </ul> 117 #: <div id="tab-1"> 118 #: Content of tab 1 119 #: </div> 120 #: <div id="tab-2"> 121 #: Content of tab 2 122 #: </div> 123 #: </div> 124 #: 125 #: When the HTML is rendered, clicking into one of the tabs will make 126 #: other <div>s disappear. See 127 #: 128 #: http://jqueryui.com/demos/tabs/ 129 #: 130 #: for details. 131 #: 132 tabs = ResourceInclusion(waeup_sirp, 'tabs.js', 133 depends=[base, jquery, jqueryui]) 134 135 #: Register basic YUI based CSS as a resource. 136 yuiapp_css = ResourceInclusion( 137 waeup_sirp, 'yuiapp.css', 138 depends=[yui.reset_fonts_grids, yui.sam]) 139 140 #: Register basic WAeUP base CSS (which is based on ``yuiapp.css`` as a 141 #: resource. 142 waeup_base_css = ResourceInclusion( 143 waeup_sirp, 'waeup-base.css', 144 depends=[yuiapp_css]) 145 146 #: The red WAeUP theme registered as a resource. 147 waeuptheme_red1 = ResourceInclusion( 148 waeup_sirp, 'waeuptheme-red1.css', 149 depends=[waeup_base_css, base]) 150 151 #: The gray WAeUP theme registered as a resource. 152 waeuptheme_gray1 = ResourceInclusion( 153 waeup_sirp, 'waeuptheme-gray1.css', 154 depends=[waeup_base_css])
Note: See TracChangeset for help on using the changeset viewer.