summaryrefslogtreecommitdiff
path: root/web-ui/app/js/page/default.js
blob: 1571202e00c6bf53e9f1ed125b48485a6619166c (plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
 * Copyright (c) 2014 ThoughtWorks, Inc.
 *
 * Pixelated is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Pixelated is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
 */
define(
  [
    'mail_view/ui/compose_box',
    'mail_list_actions/ui/mail_list_actions',
    'user_alerts/ui/user_alerts',
    'mail_list/ui/mail_list',
    'mail_view/ui/no_message_selected_pane',
    'mail_view/ui/mail_view',
    'mail_view/ui/mail_actions',
    'mail_view/ui/reply_section',
    'mail_view/data/mail_sender',
    'services/mail_service',
    'services/delete_service',
    'services/recover_service',
    'tags/ui/tag_list',
    'tags/data/tags',
    'page/router',
    'dispatchers/right_pane_dispatcher',
    'dispatchers/middle_pane_dispatcher',
    'dispatchers/left_pane_dispatcher',
    'search/search_trigger',
    'search/results_highlighter',
    'foundation/off_canvas',
    'page/pane_contract_expand',
    'views/i18n',
    'views/recipientListFormatter',
    'flight/lib/logger',
    'page/logout',
    'page/logout_shortcut'
  ],

  function (
    composeBox,
    mailListActions,
    userAlerts,
    mailList,
    noMessageSelectedPane,
    mailView,
    mailViewActions,
    replyButton,
    mailSender,
    mailService,
    deleteService,
    recoverService,
    tagList,
    tags,
    router,
    rightPaneDispatcher,
    middlePaneDispatcher,
    leftPaneDispatcher,
    searchTrigger,
    resultsHighlighter,
    offCanvas,
    paneContractExpand,
    viewI18n,
    recipientListFormatter,
    withLogging,
    logout,
    logoutShortcut) {

    'use strict';
    function initialize(path) {
      viewI18n.init(path + '/assets/');
      paneContractExpand.attachTo(document);

      userAlerts.attachTo('#user-alerts');

      mailList.attachTo('#mail-list');
      mailListActions.attachTo('#list-actions');

      searchTrigger.attachTo('#search-trigger');
      resultsHighlighter.attachTo(document);

      mailSender.attachTo(document);

      mailService.attachTo(document);
      deleteService.attachTo(document);
      recoverService.attachTo(document);

      tags.attachTo(document);
      tagList.attachTo('#tag-list');

      router.attachTo(document);

      rightPaneDispatcher.attachTo(document);
      middlePaneDispatcher.attachTo(document);
      leftPaneDispatcher.attachTo(document);

      offCanvas.attachTo(document);
      logout.attachTo('#logout');
      logoutShortcut.attachTo('#logout-shortcut');
    }

    return initialize;
  }
);