PageSourceSearch

https://www.eshop.jobst-usa.com/_ui/addons/commerceorgaddon/responsive/common/js/commerceorgaddon.js

js jobst-usa.com collected 2026-09-26 12:58:11 UTC 7,826 bytes, 245 lines download raw bytes

1ACC.commerceorg = {
2
3    _autoload: [
4        "bindToSelectBudget",
5        "bindToDeselectBudget",
6        "bindToSelectLink",
7        "bindToDeselectLink",
8        "bindToActionConfirmationModalWindow",
9        "disablePermissionConfirmation",
10        "bindToSelectUser",
11        "bindToDeselectUser",
12	    "bindToUnitAddUserButton",
13	    "disablePermissionConfirmation",
14        "bindPermissionTypeSelectionForAddNew",
15        "bindToRemoveUserFromUnit",
16        "budgetFormInit"
17    ],
18
19    bindToSelectBudget: function()
20    {
21        $(document).on('click','.js-selectBudget',function(){
22            var url = $(this).attr('url');
23            $.postJSON(url,{}, ACC.commerceorg.selectionCallback);
24            return false;
25        });
26
27    },
28
29    bindToDeselectBudget: function()
30    {
31        $(document).on('click','.js-deselectBudget',function(){
32            var url = $(this).attr('url');
33            $.postJSON(url,{}, ACC.commerceorg.deselectionCallback);
34            return false;
35        });
36    },
37
38    selectionCallback: function(budget)
39    {
40        $('#card-' + budget.normalizedCode).addClass("selected");
41        $('#span-' + budget.normalizedCode).html($('#enableDisableLinksTemplate').tmpl(budget));
42    },
43
44    deselectionCallback: function(budget)
45    {
46        $('#card-' + budget.normalizedCode).removeClass("selected");
47        $('#span-' + budget.normalizedCode).html($('#enableDisableLinksTemplate').tmpl(budget));
48    },
49
50    disablePermissionConfirmation: function(data)
51    {
52        $(document).on("click",".js-disable-permission-confirmation",function(e){
53            e.preventDefault();
54
55            ACC.colorbox.open("",{
56                inline:true,
57                href: "#disablePermission",
58                width:"620px",
59                onComplete: function(){
60                    $(this).colorbox.resize();
61                }
62            });
63        });
64
65        $(document).on("click",'#disablePermission #cancelDisablePermission', function (e) {
66            e.preventDefault();
67            $.colorbox.close();
68        });
69    },
70
71    bindPermissionTypeSelectionForAddNew: function ()
72    {
73        $('#selectNewPermissionType').on("change", function (e)
74        {
75            $.ajax({
76                url: ACC.config.encodedContextPath + '/my-company/organization-management/manage-permissions/getNewPermissionForm',
77                async: true,
78                data: {'permissionType':$(this).val()},
79                dataType: "html",
80                beforeSend: function ()
81                {
82                    $("#addNewPermissionForm").html(ACC.address.spinner);
83                }
84            }).done(function (data)
85            {
86                $("#addNewPermissionForm").html($(data).html());
87                ACC.commerceorg.bindPermissionTypeSelectionForAddNew();
88            });
89        })
90    },
91
92    bindToSelectUser: function()
93    {
94        $(document).on('click','.js-selectUser',function(){
95            var url = $(this).attr('url');
96            $.postJSON(url,{}, ACC.commerceorg.userSelectionCallback);
97            return false;
98        });
99    },
100
101    bindToDeselectUser: function()
102    {
103        $(document).on('click','.js-deselectUser',function(){
104            var url = $(this).attr('url');
105            $.postJSON(url,{}, ACC.commerceorg.userSelectionCallback);
106            return false;
107        });
108    },
109
110    bindToRemoveUserFromUnit: function()
111    {
112        $(document).on('click','.js-remove-user-from-unit',function(){
113        	var removeUserFromUnit = $(this).parents('.card');
114        	var counterElem = $(this).parents('.account-cards').prev('.account-list-header').find('.counter');
115
116        	$.postJSON(this.getAttribute('url'), {}, function(){
117        		removeUserFromUnit.remove();
118                counterElem.text(counterElem.text() - 1);
119        	});
120
121        	return false;
122        });
123    },
124
125    userSelectionCallback: function(user)
126    {
127        var userNormalizedId = typeof user.normalizedUid != 'undefined' ? user.normalizedUid : user.normalizedCode;
128
129        $('#selection-' + userNormalizedId).html($('#enableDisableLinksTemplate').tmpl(user));
130        $('#roles-' + userNormalizedId).html($('#userRolesTemplate').tmpl(user));
131        if (user.selected)
132        {
133            $('#row-' + userNormalizedId).addClass("selected");
134        }
135        else
136        {
137            $('#row-' + userNormalizedId).removeClass("selected");
138        }
139    },
140
141    bindToSelectLink: function()
142    {
143        $(document).on('click','.js-selectLink',function(){
144            var url = $(this).attr('url');
145            $.postJSON(url,{}, ACC.commerceorg.selectionCallbackLink);
146            return false;
147        });
148    },
149
150    bindToDeselectLink: function()
151    {
152        $(document).on('click','.js-deselectLink',function(){
153            var url = $(this).attr('url');
154            $.postJSON(url,{}, ACC.commerceorg.deselectionCallbackLink);
155            return false;
156        });
157    },
158
159    selectionCallbackLink: function(permission)
160    {
161        $('#row-' + permission.normalizedCode).addClass("selected");
162        $('#span-' + permission.normalizedCode).html($('#enableDisableLinksTemplate').tmpl(permission));
163    },
164
165    deselectionCallbackLink: function(permission)
166    {
167        $('#row-' + permission.normalizedCode).removeClass("selected");
168        $('#span-' + permission.normalizedCode).html($('#enableDisableLinksTemplate').tmpl(permission));
169    },
170
171
172    bindToActionConfirmationModalWindow: function()
173    {
174        $('.js-action-confirmation-modal a').click(function(e){
175            e.preventDefault();
176
177            var title = $(this).data('action-confirmation-modal-title');
178            var id = $(this).data('action-confirmation-modal-id');
179            var modalWindow = $('#js-action-confirmation-modal-content-' + id);
180
181            if (modalWindow.data('useSourceElementUrl') === true) {
182                var url = $(this).prop('href');
183
184                modalWindow.find('.url-holder').each(function(index, element) {
185                    var target = $(element);
186
187                    if (target.is("form")) {
188                        target.prop('action', url);
189                    } else {
190                        target.prop('href', url);
191                    }
192                });
193            }
194
195            ACC.colorbox.open(title,{
196                inline:true,
197                href:modalWindow,
198                width:"480px",
199                onComplete: function(){
200                    ACC.colorbox.resize();
201                }
202            });
203        });
204
205        $('.js-action-confirmation-modal-cancel').click(function(e){
206            e.preventDefault();
207            ACC.colorbox.close();
208        });
209    },
210
211    bindToUnitAddUserButton: function()
212    {
213        $('.js-add-user-action').click(function(e) {
214            $(this).parent('.add-user-action-menu').toggleClass('open');
215            return false;
216        });
217    },
218    
219    budgetFormInit: function() 
220    {
221        var dateFormatForDatePicker = $('#editB2bBudgetform').data("dateFormatForDatePicker");
222
223        $("#budgetStartDate").datepicker({dateFormat: dateFormatForDatePicker});
224        $(document).on("click", '#editB2bBudgetform .js-open-datepicker-budgetStartDate', function () {
225            $("#budgetStartDate").datepicker('show');
226        });
227
228        $("#budgetEndDate").datepicker({dateFormat: dateFormatForDatePicker});
229        $(document).on("click", '#editB2bBudgetform .js-open-datepicker-budgetEndDate', function () {
230            $("#budgetEndDate").datepicker('show');
231        });
232
233        $('#editB2bBudgetform').validate({
234            rules: {
235                startDate: {
236                    required: true
237                },
238                endDate: {
239                    required: true
240                }
241            }
242
243        })
244    }
245};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.