DmitrMakeev commited on
Commit
52c665d
1 Parent(s): a4e83f0

Update se_mes_im_ran.html

Browse files
Files changed (1) hide show
  1. se_mes_im_ran.html +69 -67
se_mes_im_ran.html CHANGED
@@ -5,77 +5,77 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Send Messages with Image</title>
7
  <style>
8
- body {
9
- font-family: Arial, sans-serif;
10
- text-align: center;
11
- background-color: #f0f0f0;
12
- margin: 0;
13
- padding: 0;
14
- }
15
- h1 {
16
- background-color: #4CAF50;
17
- color: white;
18
- padding: 20px;
19
- margin: 0;
20
- border-bottom: 2px solid #388E3C;
21
- }
22
- .input-row {
23
- display: flex;
24
- justify-content: center;
25
- gap: 10px;
26
- margin-top: 20px;
27
- }
28
- .input-row input, .input-row textarea {
29
- padding: 10px;
30
- font-size: 16px;
31
- border: 1px solid #ccc;
32
- border-radius: 5px;
33
- }
34
- #messageInput, #urlFileInput, #fileNameInput {
35
- width: 80%;
36
- margin-top: 20px;
37
- }
38
- #progressBarContainer {
39
- width: 80%;
40
- margin: 20px auto;
41
- }
42
- #progressBar {
43
- width: 100%;
44
- background-color: #ddd;
45
- }
46
- #progress {
47
- width: 0%;
48
- height: 30px;
49
- background-color: #4CAF50;
50
- text-align: center;
51
- line-height: 30px;
52
- color: white;
53
- }
54
- #sendButton {
55
- color: white;
56
- background-color: #4CAF50;
57
- border: none;
58
- cursor: pointer;
59
- padding: 10px 20px;
60
- font-size: 16px;
61
- border-radius: 5px;
62
- margin-top: 20px;
63
- }
64
- #sendButton:hover {
65
- background-color: #388E3C;
66
- }
 
 
67
  </style>
68
  </head>
69
  <body>
70
- <h1>Отправка сообщения с картинкой</h1>
71
  <div class="input-row">
72
  <input type="text" id="apiKeyInput" placeholder="Введите API ключ">
73
  <input type="number" id="minDelayInput" placeholder="Min Delay (ms)" value="500">
74
  <input type="number" id="maxDelayInput" placeholder="Max Delay (ms)" value="1000">
75
  </div>
76
- <input type="text" id="urlFileInput" placeholder="Введите URL файла">
77
- <input type="text" id="fileNameInput" placeholder="Введите название файла">
78
- <textarea id="messageInput" placeholder="Введите текст сообщения с картинкой."></textarea>
79
  <div id="progressBarContainer">
80
  <div id="progressBar">
81
  <div id="progress">0%</div>
@@ -87,8 +87,8 @@
87
  <script>
88
  document.getElementById('sendButton').addEventListener('click', function() {
89
  const apiKey = document.getElementById('apiKeyInput').value;
90
- const urlFile = document.getElementById('urlFileInput').value;
91
- const fileName = document.getElementById('fileNameInput').value;
92
  const messageTemplate = document.getElementById('messageInput').value;
93
  const minDelay = parseInt(document.getElementById('minDelayInput').value) || 500;
94
  const maxDelay = parseInt(document.getElementById('maxDelayInput').value) || 10000;
@@ -97,11 +97,11 @@
97
  return;
98
  }
99
  if (!urlFile) {
100
- alert('Please enter the URL of the file.');
101
  return;
102
  }
103
  if (!fileName) {
104
- alert('Please enter the file name.');
105
  return;
106
  }
107
  if (!messageTemplate) {
@@ -118,6 +118,8 @@
118
  alert('Please select a file.');
119
  return;
120
  }
 
 
121
  const reader = new FileReader();
122
  reader.onload = function(event) {
123
  const text = event.target.result;
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>Send Messages with Image</title>
7
  <style>
8
+ body {
9
+ font-family: Arial, sans-serif;
10
+ text-align: center;
11
+ background-color: #f0f0f0;
12
+ margin: 0;
13
+ padding: 0;
14
+ max-height: 250px; /* Устанавливаем максимальную высоту страницы */
15
+ }
16
+ h1 {
17
+ background-color: #4CAF50;
18
+ color: white;
19
+ padding: 20px;
20
+ margin: 0;
21
+ border-bottom: 2px solid #388E3C;
22
+ }
23
+ .input-row {
24
+ display: flex;
25
+ justify-content: center;
26
+ gap: 10px;
27
+ margin-top: 20px;
28
+ }
29
+ .input-row input, .input-row textarea {
30
+ padding: 10px;
31
+ font-size: 16px;
32
+ border: 1px solid #ccc;
33
+ border-radius: 5px;
34
+ }
35
+ #messageInput {
36
+ width: 80%;
37
+ margin-top: 20px;
38
+ height: 60px; /* Устанавливаем высоту поля ввода текста */
39
+ }
40
+ #progressBarContainer {
41
+ width: 80%;
42
+ margin: 20px auto;
43
+ }
44
+ #progressBar {
45
+ width: 100%;
46
+ background-color: #ddd;
47
+ }
48
+ #progress {
49
+ width: 0%;
50
+ height: 30px;
51
+ background-color: #4CAF50;
52
+ text-align: center;
53
+ line-height: 30px;
54
+ color: white;
55
+ }
56
+ #sendButton {
57
+ color: white;
58
+ background-color: #4CAF50;
59
+ border: none;
60
+ cursor: pointer;
61
+ padding: 10px 20px;
62
+ font-size: 16px;
63
+ border-radius: 5px;
64
+ margin-top: 20px;
65
+ }
66
+ #sendButton:hover {
67
+ background-color: #388E3C;
68
+ }
69
  </style>
70
  </head>
71
  <body>
72
+ <h1></h1>
73
  <div class="input-row">
74
  <input type="text" id="apiKeyInput" placeholder="Введите API ключ">
75
  <input type="number" id="minDelayInput" placeholder="Min Delay (ms)" value="500">
76
  <input type="number" id="maxDelayInput" placeholder="Max Delay (ms)" value="1000">
77
  </div>
78
+ <textarea id="messageInput" placeholder="Введите текст сообщения под файлом (отправка ссылок на сторонние ресурсы поддерживается, показа превью в этом типе отправки нет)."></textarea>
 
 
79
  <div id="progressBarContainer">
80
  <div id="progressBar">
81
  <div id="progress">0%</div>
 
87
  <script>
88
  document.getElementById('sendButton').addEventListener('click', function() {
89
  const apiKey = document.getElementById('apiKeyInput').value;
90
+ const urlFile = localStorage.getItem('fileUrl');
91
+ const fileName = localStorage.getItem('filename');
92
  const messageTemplate = document.getElementById('messageInput').value;
93
  const minDelay = parseInt(document.getElementById('minDelayInput').value) || 500;
94
  const maxDelay = parseInt(document.getElementById('maxDelayInput').value) || 10000;
 
97
  return;
98
  }
99
  if (!urlFile) {
100
+ alert('URL of the file is not found in local storage.');
101
  return;
102
  }
103
  if (!fileName) {
104
+ alert('File name is not found in local storage.');
105
  return;
106
  }
107
  if (!messageTemplate) {
 
118
  alert('Please select a file.');
119
  return;
120
  }
121
+ console.log('URL файла:', urlFile);
122
+ console.log('Имя файла:', fileName);
123
  const reader = new FileReader();
124
  reader.onload = function(event) {
125
  const text = event.target.result;