File: problem.js

package info (click to toggle)
php-horde 5.2.1%2Bdebian0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 12,196 kB
  • sloc: php: 11,089; xml: 6,460; sh: 96; makefile: 33; sql: 1
file content (27 lines) | stat: -rw-r--r-- 680 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * Provides the javascript for problem reporting.
 *
 * @copyright  2014 Horde LLC
 * @license    LGPL-2 (http://www.horde.org/licenses/lgpl)
 */

var HordeProblem = {

    onSubmit: function(e)
    {
        if ($F('subject').empty()) {
            window.alert(this.summary_text);
            $('subject').focus();
            e.stop();
        } else if ($F('message').empty()) {
            window.alert(this.message_text);
            $('message').focus();
            e.stop();
        } else {
            $('actionID').setValue('send_problem_report');
        }
    }

};

$('problem-report').observe('click', HordeProblem.onSubmit.bindAsEventListener(HordeProblem));