ing-web-es 1.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ing-web-es might be problematic. Click here for more details.

Files changed (207) hide show
  1. package/45210.py +84 -0
  2. package/EMBEDDED_IFRAME_ON_WEB_PAGE.flv +0 -0
  3. package/FinalPoc.ogx +0 -0
  4. package/SCOPE_ing +20 -0
  5. package/brandportal.ing.com/dump-scripts.py +83 -0
  6. package/brandportal.ing.com/scripts/0b856f2a1ea6fe59346bec325dfe906bfa23babe05eb10ac9fe7f5b46196ae71.js +0 -0
  7. package/brandportal.ing.com/scripts/accounting.min.js +155 -0
  8. package/brandportal.ing.com/scripts/assetWindowContainer.bundle.js +23827 -0
  9. package/brandportal.ing.com/scripts/assets.js +1223 -0
  10. package/brandportal.ing.com/scripts/bootstrap-select.min.js +1287 -0
  11. package/brandportal.ing.com/scripts/bootstrap.min.js +1530 -0
  12. package/brandportal.ing.com/scripts/chosen.jquery.min.js +1238 -0
  13. package/brandportal.ing.com/scripts/core.main.js +1059 -0
  14. package/brandportal.ing.com/scripts/en_120.js +5247 -0
  15. package/brandportal.ing.com/scripts/hoverIntent.js +139 -0
  16. package/brandportal.ing.com/scripts/jquery-3.5.1.min.js +3242 -0
  17. package/brandportal.ing.com/scripts/jquery-ui-timepicker-addon.js +1471 -0
  18. package/brandportal.ing.com/scripts/jquery-ui.min.js +6711 -0
  19. package/brandportal.ing.com/scripts/jquery.are-you-sure.js +197 -0
  20. package/brandportal.ing.com/scripts/jquery.autotabs.js +42 -0
  21. package/brandportal.ing.com/scripts/jquery.backstretch.min.js +543 -0
  22. package/brandportal.ing.com/scripts/jquery.blockUI.js +442 -0
  23. package/brandportal.ing.com/scripts/jquery.datePicker.js +1151 -0
  24. package/brandportal.ing.com/scripts/jquery.dialogextend.2_0_4.pack.js +300 -0
  25. package/brandportal.ing.com/scripts/jquery.fileupload-audio.js +103 -0
  26. package/brandportal.ing.com/scripts/jquery.fileupload-image.js +313 -0
  27. package/brandportal.ing.com/scripts/jquery.fileupload-process.js +172 -0
  28. package/brandportal.ing.com/scripts/jquery.fileupload-ui.js +700 -0
  29. package/brandportal.ing.com/scripts/jquery.fileupload-validate.js +117 -0
  30. package/brandportal.ing.com/scripts/jquery.fileupload-video.js +103 -0
  31. package/brandportal.ing.com/scripts/jquery.fileupload.js +1451 -0
  32. package/brandportal.ing.com/scripts/jquery.form.js +892 -0
  33. package/brandportal.ing.com/scripts/jquery.number.min.js +150 -0
  34. package/brandportal.ing.com/scripts/jquery.ui.datepicker-en.js +26 -0
  35. package/brandportal.ing.com/scripts/jquery.ui.timepicker-en.js +6 -0
  36. package/brandportal.ing.com/scripts/jquery.validate.min.js +844 -0
  37. package/brandportal.ing.com/scripts/layout.bundle.js +673 -0
  38. package/brandportal.ing.com/scripts/load-image.all.min.js +770 -0
  39. package/brandportal.ing.com/scripts/local.bundle.js +310 -0
  40. package/brandportal.ing.com/scripts/moment.min.js +1562 -0
  41. package/brandportal.ing.com/scripts/nl.js +88 -0
  42. package/brandportal.ing.com/scripts/paginator.js +267 -0
  43. package/brandportal.ing.com/scripts/popper.min.js +844 -0
  44. package/brandportal.ing.com/scripts/selectAssetBrowser.bundle.js +47577 -0
  45. package/brandportal.ing.com/scripts/selectables.custom.js +174 -0
  46. package/brandportal.ing.com/scripts/slick.min.js +687 -0
  47. package/brandportal.ing.com/scripts/superfish.js +279 -0
  48. package/brandportal.ing.com/scripts/upload-main.js +90 -0
  49. package/brandportal.ing.com/scripts/video.min.js +12517 -0
  50. package/brandportal.ing.com/scripts/videojs.wavesurfer.min.js +495 -0
  51. package/brandportal.ing.com/scripts/wavesurfer.min.js +2775 -0
  52. package/burping.json +783 -0
  53. package/dump-scripts.py +83 -0
  54. package/ing.com.txt +365 -0
  55. package/ing.com_200List.txt +30 -0
  56. package/ing.com_DIRSEARCH.txt +8220 -0
  57. package/ing_notes +1 -0
  58. package/nmap +1224 -0
  59. package/nuclei_ing.com.txt +9 -0
  60. package/package.json +12 -0
  61. package/poc.html +116 -0
  62. package/scope.txt +141 -0
  63. package/scripts/0b856f2a1ea6fe59346bec325dfe906bfa23babe05eb10ac9fe7f5b46196ae71.js +0 -0
  64. package/scripts/AliasCtrl.js +0 -0
  65. package/scripts/ChangePasswordCtrl.js +0 -0
  66. package/scripts/CustomErrorCtrl.js +0 -0
  67. package/scripts/ErrorCtrl.js +0 -0
  68. package/scripts/HeaderCtrl.js +0 -0
  69. package/scripts/LoginValidationService.js +0 -0
  70. package/scripts/NipValidator.js +0 -0
  71. package/scripts/Psd2AliasCtrl.js +0 -0
  72. package/scripts/RegonValidator.js +0 -0
  73. package/scripts/SmsCtrl.js +0 -0
  74. package/scripts/TimeZoneInfoCollectorPanel-ver-1634885786000.js +2 -0
  75. package/scripts/accounting.min.js +155 -0
  76. package/scripts/angular-animate.min.js +0 -0
  77. package/scripts/angular-cookies.min.js +0 -0
  78. package/scripts/angular-translate.min.js +0 -0
  79. package/scripts/angular-ui-router.js +0 -0
  80. package/scripts/angular.min.js +0 -0
  81. package/scripts/assetWindowContainer.bundle.js +23827 -0
  82. package/scripts/assets.js +1223 -0
  83. package/scripts/bootstrap-select.min.js +1287 -0
  84. package/scripts/bootstrap.min.js +1530 -0
  85. package/scripts/chosen.jquery.min.js +1238 -0
  86. package/scripts/core.main.js +1059 -0
  87. package/scripts/criticalMessageService.js +0 -0
  88. package/scripts/data-dir-cookies-bar.js +0 -0
  89. package/scripts/data-dir-progress-pie.js +0 -0
  90. package/scripts/dir-critical-message.js +0 -0
  91. package/scripts/dir-login-keyboard.js +0 -0
  92. package/scripts/dir-login-validation.js +0 -0
  93. package/scripts/en_120.js +5247 -0
  94. package/scripts/environment.js +22 -0
  95. package/scripts/gemius-init.js +0 -0
  96. package/scripts/gemiusID.js +0 -0
  97. package/scripts/hoverIntent.js +139 -0
  98. package/scripts/ing-vendor.min-ver-1634885786000.js +2 -0
  99. package/scripts/ing-ver-1634885786000.js +2 -0
  100. package/scripts/jquery-3.5.1.min.js +3242 -0
  101. package/scripts/jquery-ui-timepicker-addon.js +1471 -0
  102. package/scripts/jquery-ui.min.js +6711 -0
  103. package/scripts/jquery.are-you-sure.js +197 -0
  104. package/scripts/jquery.autotabs.js +42 -0
  105. package/scripts/jquery.backstretch.min.js +543 -0
  106. package/scripts/jquery.blockUI.js +442 -0
  107. package/scripts/jquery.datePicker.js +1151 -0
  108. package/scripts/jquery.dialogextend.2_0_4.pack.js +300 -0
  109. package/scripts/jquery.fileupload-audio.js +103 -0
  110. package/scripts/jquery.fileupload-image.js +313 -0
  111. package/scripts/jquery.fileupload-process.js +172 -0
  112. package/scripts/jquery.fileupload-ui.js +700 -0
  113. package/scripts/jquery.fileupload-validate.js +117 -0
  114. package/scripts/jquery.fileupload-video.js +103 -0
  115. package/scripts/jquery.fileupload.js +1451 -0
  116. package/scripts/jquery.form.js +892 -0
  117. package/scripts/jquery.number.min.js +150 -0
  118. package/scripts/jquery.ui.datepicker-en.js +26 -0
  119. package/scripts/jquery.ui.timepicker-en.js +6 -0
  120. package/scripts/jquery.validate.min.js +844 -0
  121. package/scripts/jsbn-ver-1634886518000.js +2 -0
  122. package/scripts/layout.bundle.js +673 -0
  123. package/scripts/load-image.all.min.js +770 -0
  124. package/scripts/local.bundle.js +310 -0
  125. package/scripts/login-app.js +0 -0
  126. package/scripts/login-en.js +0 -0
  127. package/scripts/login-pl.js +0 -0
  128. package/scripts/login-states.js +0 -0
  129. package/scripts/main.js +23 -0
  130. package/scripts/mobileAuthCtrl.js +0 -0
  131. package/scripts/moment.min.js +1562 -0
  132. package/scripts/mon_ing_init.js +22 -0
  133. package/scripts/nl.js +88 -0
  134. package/scripts/paginator.js +267 -0
  135. package/scripts/pinLoginDefault-ver-1634885786000.js +2 -0
  136. package/scripts/popper.min.js +844 -0
  137. package/scripts/prng4-ver-1634886518000.js +2 -0
  138. package/scripts/psd2-states.js +0 -0
  139. package/scripts/rng-ver-1634886518000.js +2 -0
  140. package/scripts/rsa_jsbn-ver-1634886518000.js +2 -0
  141. package/scripts/selectAssetBrowser.bundle.js +47577 -0
  142. package/scripts/selectables.custom.js +174 -0
  143. package/scripts/sgemius.js +0 -0
  144. package/scripts/sha1.js +0 -0
  145. package/scripts/slick.min.js +687 -0
  146. package/scripts/superfish.js +279 -0
  147. package/scripts/upload-main.js +90 -0
  148. package/scripts/video.min.js +12517 -0
  149. package/scripts/videojs.wavesurfer.min.js +495 -0
  150. package/scripts/wavesurfer.min.js +2775 -0
  151. package/scripts/webtrekk_v4-ver-1634885786000.js +2 -0
  152. package/setup-feature.js +47 -0
  153. package/start.ingbusiness.pl/dump-scripts.py +83 -0
  154. package/start.ingbusiness.pl/form.html_v=202110040949 +52 -0
  155. package/start.ingbusiness.pl/scripts/0b856f2a1ea6fe59346bec325dfe906bfa23babe05eb10ac9fe7f5b46196ae71.js +0 -0
  156. package/start.ingbusiness.pl/scripts/AliasCtrl.js +136 -0
  157. package/start.ingbusiness.pl/scripts/ChangePasswordCtrl.js +162 -0
  158. package/start.ingbusiness.pl/scripts/CustomErrorCtrl.js +9 -0
  159. package/start.ingbusiness.pl/scripts/ErrorCtrl.js +30 -0
  160. package/start.ingbusiness.pl/scripts/HeaderCtrl.js +84 -0
  161. package/start.ingbusiness.pl/scripts/LoginService.js +86 -0
  162. package/start.ingbusiness.pl/scripts/LoginValidationService.js +52 -0
  163. package/start.ingbusiness.pl/scripts/NipValidator.js +30 -0
  164. package/start.ingbusiness.pl/scripts/PasswordCtrl.js +179 -0
  165. package/start.ingbusiness.pl/scripts/Psd2AliasCtrl.js +12 -0
  166. package/start.ingbusiness.pl/scripts/RegonValidator.js +73 -0
  167. package/start.ingbusiness.pl/scripts/RequestService.js +26 -0
  168. package/start.ingbusiness.pl/scripts/SmsCtrl.js +91 -0
  169. package/start.ingbusiness.pl/scripts/UnlockUserCtrl.js +79 -0
  170. package/start.ingbusiness.pl/scripts/angular-animate.min.js +1535 -0
  171. package/start.ingbusiness.pl/scripts/angular-cookies.min.js +62 -0
  172. package/start.ingbusiness.pl/scripts/angular-translate.min.js +871 -0
  173. package/start.ingbusiness.pl/scripts/angular-ui-router.js +1561 -0
  174. package/start.ingbusiness.pl/scripts/angular.min.js +9845 -0
  175. package/start.ingbusiness.pl/scripts/criticalMessageService.js +24 -0
  176. package/start.ingbusiness.pl/scripts/data-dir-button-loader.js +30 -0
  177. package/start.ingbusiness.pl/scripts/data-dir-compile-template.js +17 -0
  178. package/start.ingbusiness.pl/scripts/data-dir-cookies-bar.js +37 -0
  179. package/start.ingbusiness.pl/scripts/data-dir-progress-pie.js +102 -0
  180. package/start.ingbusiness.pl/scripts/data-dir-svg-icon.js +633 -0
  181. package/start.ingbusiness.pl/scripts/data-gemius-event.js +119 -0
  182. package/start.ingbusiness.pl/scripts/dir-critical-message.js +9 -0
  183. package/start.ingbusiness.pl/scripts/dir-help-panel-content.js +29 -0
  184. package/start.ingbusiness.pl/scripts/dir-login-keyboard.js +346 -0
  185. package/start.ingbusiness.pl/scripts/dir-login-validation.js +20 -0
  186. package/start.ingbusiness.pl/scripts/dir-nav-links.js +26 -0
  187. package/start.ingbusiness.pl/scripts/dir-title.js +21 -0
  188. package/start.ingbusiness.pl/scripts/gemius-init.js +12 -0
  189. package/start.ingbusiness.pl/scripts/gemiusID.js +32 -0
  190. package/start.ingbusiness.pl/scripts/hashService.js +91 -0
  191. package/start.ingbusiness.pl/scripts/helpPanelPasswordService.js +26 -0
  192. package/start.ingbusiness.pl/scripts/helpPanelService.js +92 -0
  193. package/start.ingbusiness.pl/scripts/jquery-3.5.1.min.js +3242 -0
  194. package/start.ingbusiness.pl/scripts/login-app.js +107 -0
  195. package/start.ingbusiness.pl/scripts/login-en.js +73 -0
  196. package/start.ingbusiness.pl/scripts/login-pl.js +74 -0
  197. package/start.ingbusiness.pl/scripts/login-states.js +156 -0
  198. package/start.ingbusiness.pl/scripts/maskService.js +194 -0
  199. package/start.ingbusiness.pl/scripts/maskUtilService.js +302 -0
  200. package/start.ingbusiness.pl/scripts/mobileAuthCtrl.js +189 -0
  201. package/start.ingbusiness.pl/scripts/psd2-states.js +67 -0
  202. package/start.ingbusiness.pl/scripts/securityPolicyService.js +119 -0
  203. package/start.ingbusiness.pl/scripts/sgemius.js +257 -0
  204. package/start.ingbusiness.pl/scripts/sha1.js +210 -0
  205. package/start.ingbusiness.pl/scripts/sprintf.js +115 -0
  206. package/start.ingbusiness.pl/scripts/tabletScalingService.js +59 -0
  207. package/start.ingbusiness.pl/scripts/userAgentResolverService.js +12 -0
