1
|
|
|
/** |
2
|
|
|
* |
3
|
|
|
* This is [Siteapp] configured as what it essentially is: |
4
|
|
|
* An abstraction of the *Zurb Foundation* core, respectivly the plugin mechanism |
5
|
|
|
* |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
/* <!-- essential core */ |
9
|
|
|
import Siteapp from '../siteapp.core'; |
10
|
|
|
|
11
|
|
|
// Touch and Triggers previously were almost purely sede effect driven, |
12
|
|
|
// so no // need to add it to Siteapp, just init them. |
13
|
|
|
import { Keyboard } from '../util/siteapp.util.keyboard'; |
14
|
|
|
import { MediaQuery } from '../util/siteapp.util.mediaQuery'; |
15
|
|
|
import { Triggers } from '../util/siteapp.util.triggers'; |
16
|
|
|
|
17
|
|
|
Siteapp.prototype.Keyboard = Keyboard; |
18
|
|
|
Siteapp.prototype.MediaQuery = MediaQuery; |
19
|
|
|
Siteapp.prototype.Triggers = Triggers; |
20
|
|
|
|
21
|
|
|
Siteapp.Keyboard = Siteapp.prototype.Keyboard; |
22
|
|
|
Siteapp.MediaQuery = Siteapp.prototype.MediaQuery; |
23
|
|
|
Siteapp.Triggers = Siteapp.prototype.Triggers; |
24
|
|
|
|
25
|
|
|
//Extra Core Components: Storage/Module-Managment, Log, Debug |
26
|
|
|
import { Exception } from '../sys/siteapp.exception'; |
27
|
|
|
|
28
|
|
|
Siteapp.prototype.Exception = Exception; |
29
|
|
|
Siteapp.Exception = Exception; |
30
|
|
|
|
31
|
|
|
/* essential core --> */ |
32
|
|
|
|
33
|
|
|
|
34
|
|
|
// attach application module manager classes |
35
|
|
|
import Module from '../module/siteapp.module'; |
36
|
|
|
import ModuleFactory from '../module/siteapp.moduleFactory'; |
37
|
|
|
import ModuleManager from '../module/siteapp.moduleManager'; |
38
|
|
|
|
39
|
|
|
Siteapp.prototype.Module = Module; |
40
|
|
|
Siteapp.Module = Module; |
41
|
|
|
Siteapp.prototype.ModuleFactory = ModuleFactory; |
42
|
|
|
Siteapp.ModuleFactory = ModuleFactory; |
43
|
|
|
Siteapp.prototype.ModuleManager = ModuleManager; |
44
|
|
|
Siteapp.ModuleManager = ModuleManager; |
45
|
|
|
|
46
|
|
|
/* Foundation compatiblitiy mappings */ |
47
|
|
|
Siteapp.prototype.rtl = Siteapp.prototype.utilities.rtl; |
48
|
|
|
Siteapp.prototype.GetYoDigits = Siteapp.prototype.utilities.genUUID; |
49
|
|
|
Siteapp.prototype.transitionend = Siteapp.prototype.utilities.transitionend; |
50
|
|
|
Siteapp.prototype.util = Siteapp.prototype.utilities; |
51
|
|
|
Siteapp.util = Siteapp.prototype.utilities; |
52
|
|
|
|
53
|
|
|
//'Foundation.Plugin' alias for 'Siteapp.Module' |
54
|
|
|
Siteapp.prototype.Plugin = Siteapp.Module; |
55
|
|
|
Siteapp.Plugin = Siteapp.prototype.Plugin; |
56
|
|
|
|
57
|
|
|
|
58
|
|
|
var Foundation_VERSION = '7.x-proposal'; |
59
|
|
|
|
60
|
|
|
const ZurbFoundationConfig = { |
61
|
|
|
|
62
|
|
|
// application namespace |
63
|
|
|
namespace: 'foundation', |
64
|
|
|
|
65
|
|
|
// main module manager config |
66
|
|
|
moduleManager: { |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* use namespaced module trigger 'data-' attribute |
70
|
|
|
* true => data-{namespace}-{modulename} (default) |
71
|
|
|
* false => data-{modulename} |
72
|
|
|
* |
73
|
|
|
* @var {booloean} namespacedModuleTriggers |
74
|
|
|
* @default true |
75
|
|
|
*/ |
76
|
|
|
namespacedModuleTriggers: false, |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Since registered plugins/modules are stored under |
80
|
|
|
* [Siteapp].Modules.{PluginName}, this flag lets the |
81
|
|
|
* module manager map them back to [Siteapp].{PluginName} |
82
|
|
|
* for Foundation compatiblity when set to 'true'. |
83
|
|
|
* ATTENTION: Only do that on one/the main module manager, |
84
|
|
|
* because, in that scope, one manager would override |
85
|
|
|
* the registered modules of another module manager if |
86
|
|
|
* modules are assigned the same name! |
87
|
|
|
* @var {booloean} mapModulesToApplication |
88
|
|
|
* @default false |
89
|
|
|
*/ |
90
|
|
|
mapModulesToApplication: true |
91
|
|
|
|
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
}; |
95
|
|
|
|
96
|
|
|
// Global [Foundation] object |
97
|
|
|
// This is attached to the window, or used as a module for AMD/Browserify |
98
|
|
|
class Foundation extends Siteapp { |
99
|
|
|
|
100
|
|
|
}; |
101
|
|
|
|
102
|
|
|
const zurbFoundation = new Foundation(ZurbFoundationConfig); |
103
|
|
|
zurbFoundation.version = Foundation_VERSION; |
104
|
|
|
|
105
|
|
|
window.Foundation = zurbFoundation; |
106
|
|
|
zurbFoundation.addToJquery($); |
107
|
|
|
|
108
|
|
|
|
109
|
|
|
export {Foundation}; |
110
|
|
|
|