This repository was archived by the owner on May 6, 2025. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathconfig.coffee
More file actions
68 lines (65 loc) · 2.43 KB
/
Copy pathconfig.coffee
File metadata and controls
68 lines (65 loc) · 2.43 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#### *module* config
#
# конфиги для черхитектуры
#
define [
"utils/popups",
"utils/preprocessors/scroll",
"utils/preprocessors/clicks"
], (popupsModule, scrollPreprocessor, clicksPreprocessor) ->
widgetDataAttributeName: "data-js-widgets"
widgetCssAttributeName: "data-css-widgets"
reloadParamsDataAttributeName: "data-reload-params"
reloadSectionsDataAttributeName: "data-reload-sections"
baseWidgetsPath: ""
noFirstTransition: false
sectionTagName: "section"
autoScrollOnTransitions: true
sectionSelectorAttributeName: "data-selector"
storage: ["fake", "localStorage", "cookies"]
# todo сделать непереопределяемыми
_modules:
popups: popupsModule
scroll: scrollPreprocessor
clicks: clicksPreprocessor
####
#
# Пример задания правил редиректа:
#
# che({
# redirectDefaultRuleName: 'common',
# redirectRules: {
# 'common': [{
# 'sectionName': 'UserBarWidget',
# 'params': {
# 'target': '#UserBarWidget'
# }
# },{
# 'sectionName': 'pageView',
# 'params': {
# 'target': '#GlobalContent'
# }
# },{
# 'sectionName': 'EmptyWidget',
# 'params': {
# 'target': '#OverlayContent'
# }
# }],
# 'popupWidget': {
# 'target': '#OverlayContent',
# 'ns': 'popup'
# }
# }
# });
#
# Если прийдет редирект с урлом "/page1?popupWidget=AuthPopupWidget&redirectTo=/page2",
# черхитектура сделает запрос на новый урл сформирова на основе урла следующие
# sectionsHeader – "UserBarWidget: {"target":"#UserBarWidget"};pageView: {"target":"#GlobalContent"};AuthPopupWidget: {"target":"#OverlayContent","ns":"popup"}"
# Если же в урле не будет указан popupWidget, то sectionsHeader будет равен:
# "UserBarWidget: {"target":"#UserBarWidget"};pageView: {"target":"#GlobalContent"};EmptyWidget: {"target":"#OverlayContent"}"
redirectDefaultRuleName: "common"
redirectRules:
common: null
setup: (customConfig) ->
@[param] = value for param, value of customConfig
@