@@ -0,0 +1,1059 @@
1
+ // Arry to store error title (attr)
2
+ var errors = new Array();
3
+ var urlhash = window.location.hash;
4
+ (function($) {
5
+
6
+ $.fn.extend({
7
+ copyEvents: function(from) {
8
+ $.event.copy($(from), this);
9
+ return this;
10
+ },
11
+
12
+ copyEventsTo: function(to) {
13
+ $.event.copy(this, $(to));
14
+ return this;
15
+ }
16
+ });
17
+
18
+ $.event.copy = function(from, to) {
19
+ var events = $.data(from[0], 'events');
20
+ if (!from.size() || !events || !to.size()) return;
21
+
22
+ to.each(function() {
23
+ for (var type in events)
24
+ for (var handler in events[type])
25
+ $.event.add(this, type, events[type][handler], events[type][handler].data);
26
+ });
27
+ };
28
+
29
+ })(jQuery);
30
+
31
+ function ___getPageSize() {
32
+ var xScroll, yScroll;
33
+ if (window.innerHeight && window.scrollMaxY) {
34
+ xScroll = window.innerWidth + window.scrollMaxX;
35
+ yScroll = window.innerHeight + window.scrollMaxY;
36
+ } else if (document.body.scrollHeight > document.body.offsetHeight) { // all
37
+ // but
38
+ // Explorer
39
+ // Mac
40
+ xScroll = document.body.scrollWidth;
41
+ yScroll = document.body.scrollHeight;
42
+ } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla
43
+ // and Safari
44
+ xScroll = document.body.offsetWidth;
45
+ yScroll = document.body.offsetHeight;
46
+ }
47
+ var windowWidth, windowHeight;
48
+ if (self.innerHeight) { // all except Explorer
49
+ if (document.documentElement.clientWidth) {
50
+ windowWidth = document.documentElement.clientWidth;
51
+ } else {
52
+ windowWidth = self.innerWidth;
53
+ }
54
+ windowHeight = self.innerHeight;
55
+ } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer
56
+ // 6
57
+ // Strict
58
+ // Mode
59
+ windowWidth = document.documentElement.clientWidth;
60
+ windowHeight = document.documentElement.clientHeight;
61
+ } else if (document.body) { // other Explorers
62
+ windowWidth = document.body.clientWidth;
63
+ windowHeight = document.body.clientHeight;
64
+ }
65
+ // for small pages with total height less then height of the viewport
66
+ if (yScroll < windowHeight) {
67
+ pageHeight = windowHeight;
68
+ } else {
69
+ pageHeight = yScroll;
70
+ }
71
+ // for small pages with total width less then width of the viewport
72
+ if (xScroll < windowWidth) {
73
+ pageWidth = xScroll;
74
+ } else {
75
+ pageWidth = windowWidth;
76
+ }
77
+ arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight);
78
+ return arrayPageSize;
79
+ }
80
+
81
+ function ___getPageScroll() {
82
+ var xScroll, yScroll;
83
+ if (self.pageYOffset) {
84
+ yScroll = self.pageYOffset;
85
+ xScroll = self.pageXOffset;
86
+ } else if (document.documentElement && document.documentElement.scrollTop) { // Explorer
87
+ // 6
88
+ // Strict
89
+ yScroll = document.documentElement.scrollTop;
90
+ xScroll = document.documentElement.scrollLeft;
91
+ } else if (document.body) { // all other Explorers
92
+ yScroll = document.body.scrollTop;
93
+ xScroll = document.body.scrollLeft;
94
+ }
95
+ arrayPageScroll = new Array(xScroll, yScroll);
96
+ return arrayPageScroll;
97
+ };
98
+
99
+ $.extend({
100
+ dialogDefaults: {
101
+ bgiframe: true,
102
+ autoOpen: false,
103
+ modal: true,
104
+ resizable: false,
105
+ draggable: false,
106
+ position: 'center',
107
+ width: 500,
108
+ height: 'auto',
109
+ minHeight: 500,
110
+ maxHeight: 800,
111
+ // dialogClass: 'ingtheme',
112
+ dialogClass: 'customdialog',
113
+ overlay: {
114
+ backgroundColor: '#000',
115
+ opacity: 0.5
116
+ },
117
+ buttons: {
118
+ 'Ok': function() {
119
+ $(this).dialog('close');
120
+ }
121
+ }
122
+ },
123
+ promptDefaults: {}
124
+ });
125
+ $.extend($.ui.dialog.prototype.options, {
126
+ autoOpen: false,
127
+ modal: true,
128
+ bgiframe: true,
129
+ width: 500,
130
+ height: "auto",
131
+ minHeight: 500,
132
+ maxHeight: 800,
133
+ position: ['center', 'center'],
134
+ resizable: false,
135
+ draggable: false,
136
+ title: "Dialog title",
137
+ buttons: {}
138
+ });
139
+ $(document).ready(function() {
140
+ $('#alert').dialog($.dialogDefaults);
141
+ $('#mainDialog').dialog($.dialogDefaults);
142
+ $('#prompt').dialog($.dialogDefaults);
143
+ $('#downloadManager').dialog($.dialogDefaults);
144
+
145
+ /* Init framework dialogs */
146
+ $('div[id^="fw-dialog-"],#fw_transfer_message').each(function() {
147
+ $(this).on('dialogopen.positioning', function(event, ui) {});
148
+ });
149
+ });
150
+ /* Delegate opendialog event */
151
+ $(document).on('dialogopen.positioning', '.ui-dialog .ui-dialog-content', function(event, ui) {
152
+ $(this).dialog({
153
+ height: 'auto',
154
+ minHeight: 50,
155
+ maxHeight: ($(window).height() - 100),
156
+ });
157
+ var wrapper = $(this).closest('.ui-dialog');
158
+ if (wrapper.height() > $(window).height()) {
159
+ $(this).dialog({
160
+ position: {
161
+ my: 'center top',
162
+ at: 'center top',
163
+ of: window
164
+ },
165
+ });
166
+ wrapper.css({
167
+ 'position': 'absolute'
168
+ });
169
+ } else {
170
+ $(this).dialog({
171
+ position: {
172
+ my: 'center center',
173
+ at: 'center center',
174
+ of: window
175
+ },
176
+ });
177
+ wrapper.css({
178
+ 'position': 'fixed'
179
+ });
180
+ }
181
+ });
182
+ $(window).resize(function() {
183
+ // $('.ui-dialog .ui-dialog-content').each(function() {
184
+ $('div[id^="fw-dialog-"],#fw_transfer_message').each(function() {
185
+ if ($(this).dialog('isOpen')) {
186
+ $(this).trigger('dialogopen.positioning');
187
+ }
188
+ });
189
+ });
190
+
191
+ $.fn.extend({
192
+ request: function(o, fn) {
193
+ d = {
194
+ url: location.href
195
+ };
196
+ o = $.extend(d, o);
197
+ this.inc(o.url + '&page-request=' + o.name + '&' + o.arguments, fn);
198
+ },
199
+ fw_ajax: function(o, fn) {
200
+ d = {
201
+ url: location.href
202
+ };
203
+ o = $.extend(d, o);
204
+ var options = new Array();
205
+ for (var p in o) {
206
+ if (p == 'url') {
207
+ continue
208
+ };
209
+ options.push(p + "=" + o[p]);
210
+ };
211
+ this.inc(o.url + '&' + options.join("&"), fn);
212
+ },
213
+ liveSearch: function() {
214
+ $(this).request({
215
+ name: 'liveSearch',
216
+ arguments: 'searchterm=' + $(this).val()
217
+ }, function(msg) {
218
+ $('#searchresult').html(msg);
219
+ });
220
+ },
221
+ checkResize: function() {
222
+ $(this).data('overlay.dialog', {
223
+ opacity: 0.5,
224
+ backgroundColor: '#000'
225
+ });
226
+ $(this).parent().parent().addClass('merkwereld');
227
+ $(this).data('buttons.dialog', {});
228
+ var messageHeight = $(this).find('.dialogContent').height();
229
+
230
+ var messageWidth = $('#mainDialog').css('width');
231
+
232
+ // TODO: This needs tweaking. 40px extra for Core
233
+ $(this).data('height.dialog', messageHeight + 40 + 'px');
234
+
235
+ var arrPageSizes = ___getPageSize();
236
+ // Style overlay and show it
237
+ $('.ui-dialog-overlay').css({
238
+ width: arrPageSizes[0],
239
+ // We need to add another 80 pix safemargin for Internet explorer
240
+ // resize troubles
241
+ height: arrPageSizes[1] + 80
242
+ });
243
+
244
+ // Calculate top and left offset for the jquery-lightbox div object and
245
+ // show it
246
+ $('.ui-dialog').css({
247
+ top: arrPageSizes[3] / 10,
248
+ left: (arrPageSizes[0] / 2) - (parseInt(messageWidth) / 2)
249
+ });
250
+
251
+ // If window was resized, calculate the new overlay dimensions
252
+ $(window).resize(function() {
253
+ // Get page sizes
254
+ var arrPageSizes = ___getPageSize();
255
+ // Style overlay and show it
256
+ $('.ui-dialog-overlay').css({
257
+ width: arrPageSizes[0],
258
+ // We need to add another 80 pix safemargin for Internet
259
+ // explorer resize troubles
260
+ height: arrPageSizes[1] + 80
261
+ });
262
+
263
+ // Calculate top and left offset for the jquery-lightbox div object
264
+ // and show it
265
+ $('.ui-dialog').css({
266
+ top: arrPageSizes[3] / 10,
267
+ left: (arrPageSizes[0] / 2) - (parseInt(messageWidth) / 2)
268
+ });
269
+ });
270
+ },
271
+ resizeAlert: function() {
272
+ $(this).data('overlay.dialog', {
273
+ opacity: 0.5,
274
+ backgroundColor: '#000'
275
+ });
276
+ $(this).parent().parent().addClass('alert');
277
+ $(this).data('buttons.dialog', {});
278
+ var messageHeight = $(this).find('.dialogContent').height();
279
+ var messageWidth = $('#alert').css('width');
280
+
281
+ // TODO: This needs tweaking. 40px extra for Core, 80px for MW
282
+ $(this).data('height.dialog', messageHeight + 40 + 'px');
283
+
284
+ var arrPageSizes = ___getPageSize();
285
+ // Style overlay and show it
286
+ $('.ui-dialog-overlay').css({
287
+ width: arrPageSizes[0],
288
+ // We need to add another 80 pix safemargin for Internet explorer
289
+ // resize troubles
290
+ height: arrPageSizes[1] + 80
291
+ });
292
+
293
+ // Calculate top and left offset for the jquery-lightbox div object and
294
+ // show it
295
+ $('.ui-dialog.alert').css({
296
+ top: (arrPageSizes[3] / 2) - (messageHeight / 2),
297
+ left: (arrPageSizes[0] / 2) - (parseInt(messageWidth) / 2)
298
+ });
299
+
300
+ // If window was resized, calculate the new overlay dimensions
301
+ $(window).resize(function() {
302
+ // Get page sizes
303
+ var arrPageSizes = ___getPageSize();
304
+ // Style overlay and show it
305
+ $('.ui-dialog-overlay').css({
306
+ width: arrPageSizes[0],
307
+ // We need to add another 80 pix safemargin for Internet
308
+ // explorer resize troubles
309
+ height: arrPageSizes[1] + 80
310
+ });
311
+
312
+ // Calculate top and left offset for the jquery-lightbox div object
313
+ // and show it
314
+ $('.ui-dialog.alert').css({
315
+ top: (arrPageSizes[3] / 2) - (messageHeight / 2),
316
+ left: (arrPageSizes[0] / 2) - (parseInt(messageWidth) / 2)
317
+ });
318
+ });
319
+ },
320
+ errorDialog: function(template) {
321
+ $('#dialog').request({
322
+ name: 'mod_modules',
323
+ arguments: 'page-request=mod_messages.messages.' + template
324
+ }, function(message) {
325
+ $('#dialog').html(message);
326
+ var title = $('#dialog .title').html();
327
+ var buttons = {};
328
+ $("#dialog .buttons button").each(function() {});
329
+ $('#dialog .title').remove();
330
+ // $('#dialog .buttons').hide();
331
+ $('#dialog').dialog({
332
+ 'title': title,
333
+ "minHeight": 100,
334
+ "buttons": buttons
335
+ });
336
+ $('#dialog').dialog('open');
337
+ });
338
+
339
+ // Reset
340
+ errors = new Array();
341
+ },
342
+ checkPassword: function() {
343
+ if (!errors.length) {
344
+ $(this).find('.mandatory').each(function() {
345
+ if (!$(this).mandatory()) {
346
+ errors.push($(this));
347
+ $(this).css('background-color', '#fdd');
348
+ template = 'users.request.mandatory';
349
+ }
350
+ });
351
+ }
352
+ if (!errors.length) {
353
+ if (($(this).find('#password').val() !== $(this).find('#passwordConfirmed').val())) {
354
+ errors.push($(this).find('#passwordConfirmed'));
355
+ template = 'users.password.set';
356
+ }
357
+ }
358
+ if (!errors.length) {
359
+ if ($(this).find('#password').val().length < 4) {
360
+ errors.push($(this).find('#password'));
361
+ template = 'users.password.set';
362
+ }
363
+ }
364
+ // if (! errors.length) {
365
+ // var pattern = new RegExp(/[A-Z]/);
366
+ // if (!pattern.test($(this).find('#password').val())) {
367
+ // errors.push($(this).find('#password').val());
368
+ // template = 'users.password.set';
369
+ // }
370
+ // }
371
+ // if (! errors.length) {
372
+ // var pattern = new RegExp(/[0-9]/);
373
+ // if (!pattern.test($(this).find('#password').val())) {
374
+ // errors.push($(this).find('#password').val());
375
+ // template = 'users.password.set';
376
+ // }
377
+ // }
378
+ if (!errors.length) {
379
+ $(this).submit();
380
+ return;
381
+ }
382
+
383
+ // Show error(s)
384
+ $(this).errorDialog(template);
385
+ },
386
+ authenticate: function() {
387
+ if ($("#authenticate").length > 0) {
388
+ $('#mainDialog #authenticate .authenticateMessage').hide();
389
+ $('#mainDialog').find('.dialogTitle').html($('#authenticate').find('.dialogTitle').html());
390
+ $('#mainDialog').find('.dialogContent').html($('#authenticate').parent().html());
391
+
392
+ var messageWidth = $('#mainDialog').css('width');
393
+ var marginLeft = $('#mainDialog').css('margin-left');
394
+ var marginRight = $('#mainDialog').css('margin-right');
395
+ var calcWidth = parseInt(marginLeft) + parseInt(marginRight) + parseInt(messageWidth);
396
+ // $('#mainDialog').data('width.dialog', calcWidth+'px');
397
+
398
+ $('#mainDialog').dialog('open');
399
+ $('#mainDialog').checkResize();
400
+ }
401
+ },
402
+ authenticateFailure: function() {
403
+ if ($("#authenticateFailure").length > 0) {
404
+ $('#mainDialog').find('.dialogTitle').html($('#authenticateFailure').find('.dialogTitle').html());
405
+ $('#mainDialog').find('.dialogContent').html($('#authenticateFailure').parent().html());
406
+
407
+ var messageWidth = $('#mainDialog').css('width');
408
+ var marginLeft = $('#mainDialog').css('margin-left');
409
+ var marginRight = $('#mainDialog').css('margin-right');
410
+ var calcWidth = parseInt(marginLeft) + parseInt(marginRight) + parseInt(messageWidth);
411
+ $('#mainDialog').data('width.dialog', calcWidth + 'px');
412
+
413
+ $('#mainDialog').dialog('open');
414
+ $('#mainDialog').checkResize();
415
+ }
416
+ },
417
+ authenticateSuccess: function() {
418
+ if ($("#authenticateSuccess").length > 0) {
419
+ $('#mainDialog').find('.dialogTitle').html($('#authenticateSuccess').find('.dialogTitle').html());
420
+ $('#mainDialog').find('.dialogContent').html($('#authenticateSuccess').parent().html());
421
+
422
+ var messageWidth = $('#mainDialog').css('width');
423
+ var marginLeft = $('#mainDialog').css('margin-left');
424
+ var marginRight = $('#mainDialog').css('margin-right');
425
+ var calcWidth = parseInt(marginLeft) + parseInt(marginRight) + parseInt(messageWidth);
426
+ $('#mainDialog').data('width.dialog', calcWidth + 'px');
427
+
428
+ $('#mainDialog').dialog('open');
429
+ $('#mainDialog').checkResize();
430
+ }
431
+ },
432
+ processAuthenticate: function() {
433
+ oForm = $(this);
434
+
435
+ if (!errors.length) {
436
+ err = 0;
437
+ $(this).find('.mandatory').each(function() {
438
+ if (!$(this).mandatory()) {
439
+ err++;
440
+ }
441
+
442
+ });
443
+ if (err > 1) {
444
+ //errors.push(oForm);
445
+ template = 'users.request.emailpassword.mandatory';
446
+ $(this).errorDialog(template);
447
+ return;
448
+ }
449
+
450
+ }
451
+ if (!errors.length) {
452
+ $(this).find('.mandatory').each(function() {
453
+ if (!$(this).mandatory()) {
454
+ errors.push($(this));
455
+ template = 'users.request.mandatory';
456
+ }
457
+ });
458
+ }
459
+ if (!errors.length) {
460
+ $(this).find('.email').each(function() {
461
+ if (!$(this).validateEmail()) {
462
+ errors.push($(this));
463
+ template = 'users.request.invalid.email';
464
+ }
465
+ });
466
+ }
467
+ if (!errors.length || errors.length == 0) {
468
+ $(this).submit();
469
+ return;
470
+ }
471
+ // Show error(s)
472
+ $(this).errorDialog(template);
473
+ },
474
+ passwordRetrieval: function() {
475
+ if (!errors.length) {
476
+ $(this).find('.mandatory').each(function() {
477
+ if (!$(this).mandatory()) {
478
+ $(this).addClass('error');
479
+ errors.push($(this));
480
+ template = 'users.request.mandatory';
481
+ }
482
+ });
483
+ }
484
+ if (!errors.length) {
485
+ $(this).find('.email').each(function() {
486
+ if (!$(this).validateEmail()) {
487
+ $(this).addClass('error');
488
+ errors.push($(this));
489
+ template = 'users.request.invalid.email';
490
+ }
491
+ });
492
+ }
493
+ if (!errors.length) {
494
+ $(this).submit();
495
+ return;
496
+ }
497
+ // Show error(s)
498
+ $(this).errorDialog(template);
499
+ $('#password_retrieval_button').removeAttr('disabled');
500
+ },
501
+ accountRequest: function() {
502
+ // External information
503
+ errors = new Array();
504
+ var email = $(this).find('.emailcheck').val();
505
+ var emailConfirm = $(this).find('[name="email-confirm"]').val();
506
+ oForm = $(this);
507
+ $('#msg').request({
508
+ name: 'mod_modules',
509
+ arguments: 'page-request=mod_users.email.check&email=' + email
510
+ }, function(msg) {
511
+
512
+ if (msg == 'exists') {
513
+ errors.push(oForm.find('.emailcheck'));
514
+ template = 'users.request.email.exists';
515
+ }
516
+
517
+ // Agree confirmation
518
+ if (!errors.length) {
519
+ if (!oForm.find("input[name='agree']:checked").length) {
520
+ oForm.find("input[name='agree']").addClass('error');
521
+ oForm.find("input[name='agree']").parents('label').addClass('error');
522
+ errors.push(oForm.find("input[name='agree']"));
523
+ template = 'users.request.mandatory';
524
+ }
525
+ }
526
+
527
+ if (!oForm.find("input[name='group[]']:checked").length) {
528
+ oForm.find(".brand label").each(function() {
529
+ $(this).addClass("error");
530
+ errors.push($(this));
531
+ template = 'users.request.mandatory';
532
+ });
533
+ }
534
+
535
+ oForm.find('.mandatory').each(function() {
536
+ if (!$(this).mandatory()) {
537
+ $(this).addClass("error");
538
+ $(this).parents('label').addClass("error");
539
+ errors.push($(this));
540
+ template = 'users.request.mandatory';
541
+ }
542
+ });
543
+
544
+ if (!errors.length) {
545
+ oForm.find('.email').each(function() {
546
+ if (!$(this).validateEmail()) {
547
+ $(this).addClass("error");
548
+ errors.push($(this));
549
+ template = 'users.request.invalid.email';
550
+ }
551
+ });
552
+ }
553
+
554
+ if (!errors.length) {
555
+ oForm.find('.domain').each(function() {
556
+ if (!$(this).validateDomain()) {
557
+ $(this).addClass("error");
558
+ errors.push($(this));
559
+ template = 'users.request.invalid.domain';
560
+ }
561
+ });
562
+ }
563
+
564
+ // Email confirmation
565
+ if (!errors.length) {
566
+ if (email != emailConfirm) {
567
+ oForm.find('.email').each(function() {
568
+ $(this).addClass("error");
569
+ errors.push($(this));
570
+ template = 'users.request.mandatory';
571
+ });
572
+ }
573
+ }
574
+
575
+
576
+ if (!errors.length) {
577
+ oForm.submit();
578
+ return;
579
+ }
580
+ // Show error(s)
581
+ oForm.errorDialog(template);
582
+ });
583
+
584
+
585
+
586
+ },
587
+ // Authenticate group handler
588
+ accountRequestGroups: function() {
589
+ $(this).removeClass('error');
590
+ $(this).next().remove();
591
+ $(this).next().remove();
592
+ $(this).next().remove();
593
+ $(this).next().remove();
594
+ $(this).next().remove();
595
+
596
+ if (typeof(groups[$(this).val()]) == 'object' && groups[$(this).val()].childs.length) {
597
+ var el = $('<select onchange="$(this).accountRequestGroups();$(\'#mainDialog\').checkResize();return false" />');
598
+ el.attr('name', $(this).attr('name'));
599
+ el.addClass('mandatory');
600
+ el.attr('title', $(this).attr('title'));
601
+ el.append('<option value="0">' + $(this).children().eq(0).text() + '</option>');
602
+
603
+ $(groups[$(this).val()].childs).each(function(n, i) {
604
+ var child = $(groups[i]);
605
+ el.append('<option value=' + $(child).attr('id') + '>' + $(child).attr('name') + '</option>');
606
+ });
607
+
608
+ // Insert element into the DOM
609
+ $(this).after(el);
610
+ }
611
+ },
612
+ downloadSelectAll: function() {
613
+ if ($('#downloadManager .downloadFile .cart input:checkbox:checked').length != $('#downloadManager .downloadFile .cart input:checkbox').length) {
614
+ $('#downloadManager .downloadFile .cart input:checkbox').attr('checked', 'checked');
615
+ $(this).attr('checked', 'checked');
616
+ } else {
617
+ $('#downloadManager .downloadFile .cart input:checkbox').removeAttr('checked');
618
+ $(this).removeAttr('checked');
619
+ }
620
+ },
621
+
622
+ mandatory: function() {
623
+ if ((!$(this).val().length) || ($(this).val() == 0)) {
624
+ return false;
625
+ }
626
+ return true;
627
+ },
628
+ // Alert
629
+ alert: function() {
630
+ $('#alert').dialog('open');
631
+ $('#alert').resizeAlert();
632
+ },
633
+ // Prompt
634
+ prompt: function() {
635
+ $('#prompt').dialog('open');
636
+ $('#prompt').checkResize();
637
+ },
638
+ // Download manager
639
+
640
+ // Data validation
641
+ validateEmail: function() {
642
+ var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
643
+
644
+ return filter.test($(this).val());
645
+ },
646
+ validateDomain: function() {
647
+ var error = false;
648
+ var email = $(this).val();
649
+ var domain = email.split('@')[1];
650
+
651
+ if (typeof(domain) != "undefined") {
652
+ for (n = 0; n < domains.length; n++) {
653
+ if (domains[n] == domain) {
654
+ error = true;
655
+ }
656
+ }
657
+ }
658
+
659
+ return error;
660
+ }
661
+ });
662
+
663
+ // Prompt (NOT unused)
664
+ $.extend({
665
+ removeHashParameter: function(parameter) {
666
+ var s = false;
667
+ var c = 0;
668
+ urlhash = urlhash.replace(/^#/, '');
669
+ aH = urlhash.split('&');
670
+ jQuery.each(aH, function() {
671
+ a = this.split('=');
672
+ if (a[0] == parameter) {
673
+ //aH[c] = parameter + "=" + value;
674
+ delete aH[c];
675
+ }
676
+ c++;
677
+ });
678
+ urlhash = aH.join('&');
679
+ while (urlhash.charAt(urlhash.length - 1) == "&") {
680
+ urlhash = urlhash.slice(0, -1);
681
+ }
682
+
683
+ return urlhash.replace('&&', '&');
684
+ },
685
+ setHashParameter: function(parameter, value) {
686
+ var s = false;
687
+ var c = 0;
688
+ urlhash = urlhash.replace(/^#/, '');
689
+ var aH = urlhash.split('&');
690
+ /* Remove empty items */
691
+ aH = aH.filter(function(item) {
692
+ return item != '';
693
+ });
694
+ jQuery.each(aH, function() {
695
+ a = this.split('=');
696
+ if (a[0] == parameter) {
697
+ aH[c] = parameter + "=" + value;
698
+ s = true;
699
+ }
700
+ c++;
701
+ });
702
+ if (s == false) {
703
+ aH[c] = parameter + "=" + value;
704
+ }
705
+ urlhash = aH.join('&');
706
+ return urlhash.replace('&&', '&');
707
+ },
708
+ getHashParameter: function(parameter) {
709
+ val = false;
710
+ urlhash = urlhash.replace(/^#/, '');
711
+ aH = urlhash.split('&');
712
+ jQuery.each(aH, function() {
713
+ a = this.split('=');
714
+ if (a[0] == parameter) {
715
+ val = a[1];
716
+ return false;
717
+ }
718
+ });
719
+ return val;
720
+ },
721
+ prompt: function(o) {
722
+ o = $.extend({}, $.promptDefaults, o);
723
+ dialog = $('<div id="prompt"></div>');
724
+ dialog.dialog(o);
725
+ dialog.html(o.content)
726
+
727
+ return false;
728
+ },
729
+
730
+ promptDefaults: {
731
+ bgiframe: true,
732
+ autoOpen: true,
733
+ modal: true,
734
+ resizable: false,
735
+ draggable: false,
736
+ position: 'center',
737
+ width: 500,
738
+ height: 'auto',
739
+ minHeight: 500,
740
+ maxHeight: 800,
741
+ title: 'Dialog',
742
+ dialogClass: 'customdialog',
743
+ content: 'Content',
744
+ overlay: {
745
+ backgroundColor: '#000',
746
+ opacity: 0.5
747
+ },
748
+ buttons: {
749
+ 'Ok': function() {
750
+ $(this).dialog('close');
751
+ }
752
+ }
753
+ },
754
+ loginDialog: function() {
755
+ $.ajax({
756
+ url: '/api',
757
+ type: 'POST',
758
+ dataType: 'JSON',
759
+ data: {
760
+ 'request': 'authenticate.validate',
761
+ 'requestaction': 'logindialog',
762
+ 'requestkey': $('#registrykey').val()
763
+ }
764
+ }).done(function(data) {
765
+ var obj = $.parseJSON(data);
766
+ if (obj.code == 200) {
767
+ $('#fw-dialog-confirm').dialog({
768
+ width: 332,
769
+ 'min-height': 270
770
+ });
771
+ $('#fw-dialog-confirm').html(obj.html);
772
+ $('#fw-dialog-confirm').dialog('open');
773
+ $('#fw-dialog-confirm').css('height', 'auto');
774
+ }
775
+ });
776
+ }
777
+
778
+ });
779
+
780
+ // qtip popup js
781
+ //-918px
782
+ $.fn.extend({
783
+ toolBox: function() {
784
+ // Test on class
785
+ options = {
786
+ content: {
787
+ text: function(event, api) {
788
+ $('#toolbox-wrapper .bottom-center').attr('style', 'background-position: -20px bottom');
789
+ $('#toolbox-wrapper .tooltip-content').html($(this).attr('toolbox'));
790
+ $('.ui-tooltip').css('max-width', '1200px');
791
+ $('.ui-tooltip').css('max-height', '1200px');
792
+ data = $.parseJSON($(this).attr('toolboxdata'));
793
+ if (data) {
794
+ if (data.width) {
795
+ $('.ui-tooltip').css('max-width', data.width);
796
+ $('.ui-tooltip').css('width', data.width);
797
+ $('.ui-tooltip').css('min-width', data.width);
798
+ }
799
+ if (data.height) {
800
+ $('.ui-tooltip').css('max-height', data.height);
801
+ $('.ui-tooltip').css('height', data.height);
802
+ }
803
+ if (data.arrow) {
804
+ $('#toolbox-wrapper .bottom-center').attr('style', 'background-position: ' + data.arrow + 'px bottom');
805
+ }
806
+ if (data.show) {
807
+ // $(this).show.event = data.show;
808
+ }
809
+
810
+ }
811
+
812
+ return $('#toolbox-wrapper .tooltip-box').clone();
813
+ }
814
+
815
+ },
816
+ show: {
817
+ event: 'mouseover'
818
+ },
819
+
820
+ events: {
821
+ show: function(event, api) {}
822
+ },
823
+ position: {
824
+ my: 'bottom center',
825
+ at: 'left center',
826
+ viewport: $(window),
827
+ adjust: {
828
+ y: 0
829
+
830
+ }
831
+ },
832
+ style: {
833
+ def: false,
834
+ tip: {
835
+ corner: false
836
+ }
837
+ },
838
+ hide: {
839
+ fixed: true
840
+ }
841
+
842
+ };
843
+ position = $.extend(options.position, {});
844
+ hide = $.extend(options.hide, {});
845
+ $(this).each(function(i, ui) {
846
+ /* these should come from the toolboxdata attribute */
847
+ if ($(ui).hasClass('tooltip-assetpreview')) {
848
+ position = $.extend(options.position, {
849
+ target: 'mouse',
850
+ my: 'bottom left',
851
+ at: 'bottom left',
852
+ adjust: {
853
+ x: 10
854
+ }
855
+ });
856
+ }
857
+ if ($(ui).hasClass('tooltip-childassetpreview')) {
858
+ position = $.extend(options.position, {
859
+ target: {
860
+ mouse: false
861
+ },
862
+ my: 'bottom center',
863
+ at: 'bottom center',
864
+ adjust: {
865
+ y: -70
866
+ }
867
+ });
868
+ hide = $.extend(hide.fixed, {
869
+ fixed: false
870
+ });
871
+
872
+ }
873
+ if ($(ui).hasClass('tooltip-information-atl')) {
874
+ position = $.extend(options.position, {
875
+ target: {
876
+ mouse: false
877
+ },
878
+ my: 'bottom left',
879
+ at: 'right top',
880
+ adjust: {
881
+ x: -80,
882
+ y: 15
883
+ }
884
+ });
885
+ }
886
+ if ($(ui).hasClass('tooltip-information-btl')) {
887
+ position = $.extend(options.position, {
888
+ target: {
889
+ mouse: false
890
+ },
891
+ my: 'bottom left',
892
+ at: 'right top',
893
+ adjust: {
894
+ x: -80,
895
+ y: -22
896
+ }
897
+ });
898
+ }
899
+ if ($(ui).hasClass('tooltip-guidelines')) {
900
+ position = $.extend(options.position, {
901
+ target: {
902
+ mouse: false
903
+ },
904
+ my: 'bottom left',
905
+ at: 'left top',
906
+ adjust: {
907
+ x: -20,
908
+ y: 20
909
+ }
910
+ });
911
+ }
912
+ options = $.extend(options, {
913
+ position: position
914
+ });
915
+
916
+ $(ui).qtip(options);
917
+ });
918
+ }
919
+ });
920
+ $(document).ready(function() {
921
+ //$('[toolbox_click]').toolBoxClick();
922
+ $('[toolbox]').toolBox();
923
+ $('.lightboxCMS').each(function() {
924
+ $(this).lightBox({
925
+ maxHeight: 600,
926
+ maxWidth: 940,
927
+ overlayOpacity: 0.5
928
+ });
929
+ });
930
+ });
931
+
932
+ function array_unique(inputArr) {
933
+ var key = '',
934
+ tmp_arr2 = {},
935
+ val = '';
936
+
937
+ var __array_search = function(needle, haystack) {
938
+ var fkey = '';
939
+ for (fkey in haystack) {
940
+ if (haystack.hasOwnProperty(fkey)) {
941
+ if ((haystack[fkey] + '') === (needle + '')) {
942
+ return fkey;
943
+ }
944
+ }
945
+ }
946
+ return false;
947
+ };
948
+
949
+ for (key in inputArr) {
950
+ if (inputArr.hasOwnProperty(key)) {
951
+ val = inputArr[key];
952
+ if (false === __array_search(val, tmp_arr2)) {
953
+ tmp_arr2[key] = val;
954
+ }
955
+ }
956
+ }
957
+
958
+ return tmp_arr2;
959
+ }
960
+
961
+ function implode(glue, pieces) {
962
+ var i = '',
963
+ retVal = '',
964
+ tGlue = '';
965
+ if (arguments.length === 1) {
966
+ pieces = glue;
967
+ glue = '';
968
+ }
969
+ if (typeof pieces === 'object') {
970
+ if (Object.prototype.toString.call(pieces) === '[object Array]') {
971
+ return pieces.join(glue);
972
+ }
973
+ for (i in pieces) {
974
+ retVal += tGlue + pieces[i];
975
+ tGlue = glue;
976
+ }
977
+ return retVal;
978
+ }
979
+ return pieces;
980
+ }
981
+
982
+ //set global mouseup listener to add things that need to be hidden when clicked outside
983
+ $(document).on('mouseup.global', function(e) {
984
+ var search = $(".search-wrapper.search-active");
985
+ if ( //close search when clicked outside of search
986
+ !search.is(e.target) &&
987
+ search.has(e.target).length === 0 &&
988
+ !$(e.target).hasClass('openSearch') &&
989
+ $(e.target).parents('.openSearch').length === 0
990
+ ) {
991
+ search.removeClass('search-active');
992
+ $('.closeSearch').removeClass('closeSearch');
993
+ }
994
+
995
+ var contextMenu = $('.contextMenu');
996
+ if ( // close context menu when clicked outside context menu
997
+ !contextMenu.is(e.target) &&
998
+ !(contextMenu.has(e.target).length > 0)
999
+ ) {
1000
+ contextMenu.remove();
1001
+ }
1002
+
1003
+ $('.multi-edit').tooltip('hide');
1004
+ });
1005
+
1006
+ function getContextMenuPostion(event, contextMenu) {
1007
+ var pageSize = {
1008
+ width: $(window).width(),
1009
+ height: $(window).height()
1010
+ };
1011
+ var contextMenuSize = {
1012
+ width: contextMenu.width(),
1013
+ height: contextMenu.height()
1014
+ };
1015
+ var mousePosition = {
1016
+ x: event.clientX,
1017
+ y: event.clientY
1018
+ };
1019
+
1020
+ var contextMenuPostition = mousePosition;
1021
+
1022
+ if ((mousePosition.x + contextMenuSize.width) > pageSize.width) { //if the context menu falls out of screen x
1023
+ contextMenuPostition.x = contextMenuPostition.x - contextMenuSize.width;
1024
+ }
1025
+
1026
+ if ((mousePosition.y + contextMenuSize.height) > pageSize.height) { //if the context menu falls out of screen y
1027
+ contextMenuPostition.y = contextMenuPostition.y - contextMenuSize.height;
1028
+ }
1029
+
1030
+ if (mousePosition.x > pageSize.width) { //if mouse position is outside the window right
1031
+ contextMenuPostition.x = pageSize.width - contextMenuSize.width;
1032
+ }
1033
+
1034
+ if (mousePosition.x < 0) { //if mouse position is outside the window left
1035
+ contextMenuPostition.x = 0;
1036
+ }
1037
+
1038
+ if (mousePosition.y > (pageSize.height - 128)) { //if mouse postition is outside the window bottom
1039
+ contextMenuPostition.y = pageSize.height - contextMenuSize.height;
1040
+ }
1041
+
1042
+ if (mousePosition.y < 0) { //if mouse position is outside the window top
1043
+ contextMenuPostition.y = 0;
1044
+ }
1045
+
1046
+ return contextMenuPostition;
1047
+ }
1048
+ //
1049
+ // $('body').click(function(e){
1050
+ // console.log(e.clientY);
1051
+ // });
1052
+
1053
+ function scrollToTop() {
1054
+ const c = document.documentElement.scrollTop || document.body.scrollTop;
1055
+ if (c > 0) {
1056
+ window.requestAnimationFrame(scrollToTop);
1057
+ window.scrollTo(0, c - c / 10);
1058
+ }
1059
+ };