Changeset 250 for trunk/web-app


Ignore:
Timestamp:
Mar 9, 2010, 2:16:07 PM (11 years ago)
Author:
duh
Message:
  • date and datetimefields are now handled independent of naming but by field type (a rel='date' and rel='datetime' argument is added to the rendered input element)
  • client side error reporting did not work properly for select elements
  • dynamically inserted javascript confirmation warning in the DOM-anchors outside of the wizard (navigating away from the wizard without saving causes loss of data and work)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web-app/js/wizard.js

    r247 r250  
    2626
    2727    // attach Tooltips
     28    insertOnRedirectWarning();
    2829    onWizardPage();
    2930});
     
    4445    // accordeon(s)
    4546    $("#accordion").accordion();
     47}
     48
     49// insert a redirect confirmation dialogue to all anchors leading the
     50// user away from the wizard
     51function insertOnRedirectWarning() {
     52    // find all anchors that lie outside the wizard
     53    $('a').each(function() {
     54        var element = $(this)
     55        var re = /^#/gi;
     56
     57        if (!element.attr('href').match(/^#/gi) && !element.attr('href').match(/\/([^\/]+)\/wizard\/pages/gi)) {
     58            // bind a warning to the onclick event
     59            element.bind('click',function() {
     60                return confirm('Warning: navigating away from the wizard causes loss of work and unsaved data. Are you sure you want to continue?');
     61            })
     62        }
     63    })
    4664}
    4765
     
    117135// add datepickers to date fields
    118136function attachDatePickers() {
    119     $('div#wizard').find("input[type=text][name$='Date']").each(function() {
     137    $('div#wizard').find("input[type=text][rel$='date']").each(function() {
    120138        $(this).datepicker({
    121139            dateFormat  : 'dd/mm/yy',
     
    128146// add datetimepickers to date fields
    129147function attachDateTimePickers() {
    130     $('div#wizard').find("input[type=text][name$='Time']").each(function() {
     148    $('div#wizard').find("input[type=text][rel$='datetime']").each(function() {
    131149        $(this).datepicker({
    132150            dateFormat      : 'dd/mm/yy',
Note: See TracChangeset for help on using the changeset viewer.