This repository was archived by the owner on May 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.coffee
More file actions
49 lines (38 loc) · 1.59 KB
/
app.coffee
File metadata and controls
49 lines (38 loc) · 1.59 KB
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
#### Точка входа для приложения
#
#
define (require) ->
che = (customConfig) ->
config = require "config"
errorHanler = require "utils/errorHandlers/errorHandler"
consoleHandler = require "utils/errorHandlers/console"
# Переопределяем дефолтные параметры конфига, если надо
config.setup customConfig if customConfig
customConfig.modules ?= []
# Подключаем опциональные модули
for module in customConfig.modules when config._modules[module]?
che.module = config._modules[module]
# Добавляем обработчики ошибок
errorHanler.addErrorHandler consoleHandler
# Запускаем рантайм черхитектуры
sections = require "sections"
clicks = require "clicks"
loader = require "loader"
sections.init(config)
# Объявляем минимально необходимый публичный интерфейс.
che.config = require "config"
che.events = require "events"
che.loader = require "loader"
che.history = require "history"
che.dom = require "dom"
che.ajax = require "ajax"
che.domReady = require "lib/domReady"
che.clicks = require "clicks"
che.forms = require "clicks/forms"
che.anchors = require "clicks/anchors"
che.sectionsLoader = require "sections/loader"
che.widgets = require "widgets"
che.widgetsData = require "utils/widgetsData"
che.clicksPreprocessor = require "utils/preprocessors/clicks"
che.scrollPreprocessor = require "utils/preprocessors/scroll"
che