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,1223 @@
1
+ var scrollTimer = false;
2
+ var speed = 10;
3
+ $(document).off('ajaxSuccess.getpage-filtering').on('ajaxSuccess.getpage-filtering', function(event, jqXHR, options, data) {
4
+ var tags = $.getHashParameter('tag');
5
+ if (tags != '') {
6
+ tags = tags.split(',');
7
+ } else {
8
+ tags = [];
9
+ }
10
+ $.each(tags, function(id, keyword) {
11
+ if ($('.filter_fid_' + keyword + '-keyword').length > 0) {
12
+ $('.filter_fid_' + keyword + '-keyword').prop('checked', 'checked');
13
+ $.uniform.update($('.filter_fid_' + keyword + '-keyword'));
14
+ }
15
+ });
16
+ var filterData = data
17
+ if (data == null) {
18
+ return;
19
+ }
20
+ if (typeof filterData !== 'object') {
21
+ try {
22
+ filterData = $.parseJSON(data);
23
+ } catch (e) {}
24
+ }
25
+ if (filterData.hasOwnProperty('filtering') === false) {
26
+ return;
27
+ }
28
+ if (filterData.filtering.length === 0) {
29
+ $('.asset-filter-counter').text('');
30
+ return;
31
+ }
32
+ var filtering = filterData.filtering || {};
33
+ var filters = $('.filter_views input[id^="filter_fid_"]');
34
+ filters.each(function() {
35
+ var id = $(this).attr('id');
36
+ var name = $(this).attr('name').replace(/(\?)/g, '\\$1');
37
+ if ($('.asset-filter-counter', '.filter_title_' + name).length == 0) {
38
+ $('.filter_title_' + name).append('<span class="asset-filter-counter"></span>');
39
+ }
40
+ if (filtering.hasOwnProperty(id)) {
41
+ $('.filter_title_' + name + ' .asset-filter-counter').html('&nbsp;(' + filtering[id].count + ')');
42
+ } else {
43
+ $('.filter_title_' + name + ' .asset-filter-counter').html('&nbsp;(0)');
44
+ }
45
+ });
46
+ $('ul.generic-filter-column').each(function() {
47
+ $('.asset-filter-counter', this).show();
48
+ });
49
+ $('ul.generic-filter-column:has(input:checked)').each(function() {
50
+ $('.asset-filter-counter', this).hide();
51
+ });
52
+ });
53
+ var assetchanged = false;
54
+ var page_resize = false;
55
+ var winWidth = $(window).width(),
56
+ winHeight = $(window).height();
57
+ $(document).ready(function() {
58
+ var hash = location.hash;
59
+ var vars = $.getUrlVars();
60
+ var hashes = hash.slice(1).split('&');
61
+ $.each(hashes, function(i, hash) {
62
+ hash = hash.split('=');
63
+ vars[hash[0]] = hash[1];
64
+ });
65
+ ajax_asset_handler(vars);
66
+ jQuery(window).bind('hashchange', function(e) {
67
+ var vars = $.getUrlVars();
68
+ ajax_asset_handler(vars);
69
+ });
70
+ t = false;
71
+ $(document).ajaxSend(function(a, b, senddata) {
72
+ if (typeof senddata.showLoader === 'undefined' || senddata.showLoader === true) {
73
+ $.blockUI({
74
+ css: {
75
+ backgroundColor: ''
76
+ },
77
+ overlayCSS: {
78
+ backgroundColor: '#ccc',
79
+ opacity: 0
80
+ },
81
+ message: ''
82
+ });
83
+ if (t == false) {
84
+ t = setTimeout('showLoaderOverlay()', 700);
85
+ }
86
+ }
87
+ }).ajaxStop(function() {
88
+ $.unblockUI();
89
+ hideLoaderOverlay();
90
+ clearTimeout(t);
91
+ t = false;
92
+ });
93
+ });
94
+
95
+ function showLoader() {
96
+ $.blockUI({
97
+ css: {
98
+ background: 'none!important',
99
+ backgroundColor: 'none!important',
100
+ border: 'none!important'
101
+ },
102
+ overlayCSS: {
103
+ backgroundColor: '#fff',
104
+ opacity: 0.5
105
+ },
106
+ message: $('<div id="ajax_load_message" style=""><img src="/images/file_type_previews/loading.svg"></div>')
107
+ });
108
+ }
109
+ var hasharray = [];
110
+
111
+ function ajax_asset_handler(obj) {}
112
+ $.extend({
113
+ setAssetPaginator: function() {
114
+ $('.paginator-wrapper').hide();
115
+ var current_page = current_assets_cnt;
116
+ if (current_page > number_of_assets) {
117
+ current_page = number_of_assets;
118
+ }
119
+ $('.paginator').paginator({
120
+ 'data': {
121
+ current_page: current_page > 0 ? current_page : 1,
122
+ total_pages: number_of_assets,
123
+ items_per_page: 1
124
+ },
125
+ 'callback': function() {}
126
+ });
127
+ },
128
+ recreatePreview: function(id) {
129
+ $.ajax({
130
+ url: '/api/&request=asset.request',
131
+ type: 'POST',
132
+ global: false,
133
+ async: true,
134
+ data: {
135
+ 'action': 'asset.recreatePreview',
136
+ 'requestkey': $('#registrykey').val(),
137
+ 'asset_id': id
138
+ }
139
+ });
140
+ $('#fw-dialog-main').dialog({
141
+ "width": 325,
142
+ buttons: [{
143
+ text: translations[0]['asset/button/okay'],
144
+ click: function() {
145
+ $(this).dialog("close");
146
+ }
147
+ }]
148
+ });
149
+ $('#fw-dialog-main').html(assetTranslations.asset_message_recreate_preview).dialog('open');
150
+ $('#fw-dialog-main').css('height', 'auto');
151
+ },
152
+ setGridPaginator: function() {
153
+ $('.paginator-wrapper').show();
154
+ var current_page = parseInt($.getHashParameter('page'));
155
+ var aid = parseInt($.getHashParameter('id'));
156
+ var ipr = $.getHashParameter('itemsperpage');
157
+ if (ipr == 0) {
158
+ ipr = $.getHashParameter('ipr') * $.getHashParameter('rows');
159
+ }
160
+ if (current_page > Math.ceil(number_of_assets / ipr)) {
161
+ $.setParameterAndLoad('page', Math.ceil(number_of_assets / ipr));
162
+ current_page = Math.ceil(number_of_assets / ipr);
163
+ }
164
+ assetPages = Math.ceil(number_of_assets / ipr);
165
+ $('.paginator').paginator({
166
+ 'data': {
167
+ current_page: current_page > 0 ? current_page : 1,
168
+ total_pages: Math.ceil(number_of_assets / ipr),
169
+ items_per_page: number_of_assets
170
+ },
171
+ 'callback': function() {
172
+ $.setParameterAndLoad('page', paginator.data.current_page);
173
+ }
174
+ });
175
+ },
176
+ unlockAssets: function(ids) {
177
+ if (!$.isArray(ids)) {
178
+ var ids = [ids];
179
+ }
180
+ $.ajax({
181
+ url: '/api/&request=asset.request',
182
+ type: 'POST',
183
+ global: false,
184
+ async: true,
185
+ data: {
186
+ 'action': 'asset.unlockAssets',
187
+ 'requestkey': $('#registrykey').val(),
188
+ 'asset_ids': ids
189
+ }
190
+ });
191
+ },
192
+ setParameterAndLoad: function(parameter, value, target) {
193
+ $.setHashParameter(parameter, value);
194
+ $.doRequest(target);
195
+ },
196
+ setFilterAndLoad: function(obj) {
197
+ filter = $.getHashParameter('filter');
198
+ if (filter != '') {
199
+ filter = filter.split(',');
200
+ } else {
201
+ filter = [];
202
+ }
203
+ f = obj.attr('id').replace('filter_fid_', '');
204
+ if (obj.is(':checked')) {
205
+ filter.push(f);
206
+ $.setParameterAndLoad('filter', filter.join(','));
207
+ } else {
208
+ fi = [];
209
+ c = 0;
210
+ jQuery.each(filter, function() {
211
+ if (this != f) {
212
+ fi[c] = this;
213
+ c++;
214
+ }
215
+ });
216
+ $.setParameterAndLoad('filter', fi.join(','));
217
+ }
218
+ },
219
+ reset_categories: function() {
220
+ if ($.isFunction($.removeHashParameter) && $.isFunction($.doRequest)) {
221
+ $.removeHashParameter('category');
222
+ $.doRequest();
223
+ }
224
+ },
225
+ filterTag: function(obj, tagid) {
226
+ if ($(obj).is(':checked')) {
227
+ $.setTagAndLoad(tagid);
228
+ } else {
229
+ $.removeTagAndLoad(tagid);
230
+ }
231
+ },
232
+ setTagAndLoad: function(tagid) {
233
+ tag = $.getHashParameter('tag');
234
+ if (tag != '') {
235
+ tag = tag.split(',');
236
+ } else {
237
+ tag = [];
238
+ }
239
+ tag.push(tagid);
240
+ var tagArray = [];
241
+ for (var i = 0; i < tag.length; i++) {
242
+ if ((jQuery.inArray(tag[i], tagArray)) == -1) {
243
+ tagArray.push(tag[i]);
244
+ }
245
+ }
246
+ $.setParameterAndLoad('tag', tagArray.join(','));
247
+ $.clearLiveSearch();
248
+ },
249
+ removeTagAndLoad: function(tagid) {
250
+ tag = $.getHashParameter('tag');
251
+ if (tag != '') {
252
+ tag = tag.split(',');
253
+ } else {
254
+ tag = [];
255
+ }
256
+ var tagArray = [];
257
+ c = 0;
258
+ jQuery.each(tag, function() {
259
+ if (this != tagid) {
260
+ tagArray[c] = this;
261
+ c++;
262
+ }
263
+ });
264
+ $.setParameterAndLoad('tag', tagArray.join(','));
265
+ $.clearLiveSearch();
266
+ },
267
+ removeCountryFilterAndLoad: function(tagid) {
268
+ tag = $.getHashParameter('filter');
269
+ if (tag != '') {
270
+ tag = tag.split(',');
271
+ } else {
272
+ tag = [];
273
+ }
274
+ var tagArray = [];
275
+ c = 0;
276
+ jQuery.each(tag, function() {
277
+ if (this != tagid) {
278
+ tagArray[c] = this;
279
+ c++;
280
+ }
281
+ });
282
+ $.setParameterAndLoad('filter', tagArray.join(','));
283
+ $.clearLiveSearch();
284
+ },
285
+ setSearchTermAndLoad: function(searchTermText) {
286
+ searchTerm = (searchTerm + '').replace(/%20/g, " ").replace(/,/g, " ");
287
+ if (searchTerm == false || searchTerm == 'false') {
288
+ searchTerm = '';
289
+ }
290
+ searchTermText = decodeURIComponent(searchTermText);
291
+ searchTermText = (searchTermText + '').replace(/%20/g, " ");
292
+ if (searchTerm != '') {
293
+ searchTerm = searchTerm.split(' ');
294
+ } else {
295
+ searchTerm = [];
296
+ }
297
+ if (searchTermText != '') {
298
+ searchTermText = searchTermText.split(' ');
299
+ } else {
300
+ searchTermText = [];
301
+ }
302
+ jQuery.each(searchTermText, function(key, value) {
303
+ if (value == 'false' || value == false) {} else {
304
+ searchTerm.push(value);
305
+ }
306
+ });
307
+ searchTerm = array_unique(searchTerm);
308
+ searchTerm = implode(' ', searchTerm);
309
+ searchTerm = encodeURIComponent(decodeURIComponent(searchTerm));
310
+ $.setParameterAndLoad('searchTerm', searchTerm);
311
+ $.clearLiveSearch();
312
+ },
313
+ removeSearchTermAndLoad: function(searchTermText) {
314
+ searchTerm = $.getHashParameter('searchTerm');
315
+ searchTerm = (searchTerm + '').replace(/%20/g, " ");
316
+ if (searchTerm == false || searchTerm == 'false') {
317
+ searchTerm = '';
318
+ }
319
+ if (searchTerm != '') {
320
+ searchTerm = searchTerm.split(' ');
321
+ } else {
322
+ searchTerm = [];
323
+ }
324
+ var searchTermArray = [];
325
+ c = 0;
326
+ jQuery.each(searchTerm, function(key, value) {
327
+ if (value != searchTermText) {
328
+ searchTermArray[c] = value;
329
+ c++;
330
+ }
331
+ });
332
+ $.setParameterAndLoad('searchTerm', encodeURIComponent(decodeURIComponent(searchTermArray.join(' '))));
333
+ $.clearLiveSearch();
334
+ },
335
+ setAdvancedSearchField: function(el) {
336
+ asearch = [];
337
+ $(el).parents('#advanced_search').find('.search-line').each(function() {
338
+ var type = $(this).find(".as_field").val();
339
+ var operator = $(this).find("select.as_match").val();
340
+ var value;
341
+ var inputWrapper = $(this).find('.input-wrapper');
342
+ switch ($(this).data('input-type')) {
343
+ case 'select':
344
+ case 'input-select':
345
+ case 'multiselect':
346
+ case 'input-multi-select':
347
+ value = inputWrapper.find('select').val();
348
+ break;
349
+ case 'text':
350
+ case 'username':
351
+ value = inputWrapper.find('input').val();
352
+ break;
353
+ case 'radio':
354
+ case 'input-radio':
355
+ operator = '__eq__';
356
+ value = inputWrapper.find('input[type=radio]:checked').val();
357
+ break;
358
+ case 'textarea':
359
+ value = inputWrapper.find('textarea').val();
360
+ break;
361
+ case 'date':
362
+ var date = moment(inputWrapper.find('input').val(), 'DD MMMM YYYY');
363
+ value = date.format('YYYY-MM-DD');
364
+ break;
365
+ }
366
+ asearch.push({
367
+ type: type,
368
+ operator: operator,
369
+ value: value
370
+ });
371
+ });
372
+ $('#advanced_search').trigger('asearch', {
373
+ search: asearch
374
+ });
375
+ },
376
+ doRequest: function(target) {
377
+ $.setHashParameter('m', 'asset');
378
+ url = urlhash.replace('#', '');
379
+ $('[id^="par_"]:not(option)').each(function(i, ui) {
380
+ url = $.setHashParameter($(ui).attr('name'), $(ui).val());
381
+ });
382
+ if (target != undefined) {
383
+ $('#' + target).attr('src', '/#' + url);
384
+ } else {
385
+ document.location = '#' + url;
386
+ $('link[type*=icon]').detach().appendTo('head');
387
+ }
388
+ },
389
+ getHashUrl: function() {
390
+ url = urlhash.replace('#', '');
391
+ $.setHashParameter('m', 'asset');
392
+ $('[id^="par_"]:not(option)').each(function(i, ui) {
393
+ url = $.setHashParameter($(ui).attr('name'), $(ui).val());
394
+ });
395
+ return url;
396
+ },
397
+ getUrlVars: function() {
398
+ var vars = {};
399
+ var hash = location.hash;
400
+ var hashes = hash.slice(1).split('&');
401
+ $.each(hashes, function(i, hash) {
402
+ hash = hash.split('=');
403
+ vars[hash[0]] = hash[1];
404
+ });
405
+ return vars;
406
+ },
407
+ resetSearch: function() {
408
+ $.removeHashParameter('searchTerm');
409
+ $('#assetSearchBox').val('');
410
+ $.switchToGrid();
411
+ $('[class^="filter_fid_"]').removeAttr('checked');
412
+ $.removeHashParameter('filter');
413
+ $.removeHashParameter();
414
+ $.uniform.update();
415
+ },
416
+ reloadGrid: function() {
417
+ $.setParameterAndLoad('reloadgrid', Math.floor(Math.random() * 10000000));
418
+ },
419
+ setDefaultPreviewPeriod: function(obj) {
420
+ $('[id^=asset_line_] .default_preview_from').show();
421
+ $('[id^=asset_line_] .default_preview_till').show();
422
+ $('.previous_preview_id').val(obj.val());
423
+ $('#asset_line_' + obj.val() + ' .default_preview_from').datepicker("setDate", 0).hide();
424
+ $('#asset_line_' + obj.val() + ' .default_preview_till').datepicker("setDate", 0).hide();
425
+ },
426
+ errorHandling: function(jsxmltype, type, id, data) {
427
+ switch (type) {
428
+ case 'savedone':
429
+ $('#fw-dialog-main').html(translations[0]['asset/save/error']);
430
+ $('#fw-dialog-main').dialog({
431
+ "width": 325,
432
+ buttons: [{
433
+ text: translations[0]['asset/button/okay'],
434
+ click: function() {
435
+ $(this).dialog("close");
436
+ }
437
+ }]
438
+ });
439
+ $('#fw-dialog-main').dialog('open');
440
+ $('#fw-dialog-main').css('height', 'auto');
441
+ break;
442
+ }
443
+ },
444
+ assetAfterSave: function(jsxmltype, type, id, data) {
445
+ switch (type) {
446
+ case 'nothing':
447
+ $('#fw-dialog-main').html(data);
448
+ $('#fw-dialog-main').dialog({
449
+ "width": 325
450
+ });
451
+ $('#fw-dialog-main').dialog('open');
452
+ $('#fw-dialog-main').css('height', 'auto');
453
+ return;
454
+ break;
455
+ case 'submit_for_approval':
456
+ $.reloadGrid();
457
+ return;
458
+ break;
459
+ case 'delete-asset':
460
+ $.reloadGrid();
461
+ return;
462
+ break;
463
+ case 'savedone':
464
+ $('#fw-dialog-main').html(data);
465
+ $('#fw-dialog-main').dialog({
466
+ "width": 325
467
+ });
468
+ $('#fw-dialog-main').dialog('open');
469
+ $('#fw-dialog-main').css('height', 'auto');
470
+ $.displayAssetDetails(id);
471
+ return;
472
+ break;
473
+ }
474
+ $.reloadGrid();
475
+ switch (jsxmltype) {
476
+ case 'order':
477
+ $('#mainDialog').dialog({
478
+ dialogClass: 'customdialog',
479
+ buttons: [{
480
+ text: "Oke",
481
+ click: function() {
482
+ $(this).dialog("close");
483
+ }
484
+ }],
485
+ width: 400,
486
+ height: 200
487
+ });
488
+ $('#mainDialog').html($('#message_admin_order').html());
489
+ $('#mainDialog').dialog('open');
490
+ $.switchToGrid();
491
+ break;
492
+ default:
493
+ $.setParameterAndLoad('a', 'details');
494
+ break;
495
+ }
496
+ },
497
+ addToCart: function(id, type) {
498
+ $.ajax({
499
+ url: '/api/&request=asset.request',
500
+ type: 'POST',
501
+ data: {
502
+ 'action': 'asset.addtocart',
503
+ 'requestkey': $('#registrykey').val(),
504
+ 'assettype': type,
505
+ 'location': window.location.href,
506
+ 'asset_id': id
507
+ }
508
+ }).done(function(data, status) {
509
+ obj = $.parseJSON(data);
510
+ if (obj.code == 200) {
511
+ $('#asset_' + id + ' .selected').addClass('view');
512
+ $('#cartCounter').html(obj.cart_items);
513
+ $('#footercartCounter').html(obj.cart_items);
514
+ if (obj.cart_content != '') {
515
+ $('.asset-cart-wrapper-outer').fadeIn('slow');
516
+ $('.asset-cart-wrapper-inner .content').html(obj.cart_content);
517
+ $('.asset-cart-wrapper-outer').fadeOut('slow');
518
+ }
519
+ if (obj.cart_bar_content != '') {
520
+ $('#footerCart').slideDown('slow');
521
+ $('#footerWrapper').addClass('cartBarVisible');
522
+ $('#footerCart #footerCartBar ul').html(obj.cart_bar_content);
523
+ var cartBarUlWidth = 0;
524
+ $('#footerCartBar img').each(function() {
525
+ cartBarUlWidth += $(this).width() + 7;
526
+ });
527
+ $('#footerCart #footerCartBar ul').css('width', cartBarUlWidth);
528
+ $('#footerCart').slideUp('slow');
529
+ $('#footerWrapper').removeClass('cartBarVisible');
530
+ }
531
+ } else if (obj.code == 400) {
532
+ alert(obj.message);
533
+ } else {
534
+ return false;
535
+ }
536
+ });
537
+ return false;
538
+ },
539
+ removeFromCart: function(id, type) {
540
+ if (type != '') {
541
+ $('.asset-cart-wrapper-outer #cart_item_' + id + '_' + type).remove();
542
+ $('#footerCart #footerCartBar ul #cart_item_' + id + '_' + type).remove();
543
+ } else {
544
+ $('.asset-cart-wrapper-outer #cart_item_' + id).remove();
545
+ $('#footerCart #footerCartBar ul #cart_item_' + id).remove();
546
+ }
547
+ $('#check_' + id + '_' + type).removeAttr('checked');
548
+ $('#check_' + id + '_' + type).removeClass('incart');
549
+ $.uniform.update($('#check_' + id + '_' + type));
550
+ if ($('.scrollview .cart_item').length == 0) {
551
+ $('.cart_order_button').hide();
552
+ }
553
+ $.ajax({
554
+ url: '/api/&request=asset.request',
555
+ type: 'POST',
556
+ data: {
557
+ 'action': 'asset.removefromcart',
558
+ 'location': window.location.href,
559
+ 'assettype': type,
560
+ 'requestkey': $('#registrykey').val(),
561
+ 'asset_id': id
562
+ }
563
+ }).done(function(data, status) {
564
+ obj = $.parseJSON(data);
565
+ if (obj.code == 200) {
566
+ $('#cartCounter').html(obj.cart_items);
567
+ if (obj.incart == 0) {
568
+ $('#asset_' + id + ' .selected').removeClass('view');
569
+ }
570
+ }
571
+ });
572
+ },
573
+ emptyCart: function() {
574
+ $('.cart_order_button').hide();
575
+ $.ajax({
576
+ url: '/api/&request=asset.request',
577
+ type: 'POST',
578
+ data: {
579
+ 'action': 'asset.emptycart',
580
+ 'location': window.location.href,
581
+ 'requestkey': $('#registrykey').val(),
582
+ }
583
+ }).done(function(data, status) {
584
+ var obj = $.parseJSON(data);
585
+ if (obj.code == 200) {
586
+ $('#cartCounter').html(obj.cart_items);
587
+ $('.asset-cart-wrapper-inner .content').html(obj.cart_content);
588
+ $('[id^="asset_"] .selected').removeClass('view');
589
+ }
590
+ });
591
+ },
592
+ createFilterData: function() {
593
+ var filterdata = new Array;
594
+ $('[id^="filter_"]:not(option)').each(function(i, ui) {
595
+ if ($(ui).attr('type') == 'checkbox') {
596
+ filterdata.push($(ui).attr('name') + "=" + ($(ui).attr('checked') == "checked" ? "1" : "0"));
597
+ } else {
598
+ filterdata.push($(ui).attr('name') + "=" + $(ui).attr('value'));
599
+ }
600
+ });
601
+ return escape(filterdata.join('&'));
602
+ },
603
+ createFilterUrl: function() {
604
+ var filterdata = new Array;
605
+ $('[id^="filter_"]:not(option)').each(function(i, ui) {
606
+ filterdata.push($(ui).attr('name') + "=" + $(ui).attr('value'));
607
+ });
608
+ return filterdata.join('&');
609
+ },
610
+ groupLineDetails: function(obj) {
611
+ obj.closest('.asset_line').find('.line_opened').toggle();
612
+ obj.closest('.asset_line').find('.line_closed').toggle();
613
+ },
614
+ removeAssetLine: function(obj, assetIdClass, assetLineClass, confirmationTranslation) {
615
+ var assetIdClass = undefined != assetIdClass ? assetIdClass : 'asset_relation_ids';
616
+ var assetLineClass = undefined != assetLineClass ? assetLineClass : 'asset_line';
617
+ var confirmationTranslation = undefined != confirmationTranslation ? confirmationTranslation : 'asset/info/disconnect_child';
618
+ id = obj.closest('.' + assetLineClass + '_row').attr('id').replace(assetLineClass + '_', '');
619
+ child_ids = $('.' + assetIdClass).attr('orgval').split(',');
620
+ if ($.inArray(id, child_ids) != -1) {
621
+ $('#fw-dialog-main').dialog({
622
+ buttons: [{
623
+ text: translations[0]['asset/button/cancel'],
624
+ click: function() {
625
+ $(this).dialog("close");
626
+ }
627
+ }, {
628
+ text: translations[0]['asset/button/okay'],
629
+ click: function() {
630
+ $('#' + obj.target).html(obj.html);
631
+ var s = $('.' + assetIdClass).val().split(',');
632
+ s.splice($.inArray(id, s), 1);
633
+ $('.' + assetIdClass).val(s.join(','));
634
+ obj.closest('.' + assetLineClass + '_row').remove();
635
+ $(this).dialog("close");
636
+ }
637
+ }],
638
+ width: 470,
639
+ 'min-height': 270
640
+ });
641
+ $('#fw-dialog-main').html(translations[0][confirmationTranslation]);
642
+ $('#fw-dialog-main').dialog('open');
643
+ } else {
644
+ var s = $('.' + assetIdClass).val().split(',');
645
+ s.splice($.inArray(id, s), 1);
646
+ $('.' + assetIdClass).val(s.join(','));
647
+ obj.closest('.' + assetLineClass + '_row').remove();
648
+ }
649
+ },
650
+ promoteToChild: function(obj) {
651
+ var assetIdClass = undefined != assetIdClass ? assetIdClass : 'asset_version_ids';
652
+ var assetLineClass = undefined != assetLineClass ? assetLineClass : 'asset_line';
653
+ id = obj.closest('.' + assetLineClass + '_row').attr('id').replace(assetLineClass + '_', '');
654
+ $.ajax({
655
+ url: '/api/&request=asset.request',
656
+ type: 'POST',
657
+ data: {
658
+ 'asset_id': id,
659
+ 'xmlset': 'assetChildEdit',
660
+ 'action': 'asset.getrelationline',
661
+ 'asset_line_type': 'child',
662
+ 'target': 'asset_lines',
663
+ 'requestkey': $('#registrykey').val()
664
+ }
665
+ }).done(function(data, status) {
666
+ obj = $.parseJSON(data);
667
+ s = $('.asset_relation_ids').val();
668
+ if (s == '') {
669
+ s = id;
670
+ } else {
671
+ s = s.split(',')
672
+ s[s.length] = id;
673
+ s = s.join(',');
674
+ }
675
+ $('.asset_relation_ids').val(s);
676
+ $(obj.html).appendTo($('.asset_lines').find('.asset_line').parent());
677
+ var c = $('.asset_version_ids').val().split(',');
678
+ c.splice($.inArray(id, c), 1);
679
+ $('.asset_version_ids').val(c.join(','));
680
+ $('#asset_line_' + id).remove();
681
+ });
682
+ return;
683
+ },
684
+ promoteToVersion: function(obj) {
685
+ var assetIdClass = undefined != assetIdClass ? assetIdClass : 'asset_relation_ids';
686
+ var assetLineClass = undefined != assetLineClass ? assetLineClass : 'asset_line';
687
+ id = obj.closest('.' + assetLineClass + '_row').attr('id').replace(assetLineClass + '_', '');
688
+ $.ajax({
689
+ url: '/api/&request=asset.request',
690
+ type: 'POST',
691
+ data: {
692
+ 'asset_id': id,
693
+ 'xmlset': 'assetVersionEdit',
694
+ 'action': 'asset.getrelationline',
695
+ 'asset_line_type': 'version',
696
+ 'target': 'version_asset_lines',
697
+ 'requestkey': $('#registrykey').val()
698
+ }
699
+ }).done(function(data, status) {
700
+ obj = $.parseJSON(data);
701
+ var s = $('.asset_version_ids').val();
702
+ if (s == '') {
703
+ s = id;
704
+ } else {
705
+ s = s.split(',');
706
+ s[s.length] = id;
707
+ s = s.join(',');
708
+ }
709
+ $('.asset_version_ids').val(s);
710
+ $(obj.html).appendTo($('.version_asset_lines').find('.version_asset_line').parent());
711
+ var c = $('.asset_relation_ids').val().split(',');
712
+ c.splice($.inArray(id, c), 1);
713
+ $('.asset_relation_ids').val(c.join(','));
714
+ $('#asset_line_' + id).remove();
715
+ });
716
+ return;
717
+ },
718
+ goPageRequest: function(page) {
719
+ $.ajax({
720
+ url: '/api/&request=asset.request',
721
+ type: 'POST',
722
+ data: {
723
+ 'action': 'asset.gopage',
724
+ 'location': window.location.href,
725
+ 'filter': $.createFilterData(),
726
+ 'requestkey': $('#registrykey').val()
727
+ }
728
+ }).done(function(data, status) {
729
+ obj = $.parseJSON(data);
730
+ if (obj.code == 200) {
731
+ $('[toolbox]').qtip('destroy')
732
+ $('#' + obj.target).html(obj.html);
733
+ $('[toolbox]').toolBox();
734
+ } else {
735
+ alert(obj.message);
736
+ }
737
+ });
738
+ },
739
+ setPageTitle: function(title, title2) {
740
+ if (title2) {
741
+ title2 = '</div><div style="overflow: hidden" class="assetnumber">' + title2;
742
+ style2 = '';
743
+ } else {
744
+ title2 = '';
745
+ style2 = ' padding-bottom: 10px;';
746
+ }
747
+ $('.page_heading_spacer').html('<div style="overflow: hidden;' + style2 + '" class="assettitle">' + title + title2 + '</div>');
748
+ Cufon.replace('.page_heading_spacer div.assettitle', {
749
+ fontFamily: 'Rockwell'
750
+ });
751
+ Cufon.replace('.page_heading_spacer div.assetnumber', {
752
+ fontFamily: 'Rockwell-light'
753
+ });
754
+ },
755
+ editCategory: function(obj) {
756
+ var id = $(obj).closest('form').attr('object').replace('id_', '');
757
+ $.ajax({
758
+ url: '/api/&request=asset.request',
759
+ type: 'POST',
760
+ data: {
761
+ 'action': 'asset.getcategorybrowser',
762
+ 'requestkey': $('#registrykey').val(),
763
+ 'location': window.location.href,
764
+ 'asset_id': id
765
+ }
766
+ }).done(function(data, status) {
767
+ $('#fw-dialog-main').dialog({
768
+ buttons: [{
769
+ text: assetTranslations.asset_button_cancel,
770
+ click: function() {
771
+ $(this).dialog("close");
772
+ }
773
+ }, {
774
+ text: assetTranslations.asset_button_save,
775
+ click: function() {
776
+ $.saveCategories();
777
+ }
778
+ }],
779
+ width: 725,
780
+ height: 500
781
+ });
782
+ var obj = $.parseJSON(data);
783
+ if (obj.code == 200) {
784
+ $('#fw-dialog-main').html(obj.html);
785
+ $('#fw-dialog-main').dialog('open');
786
+ if (obj.hasOwnProperty('target') && obj.target.length > 0) {
787
+ $('#' + obj.target).html(obj.html);
788
+ }
789
+ } else {
790
+ alert(obj.message);
791
+ }
792
+ return false;
793
+ });
794
+ },
795
+ performAdvancedSearch: function() {},
796
+ previewRelationAsset: function(id) {
797
+ $(".grid_detail div[class*='asset_preview_div_']").hide().addClass('hidden');
798
+ $('.grid_detail .asset_preview_div_' + id).first().show().removeClass('hidden');
799
+ }
800
+ });
801
+ if (!$('div#debug-dialog').length) {
802
+ var debug_dialog = $('<div id="debug-dialog"></div>');
803
+ $('body').append(debug_dialog);
804
+ var debug_dialog_opener = $('<a id="debug-dialog-opener">&nbsp;</a>');
805
+ $('body').append(debug_dialog_opener);
806
+ debug_dialog_opener.on('click', function() {
807
+ try {
808
+ console.log(this);
809
+ } catch (e) {}
810
+ debug_dialog.dialog('open');
811
+ });
812
+ debug_dialog_opener.css({
813
+ 'position': 'absolute',
814
+ 'left': '0',
815
+ 'top': '0',
816
+ 'display': 'block',
817
+ 'width': '10px',
818
+ 'text-align': 'center',
819
+ 'z-index': 100000
820
+ });
821
+ }
822
+ var dialog_main_options = $('#fw-dialog-main').dialog('option') || {};
823
+ var options = $.extend(dialog_main_options, {
824
+ width: 500,
825
+ minHeight: 200,
826
+ maxHeight: 400,
827
+ modal: false,
828
+ draggable: true,
829
+ resizable: true,
830
+ position: ['left', 'top'],
831
+ title: 'debug'
832
+ });
833
+ $('div#debug-dialog').dialog(options);
834
+ $(function() {
835
+ $(document).ajaxSuccess(function(event, xhr, settings) {
836
+ if ($('#asset_bank_container').hasClass('ui-selectable') && $('#wrapper').length) {
837
+ debug_dialog.append('<p>' + Date() + ' asset_bank_container.ui-selectable: ' + $('#asset_bank_container.ui-selectable').length + '</p>');
838
+ $('#wrapper').css({
839
+ 'background-color': 'rgba(255,255,255,0)'
840
+ })
841
+ $('#wrapper').selectable({
842
+ filter: 'div.asset-thumb-container-wrapper',
843
+ cancel: '.asset_detail_row,[class*="-wrapper-outer"] *, #asset_content_detail_container_overlay,[onclick],.asset-thumb-action,.paginator *,.assetadvancedsearch-wrapper-outer *, .batch_transfer_ownership',
844
+ stop: function(event, ui) {
845
+ $('div.asset-thumb-container-wrapper.ui-draggable:not(.ui-selected)', this).draggable('destroy');
846
+ try {
847
+ debug_dialog.append('<p>' + Date() + ' item(s) selected: ' + $('.ui-selected').length + '</p>');
848
+ } catch (e) {}
849
+ $('div.asset-thumb-container-wrapper.ui-selected:not(.ui-draggable)', this).draggable({
850
+ appendTo: 'body',
851
+ containment: false,
852
+ helper: function(event) {
853
+ var quantity = 0;
854
+ $('.ui-selected').each(function() {
855
+ var total = parseInt($('[data-total]', this).data('total'));
856
+ if (total != NaN) {
857
+ quantity += total;
858
+ }
859
+ });
860
+ return $('<div class="asset-selection-dragger">-</div>').html(quantity);
861
+ },
862
+ cursor: 'cell',
863
+ distance: 5,
864
+ cursorAt: {
865
+ top: 40,
866
+ left: -40
867
+ },
868
+ start: function() {
869
+ $('.asset-selection-droppable').addClass('accept-mode')
870
+ $('.asset-selection-button-wrapper').addClass('asset-selection-button-wrapper-drag-accept')
871
+ },
872
+ stop: function() {
873
+ $('.asset-selection-droppable').removeClass('accept-mode')
874
+ $('.asset-selection-button-wrapper').removeClass('asset-selection-button-wrapper-drag-accept')
875
+ },
876
+ });
877
+ },
878
+ start: function() {
879
+ try {
880
+ debug_dialog.append('<p>' + Date() + ' start dragging</p>');
881
+ } catch (e) {}
882
+ }
883
+ });
884
+ $('.asset-selection-droppable, .asset-selection-button-wrapper').droppable({
885
+ drop: function(event, ui) {
886
+ var ids = new Array();
887
+ var type = $(this).data('type');
888
+ var reference = $(this).data('reference');
889
+ $('div.asset-thumb-container-wrapper.ui-selected.ui-draggable').each(function() {
890
+ var id = $('.asset_thumb_container:first', this).data('id');
891
+ if (id != undefined) {
892
+ ids.push(id);
893
+ }
894
+ });
895
+ switch (type) {
896
+ case 'batchedit':
897
+ break;
898
+ default:
899
+ $(this).addToSelection(ids, type, reference);
900
+ break;
901
+ }
902
+ },
903
+ over: function(event, ui) {}
904
+ });
905
+ }
906
+ $('.asset-thumb-actions .asset-thumb-action:not(.asset-thumb-action-bind)').each(function() {
907
+ $(this).addClass('asset-thumb-action-bind').on('click', function() {
908
+ var id = $(this).data('id');
909
+ var type = $(this).data('type');
910
+ var reference = $(this).data('reference');
911
+ switch (type) {
912
+ case 'info':
913
+ alert('open details, asset.js (1065)');
914
+ break;
915
+ default:
916
+ $(this).addToSelection([id], type, reference);
917
+ break;
918
+ }
919
+ $('.asset-selections-wrapper').trigger('selectionAmountChanged');
920
+ });
921
+ });
922
+ });
923
+ });
924
+ $.fn.extend({
925
+ selectionContainer: function(action, option) {
926
+ var sliderWrapperClass = 'asset-selection-slider-wrapper';
927
+ var sliderWrapperClassActive = 'asset-selection-slider-wrapper-active';
928
+ var sliderButtonClassActive = 'asset-selection-button-wrapper-active';
929
+ var visible = false;
930
+ switch (action) {
931
+ case 'init':
932
+ var $frames = $('.frame', this);
933
+ var $wrappers = $(this);
934
+ $wrappers.each(function() {
935
+ var $frame = $('.frame', this);
936
+ var $slidee = $frame.find('ul').eq(0);
937
+ var $wrap = $frame.parent();
938
+ $frame.sly({
939
+ horizontal: 1,
940
+ itemNav: 'basic',
941
+ smart: 1,
942
+ activateOn: 'click',
943
+ mouseDragging: 1,
944
+ touchDragging: 1,
945
+ releaseSwing: 1,
946
+ startAt: 3,
947
+ scrollBar: $wrap.find('.scrollbar'),
948
+ scrollBy: 1,
949
+ pagesBar: $wrap.find('.pages'),
950
+ activatePageOn: 'click',
951
+ speed: 300,
952
+ elasticBounds: 1,
953
+ easing: 'easeOutExpo',
954
+ dragHandle: 1,
955
+ dynamicHandle: 1,
956
+ clickBar: 1,
957
+ });
958
+ $frame.sly('toEnd');
959
+ $wrap.addClass(sliderWrapperClass);
960
+ var reference = $(this).data('reference');
961
+ var button = $('[data-reference="' + reference + '"].asset-selection-button-wrapper');
962
+ var buttons = $('[data-reference].asset-selection-button-wrapper');
963
+ button.hoverIntent(function(e) {
964
+ e.stopPropagation();
965
+ $wrappers.not($wrap).selectionContainer('hide', 'fast');
966
+ $wrap.selectionContainer('show', 'slow');
967
+ }, function() {});
968
+ });
969
+ $(this).hover(function() {}, function(e) {
970
+ e.stopPropagation();
971
+ $wrappers.selectionContainer('hide', 800)
972
+ });
973
+ break;
974
+ case 'refresh':
975
+ $(this).each(function() {
976
+ if ($(this).is(':visible')) {
977
+ $('.asset-selection-droppable', this).sly('reload').sly('toEnd');
978
+ } else {
979
+ $(this).css({
980
+ 'display': 'inline',
981
+ 'visibility': 'hidden',
982
+ });
983
+ $('.asset-selection-droppable', this).sly('reload').sly('toEnd');
984
+ $(this).css({
985
+ 'display': 'none',
986
+ 'visibility': 'visible',
987
+ });
988
+ }
989
+ });
990
+ break;
991
+ case 'show':
992
+ $(this).each(function() {
993
+ $(this).slideDown(option == undefined ? 'slow' : option);
994
+ $(this).addClass(sliderWrapperClassActive);
995
+ var reference = $(this).data('reference');
996
+ var button = $('[data-reference="' + reference + '"].asset-selection-button-wrapper');
997
+ button.addClass(sliderButtonClassActive);
998
+ var buttons = $('[data-reference].asset-selection-button-wrapper');
999
+ buttons.not(button).removeClass(sliderButtonClassActive);
1000
+ });
1001
+ break;
1002
+ case 'hide':
1003
+ $(this).each(function() {
1004
+ $(this).slideUp(option == undefined ? 'slow' : option);
1005
+ $(this).removeClass(sliderWrapperClassActive);
1006
+ var buttons = $('[data-reference].asset-selection-button-wrapper');
1007
+ buttons.removeClass(sliderButtonClassActive);
1008
+ });
1009
+ break;
1010
+ }
1011
+ },
1012
+ removeFromSelection: function(id, type, reference) {
1013
+ $.ajax({
1014
+ url: '/api',
1015
+ type: 'POST',
1016
+ dataType: 'json',
1017
+ global: false,
1018
+ context: $(this),
1019
+ data: {
1020
+ 'action': 'asset.removeFromSelection',
1021
+ 'requestkey': $('#registrykey').val(),
1022
+ 'request': 'asset.request',
1023
+ 'id': id,
1024
+ 'type': type,
1025
+ 'reference': reference,
1026
+ 'location': window.location.href
1027
+ }
1028
+ }).done(function(data) {
1029
+ if (data.code == 200) {
1030
+ var wrapper = $('[data-reference="' + reference + '"].asset-selection-droppable');
1031
+ $('li[data-item-asset-type="' + type + '"][data-item-asset-id="' + id + '"]', wrapper).remove();
1032
+ if (!$('li[data-item-asset-id="' + id + '"]').length) {
1033
+ $('#asset_' + id + ' .selected').removeClass('view');
1034
+ }
1035
+ if (!$('li[data-item-asset-id="' + id + '"]', wrapper).length) {
1036
+ $('#asset_' + id + ' [data-reference="' + reference + '"].iconSmall').removeClass('asset-selected');
1037
+ }
1038
+ if (data.hasOwnProperty('reference') && data.hasOwnProperty('items')) {
1039
+ $('.footer-counter[data-reference=' + data.reference + ']').html(data.items);
1040
+ if ($.isFunction($.showNumberOfFavorites)) {
1041
+ $.showNumberOfFavorites(data.items, data.reference);
1042
+ }
1043
+ }
1044
+ } else if (data.code == 400) {
1045
+ alert(data.message);
1046
+ } else {
1047
+ return false;
1048
+ }
1049
+ });
1050
+ return false;
1051
+ },
1052
+ addToSelection: function(ids, type, reference) {
1053
+ var button = $(this);
1054
+ var isActive = button.hasClass('btn-active-selection');
1055
+ if (!$.isArray(ids)) {
1056
+ var ids = [ids];
1057
+ }
1058
+ $(this).addClass('posting-selection');
1059
+ $.ajax({
1060
+ url: '/api',
1061
+ type: 'POST',
1062
+ dataType: 'json',
1063
+ global: false,
1064
+ context: $(this),
1065
+ data: {
1066
+ 'action': (isActive ? 'asset.removeFromSelectionMulti' : 'asset.addToSelection'),
1067
+ 'requestkey': $('#registrykey').val(),
1068
+ 'request': 'asset.request',
1069
+ 'ids': ids.join(','),
1070
+ 'type': type,
1071
+ 'reference': reference,
1072
+ 'location': window.location.href
1073
+ }
1074
+ }).done(function(data) {
1075
+ !isActive ? button.addClass('btn-active-selection') : button.removeClass('btn-active-selection');
1076
+ $(this).removeClass('posting-selection');
1077
+ if (data.hasOwnProperty('code') && data.code == 200) {
1078
+ if (isActive) {
1079
+ button.removeClass('btn-active-selection');
1080
+ }
1081
+ if (data.hasOwnProperty('added') && !isActive) {
1082
+ $.each(data.added, function(key, value) {
1083
+ $('#asset_' + value + ' .selected').addClass('view');
1084
+ $('#asset_' + value + ' [data-reference="' + reference + '"].iconSmall').addClass('asset-selected');
1085
+ $('.asset-actions [data-id="' + value + '"][data-reference="' + reference + '"]').addClass('btn-active-selection');
1086
+ });
1087
+ }
1088
+ if (data.hasOwnProperty('reference') && data.hasOwnProperty('items')) {
1089
+ $('.footer-counter[data-reference=' + data.reference + ']').html(data.items);
1090
+ if ($.isFunction($.showNumberOfFavorites)) {
1091
+ $.showNumberOfFavorites(data.items, data.reference);
1092
+ }
1093
+ }
1094
+ if (data.hasOwnProperty('reference') && data.hasOwnProperty('html')) {
1095
+ $('.asset-selection-droppable-wrapper[data-reference!=' + data.reference + ']').selectionContainer('hide', 'fast');
1096
+ $('.asset-selection-droppable-wrapper[data-reference=' + data.reference + ']').selectionContainer('show');
1097
+ $('.asset-selection-droppable[data-reference=' + data.reference + '] ul').append(data.html);
1098
+ $('.asset-selection-droppable-wrapper[data-reference=' + data.reference + ']').selectionContainer('refresh');
1099
+ setTimeout(function() {
1100
+ $('.asset-selection-droppable-wrapper[data-reference=' + data.reference + ']').selectionContainer('refresh');
1101
+ }, 500);
1102
+ }
1103
+ } else if (data.code == 400) {
1104
+ alert(data.message);
1105
+ } else {
1106
+ return false;
1107
+ }
1108
+ });
1109
+ return false;
1110
+ },
1111
+ getSelection: function(reference) {
1112
+ $.ajax({
1113
+ url: '/api',
1114
+ type: 'POST',
1115
+ dataType: 'json',
1116
+ global: false,
1117
+ context: $(this),
1118
+ data: {
1119
+ 'action': 'asset.getSelection',
1120
+ 'requestkey': $('#registrykey').val(),
1121
+ 'request': 'asset.request',
1122
+ 'reference': reference,
1123
+ 'location': window.location.href
1124
+ }
1125
+ }).done(function(data) {
1126
+ if (data.code == 200) {
1127
+ if (data.reference && data.items) {
1128
+ $('.footer-counter[data-reference=' + data.reference + ']').html(data.items);
1129
+ }
1130
+ if (data.reference && data.html) {
1131
+ $('.asset-selection-droppable[data-reference=' + data.reference + '] ul').append(data.html);
1132
+ }
1133
+ $('.asset-selection-droppable-wrapper').css({
1134
+ 'display': 'inline',
1135
+ 'visibility': 'hidden',
1136
+ });
1137
+ $('.asset-selection-droppable-wrapper').selectionContainer('refresh');
1138
+ $('.asset-selection-droppable-wrapper').css({
1139
+ 'display': 'none',
1140
+ 'visibility': 'visible',
1141
+ });
1142
+ } else if (data.code == 400) {
1143
+ alert(data.message);
1144
+ } else {
1145
+ return false;
1146
+ }
1147
+ });
1148
+ return false;
1149
+ },
1150
+ rejectUpload: function(obj) {
1151
+ $(this).attr('disabled', 'disabled');
1152
+ $('#fw-dialog-main').dialog({
1153
+ title: assetTranslations.asset_reject_title,
1154
+ buttons: [{
1155
+ text: assetTranslations.asset_button_cancel,
1156
+ click: function() {
1157
+ $(this).dialog("close");
1158
+ }
1159
+ }, {
1160
+ text: assetTranslations.asset_button_reject,
1161
+ click: function() {
1162
+ if ($("#asset_reject_reason").val().trim() == "") {
1163
+ $('#fw-dialog-alert').dialog({
1164
+ title: assetTranslations.asset_reject_alert_enter_message,
1165
+ 'width': 400,
1166
+ 'buttons': [{
1167
+ 'id': 'ok',
1168
+ 'text': assetTranslations.asset_button_ok,
1169
+ 'click': function() {
1170
+ $(this).dialog('close');
1171
+ }
1172
+ }]
1173
+ }).dialog('open');
1174
+ } else {
1175
+ $('.row_approval_remarks textarea').val($("#asset_reject_reason").val().replace(/(?:\r\n|\r|\n)/g, '<br />'));
1176
+ $('.row_approval_remarks input').val($("#asset_reject_reason").val().replace(/(?:\r\n|\r|\n)/g, '<br />'));
1177
+ $(this).dialog("close");
1178
+ obj.save(obj, 'reject_asset');
1179
+ }
1180
+ }
1181
+ }],
1182
+ width: 470,
1183
+ 'min-height': 270
1184
+ });
1185
+ $('#fw-dialog-main').html(assetTranslations.asset_reject_text + '<br/><div><textarea id="asset_reject_reason"></textarea>');
1186
+ $('#fw-dialog-main').dialog('open');
1187
+ $(this).removeAttr('disabled');
1188
+ }
1189
+ });
1190
+ $(document).ready(function() {
1191
+ $('.searchBoxContainerInput .autocomplete').each(function() {
1192
+ var atype = $(this).attr("autotype");
1193
+ $(this).autocomplete({
1194
+ minLength: 3,
1195
+ source: function(request, response) {
1196
+ btype = atype;
1197
+ $.ajax({
1198
+ url: '/api/&request=asset.autocompleter',
1199
+ type: 'POST',
1200
+ dataType: 'json',
1201
+ data: {
1202
+ featureClass: "P",
1203
+ style: "full",
1204
+ maxRows: 12,
1205
+ type: btype,
1206
+ requestkey: $('#registrykey').val(),
1207
+ term: request.term
1208
+ },
1209
+ success: function(data) {
1210
+ response($.map(data[btype], function(item) {
1211
+ return {
1212
+ label: item.value,
1213
+ value: item.value,
1214
+ id: item.id
1215
+ }
1216
+ }));
1217
+ }
1218
+ });
1219
+ },
1220
+ delay: 750
1221
+ });
1222
+ });
1223
+ });