@pageboard/html 0.14.19 → 0.14.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/elements/accordion.js +1 -1
- package/elements/fieldsets.js +1 -1
- package/elements/form.js +2 -2
- package/elements/grid.js +1 -1
- package/elements/image.js +1 -1
- package/elements/input-file.js +2 -2
- package/elements/input-property.js +1 -1
- package/elements/inputs.js +5 -5
- package/elements/layout.js +1 -1
- package/elements/link.js +2 -2
- package/elements/menu.js +2 -2
- package/elements/navigation.js +1 -1
- package/elements/page.js +1 -1
- package/elements/paragraph.js +2 -2
- package/elements/query-tags.js +1 -1
- package/elements/tab.js +1 -1
- package/elements/table.js +1 -1
- package/elements/template.js +1 -1
- package/package.json +3 -8
- package/ui/card.css +3 -3
- package/ui/components/accordion.css +241 -0
- package/ui/components/accordion.js +613 -0
- package/ui/components/ad.css +275 -0
- package/ui/components/api.js +1167 -0
- package/ui/components/breadcrumb.css +122 -0
- package/ui/components/button.css +3525 -0
- package/ui/components/card.css +939 -0
- package/ui/components/checkbox.css +604 -0
- package/ui/components/checkbox.js +831 -0
- package/ui/components/colorize.js +274 -0
- package/ui/components/comment.css +268 -0
- package/ui/components/container.css +149 -0
- package/ui/components/dimmer.css +224 -0
- package/ui/components/dimmer.js +733 -0
- package/ui/components/divider.css +253 -0
- package/ui/components/dropdown.css +1448 -0
- package/ui/components/dropdown.js +3955 -0
- package/ui/components/embed.css +160 -0
- package/ui/components/embed.js +706 -0
- package/ui/components/feed.css +281 -0
- package/ui/components/flag.css +1035 -0
- package/ui/components/form.css +1011 -0
- package/ui/components/form.js +1706 -0
- package/ui/components/grid.css +1941 -0
- package/ui/components/header.css +719 -0
- package/ui/components/icon.css +4777 -0
- package/ui/components/image.css +310 -0
- package/ui/components/input.css +469 -0
- package/ui/components/item.css +464 -0
- package/ui/components/label.css +1281 -0
- package/ui/components/list.css +943 -0
- package/ui/components/loader.css +339 -0
- package/ui/components/menu.css +1940 -0
- package/ui/components/message.css +468 -0
- package/ui/components/modal.css +617 -0
- package/ui/components/modal.js +1034 -0
- package/ui/components/nag.css +145 -0
- package/ui/components/nag.js +507 -0
- package/ui/components/placeholder.css +229 -0
- package/ui/components/popup.css +640 -0
- package/ui/components/popup.js +1532 -0
- package/ui/components/progress.css +502 -0
- package/ui/components/progress.js +931 -0
- package/ui/components/rail.css +152 -0
- package/ui/components/rating.css +257 -0
- package/ui/components/rating.js +508 -0
- package/ui/components/reset.css +476 -0
- package/ui/components/reveal.css +260 -0
- package/ui/components/search.css +431 -0
- package/ui/components/search.js +1505 -0
- package/ui/components/segment.css +824 -0
- package/ui/components/shape.css +143 -0
- package/ui/components/shape.js +921 -0
- package/ui/components/sidebar.css +537 -0
- package/ui/components/sidebar.js +1033 -0
- package/ui/components/site.css +184 -0
- package/ui/components/site.js +487 -0
- package/ui/components/state.js +708 -0
- package/ui/components/statistic.css +534 -0
- package/ui/components/step.css +566 -0
- package/ui/components/sticky.css +73 -0
- package/ui/components/sticky.js +959 -0
- package/ui/components/tab.css +89 -0
- package/ui/components/tab.js +952 -0
- package/ui/components/table.css +1108 -0
- package/ui/components/transition.css +1792 -0
- package/ui/components/transition.js +1095 -0
- package/ui/components/video.css +121 -0
- package/ui/components/video.js +532 -0
- package/ui/components/visibility.js +1311 -0
- package/ui/components/visit.js +517 -0
- package/ui/item.css +2 -2
- package/ui/themes/default/assets/fonts/brand-icons.eot +0 -0
- package/ui/themes/default/assets/fonts/brand-icons.svg +1008 -0
- package/ui/themes/default/assets/fonts/brand-icons.ttf +0 -0
- package/ui/themes/default/assets/fonts/brand-icons.woff +0 -0
- package/ui/themes/default/assets/fonts/brand-icons.woff2 +0 -0
- package/ui/themes/default/assets/fonts/icons.eot +0 -0
- package/ui/themes/default/assets/fonts/icons.otf +0 -0
- package/ui/themes/default/assets/fonts/icons.svg +1518 -0
- package/ui/themes/default/assets/fonts/icons.ttf +0 -0
- package/ui/themes/default/assets/fonts/icons.woff +0 -0
- package/ui/themes/default/assets/fonts/icons.woff2 +0 -0
- package/ui/themes/default/assets/fonts/outline-icons.eot +0 -0
- package/ui/themes/default/assets/fonts/outline-icons.svg +366 -0
- package/ui/themes/default/assets/fonts/outline-icons.ttf +0 -0
- package/ui/themes/default/assets/fonts/outline-icons.woff +0 -0
- package/ui/themes/default/assets/fonts/outline-icons.woff2 +0 -0
- package/ui/themes/default/assets/images/flags.png +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* # Semantic UI 2.4.1 - Site
|
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* Released under the MIT license
|
|
7
|
+
* http://opensource.org/licenses/MIT
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
/*******************************
|
|
13
|
+
Page
|
|
14
|
+
*******************************/
|
|
15
|
+
|
|
16
|
+
html,
|
|
17
|
+
body {
|
|
18
|
+
height: 100%;
|
|
19
|
+
}
|
|
20
|
+
html {
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
}
|
|
23
|
+
body {
|
|
24
|
+
margin: 0px;
|
|
25
|
+
padding: 0px;
|
|
26
|
+
overflow-x: hidden;
|
|
27
|
+
min-width: 320px;
|
|
28
|
+
background: #FFFFFF;
|
|
29
|
+
font-family: Arial, sans-serif;
|
|
30
|
+
font-size: 14px;
|
|
31
|
+
line-height: 1.4285em;
|
|
32
|
+
color: rgb(0 0 0 / 87%);
|
|
33
|
+
-webkit-font-smoothing: antialiased;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/*******************************
|
|
38
|
+
Headers
|
|
39
|
+
*******************************/
|
|
40
|
+
|
|
41
|
+
h1,
|
|
42
|
+
h2,
|
|
43
|
+
h3,
|
|
44
|
+
h4,
|
|
45
|
+
h5 {
|
|
46
|
+
font-family: Arial, sans-serif;
|
|
47
|
+
line-height: 1.2857em;
|
|
48
|
+
margin: calc(2rem - 0.1429em) 0em 1rem;
|
|
49
|
+
font-weight: bold;
|
|
50
|
+
padding: 0em;
|
|
51
|
+
}
|
|
52
|
+
h1 {
|
|
53
|
+
min-height: 1rem;
|
|
54
|
+
font-size: 2rem;
|
|
55
|
+
}
|
|
56
|
+
h2 {
|
|
57
|
+
font-size: 1.7143rem;
|
|
58
|
+
}
|
|
59
|
+
h3 {
|
|
60
|
+
font-size: 1.2857rem;
|
|
61
|
+
}
|
|
62
|
+
h4 {
|
|
63
|
+
font-size: 1.0714rem;
|
|
64
|
+
}
|
|
65
|
+
h5 {
|
|
66
|
+
font-size: 1rem;
|
|
67
|
+
}
|
|
68
|
+
h1:first-child,
|
|
69
|
+
h2:first-child,
|
|
70
|
+
h3:first-child,
|
|
71
|
+
h4:first-child,
|
|
72
|
+
h5:first-child {
|
|
73
|
+
margin-top: 0em;
|
|
74
|
+
}
|
|
75
|
+
h1:last-child,
|
|
76
|
+
h2:last-child,
|
|
77
|
+
h3:last-child,
|
|
78
|
+
h4:last-child,
|
|
79
|
+
h5:last-child {
|
|
80
|
+
margin-bottom: 0em;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
/*******************************
|
|
85
|
+
Text
|
|
86
|
+
*******************************/
|
|
87
|
+
|
|
88
|
+
p {
|
|
89
|
+
margin: 0em 0em 1em;
|
|
90
|
+
line-height: 1.4285em;
|
|
91
|
+
}
|
|
92
|
+
p:first-child {
|
|
93
|
+
margin-top: 0em;
|
|
94
|
+
}
|
|
95
|
+
p:last-child {
|
|
96
|
+
margin-bottom: 0em;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/*-------------------
|
|
100
|
+
Links
|
|
101
|
+
--------------------*/
|
|
102
|
+
|
|
103
|
+
a {
|
|
104
|
+
color: #4183C4;
|
|
105
|
+
text-decoration: none;
|
|
106
|
+
}
|
|
107
|
+
a:hover {
|
|
108
|
+
color: #1e70bf;
|
|
109
|
+
text-decoration: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
/*******************************
|
|
114
|
+
Scrollbars
|
|
115
|
+
*******************************/
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
/*******************************
|
|
120
|
+
Highlighting
|
|
121
|
+
*******************************/
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
/* Site */
|
|
125
|
+
::selection {
|
|
126
|
+
background-color: #CCE2FF;
|
|
127
|
+
color: rgb(0 0 0 / 87%);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Form */
|
|
131
|
+
textarea::selection,
|
|
132
|
+
input::selection {
|
|
133
|
+
background-color: rgb(100 100 100 / 40%);
|
|
134
|
+
color: rgb(0 0 0 / 87%);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Force Simple Scrollbars */
|
|
138
|
+
body ::-webkit-scrollbar {
|
|
139
|
+
appearance: none;
|
|
140
|
+
width: 10px;
|
|
141
|
+
height: 10px;
|
|
142
|
+
}
|
|
143
|
+
body ::-webkit-scrollbar-track {
|
|
144
|
+
background: rgb(0 0 0 / 10%);
|
|
145
|
+
border-radius: 0px;
|
|
146
|
+
}
|
|
147
|
+
body ::-webkit-scrollbar-thumb {
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
border-radius: 5px;
|
|
150
|
+
background: rgb(0 0 0 / 25%);
|
|
151
|
+
transition: color 0.2s ease;
|
|
152
|
+
}
|
|
153
|
+
body ::-webkit-scrollbar-thumb:window-inactive {
|
|
154
|
+
background: rgb(0 0 0 / 15%);
|
|
155
|
+
}
|
|
156
|
+
body ::-webkit-scrollbar-thumb:hover {
|
|
157
|
+
background: rgb(128 135 139 / 80%);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Inverted UI */
|
|
161
|
+
body .ui.inverted::-webkit-scrollbar-track {
|
|
162
|
+
background: rgb(255 255 255 / 10%);
|
|
163
|
+
}
|
|
164
|
+
body .ui.inverted::-webkit-scrollbar-thumb {
|
|
165
|
+
background: rgb(255 255 255 / 25%);
|
|
166
|
+
}
|
|
167
|
+
body .ui.inverted::-webkit-scrollbar-thumb:window-inactive {
|
|
168
|
+
background: rgb(255 255 255 / 15%);
|
|
169
|
+
}
|
|
170
|
+
body .ui.inverted::-webkit-scrollbar-thumb:hover {
|
|
171
|
+
background: rgb(255 255 255 / 35%);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
/*******************************
|
|
176
|
+
Global Overrides
|
|
177
|
+
*******************************/
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
/*******************************
|
|
182
|
+
Site Overrides
|
|
183
|
+
*******************************/
|
|
184
|
+
|
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* # Semantic UI 2.4.1 - Site
|
|
3
|
+
* http://github.com/semantic-org/semantic-ui/
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* Released under the MIT license
|
|
7
|
+
* http://opensource.org/licenses/MIT
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
;(function ($, window, document, undefined) {
|
|
12
|
+
|
|
13
|
+
$.site = $.fn.site = function(parameters) {
|
|
14
|
+
var
|
|
15
|
+
time = new Date().getTime(),
|
|
16
|
+
performance = [],
|
|
17
|
+
|
|
18
|
+
query = arguments[0],
|
|
19
|
+
methodInvoked = (typeof query == 'string'),
|
|
20
|
+
queryArguments = [].slice.call(arguments, 1),
|
|
21
|
+
|
|
22
|
+
settings = ( $.isPlainObject(parameters) )
|
|
23
|
+
? $.extend(true, {}, $.site.settings, parameters)
|
|
24
|
+
: $.extend({}, $.site.settings),
|
|
25
|
+
|
|
26
|
+
namespace = settings.namespace,
|
|
27
|
+
error = settings.error,
|
|
28
|
+
|
|
29
|
+
eventNamespace = '.' + namespace,
|
|
30
|
+
moduleNamespace = 'module-' + namespace,
|
|
31
|
+
|
|
32
|
+
$document = $(document),
|
|
33
|
+
$module = $document,
|
|
34
|
+
element = this,
|
|
35
|
+
instance = $module.data(moduleNamespace),
|
|
36
|
+
|
|
37
|
+
module,
|
|
38
|
+
returnedValue
|
|
39
|
+
;
|
|
40
|
+
module = {
|
|
41
|
+
|
|
42
|
+
initialize: function() {
|
|
43
|
+
module.instantiate();
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
instantiate: function() {
|
|
47
|
+
module.verbose('Storing instance of site', module);
|
|
48
|
+
instance = module;
|
|
49
|
+
$module
|
|
50
|
+
.data(moduleNamespace, module)
|
|
51
|
+
;
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
normalize: function() {
|
|
55
|
+
module.fix.console();
|
|
56
|
+
module.fix.requestAnimationFrame();
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
fix: {
|
|
60
|
+
console: function() {
|
|
61
|
+
module.debug('Normalizing window.console');
|
|
62
|
+
if (console === undefined || console.log === undefined) {
|
|
63
|
+
module.verbose('Console not available, normalizing events');
|
|
64
|
+
module.disable.console();
|
|
65
|
+
}
|
|
66
|
+
if (typeof console.group == 'undefined' || typeof console.groupEnd == 'undefined' || typeof console.groupCollapsed == 'undefined') {
|
|
67
|
+
module.verbose('Console group not available, normalizing events');
|
|
68
|
+
window.console.group = function() {};
|
|
69
|
+
window.console.groupEnd = function() {};
|
|
70
|
+
window.console.groupCollapsed = function() {};
|
|
71
|
+
}
|
|
72
|
+
if (typeof console.markTimeline == 'undefined') {
|
|
73
|
+
module.verbose('Mark timeline not available, normalizing events');
|
|
74
|
+
window.console.markTimeline = function() {};
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
consoleClear: function() {
|
|
78
|
+
module.debug('Disabling programmatic console clearing');
|
|
79
|
+
window.console.clear = function() {};
|
|
80
|
+
},
|
|
81
|
+
requestAnimationFrame: function() {
|
|
82
|
+
module.debug('Normalizing requestAnimationFrame');
|
|
83
|
+
if(window.requestAnimationFrame === undefined) {
|
|
84
|
+
module.debug('RequestAnimationFrame not available, normalizing event');
|
|
85
|
+
window.requestAnimationFrame = window.requestAnimationFrame
|
|
86
|
+
|| window.mozRequestAnimationFrame
|
|
87
|
+
|| window.webkitRequestAnimationFrame
|
|
88
|
+
|| window.msRequestAnimationFrame
|
|
89
|
+
|| function(callback) { setTimeout(callback, 0); }
|
|
90
|
+
;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
moduleExists: function(name) {
|
|
96
|
+
return ($.fn[name] !== undefined && $.fn[name].settings !== undefined);
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
enabled: {
|
|
100
|
+
modules: function(modules) {
|
|
101
|
+
var
|
|
102
|
+
enabledModules = []
|
|
103
|
+
;
|
|
104
|
+
modules = modules || settings.modules;
|
|
105
|
+
$.each(modules, function(index, name) {
|
|
106
|
+
if(module.moduleExists(name)) {
|
|
107
|
+
enabledModules.push(name);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
return enabledModules;
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
disabled: {
|
|
115
|
+
modules: function(modules) {
|
|
116
|
+
var
|
|
117
|
+
disabledModules = []
|
|
118
|
+
;
|
|
119
|
+
modules = modules || settings.modules;
|
|
120
|
+
$.each(modules, function(index, name) {
|
|
121
|
+
if(!module.moduleExists(name)) {
|
|
122
|
+
disabledModules.push(name);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return disabledModules;
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
change: {
|
|
130
|
+
setting: function(setting, value, modules, modifyExisting) {
|
|
131
|
+
modules = (typeof modules === 'string')
|
|
132
|
+
? (modules === 'all')
|
|
133
|
+
? settings.modules
|
|
134
|
+
: [modules]
|
|
135
|
+
: modules || settings.modules
|
|
136
|
+
;
|
|
137
|
+
modifyExisting = (modifyExisting !== undefined)
|
|
138
|
+
? modifyExisting
|
|
139
|
+
: true
|
|
140
|
+
;
|
|
141
|
+
$.each(modules, function(index, name) {
|
|
142
|
+
var
|
|
143
|
+
namespace = (module.moduleExists(name))
|
|
144
|
+
? $.fn[name].settings.namespace || false
|
|
145
|
+
: true,
|
|
146
|
+
$existingModules
|
|
147
|
+
;
|
|
148
|
+
if(module.moduleExists(name)) {
|
|
149
|
+
module.verbose('Changing default setting', setting, value, name);
|
|
150
|
+
$.fn[name].settings[setting] = value;
|
|
151
|
+
if(modifyExisting && namespace) {
|
|
152
|
+
$existingModules = $(':data(module-' + namespace + ')');
|
|
153
|
+
if($existingModules.length > 0) {
|
|
154
|
+
module.verbose('Modifying existing settings', $existingModules);
|
|
155
|
+
$existingModules[name]('setting', setting, value);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
settings: function(newSettings, modules, modifyExisting) {
|
|
162
|
+
modules = (typeof modules === 'string')
|
|
163
|
+
? [modules]
|
|
164
|
+
: modules || settings.modules
|
|
165
|
+
;
|
|
166
|
+
modifyExisting = (modifyExisting !== undefined)
|
|
167
|
+
? modifyExisting
|
|
168
|
+
: true
|
|
169
|
+
;
|
|
170
|
+
$.each(modules, function(index, name) {
|
|
171
|
+
var
|
|
172
|
+
$existingModules
|
|
173
|
+
;
|
|
174
|
+
if(module.moduleExists(name)) {
|
|
175
|
+
module.verbose('Changing default setting', newSettings, name);
|
|
176
|
+
$.extend(true, $.fn[name].settings, newSettings);
|
|
177
|
+
if(modifyExisting && namespace) {
|
|
178
|
+
$existingModules = $(':data(module-' + namespace + ')');
|
|
179
|
+
if($existingModules.length > 0) {
|
|
180
|
+
module.verbose('Modifying existing settings', $existingModules);
|
|
181
|
+
$existingModules[name]('setting', newSettings);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
enable: {
|
|
190
|
+
console: function() {
|
|
191
|
+
module.console(true);
|
|
192
|
+
},
|
|
193
|
+
debug: function(modules, modifyExisting) {
|
|
194
|
+
modules = modules || settings.modules;
|
|
195
|
+
module.debug('Enabling debug for modules', modules);
|
|
196
|
+
module.change.setting('debug', true, modules, modifyExisting);
|
|
197
|
+
},
|
|
198
|
+
verbose: function(modules, modifyExisting) {
|
|
199
|
+
modules = modules || settings.modules;
|
|
200
|
+
module.debug('Enabling verbose debug for modules', modules);
|
|
201
|
+
module.change.setting('verbose', true, modules, modifyExisting);
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
disable: {
|
|
205
|
+
console: function() {
|
|
206
|
+
module.console(false);
|
|
207
|
+
},
|
|
208
|
+
debug: function(modules, modifyExisting) {
|
|
209
|
+
modules = modules || settings.modules;
|
|
210
|
+
module.debug('Disabling debug for modules', modules);
|
|
211
|
+
module.change.setting('debug', false, modules, modifyExisting);
|
|
212
|
+
},
|
|
213
|
+
verbose: function(modules, modifyExisting) {
|
|
214
|
+
modules = modules || settings.modules;
|
|
215
|
+
module.debug('Disabling verbose debug for modules', modules);
|
|
216
|
+
module.change.setting('verbose', false, modules, modifyExisting);
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
console: function(enable) {
|
|
221
|
+
if(enable) {
|
|
222
|
+
if(instance.cache.console === undefined) {
|
|
223
|
+
module.error(error.console);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
module.debug('Restoring console function');
|
|
227
|
+
window.console = instance.cache.console;
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
module.debug('Disabling console function');
|
|
231
|
+
instance.cache.console = window.console;
|
|
232
|
+
window.console = {
|
|
233
|
+
clear : function(){},
|
|
234
|
+
error : function(){},
|
|
235
|
+
group : function(){},
|
|
236
|
+
groupCollapsed : function(){},
|
|
237
|
+
groupEnd : function(){},
|
|
238
|
+
info : function(){},
|
|
239
|
+
log : function(){},
|
|
240
|
+
markTimeline : function(){},
|
|
241
|
+
warn : function(){}
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
destroy: function() {
|
|
247
|
+
module.verbose('Destroying previous site for', $module);
|
|
248
|
+
$module
|
|
249
|
+
.removeData(moduleNamespace)
|
|
250
|
+
;
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
cache: {},
|
|
254
|
+
|
|
255
|
+
setting: function(name, value) {
|
|
256
|
+
if( $.isPlainObject(name) ) {
|
|
257
|
+
$.extend(true, settings, name);
|
|
258
|
+
}
|
|
259
|
+
else if(value !== undefined) {
|
|
260
|
+
settings[name] = value;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
return settings[name];
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
internal: function(name, value) {
|
|
267
|
+
if( $.isPlainObject(name) ) {
|
|
268
|
+
$.extend(true, module, name);
|
|
269
|
+
}
|
|
270
|
+
else if(value !== undefined) {
|
|
271
|
+
module[name] = value;
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
return module[name];
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
debug: function() {
|
|
278
|
+
if(settings.debug) {
|
|
279
|
+
if(settings.performance) {
|
|
280
|
+
module.performance.log(arguments);
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
|
284
|
+
module.debug.apply(console, arguments);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
verbose: function() {
|
|
289
|
+
if(settings.verbose && settings.debug) {
|
|
290
|
+
if(settings.performance) {
|
|
291
|
+
module.performance.log(arguments);
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
|
295
|
+
module.verbose.apply(console, arguments);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
error: function() {
|
|
300
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
|
301
|
+
module.error.apply(console, arguments);
|
|
302
|
+
},
|
|
303
|
+
performance: {
|
|
304
|
+
log: function(message) {
|
|
305
|
+
var
|
|
306
|
+
currentTime,
|
|
307
|
+
executionTime,
|
|
308
|
+
previousTime
|
|
309
|
+
;
|
|
310
|
+
if(settings.performance) {
|
|
311
|
+
currentTime = new Date().getTime();
|
|
312
|
+
previousTime = time || currentTime;
|
|
313
|
+
executionTime = currentTime - previousTime;
|
|
314
|
+
time = currentTime;
|
|
315
|
+
performance.push({
|
|
316
|
+
'Element' : element,
|
|
317
|
+
'Name' : message[0],
|
|
318
|
+
'Arguments' : [].slice.call(message, 1) || '',
|
|
319
|
+
'Execution Time' : executionTime
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
clearTimeout(module.performance.timer);
|
|
323
|
+
module.performance.timer = setTimeout(module.performance.display, 500);
|
|
324
|
+
},
|
|
325
|
+
display: function() {
|
|
326
|
+
var
|
|
327
|
+
title = settings.name + ':',
|
|
328
|
+
totalTime = 0
|
|
329
|
+
;
|
|
330
|
+
time = false;
|
|
331
|
+
clearTimeout(module.performance.timer);
|
|
332
|
+
$.each(performance, function(index, data) {
|
|
333
|
+
totalTime += data['Execution Time'];
|
|
334
|
+
});
|
|
335
|
+
title += ' ' + totalTime + 'ms';
|
|
336
|
+
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
|
337
|
+
console.groupCollapsed(title);
|
|
338
|
+
if(console.table) {
|
|
339
|
+
console.table(performance);
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
$.each(performance, function(index, data) {
|
|
343
|
+
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
console.groupEnd();
|
|
347
|
+
}
|
|
348
|
+
performance = [];
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
invoke: function(query, passedArguments, context) {
|
|
352
|
+
var
|
|
353
|
+
object = instance,
|
|
354
|
+
maxDepth,
|
|
355
|
+
found,
|
|
356
|
+
response
|
|
357
|
+
;
|
|
358
|
+
passedArguments = passedArguments || queryArguments;
|
|
359
|
+
context = element || context;
|
|
360
|
+
if(typeof query == 'string' && object !== undefined) {
|
|
361
|
+
query = query.split(/[\. ]/);
|
|
362
|
+
maxDepth = query.length - 1;
|
|
363
|
+
$.each(query, function(depth, value) {
|
|
364
|
+
var camelCaseValue = (depth != maxDepth)
|
|
365
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
366
|
+
: query
|
|
367
|
+
;
|
|
368
|
+
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
|
369
|
+
object = object[camelCaseValue];
|
|
370
|
+
}
|
|
371
|
+
else if( object[camelCaseValue] !== undefined ) {
|
|
372
|
+
found = object[camelCaseValue];
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
|
376
|
+
object = object[value];
|
|
377
|
+
}
|
|
378
|
+
else if( object[value] !== undefined ) {
|
|
379
|
+
found = object[value];
|
|
380
|
+
return false;
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
module.error(error.method, query);
|
|
384
|
+
return false;
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
if ( $.isFunction( found ) ) {
|
|
389
|
+
response = found.apply(context, passedArguments);
|
|
390
|
+
}
|
|
391
|
+
else if(found !== undefined) {
|
|
392
|
+
response = found;
|
|
393
|
+
}
|
|
394
|
+
if($.isArray(returnedValue)) {
|
|
395
|
+
returnedValue.push(response);
|
|
396
|
+
}
|
|
397
|
+
else if(returnedValue !== undefined) {
|
|
398
|
+
returnedValue = [returnedValue, response];
|
|
399
|
+
}
|
|
400
|
+
else if(response !== undefined) {
|
|
401
|
+
returnedValue = response;
|
|
402
|
+
}
|
|
403
|
+
return found;
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
if(methodInvoked) {
|
|
408
|
+
if(instance === undefined) {
|
|
409
|
+
module.initialize();
|
|
410
|
+
}
|
|
411
|
+
module.invoke(query);
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
if(instance !== undefined) {
|
|
415
|
+
module.destroy();
|
|
416
|
+
}
|
|
417
|
+
module.initialize();
|
|
418
|
+
}
|
|
419
|
+
return (returnedValue !== undefined)
|
|
420
|
+
? returnedValue
|
|
421
|
+
: this
|
|
422
|
+
;
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
$.site.settings = {
|
|
426
|
+
|
|
427
|
+
name : 'Site',
|
|
428
|
+
namespace : 'site',
|
|
429
|
+
|
|
430
|
+
error : {
|
|
431
|
+
console : 'Console cannot be restored, most likely it was overwritten outside of module',
|
|
432
|
+
method : 'The method you called is not defined.'
|
|
433
|
+
},
|
|
434
|
+
|
|
435
|
+
debug : false,
|
|
436
|
+
verbose : false,
|
|
437
|
+
performance : true,
|
|
438
|
+
|
|
439
|
+
modules: [
|
|
440
|
+
'accordion',
|
|
441
|
+
'api',
|
|
442
|
+
'checkbox',
|
|
443
|
+
'dimmer',
|
|
444
|
+
'dropdown',
|
|
445
|
+
'embed',
|
|
446
|
+
'form',
|
|
447
|
+
'modal',
|
|
448
|
+
'nag',
|
|
449
|
+
'popup',
|
|
450
|
+
'rating',
|
|
451
|
+
'shape',
|
|
452
|
+
'sidebar',
|
|
453
|
+
'state',
|
|
454
|
+
'sticky',
|
|
455
|
+
'tab',
|
|
456
|
+
'transition',
|
|
457
|
+
'visit',
|
|
458
|
+
'visibility'
|
|
459
|
+
],
|
|
460
|
+
|
|
461
|
+
siteNamespace : 'site',
|
|
462
|
+
namespaceStub : {
|
|
463
|
+
cache : {},
|
|
464
|
+
config : {},
|
|
465
|
+
sections : {},
|
|
466
|
+
section : {},
|
|
467
|
+
utilities : {}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
// allows for selection of elements with data attributes
|
|
473
|
+
$.extend($.expr[ ":" ], {
|
|
474
|
+
data: ($.expr.createPseudo)
|
|
475
|
+
? $.expr.createPseudo(function(dataName) {
|
|
476
|
+
return function(elem) {
|
|
477
|
+
return !!$.data(elem, dataName);
|
|
478
|
+
};
|
|
479
|
+
})
|
|
480
|
+
: function(elem, i, match) {
|
|
481
|
+
// support: jQuery < 1.8
|
|
482
|
+
return !!$.data(elem, match[ 3 ]);
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
})( jQuery, window, document );
|