Ignore:
Timestamp:
08/02/11 11:58:29 (14 years ago)
Author:
fpvanagthoven
Message:

Start at SessionCreationTool?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/SurveyCreationTool.php

    r61 r64  
    3434    private static function javascript($id = null) {
    3535        ?>
     36        <script type="text/javascript" src="js/creation.js"></script>
    3637        <script type="text/javascript">
    3738            /* autosave every 3 minutes */
     
    7576                return questionDiv;
    7677            }
    77                                                                                                                                                                                                                                                                                                                                                    
    78             function handleFocus(input)
    79             {
    80                 /* this is such ugly code it makes me sad */
    81                 /* because it is hard coded. */
    82                 if (input.clicked == null &&
    83                     (input.value == "Untitled Survey"
    84                     || input.value == "Write a helpful description for this survey here."
    85                     || input.value == "Write a question description here."
    86                     || input.value == "Untitled Question"))
    87                 {
    88                     input.value = "";
    89                     input.style.color = "black";   
    90                     input.clicked = true;
    91                 }
    92             }
    93                                                                                                                                                                                                                                                                                                                                                                                    
    94             function handleBlur(input)
    95             {       
    96                 var surveyTitle = document.getElementById('surveyTitle');
    97                 var surveyDescription = document.getElementById('surveyDescription');
    98                                                                                                                                                                                                                                                                                                                                                                    
    99                 if (input.value == "")
    100                 {
    101                     input.style.color = "gray";
    102                     input.clicked = null;
    103                                                                                                                                                                                                                                                                                                                                                                                            
    104                     if (input == surveyTitle)
    105                     {
    106                         input.value = "Untitled Survey";
    107                     }
    108                     else if (input == surveyDescription)
    109                     {
    110                         input.value = "Write a helpful description for this survey here.";
    111                     }
    112                 }                           
    113             }
    11478                                                                                                                                                                                                                                                                                                                                   
    11579            function handleType(select, answers)
     
    397361            $value = 'Untitled Survey';
    398362        ?>
    399         <input type="text" id="surveyTitle" name="surveyTitle" value="<?php echo $value ?>" onblur="handleBlur(this)" onfocus="handleFocus(this)" />
     363        <input type="text" id="surveyTitle" class="titleBox" name="surveyTitle" value="<?php echo $value; ?>" onblur="handleBlur(this)" onfocus="handleFocus(this)" />
    400364        <?php
    401365    }
     
    419383            $value = 'Write a helpful description for this survey here.';
    420384        ?>
    421         <textarea id="surveyDescription" name="surveyDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea>
     385        <textarea id="surveyDescription" class="descriptionBox" name="surveyDescription" onblur="handleBlur(this)" onfocus="handleFocus(this)"><?php echo $value; ?></textarea>
    422386        <?php
    423387    }
Note: See TracChangeset for help on using the changeset viewer.