PageSourceSearch

https://cpq.gefran.com/store/_ui/addons/gefransapproductconfigaddon/responsive/common/js/cpq.uihandler.js

js gefran.com collected 2026-10-01 15:26:09 UTC 2,999 bytes, 97 lines download raw bytes

1/*
2 * Copyright (c) 2022 SAP SE or an SAP affiliate company. All rights reserved.
3 *
4 * This software is the confidential and proprietary information of SAP
5 * ("Confidential Information"). You shall not disclose such Confidential
6 * Information and shall use it only in accordance with the terms of the
7 * license agreement you entered into with SAP.
8 */
9
10
11
12
13
14
15
16
17
18
19
20
21CPQ.uihandler = {
22    toggleExpandCollapseStyle: function (element, elementToBlind, prefix, noBlind) {
23        element.toggleClass(prefix + "-open");
24        element.toggleClass(prefix + "-close");
25        if (noBlind) {
26            elementToBlind.toggle();
27        } else {
28            elementToBlind.slideToggle(100);
29        }
30    },
31
32    clickGroupHeader: function(postFx, e){
33        // do nothing on tab click: e.which == 9
34        if(e.which !== 9){
35            var groupElement = $(e.currentTarget);
36            var groupTitleId = groupElement.attr("id");
37            var groupId = CPQ.idhandler.getGroupIdFromGroupTitleId(groupTitleId);
38            CPQ.uihandler.toggleExpandCollapseStyle(groupElement, groupElement.next(), "cpq-group-title");
39            $("#cpqAction").val("TOGGLE_GROUP");
40            $("#autoExpand").val(false);
41            $("#groupIdToToggle").val(groupId);
42            var data = $(CPQ.core.formNameId).serialize();
43            CPQ.core.firePost(postFx, [ e, data, groupTitleId ]);
44        }
45    },
46
47    updateSlotContent: function(response, slotName, excludeId) {
48        var newSlotContent = CPQ.uihandler.getNewSlotContent(response, slotName);
49        $("#" + slotName).replaceWith(newSlotContent);
50    },
51
52    getNewSlotContent: function(response, slotName) {
53        var startTag = '<div id="start:' + slotName + '" />';
54        var endTag = '<div id="end:' + slotName + '" />';
55        var newContent = "";
56
57        var startIndex = response.indexOf(startTag);
58        if (startIndex !== -1) {
59            startIndex = startIndex + startTag.length;
60            var endIndex = response.indexOf(endTag);
61            if (endIndex !== -1) {
62                newContent = response.substring(startIndex, endIndex);
63            }
64        }
65        return newContent;
66    },
67
68    storeState: function(selector, callback) {
69        var storedState = {};
70        storedState.items = [];
71        $(selector).each(function(){
72            var item = {};
73            if(callback){
74                callback($(this), item);
75            }else{
76                item.id = $(this).attr('id');
77                item.html = $(this).html();
78            }
79            storedState.items.push(item);
80        });
81
82        return storedState;
83    },
84
85    restoreState: function(storedState, callback){
86        $.each(storedState.items,function(index, item){
87            if(callback){
88                callback(item);
89            }else{
90                var div = $(CPQ.core.encodeId(item.id));
91                if(div.length > 0){
92                    div.html(item.html);
93                }
94            }
95        });
96    }
97};

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.