PageSourceSearch

https://www.ddpmod.gov.in/themes/olivero/js/cookie-consent.js?v=1790759925

js ddpmod.gov.in collected 2026-10-02 17:28:05 UTC 10,783 bytes, 190 lines download raw bytes

1
2function removeCustomizedCookieConsent(){
3    if(checkEncryptedCookieExits('cookie_consent_selected_language')){
4        removeOneCookie("cookie_consent_selected_language");
5    }
6    if(checkEncryptedCookieExits('cookie_consent_persona_type')){
7        removeOneCookie("cookie_consent_persona_type");
8    }
9    if(checkEncryptedCookieExits('cookie_consent_fontSize')){
10        removeOneCookie("cookie_consent_fontSize");
11    }
12    if(checkEncryptedCookieExits('cookie_consent_lightContrast')){
13        removeOneCookie("cookie_consent_lightContrast");
14    }
15    if(checkEncryptedCookieExits('cookie_consent_invertColor')){
16        removeOneCookie("cookie_consent_invertColor");
17    }
18    if(checkEncryptedCookieExits('cookie_consent_highlight-link')){
19        removeOneCookie("cookie_consent_highlight-link");
20    }
21    if(checkEncryptedCookieExits('cookie_consent_hide-images')){
22        removeOneCookie("cookie_consent_hide-images");
23    }
24    if(checkEncryptedCookieExits('cookie_consent_cursorSize')){
25        removeOneCookie("cookie_consent_cursorSize");
26    }
27    if(checkEncryptedCookieExits('cookie_consent_saturated')){
28        removeOneCookie("cookie_consent_saturated");
29    }
30    if(checkEncryptedCookieExits('cookie_consent_themeColor')){
31        removeOneCookie("cookie_consent_themeColor");
32    }
33}
34document.addEventListener("DOMContentLoaded", function() {
35    var consentBanner = document.getElementById("cookie-consent-banner");
36    var acceptButton = document.getElementById("accept-cookies");
37    var declineButton = document.getElementById("decline-cookies");
38
39    if(acceptButton){
40        acceptButton.addEventListener("click", function() {
41            // Set cookie indicating user has accepted cookies
42            removeCustomizedCookieConsent();
43            storeNewCookie("cookie_consent","accepted");
44            consentBanner.style.display = "none";
45            var encryptedData = getCookieValue("sediptrit");
46            let expires = setCookieLife(0);
47            document.cookie = "sediptrit=" + encryptedData + "; " + expires + ";Secure; SameSite=Strict";
48        });
49    }
50    if(declineButton){
51        declineButton.addEventListener("click", function() {
52            // Set cookie indicating user has declined cookies
53            removeCustomizedCookieConsent();
54            storeNewCookie("cookie_consent","declined");
55            consentBanner.style.display = "none";
56            var encryptedData = getCookieValue("sediptrit");
57            let expires = setCookieLife(1);
58            // let currentDate = new Date();
59            // let nextMonthDate = new Date();
60            // nextMonthDate.setMonth(currentDate.getMonth() + 1);
61            // let expires = "expires=" + nextMonthDate.toUTCString();
62            document.cookie = "sediptrit=" + encryptedData + "; " + expires + ";Secure; SameSite=Strict";
63        });
64    }
65
66    // Check if user has previously accepted or declined cookies
67    if(consentBanner){
68        if (getEncryptedCookieValue("cookie_consent") == "accepted" || getEncryptedCookieValue("cookie_consent") == "declined" || getEncryptedCookieValue("cookie_consent") == "customized") {
69            consentBanner.style.display = "none";
70        } else {
71            consentBanner.style.display = "block";
72        }
73    }
74});
75$('#cookie_customize_save').click(function(){
76    removeCustomizedCookieConsent();
77    var cookie_consent_elements = {};
78    if($("#cookie_consent_selected_language").prop('checked') == true){
79        cookie_consent_elements["cookie_consent_selected_language"] = "accepted";
80    }
81    if($("#cookie_consent_persona_type").prop('checked') == true){
82        cookie_consent_elements["cookie_consent_persona_type"] = "accepted";
83    }
84    if($("#cookie_consent_fontSize").prop('checked') == true){
85        cookie_consent_elements["cookie_consent_fontSize"] = "accepted";
86    }
87    if($("#cookie_consent_lightContrast").prop('checked') == true){
88        cookie_consent_elements["cookie_consent_lightContrast"] = "accepted";
89    }
90    if($("#cookie_consent_invertColor").prop('checked') == true){
91        cookie_consent_elements["cookie_consent_invertColor"] = "accepted";
92    }
93    if($("#cookie_consent_highlight-link").prop('checked') == true){
94        cookie_consent_elements["cookie_consent_highlight-link"] = "accepted";
95    }
96    if($("#cookie_consent_hide-images").prop('checked') == true){
97        cookie_consent_elements["cookie_consent_hide-images"] = "accepted";
98    }
99    if($("#cookie_consent_cursorSize").prop('checked') == true){
100        cookie_consent_elements["cookie_consent_cursorSize"] = "accepted";
101    }
102    if($("#cookie_consent_saturated").prop('checked') == true){
103        cookie_consent_elements["cookie_consent_saturated"] = "accepted";
104    }
105    if($("#cookie_consent_themeColor").prop('checked') == true){
106        cookie_consent_elements["cookie_consent_themeColor"] = "accepted";
107    }
108    cookie_consent_elements["cookie_consent"] = "customized";
109    
110    var encryptedData = encryptData(cookie_consent_elements, "encryptionKey");
111    var encodedEncryptedData = encodeURIComponent(encryptedData);
112    //document.cookie = "sediptrit=" + encodedEncryptedData + "; expires=Thu, 22 Mar 9999 12:00:00 UTC; SameSite=Strict";
113    // Calculate the date one month from today
114    let currentDate = new Date();
115    let nextMonthDate = new Date();
116    nextMonthDate.setMonth(currentDate.getMonth() + 1);
117    let expires = "expires=" + nextMonthDate.toUTCString();
118    document.cookie = "sediptrit=" + encodedEncryptedData + "; " + expires + ";Secure; SameSite=Strict";
119
120    setTimeout(function(){
121        window.location.reload();
122    },100);
123});
124$('#cookie_rejectall_save').click(function(){
125    removeCustomizedCookieConsent();
126    storeNewCookie("cookie_consent","declined");
127    setTimeout(function(){
128        window.location.reload();
129    },100);
130});
131$('#cookie_acceptall_save').click(function(){
132    removeCustomizedCookieConsent();
133    storeNewCookie("cookie_consent","accepted");
134    setTimeout(function(){
135        window.location.reload();
136    },100);
137});
138
139$('#cookie_save_preference_btn').click(function(){
140    removeCustomizedCookieConsent();
141    var cookie_consent_elements = {};
142    cookie_consent_elements["cookie_consent_selected_language"] = "accepted";
143    cookie_consent_elements["cookie_consent_persona_type"] = "accepted";
144    cookie_consent_elements["cookie_consent_fontSize"] = "accepted";
145    cookie_consent_elements["cookie_consent_lightContrast"] = "accepted";
146    cookie_consent_elements["cookie_consent_invertColor"] = "accepted";
147    cookie_consent_elements["cookie_consent_highlight-link"] = "accepted";
148    cookie_consent_elements["cookie_consent_hide-images"] = "accepted";
149    cookie_consent_elements["cookie_consent_cursorSize"] = "accepted";
150    cookie_consent_elements["cookie_consent_saturated"] = "accepted";
151    cookie_consent_elements["cookie_consent_themeColor"] = "accepted";
152    
153    var optionalcookies = $("#functionalities_cookies:checked").val();
154    let expires = setCookieLife(life=1);
155    if(optionalcookies){
156        cookie_consent_elements["cookie_consent"] = "accepted";
157        expires = setCookieLife(life=0);
158    }else{
159        cookie_consent_elements["cookie_consent"] = "customized";
160    }
161    
162    var encryptedData = encryptData(cookie_consent_elements, "encryptionKey");
163    var encodedEncryptedData = encodeURIComponent(encryptedData);
164    document.cookie = "sediptrit=" + encodedEncryptedData + "; " + expires + ";Secure; SameSite=Strict";
165    var cur_language = $("#cur_lang").val();
166    if(cur_language == "हिन्दी"){
167        $("#msg-list").html('<div class="messages__wrapper layout-container"><div class="messages-list__item messages messages--status" data-drupal-selector="messages" role="contentinfo" aria-label="Status message" data-once="messages"><div class="messages__container" data-drupal-selector="messages-container" role="contentinfo" aria-label="Status message" aria-live="assertive" aria-atomic="true"><div class="messages__header"><div class="messages__icon"><svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" viewBox="0 0 32 32"><path d="M26.8,12.6c0,0.4-0.1,0.7-0.4,0.9L15.1,24.9c-0.2,0.2-0.6,0.4-1,0.4c-0.3,0-0.7-0.1-0.9-0.4l-7.5-7.5c-0.2-0.2-0.4-0.6-0.4-0.9c0-0.4,0.1-0.7,0.4-1l1.9-1.9c0.2-0.2,0.6-0.4,0.9-0.4c0.4,0,0.7,0.1,0.9,0.4l4.7,4.7l8.5-8.5c0.2-0.2,0.6-0.4,0.9-0.4c0.4,0,0.7,0.1,0.9,0.4l1.9,1.9C26.6,11.9,26.8,12.3,26.8,12.6z M32,16c0-8.8-7.2-16-16-16C7.2,0,0,7.2,0,16c0,8.8,7.2,16,16,16C24.8,32,32,24.8,32,16z"></path></svg></div></div><div class="messages__content" id="cookie_save_success">आपकी वरीयताएँ सफलतापूर्वक सहेजी गईं</div><div class="messages__button"><button type="button" class="messages__close"><span class="visually-hidden">संदेश बंद करें</span></button></div></div></div></div>');
168    }else{
169        $("#msg-list").html('<div class="messages__wrapper layout-container"><div class="messages-list__item messages messages--status" data-drupal-selector="messages" role="contentinfo" aria-label="Status message" data-once="messages"><div class="messages__container" data-drupal-selector="messages-container" role="contentinfo" aria-label="Status message" aria-live="assertive" aria-atomic="true"><div class="messages__header"><div class="messages__icon"><svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" viewBox="0 0 32 32">
169<path d="M26.8,12.6c0,0.4-0.1,0.7-0.4,0.9L15.1,24.9c-0.2,0.2-0.6,0.4-1,0.4c-0.3,0-0.7-0.1-0.9-0.4l-7.5-7.5c-0.2-0.2-0.4-0.6-0.4-0.9c0-0.4,0.1-0.7,0.4-1l1.9-1.9c0.2-0.2,0.6-0.4,0.9-0.4c0.4,0,0.7,0.1,0.9,0.4l4.7,4.7l8.5-8.5c0.2-0.2,0.6-0.4,0.9-0.4c0.4,0,0.7,0.1,0.9,0.4l1.9,1.9C26.6,11.9,26.8,12.3,26.8,12.6z M32,16c0-8.8-7.2-16-16-16C7.2,0,0,7.2,0,16c0,8.8,7.2,16,16,16C24.8,32,32,24.8,32,16z"></path></svg></div></div><div class="messages__content" id="cookie_save_success">Your preferences save successfully</div><div class="messages__button"><button type="button" class="messages__close"><span class="visually-hidden">Close message</span></button></div></div></div></div>');
170    }
171       
172    setTimeout(function(){
173        //$("#msg-list").html('');
174    },4000);
175});
176function setCookieLife(life=0){
177    let expires = "expires=Thu, 22 Mar 9999 12:00:00 GMT; path=/";
178    if(life==1){
179        let currentDate = new Date();
180        let nextMonthDate = new Date();
181        nextMonthDate.setMonth(currentDate.getMonth() + 1);
182        expires = "expires=" + nextMonthDate.toUTCString()+"; path=/";
183    }
184    return expires;
185}
186if(document.getElementById("functionalities_cookies")){
187    if(getEncryptedCookieValue("cookie_consent") == "accepted"){
188        document.getElementById("functionalities_cookies").checked = true;
189    }
190}

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.