File: activesyncadmin.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 (70 lines) | stat: -rw-r--r-- 2,433 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
 * Provides the javascript for administering ActiveSync partner devices.
 *
 * @copyright  2014 Horde LLC
 * @license    LGPL-2 (http://www.horde.org/licenses/lgpl)
 */

var HordeActiveSyncAdmin = {

    // Set in admin/activesync.php: devices

    clickHandler: function(e)
    {
        var id = e.element().readAttribute('id');

        switch (id) {
        case 'reset':
            $('actionID').setValue('reset');
            $('activesyncadmin').submit();
            e.stop();
            break;

        case 'search':
            $('actionID').setValue('search');
            $('activesyncadmin').submit();
            e.stop();
            break;

        default:
            // Save any existing search data.
            if (id) {
                if (id.startsWith('wipe_')) {
                    $('deviceID').setValue(this.devices[id.substr(5)].id);
                    $('actionID').setValue('wipe');
                    $('activesyncadmin').submit();
                    e.stop();
                } else if (id.startsWith('cancel_')) {
                    $('deviceID').setValue(this.devices[id.substr(7)].id);
                    $('actionID').setValue('cancelwipe');
                    $('activesyncadmin').submit();
                    e.stop();
                } else if (id.startsWith('remove_')) {
                    $('deviceID').setValue(this.devices[id.substr(7)].id);
                    $('actionID').setValue('delete');
                    $('uid').setValue(this.devices[id.substr(7)].user);
                    $('activesyncadmin').submit();
                    e.stop();
                } else if (id.startsWith('block_')) {
                    $('deviceID').setValue(this.devices[id.substr(6)].id);
                    $('actionID').setValue('block');
                    $('activesyncadmin').submit();
                    e.stop();
                } else if (id.startsWith('unblock_')) {
                    $('deviceID').setValue(this.devices[id.substr(8)].id);
                    $('actionID').setValue('unblock');
                    $('activesyncadmin').submit();
                    e.stop();
                }
            }
            break;
        }
    },

    onDomLoad: function()
    {
        $('activesyncadmin').observe('click', this.clickHandler.bindAsEventListener(this));
    }
};

document.observe('dom:loaded', HordeActiveSyncAdmin.onDomLoad.bind(HordeActiveSyncAdmin));