app/soc/content/js/survey-take-090825.js
author Pawel Solyga <Pawel.Solyga@gmail.com>
Sun, 06 Sep 2009 23:46:28 +0200
changeset 2868 9f7f269383f7
parent 2801 0ee67cc9bd20
permissions -rw-r--r--
Set new Melange version number to 0-5-20090906 in app.yaml.template.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2423
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
     1
/* Copyright 2009 the Melange authors.
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
     2
 *
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
     3
 * Licensed under the Apache License, Version 2.0 (the "License");
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
     4
 * you may not use this file except in compliance with the License.
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
     5
 * You may obtain a copy of the License at
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
     6
 *
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
     7
 *   http://www.apache.org/licenses/LICENSE-2.0
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
     8
 *
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
     9
 * Unless required by applicable law or agreed to in writing, software
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    10
 * distributed under the License is distributed on an "AS IS" BASIS,
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    11
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    12
 * See the License for the specific language governing permissions and
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    13
 * limitations under the License.
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    14
 */
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    15
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    16
/*
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    17
*
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    18
* @author <a href="mailto:ajaksu@gmail.com">Daniel Diniz</a>
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    19
* @author <a href="mailto:jamesalexanderlevy@gmail.com">James Levy</a>
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    20
*/
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    21
2556
d1175010235e Remove the custom propmpt inside textareas and input fields.
Daniel Diniz <ajaksu@gmail.com>
parents: 2552
diff changeset
    22
