Changeset 107
- Timestamp:
- Jan 22, 2010, 6:37:01 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/taglib/dbnp/studycapturing/WizardTagLib.groovy
r103 r107 156 156 157 157 /** 158 * wizard navigation buttons render wrapper, in order to be able to add159 * functionality in the future160 */161 def previousNext = {attrs ->162 // define AJAX provider163 setProvider([library: ajaxProvider])164 165 // render navigation buttons166 out << render(template: "/wizard/common/buttons")167 }168 169 /**170 158 * render the content of a particular wizard page 171 159 * @param Map attrs 172 * @param Closure body 160 * @param Closure body (help text) 173 161 */ 174 162 def pageContent = {attrs, body -> … … 187 175 /** 188 176 * render a textFieldElement 177 * @param Map attrs 178 * @param Closure body (help text) 189 179 */ 190 180 def textFieldElement = {attrs, body -> … … 198 188 } 199 189 190 // work variables 191 def addExampleElement = attrs.remove('addExampleElement') 192 //attrs.remove('addExampleElement') 193 200 194 // render a text element 201 195 out << '<div class="element">' … … 204 198 out << ' </div>' 205 199 out << ' <div class="input">' 200 201 // add text input field 206 202 out << textField(attrs) 203 204 // add a help icon if help information is available 205 if (body()) { 206 out << ' <div class="helpIcon" />' 207 } 208 209 // add an disabled input box for feedback purposes 210 // @see dateElement(...) 211 if (addExampleElement) { 212 def exampleAttrs = new LinkedHashMap() 213 exampleAttrs.name = attrs.get('name')+'Example' 214 exampleAttrs.class = 'isExample' 215 exampleAttrs.disabled = 'disabled' 216 out << textField(exampleAttrs) 217 } 218 219 // end HTML 207 220 out << ' </div>' 208 221 209 // add help icon?222 // add help content if it is available 210 223 if (body()) { 211 out << ' <div class="help">' 212 out << ' <div class="icon"></div>' 213 out << ' <div class="content">' 224 out << ' <div class="helpContent">' 214 225 out << ' ' + body() 215 226 out << ' </div>' 216 out << ' </div>'217 227 } 218 228 219 229 out << '</div>' 220 230 } 231 232 /** 233 * render a dateElement 234 * @param Map attrs 235 * @param Closure body (help text) 236 */ 237 def dateElement = { attrs, body -> 238 // set some textfield values 239 attrs.maxlength = 10 240 attrs.addExampleElement = true 241 242 // render a normal text field 243 out << textFieldElement(attrs,body) 244 245 // and attach the jquery-ui datepicker 246 out << '<script type="text/javascript">' 247 out << '$(document).ready(function() {' 248 out << ' $("#' + attrs.get('name') + '").datepicker({altField: \'#' + attrs.get('name') + 'Example\', altFormat: \'DD, d MM, yy\'});' 249 out << '});' 250 out << '</script>' 251 } 221 252 } -
trunk/grails-app/views/wizard/common/_wizard.gsp
r105 r107 16 16 %> 17 17 <div id="wizard" class="wizard"> 18 <h1> Proof of concept AJAXified Grails Webflow Wizard</h1>18 <h1>Create a new study</h1> 19 19 <g:form action="pages" name="wizardForm" id="wizardForm"> 20 20 <div id="wizardPage"> -
trunk/grails-app/views/wizard/pages/_study.gsp
r105 r107 16 16 %> 17 17 <wizard:pageContent> 18 <wizard:textFieldElement name=" studyTitle" description="Title" error="title" value="${study?.title}">18 <wizard:textFieldElement name="title" description="Title" error="title" value="${study?.title}"> 19 19 The title of the study you are creating 20 20 </wizard:textFieldElement> 21 <wizard:textFieldElement name=" studyCode" description="Code" error="code">21 <wizard:textFieldElement name="code" description="Code" error="code" value="${study?.code}"> 22 22 A code to reference your study by 23 23 </wizard:textFieldElement> 24 <wizard:textFieldElement name=" studyResearchQuestion" description="Research Question" error="researchQuestion">24 <wizard:textFieldElement name="researchQuestion" description="Research Question" error="researchQuestion" value="${study?.researchQuestion}"> 25 25 The research question 26 26 </wizard:textFieldElement> 27 <wizard:textFieldElement name="studyDescription" description="Description" error="description" /> 28 <wizard:textFieldElement name="studyEcCode" description="Ethical Committee Code" error="ecCode" /> 27 <wizard:textFieldElement name="description" description="Description" error="description" value="${study?.description}" /> 28 <wizard:textFieldElement name="ecCode" description="Ethical Committee Code" error="ecCode" value="${study?.ecCode}" /> 29 <wizard:dateElement name="startDate" description="Start date" error="startDate" value="${study?.startDate}"> 30 The start date of the study 31 </wizard:dateElement> 29 32 </wizard:pageContent> -
trunk/web-app/css/wizard.css
r99 r107 56 56 } 57 57 58 .wizard .element .input .isExample { 59 color: #006DBA; 60 background-color: transparent; 61 border: 0px; 62 input: disabled; 63 } 64 65 58 66 .wizard .error { 59 67 display: block; … … 87 95 } 88 96 97 .wizard .element .helpIcon { 98 display: inline-block; 99 margin-top: 4px; 100 background: url(../images/icons/famfamfam/help.png) no-repeat left top; 101 width: 16px; 102 height: 16px; 103 } 104 105 .wizard .element .helpContent { 106 display: none; 107 } 108 89 109 .wizard .element .help { 90 110 vertical-align: top; -
trunk/web-app/js/wizard.js
r105 r107 18 18 // http://code.google.com/p/fbug/issues/detail?id=1899 19 19 var wizard = $('div#wizard') 20 wizard.html('<span style="color:red;font-size:8px;"> You are using firefox 3.6, note that firefox 3.6 in combination with firebug (latest 1.6X.0a3) and XMLHttpRequest enabled in the console, break the workings of this wizard... Either disable console XMLHttpRequests, disable firebug altogether or downgrade to Firefox 3.5.7 instead</span>' + wizard.html())20 wizard.html('<span style="color:red;font-size:8px;">Firefox 3.6 contains <a href="http://code.google.com/p/fbug/issues/detail?id=2746" target="_new">a bug</a> in combination with Firebug\'s XMLHttpRequest spy which causes the wizard to not function anymore. Please make sure you have firebug\'s XMLHttpRequest spy disabled use use Firefox 3.5.7 instead...</span>' + wizard.html()) 21 21 } 22 22 … … 28 28 function attachHelpTooltips() { 29 29 // attach help action on all wizard help icons 30 $('div#wizard').find('div.help ').each(function() {31 $(this). find('div.icon').qtip({30 $('div#wizard').find('div.helpIcon').each(function() { 31 $(this).qtip({ 32 32 content: 'leftMiddle', 33 33 position: { … … 44 44 padding: 10, 45 45 textAlign: 'center', 46 tip: true, // Give it a speech bubble tip with automatic corner detection47 name: 'blue' // Style it according to the preset 'cream' style46 tip: true, 47 name: 'blue' 48 48 }, 49 content: $(this). find('div.content').html(),49 content: $(this).parent().parent().find('div.helpContent').html(), 50 50 show: 'mouseover', 51 51 hide: 'mouseout' 52 52 }) 53 }) 53 }); 54 54 }
Note: See TracChangeset
for help on using the changeset viewer.