summaryrefslogtreecommitdiff
path: root/web-ui/app/js/page/default.js
blob: e47b2f4d1f77ab2bec38c7513a21bb0e93309c46 (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
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',
    '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'
  ],

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

    'use strict';
    function initialize(path) {
      viewI18n.init(path);
      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);

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

      router.attachTo(document);

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

      offCanvas.attachTo(document);
    }

    return initialize;
  }
);