(function ($) {
2423
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    23
  $(function () {
2556
d1175010235e Remove the custom propmpt inside textareas and input fields.
Daniel Diniz <ajaksu@gmail.com>
parents: 2552
diff changeset
    24
2423
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    25
    /*
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    26
    * == Setup Survey on Page Load ==
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    27
    *
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    28
    */
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    29
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    30
    var widget = $('div#survey_widget');
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    31
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    32
    // TODO(ajaksu) survey below is unused, remove if no known use is predicted
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    33
    var survey = widget.find('tbody:first');
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    34
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    35
    if (widget.hasClass('create')) {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    36
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    37
      /*
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    38
      * == Set Custom Field Rules ==
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    39
      *
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    40
      */
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    41
      widget.find('textarea').each(
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    42
        function () {
2556
d1175010235e Remove the custom propmpt inside textareas and input fields.
Daniel Diniz <ajaksu@gmail.com>
parents: 2552
diff changeset
    43
          $(this).attr('overflow', 'auto').growfield();
2423
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    44
        }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    45
      );
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    46
    }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    47
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    48
    else { // survey has saved results
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    49
      widget.find('textarea').each(
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    50
        function () {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    51
          $(this).attr('overflow', 'auto').growfield();
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    52
        }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    53
      ).end()
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    54
      .find('.pick_multi').each(
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    55
        function () {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    56
          $(this).find('input').each(
2800
cd9eed2b787e Made all JS code JSLint compliant.
Mario Ferraro <fadinlight@gmail.com>
parents: 2572
diff changeset
    57
            /*jslint white: false */
2423
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    58
            function () {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    59
              // if $(this).attr('checked', 'true');});
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    60
            }
2800
cd9eed2b787e Made all JS code JSLint compliant.
Mario Ferraro <fadinlight@gmail.com>
parents: 2572
diff changeset
    61
            /*jslint white: true */
2423
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    62
          );
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    63
        }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    64
      );
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    65
    }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    66
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    67
    /*
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    68
    * == Configure Project ==
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    69
    *
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    70
    */
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    71
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    72
    // remember if form has been touched
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    73
    $('input,textarea,select').change(
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    74
      function () {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    75
        if ($(this).attr('id') === 'id_project') {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    76
          return;
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    77
        }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    78
        $('form:first').data('touched', true);
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    79
      }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    80
    );
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    81
2552
747e058900d5 Fix comment indention in survey-take javascript file.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents: 2550
diff changeset
    82
    // remember initially chosen project choice
2423
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    83
    $('select#id_project').blur(
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    84
      function () {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    85
        $(this).data('selected', $(this).find('option:first'));
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    86
      }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    87
    ).change(
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    88
      function () {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    89
        if ($('form:first').data('touched') === true) {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    90
          // if form has been touched, send confirmation dialog
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    91
          var save_check = confirm(["Switching projects will lose unsaved ",
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    92
                                    "edits made to this survey."].join(""));
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    93
          if (!save_check) {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    94
            $(this).data('selected').attr('selected', 'selected');
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    95
            return false;
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    96
          }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    97
        }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    98
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
    99
        if ($(this).val() !== 'None') {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   100
          // redirect with new project GET param
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   101
          window.location = [window.location.href.split('?')[0],  "?project=",
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   102
                             $(this).val()].join("");
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   103
        }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   104
      }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   105
    );
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   106
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   107
    // insert project link after project select field
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   108
    $('div#project_link').insertAfter($('select#id_project')).show();
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   109
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   110
    /*
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   111
    * == Survey Submission Handler ==
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   112
    *
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   113
    */
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   114
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   115
    // validate form
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   116
    $('input[type=submit]').bind(
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   117
      'click',
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   118
      function (e) {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   119
        e.preventDefault();
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   120
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   121
        // validate project and grade choice fields
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   122
        if ($('select#id_project') &&
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   123
        $('select#id_project').val() === 'None') {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   124
          return alert('Please Choose a Project');
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   125
        }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   126
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   127
        if ($('select#id_grade') && $('select#id_grade').val() === 'None') {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   128
          return alert('Please Choose a Grade');
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   129
        }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   130
        $('form').trigger('submit');
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   131
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   132
      }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   133
    );
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   134
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   135
    $('form').bind('submit',
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   136
      function () {
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   137
        $('input#id_s_html').val(
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   138
          widget.find('div#survey_options').remove().end().html()
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   139
        );
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   140
      }
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   141
    );
2556
d1175010235e Remove the custom propmpt inside textareas and input fields.
Daniel Diniz <ajaksu@gmail.com>
parents: 2552
diff changeset
   142
2526
8f29bfb9eb52 Survey editing/taking Javascript and CSS fixes.
James Levy <jamesalexanderlevy@gmail.com>
parents: 2423
diff changeset
   143
   /*
8f29bfb9eb52 Survey editing/taking Javascript and CSS fixes.
James Levy <jamesalexanderlevy@gmail.com>
parents: 2423
diff changeset
   144
   * == Customize Comment Appearance ==
8f29bfb9eb52 Survey editing/taking Javascript and CSS fixes.
James Levy <jamesalexanderlevy@gmail.com>
parents: 2423
diff changeset
   145
   */
2556
d1175010235e Remove the custom propmpt inside textareas and input fields.
Daniel Diniz <ajaksu@gmail.com>
parents: 2552
diff changeset
   146
2800
cd9eed2b787e Made all JS code JSLint compliant.
Mario Ferraro <fadinlight@gmail.com>
parents: 2572
diff changeset
   147
    var comments = widget.find('td > .comment');
cd9eed2b787e Made all JS code JSLint compliant.
Mario Ferraro <fadinlight@gmail.com>
parents: 2572
diff changeset
   148
    comments.each(function () {
cd9eed2b787e Made all JS code JSLint compliant.
Mario Ferraro <fadinlight@gmail.com>
parents: 2572
diff changeset
   149
      $(this).parents('tr:first')
2526
8f29bfb9eb52 Survey editing/taking Javascript and CSS fixes.
James Levy <jamesalexanderlevy@gmail.com>
parents: 2423
diff changeset
   150
           .prev().css({'margin-top': '-10px'})
8f29bfb9eb52 Survey editing/taking Javascript and CSS fixes.
James Levy <jamesalexanderlevy@gmail.com>
parents: 2423
diff changeset
   151
           .find('label').css({'font-size': '11px'});
2800
cd9eed2b787e Made all JS code JSLint compliant.
Mario Ferraro <fadinlight@gmail.com>
parents: 2572
diff changeset
   152
    });
2556
d1175010235e Remove the custom propmpt inside textareas and input fields.
Daniel Diniz <ajaksu@gmail.com>
parents: 2552
diff changeset
   153
2423
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   154
  });
d6b4be046c26 Adding JS files for use in Surveys.
Daniel Diniz <ajaksu@gmail.com>
parents:
diff changeset
   155
}(jQuery));