Update up_gr.html
Browse files- up_gr.html +27 -1
 
    	
        up_gr.html
    CHANGED
    
    | 
         @@ -44,6 +44,18 @@ 
     | 
|
| 44 | 
         
             
                    .create-button:hover {
         
     | 
| 45 | 
         
             
                        background-color: #388E3C;
         
     | 
| 46 | 
         
             
                    }
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 47 | 
         
             
                </style>
         
     | 
| 48 | 
         
             
            </head>
         
     | 
| 49 | 
         
             
            <body>
         
     | 
| 
         @@ -54,6 +66,9 @@ 
     | 
|
| 54 | 
         
             
                </div>
         
     | 
| 55 | 
         
             
                <input type="file" id="fileInput" accept=".txt">
         
     | 
| 56 | 
         
             
                <button class="create-button" id="createGroupButton">Create Group</button>
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 57 | 
         | 
| 58 | 
         
             
                <script>
         
     | 
| 59 | 
         
             
                    document.getElementById('createGroupButton').addEventListener('click', async function() {
         
     | 
| 
         @@ -86,8 +101,9 @@ 
     | 
|
| 86 | 
         
             
                                    throw new Error(`HTTP error! status: ${response.status}`);
         
     | 
| 87 | 
         
             
                                }
         
     | 
| 88 | 
         
             
                                const data = await response.json();
         
     | 
| 
         | 
|
| 89 | 
         
             
                                alert('Group created successfully!');
         
     | 
| 90 | 
         
            -
                                console.log(data);
         
     | 
| 91 | 
         
             
                            } catch (error) {
         
     | 
| 92 | 
         
             
                                console.error('Error creating group:', error);
         
     | 
| 93 | 
         
             
                                alert('Error creating group.');
         
     | 
| 
         @@ -95,6 +111,16 @@ 
     | 
|
| 95 | 
         
             
                        };
         
     | 
| 96 | 
         
             
                        reader.readAsText(file);
         
     | 
| 97 | 
         
             
                    });
         
     | 
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 98 | 
         
             
                </script>
         
     | 
| 99 | 
         
             
            </body>
         
     | 
| 100 | 
         
             
            </html>
         
     | 
| 
         | 
|
| 44 | 
         
             
                    .create-button:hover {
         
     | 
| 45 | 
         
             
                        background-color: #388E3C;
         
     | 
| 46 | 
         
             
                    }
         
     | 
| 47 | 
         
            +
                    .group-id-container {
         
     | 
| 48 | 
         
            +
                        margin-top: 20px;
         
     | 
| 49 | 
         
            +
                    }
         
     | 
| 50 | 
         
            +
                    .group-id {
         
     | 
| 51 | 
         
            +
                        color: #007BFF;
         
     | 
| 52 | 
         
            +
                        text-decoration: none;
         
     | 
| 53 | 
         
            +
                        font-size: 16px;
         
     | 
| 54 | 
         
            +
                        cursor: pointer;
         
     | 
| 55 | 
         
            +
                    }
         
     | 
| 56 | 
         
            +
                    .group-id:hover {
         
     | 
| 57 | 
         
            +
                        text-decoration: underline;
         
     | 
| 58 | 
         
            +
                    }
         
     | 
| 59 | 
         
             
                </style>
         
     | 
| 60 | 
         
             
            </head>
         
     | 
| 61 | 
         
             
            <body>
         
     | 
| 
         | 
|
| 66 | 
         
             
                </div>
         
     | 
| 67 | 
         
             
                <input type="file" id="fileInput" accept=".txt">
         
     | 
| 68 | 
         
             
                <button class="create-button" id="createGroupButton">Create Group</button>
         
     | 
| 69 | 
         
            +
                <div class="group-id-container">
         
     | 
| 70 | 
         
            +
                    <span class="group-id" id="groupIdToCopy" onclick="copyToClipboard(this)">Click here to copy the group ID</span>
         
     | 
| 71 | 
         
            +
                </div>
         
     | 
| 72 | 
         | 
| 73 | 
         
             
                <script>
         
     | 
| 74 | 
         
             
                    document.getElementById('createGroupButton').addEventListener('click', async function() {
         
     | 
| 
         | 
|
| 101 | 
         
             
                                    throw new Error(`HTTP error! status: ${response.status}`);
         
     | 
| 102 | 
         
             
                                }
         
     | 
| 103 | 
         
             
                                const data = await response.json();
         
     | 
| 104 | 
         
            +
                                document.getElementById('groupIdToCopy').innerText = data.chatId;
         
     | 
| 105 | 
         
             
                                alert('Group created successfully!');
         
     | 
| 106 | 
         
            +
                                console.log('Response JSON:', data);
         
     | 
| 107 | 
         
             
                            } catch (error) {
         
     | 
| 108 | 
         
             
                                console.error('Error creating group:', error);
         
     | 
| 109 | 
         
             
                                alert('Error creating group.');
         
     | 
| 
         | 
|
| 111 | 
         
             
                        };
         
     | 
| 112 | 
         
             
                        reader.readAsText(file);
         
     | 
| 113 | 
         
             
                    });
         
     | 
| 114 | 
         
            +
             
     | 
| 115 | 
         
            +
                    function copyToClipboard(element) {
         
     | 
| 116 | 
         
            +
                        const tempInput = document.createElement('input');
         
     | 
| 117 | 
         
            +
                        document.body.appendChild(tempInput);
         
     | 
| 118 | 
         
            +
                        tempInput.value = element.innerText;
         
     | 
| 119 | 
         
            +
                        tempInput.select();
         
     | 
| 120 | 
         
            +
                        document.execCommand('copy');
         
     | 
| 121 | 
         
            +
                        document.body.removeChild(tempInput);
         
     | 
| 122 | 
         
            +
                        alert('Group ID copied to clipboard!');
         
     | 
| 123 | 
         
            +
                    }
         
     | 
| 124 | 
         
             
                </script>
         
     | 
| 125 | 
         
             
            </body>
         
     | 
| 126 | 
         
             
            </html>
         
     |