Subversion Repositories SmartDukaan

Rev

Rev 36194 | Rev 36201 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36194 Rev 36195
Line 327... Line 327...
327
    </style>
327
    </style>
328
 
328
 
329
    <script type="text/javascript">
329
    <script type="text/javascript">
330
        const isRBM = $isRBM;
330
        const isRBM = $isRBM;
331
        isAdmin = true;
331
        isAdmin = true;
332
        function injectSmartChatScript(token) {
332
        function injectSmartChatScript(email, token) {
333
            if (document.querySelector('script[src="https://chat.smartdukaan.com/embed.js"]')) {
333
            if (document.querySelector('script[src="https://chat.smartdukaan.com/embed.js"]')) {
334
                return;
334
                return;
335
            }
335
            }
336
 
336
 
337
            const script = document.createElement('script');
337
            const script = document.createElement('script');
338
            script.src = "https://chat.smartdukaan.com/embed.js";
338
            script.src = "https://chat.smartdukaan.com/embed.js";
339
            script.setAttribute("data-role", "INTERNAL");
339
            script.setAttribute("data-role", "INTERNAL");
340
            script.setAttribute("data-token", token);
340
            script.setAttribute("data-token", token);
-
 
341
            if (email) script.setAttribute("data-email", email);
341
            script.async = true;
342
            script.async = true;
342
 
343
 
343
            document.body.appendChild(script);
344
            document.body.appendChild(script);
344
        }
345
        }
345
 
346
 
346
        document.addEventListener("DOMContentLoaded", () => {
347
        document.addEventListener("DOMContentLoaded", () => {
347
            if (isRBM) {
348
            if (isRBM) {
348
                injectSmartChatScript("eyJhbGciOiJIUzI1NiJ9.eyJyb2xlSWRzIjpbIjEiLCIyIiwiMyJdLCJpc3MiOiJwcm9maXRtYW5kaSIsImV4cCI6MTc3Nzg5OTk3MywicmV0YWlsZXJJZCI6MTc1MTM5Mjg3LCJpYXQiOjE3NzI3MTU5NzMsInVzZXJJZCI6NDAyMjJ9.aeUDKRtsemF4y1mLdWQBaWUBV2HFxoHARbc2JAZwc3U");
349
                injectSmartChatScript($authEmail, "eyJhbGciOiJIUzI1NiJ9.eyJyb2xlSWRzIjpbIjEiLCIyIiwiMyJdLCJpc3MiOiJwcm9maXRtYW5kaSIsImV4cCI6MTc3Nzg5OTk3MywicmV0YWlsZXJJZCI6MTc1MTM5Mjg3LCJpYXQiOjE3NzI3MTU5NzMsInVzZXJJZCI6NDAyMjJ9.aeUDKRtsemF4y1mLdWQBaWUBV2HFxoHARbc2JAZwc3U");
349
            }
350
            }
350
        });
351
        });
351
 
352
 
352
        function getWarehousePartners(warehouseId) {
353
        function getWarehousePartners(warehouseId) {
353
 
354
 
Line 399... Line 400...
399
    </script>
400
    </script>
400
 
401
 
401
    <script type="text/javascript">
402
    <script type="text/javascript">
402
        function getWarehouseWiseData() {
403
        function getWarehouseWiseData() {
403
            doGetAjaxRequestHandler(context + "/getWarehouseWiseData",
404
            doGetAjaxRequestHandler(context + "/getWarehouseWiseData",
404
                    function (response) {
405
                function (response) {
405
                        $('#' + "main-content").html(response);
406
                    $('#' + "main-content").html(response);
406
                        console.log(response)
407
                    console.log(response)
407
                        if (response == 'true') {
408
                    if (response == 'true') {
408
 
409
 
409
                            window.location.href = $('.dashboardload').attr('href');
410
                        window.location.href = $('.dashboardload').attr('href');
410
                        }
411
                    }
411
                    });
412
                });
412
        }
413
        }
413
 
414
 
414
        function getPartnersStat() {
415
        function getPartnersStat() {
415
            doGetAjaxRequestHandler(context + "/getPartnersStatData",
416
            doGetAjaxRequestHandler(context + "/getPartnersStatData",
416
                    function (response) {
417
                    function (response) {