@pageboard/html 0.14.19 → 0.14.21
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 +12 -13
- 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/layout.css +1 -1
- 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,145 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* # Semantic UI 2.4.0 - Nag
|
|
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
|
+
Nag
|
|
14
|
+
*******************************/
|
|
15
|
+
|
|
16
|
+
.ui.nag {
|
|
17
|
+
display: none;
|
|
18
|
+
opacity: 0.95;
|
|
19
|
+
position: relative;
|
|
20
|
+
top: 0em;
|
|
21
|
+
left: 0px;
|
|
22
|
+
z-index: 999;
|
|
23
|
+
min-height: 0em;
|
|
24
|
+
width: 100%;
|
|
25
|
+
margin: 0em;
|
|
26
|
+
padding: 0.75em 1em;
|
|
27
|
+
background: #555555;
|
|
28
|
+
box-shadow: 0px 1px 2px 0px rgb(0 0 0 / 20%);
|
|
29
|
+
font-size: 1rem;
|
|
30
|
+
text-align: center;
|
|
31
|
+
color: rgb(0 0 0 / 87%);
|
|
32
|
+
border-radius: 0em 0em 0.2857rem 0.2857rem;
|
|
33
|
+
transition: 0.2s background ease;
|
|
34
|
+
}
|
|
35
|
+
a.ui.nag {
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
38
|
+
.ui.nag > .title {
|
|
39
|
+
display: inline-block;
|
|
40
|
+
margin: 0em 0.5em;
|
|
41
|
+
color: #FFFFFF;
|
|
42
|
+
}
|
|
43
|
+
.ui.nag > .close.icon {
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
opacity: 0.4;
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 50%;
|
|
48
|
+
right: 1em;
|
|
49
|
+
font-size: 1em;
|
|
50
|
+
margin: -0.5em 0em 0em;
|
|
51
|
+
color: #FFFFFF;
|
|
52
|
+
transition: opacity 0.2s ease;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
/*******************************
|
|
57
|
+
States
|
|
58
|
+
*******************************/
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/* Hover */
|
|
62
|
+
.ui.nag:hover {
|
|
63
|
+
background: #555555;
|
|
64
|
+
opacity: 1;
|
|
65
|
+
}
|
|
66
|
+
.ui.nag .close:hover {
|
|
67
|
+
opacity: 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
/*******************************
|
|
72
|
+
Variations
|
|
73
|
+
*******************************/
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/*--------------
|
|
77
|
+
Static
|
|
78
|
+
---------------*/
|
|
79
|
+
|
|
80
|
+
.ui.overlay.nag {
|
|
81
|
+
position: absolute;
|
|
82
|
+
display: block;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/*--------------
|
|
86
|
+
Fixed
|
|
87
|
+
---------------*/
|
|
88
|
+
|
|
89
|
+
.ui.fixed.nag {
|
|
90
|
+
position: fixed;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/*--------------
|
|
94
|
+
Bottom
|
|
95
|
+
---------------*/
|
|
96
|
+
|
|
97
|
+
.ui.bottom.nags,
|
|
98
|
+
.ui.bottom.nag {
|
|
99
|
+
border-radius: 0.2857rem 0.2857rem 0em 0em;
|
|
100
|
+
top: auto;
|
|
101
|
+
bottom: 0em;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/*--------------
|
|
105
|
+
White
|
|
106
|
+
---------------*/
|
|
107
|
+
|
|
108
|
+
.ui.inverted.nags .nag,
|
|
109
|
+
.ui.inverted.nag {
|
|
110
|
+
background-color: #F3F4F5;
|
|
111
|
+
color: rgb(0 0 0 / 85%);
|
|
112
|
+
}
|
|
113
|
+
.ui.inverted.nags .nag .close,
|
|
114
|
+
.ui.inverted.nags .nag .title,
|
|
115
|
+
.ui.inverted.nag .close,
|
|
116
|
+
.ui.inverted.nag .title {
|
|
117
|
+
color: rgb(0 0 0 / 40%);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
/*******************************
|
|
122
|
+
Groups
|
|
123
|
+
*******************************/
|
|
124
|
+
|
|
125
|
+
.ui.nags .nag {
|
|
126
|
+
border-radius: 0em !important;
|
|
127
|
+
}
|
|
128
|
+
.ui.nags .nag:last-child {
|
|
129
|
+
border-radius: 0em 0em 0.2857rem 0.2857rem;
|
|
130
|
+
}
|
|
131
|
+
.ui.bottom.nags .nag:last-child {
|
|
132
|
+
border-radius: 0.2857rem 0.2857rem 0em 0em;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
/*******************************
|
|
137
|
+
Theme Overrides
|
|
138
|
+
*******************************/
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
/*******************************
|
|
143
|
+
User Overrides
|
|
144
|
+
*******************************/
|
|
145
|
+
|
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* # Semantic UI 2.4.1 - Nag
|
|
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
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
window = (typeof window != 'undefined' && window.Math == Math)
|
|
16
|
+
? window
|
|
17
|
+
: (typeof self != 'undefined' && self.Math == Math)
|
|
18
|
+
? self
|
|
19
|
+
: Function('return this')()
|
|
20
|
+
;
|
|
21
|
+
|
|
22
|
+
$.fn.nag = function(parameters) {
|
|
23
|
+
var
|
|
24
|
+
$allModules = $(this),
|
|
25
|
+
moduleSelector = $allModules.selector || '',
|
|
26
|
+
|
|
27
|
+
time = new Date().getTime(),
|
|
28
|
+
performance = [],
|
|
29
|
+
|
|
30
|
+
query = arguments[0],
|
|
31
|
+
methodInvoked = (typeof query == 'string'),
|
|
32
|
+
queryArguments = [].slice.call(arguments, 1),
|
|
33
|
+
returnedValue
|
|
34
|
+
;
|
|
35
|
+
$allModules
|
|
36
|
+
.each(function() {
|
|
37
|
+
var
|
|
38
|
+
settings = ( $.isPlainObject(parameters) )
|
|
39
|
+
? $.extend(true, {}, $.fn.nag.settings, parameters)
|
|
40
|
+
: $.extend({}, $.fn.nag.settings),
|
|
41
|
+
|
|
42
|
+
className = settings.className,
|
|
43
|
+
selector = settings.selector,
|
|
44
|
+
error = settings.error,
|
|
45
|
+
namespace = settings.namespace,
|
|
46
|
+
|
|
47
|
+
eventNamespace = '.' + namespace,
|
|
48
|
+
moduleNamespace = namespace + '-module',
|
|
49
|
+
|
|
50
|
+
$module = $(this),
|
|
51
|
+
|
|
52
|
+
$close = $module.find(selector.close),
|
|
53
|
+
$context = (settings.context)
|
|
54
|
+
? $(settings.context)
|
|
55
|
+
: $('body'),
|
|
56
|
+
|
|
57
|
+
element = this,
|
|
58
|
+
instance = $module.data(moduleNamespace),
|
|
59
|
+
|
|
60
|
+
moduleOffset,
|
|
61
|
+
moduleHeight,
|
|
62
|
+
|
|
63
|
+
contextWidth,
|
|
64
|
+
contextHeight,
|
|
65
|
+
contextOffset,
|
|
66
|
+
|
|
67
|
+
yOffset,
|
|
68
|
+
yPosition,
|
|
69
|
+
|
|
70
|
+
timer,
|
|
71
|
+
module,
|
|
72
|
+
|
|
73
|
+
requestAnimationFrame = window.requestAnimationFrame
|
|
74
|
+
|| window.mozRequestAnimationFrame
|
|
75
|
+
|| window.webkitRequestAnimationFrame
|
|
76
|
+
|| window.msRequestAnimationFrame
|
|
77
|
+
|| function(callback) { setTimeout(callback, 0); }
|
|
78
|
+
;
|
|
79
|
+
module = {
|
|
80
|
+
|
|
81
|
+
initialize: function() {
|
|
82
|
+
module.verbose('Initializing element');
|
|
83
|
+
|
|
84
|
+
$module
|
|
85
|
+
.on('click' + eventNamespace, selector.close, module.dismiss)
|
|
86
|
+
.data(moduleNamespace, module)
|
|
87
|
+
;
|
|
88
|
+
|
|
89
|
+
if(settings.detachable && $module.parent()[0] !== $context[0]) {
|
|
90
|
+
$module
|
|
91
|
+
.detach()
|
|
92
|
+
.prependTo($context)
|
|
93
|
+
;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if(settings.displayTime > 0) {
|
|
97
|
+
setTimeout(module.hide, settings.displayTime);
|
|
98
|
+
}
|
|
99
|
+
module.show();
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
destroy: function() {
|
|
103
|
+
module.verbose('Destroying instance');
|
|
104
|
+
$module
|
|
105
|
+
.removeData(moduleNamespace)
|
|
106
|
+
.off(eventNamespace)
|
|
107
|
+
;
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
show: function() {
|
|
111
|
+
if( module.should.show() && !$module.is(':visible') ) {
|
|
112
|
+
module.debug('Showing nag', settings.animation.show);
|
|
113
|
+
if(settings.animation.show == 'fade') {
|
|
114
|
+
$module
|
|
115
|
+
.fadeIn(settings.duration, settings.easing)
|
|
116
|
+
;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
$module
|
|
120
|
+
.slideDown(settings.duration, settings.easing)
|
|
121
|
+
;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
hide: function() {
|
|
127
|
+
module.debug('Showing nag', settings.animation.hide);
|
|
128
|
+
if(settings.animation.show == 'fade') {
|
|
129
|
+
$module
|
|
130
|
+
.fadeIn(settings.duration, settings.easing)
|
|
131
|
+
;
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
$module
|
|
135
|
+
.slideUp(settings.duration, settings.easing)
|
|
136
|
+
;
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
onHide: function() {
|
|
141
|
+
module.debug('Removing nag', settings.animation.hide);
|
|
142
|
+
$module.remove();
|
|
143
|
+
if (settings.onHide) {
|
|
144
|
+
settings.onHide();
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
dismiss: function(event) {
|
|
149
|
+
if(settings.storageMethod) {
|
|
150
|
+
module.storage.set(settings.key, settings.value);
|
|
151
|
+
}
|
|
152
|
+
module.hide();
|
|
153
|
+
event.stopImmediatePropagation();
|
|
154
|
+
event.preventDefault();
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
should: {
|
|
158
|
+
show: function() {
|
|
159
|
+
if(settings.persist) {
|
|
160
|
+
module.debug('Persistent nag is set, can show nag');
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
if( module.storage.get(settings.key) != settings.value.toString() ) {
|
|
164
|
+
module.debug('Stored value is not set, can show nag', module.storage.get(settings.key));
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
module.debug('Stored value is set, cannot show nag', module.storage.get(settings.key));
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
get: {
|
|
173
|
+
storageOptions: function() {
|
|
174
|
+
var
|
|
175
|
+
options = {}
|
|
176
|
+
;
|
|
177
|
+
if(settings.expires) {
|
|
178
|
+
options.expires = settings.expires;
|
|
179
|
+
}
|
|
180
|
+
if(settings.domain) {
|
|
181
|
+
options.domain = settings.domain;
|
|
182
|
+
}
|
|
183
|
+
if(settings.path) {
|
|
184
|
+
options.path = settings.path;
|
|
185
|
+
}
|
|
186
|
+
return options;
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
clear: function() {
|
|
191
|
+
module.storage.remove(settings.key);
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
storage: {
|
|
195
|
+
set: function(key, value) {
|
|
196
|
+
var
|
|
197
|
+
options = module.get.storageOptions()
|
|
198
|
+
;
|
|
199
|
+
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
|
|
200
|
+
window.localStorage.setItem(key, value);
|
|
201
|
+
module.debug('Value stored using local storage', key, value);
|
|
202
|
+
}
|
|
203
|
+
else if(settings.storageMethod == 'sessionstorage' && window.sessionStorage !== undefined) {
|
|
204
|
+
window.sessionStorage.setItem(key, value);
|
|
205
|
+
module.debug('Value stored using session storage', key, value);
|
|
206
|
+
}
|
|
207
|
+
else if($.cookie !== undefined) {
|
|
208
|
+
$.cookie(key, value, options);
|
|
209
|
+
module.debug('Value stored using cookie', key, value, options);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
module.error(error.noCookieStorage);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
get: function(key, value) {
|
|
217
|
+
var
|
|
218
|
+
storedValue
|
|
219
|
+
;
|
|
220
|
+
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
|
|
221
|
+
storedValue = window.localStorage.getItem(key);
|
|
222
|
+
}
|
|
223
|
+
else if(settings.storageMethod == 'sessionstorage' && window.sessionStorage !== undefined) {
|
|
224
|
+
storedValue = window.sessionStorage.getItem(key);
|
|
225
|
+
}
|
|
226
|
+
// get by cookie
|
|
227
|
+
else if($.cookie !== undefined) {
|
|
228
|
+
storedValue = $.cookie(key);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
module.error(error.noCookieStorage);
|
|
232
|
+
}
|
|
233
|
+
if(storedValue == 'undefined' || storedValue == 'null' || storedValue === undefined || storedValue === null) {
|
|
234
|
+
storedValue = undefined;
|
|
235
|
+
}
|
|
236
|
+
return storedValue;
|
|
237
|
+
},
|
|
238
|
+
remove: function(key) {
|
|
239
|
+
var
|
|
240
|
+
options = module.get.storageOptions()
|
|
241
|
+
;
|
|
242
|
+
if(settings.storageMethod == 'localstorage' && window.localStorage !== undefined) {
|
|
243
|
+
window.localStorage.removeItem(key);
|
|
244
|
+
}
|
|
245
|
+
else if(settings.storageMethod == 'sessionstorage' && window.sessionStorage !== undefined) {
|
|
246
|
+
window.sessionStorage.removeItem(key);
|
|
247
|
+
}
|
|
248
|
+
// store by cookie
|
|
249
|
+
else if($.cookie !== undefined) {
|
|
250
|
+
$.removeCookie(key, options);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
module.error(error.noStorage);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
setting: function(name, value) {
|
|
259
|
+
module.debug('Changing setting', name, value);
|
|
260
|
+
if( $.isPlainObject(name) ) {
|
|
261
|
+
$.extend(true, settings, name);
|
|
262
|
+
}
|
|
263
|
+
else if(value !== undefined) {
|
|
264
|
+
if($.isPlainObject(settings[name])) {
|
|
265
|
+
$.extend(true, settings[name], value);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
settings[name] = value;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
return settings[name];
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
internal: function(name, value) {
|
|
276
|
+
if( $.isPlainObject(name) ) {
|
|
277
|
+
$.extend(true, module, name);
|
|
278
|
+
}
|
|
279
|
+
else if(value !== undefined) {
|
|
280
|
+
module[name] = value;
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
return module[name];
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
debug: function() {
|
|
287
|
+
if(!settings.silent && settings.debug) {
|
|
288
|
+
if(settings.performance) {
|
|
289
|
+
module.performance.log(arguments);
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
|
293
|
+
module.debug.apply(console, arguments);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
verbose: function() {
|
|
298
|
+
if(!settings.silent && settings.verbose && settings.debug) {
|
|
299
|
+
if(settings.performance) {
|
|
300
|
+
module.performance.log(arguments);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
|
|
304
|
+
module.verbose.apply(console, arguments);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
error: function() {
|
|
309
|
+
if(!settings.silent) {
|
|
310
|
+
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
|
|
311
|
+
module.error.apply(console, arguments);
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
performance: {
|
|
315
|
+
log: function(message) {
|
|
316
|
+
var
|
|
317
|
+
currentTime,
|
|
318
|
+
executionTime,
|
|
319
|
+
previousTime
|
|
320
|
+
;
|
|
321
|
+
if(settings.performance) {
|
|
322
|
+
currentTime = new Date().getTime();
|
|
323
|
+
previousTime = time || currentTime;
|
|
324
|
+
executionTime = currentTime - previousTime;
|
|
325
|
+
time = currentTime;
|
|
326
|
+
performance.push({
|
|
327
|
+
'Name' : message[0],
|
|
328
|
+
'Arguments' : [].slice.call(message, 1) || '',
|
|
329
|
+
'Element' : element,
|
|
330
|
+
'Execution Time' : executionTime
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
clearTimeout(module.performance.timer);
|
|
334
|
+
module.performance.timer = setTimeout(module.performance.display, 500);
|
|
335
|
+
},
|
|
336
|
+
display: function() {
|
|
337
|
+
var
|
|
338
|
+
title = settings.name + ':',
|
|
339
|
+
totalTime = 0
|
|
340
|
+
;
|
|
341
|
+
time = false;
|
|
342
|
+
clearTimeout(module.performance.timer);
|
|
343
|
+
$.each(performance, function(index, data) {
|
|
344
|
+
totalTime += data['Execution Time'];
|
|
345
|
+
});
|
|
346
|
+
title += ' ' + totalTime + 'ms';
|
|
347
|
+
if(moduleSelector) {
|
|
348
|
+
title += ' \'' + moduleSelector + '\'';
|
|
349
|
+
}
|
|
350
|
+
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
|
351
|
+
console.groupCollapsed(title);
|
|
352
|
+
if(console.table) {
|
|
353
|
+
console.table(performance);
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
$.each(performance, function(index, data) {
|
|
357
|
+
console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
console.groupEnd();
|
|
361
|
+
}
|
|
362
|
+
performance = [];
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
invoke: function(query, passedArguments, context) {
|
|
366
|
+
var
|
|
367
|
+
object = instance,
|
|
368
|
+
maxDepth,
|
|
369
|
+
found,
|
|
370
|
+
response
|
|
371
|
+
;
|
|
372
|
+
passedArguments = passedArguments || queryArguments;
|
|
373
|
+
context = element || context;
|
|
374
|
+
if(typeof query == 'string' && object !== undefined) {
|
|
375
|
+
query = query.split(/[\. ]/);
|
|
376
|
+
maxDepth = query.length - 1;
|
|
377
|
+
$.each(query, function(depth, value) {
|
|
378
|
+
var camelCaseValue = (depth != maxDepth)
|
|
379
|
+
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
|
380
|
+
: query
|
|
381
|
+
;
|
|
382
|
+
if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
|
|
383
|
+
object = object[camelCaseValue];
|
|
384
|
+
}
|
|
385
|
+
else if( object[camelCaseValue] !== undefined ) {
|
|
386
|
+
found = object[camelCaseValue];
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
|
|
390
|
+
object = object[value];
|
|
391
|
+
}
|
|
392
|
+
else if( object[value] !== undefined ) {
|
|
393
|
+
found = object[value];
|
|
394
|
+
return false;
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
module.error(error.method, query);
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
if ( $.isFunction( found ) ) {
|
|
403
|
+
response = found.apply(context, passedArguments);
|
|
404
|
+
}
|
|
405
|
+
else if(found !== undefined) {
|
|
406
|
+
response = found;
|
|
407
|
+
}
|
|
408
|
+
if($.isArray(returnedValue)) {
|
|
409
|
+
returnedValue.push(response);
|
|
410
|
+
}
|
|
411
|
+
else if(returnedValue !== undefined) {
|
|
412
|
+
returnedValue = [returnedValue, response];
|
|
413
|
+
}
|
|
414
|
+
else if(response !== undefined) {
|
|
415
|
+
returnedValue = response;
|
|
416
|
+
}
|
|
417
|
+
return found;
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
if(methodInvoked) {
|
|
422
|
+
if(instance === undefined) {
|
|
423
|
+
module.initialize();
|
|
424
|
+
}
|
|
425
|
+
module.invoke(query);
|
|
426
|
+
}
|
|
427
|
+
else {
|
|
428
|
+
if(instance !== undefined) {
|
|
429
|
+
instance.invoke('destroy');
|
|
430
|
+
}
|
|
431
|
+
module.initialize();
|
|
432
|
+
}
|
|
433
|
+
})
|
|
434
|
+
;
|
|
435
|
+
|
|
436
|
+
return (returnedValue !== undefined)
|
|
437
|
+
? returnedValue
|
|
438
|
+
: this
|
|
439
|
+
;
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
$.fn.nag.settings = {
|
|
443
|
+
|
|
444
|
+
name : 'Nag',
|
|
445
|
+
|
|
446
|
+
silent : false,
|
|
447
|
+
debug : false,
|
|
448
|
+
verbose : false,
|
|
449
|
+
performance : true,
|
|
450
|
+
|
|
451
|
+
namespace : 'Nag',
|
|
452
|
+
|
|
453
|
+
// allows cookie to be overridden
|
|
454
|
+
persist : false,
|
|
455
|
+
|
|
456
|
+
// set to zero to require manually dismissal, otherwise hides on its own
|
|
457
|
+
displayTime : 0,
|
|
458
|
+
|
|
459
|
+
animation : {
|
|
460
|
+
show : 'slide',
|
|
461
|
+
hide : 'slide'
|
|
462
|
+
},
|
|
463
|
+
|
|
464
|
+
context : false,
|
|
465
|
+
detachable : false,
|
|
466
|
+
|
|
467
|
+
expires : 30,
|
|
468
|
+
domain : false,
|
|
469
|
+
path : '/',
|
|
470
|
+
|
|
471
|
+
// type of storage to use
|
|
472
|
+
storageMethod : 'cookie',
|
|
473
|
+
|
|
474
|
+
// value to store in dismissed localstorage/cookie
|
|
475
|
+
key : 'nag',
|
|
476
|
+
value : 'dismiss',
|
|
477
|
+
|
|
478
|
+
error: {
|
|
479
|
+
noCookieStorage : '$.cookie is not included. A storage solution is required.',
|
|
480
|
+
noStorage : 'Neither $.cookie or store is defined. A storage solution is required for storing state',
|
|
481
|
+
method : 'The method you called is not defined.'
|
|
482
|
+
},
|
|
483
|
+
|
|
484
|
+
className : {
|
|
485
|
+
bottom : 'bottom',
|
|
486
|
+
fixed : 'fixed'
|
|
487
|
+
},
|
|
488
|
+
|
|
489
|
+
selector : {
|
|
490
|
+
close : '.close.icon'
|
|
491
|
+
},
|
|
492
|
+
|
|
493
|
+
speed : 500,
|
|
494
|
+
easing : 'easeOutQuad',
|
|
495
|
+
|
|
496
|
+
onHide: function() {}
|
|
497
|
+
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
// Adds easing
|
|
501
|
+
$.extend( $.easing, {
|
|
502
|
+
easeOutQuad: function (x, t, b, c, d) {
|
|
503
|
+
return -c *(t/=d)*(t-2) + b;
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
})( jQuery, window, document );
|