Undi95 commited on
Commit
344a40e
·
verified ·
1 Parent(s): d11d458

Upload JVCGPT.html

Browse files
Files changed (1) hide show
  1. JVCGPT.html +116 -12
JVCGPT.html CHANGED
@@ -76,12 +76,6 @@
76
  word-wrap: break-word;
77
  white-space: pre-wrap; /* Permet les retours à la ligne */
78
  }
79
- .post-content img {
80
- width: 75px;
81
- height: 50px;
82
- display: inline; /* Ne pas forcer un retour à la ligne pour les images */
83
- margin: 10px 0;
84
- }
85
  footer {
86
  text-align: center;
87
  margin: 20px 0;
@@ -114,6 +108,18 @@
114
  button:hover {
115
  background-color: #0056b3;
116
  }
 
 
 
 
 
 
 
 
 
 
 
 
117
  </style>
118
  </head>
119
  <body>
@@ -144,6 +150,90 @@
144
  const postsContainer = document.getElementById('posts-container');
145
  postsContainer.innerHTML = ''; // Clear previous posts
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  const blocks = logs.split('<|eot_id|>');
148
  let topicTitleSet = false; // Ensure the topic title is set only once
149
 
@@ -163,7 +253,19 @@
163
  if (pseudoMatch && dateMatch && postMatch) {
164
  const username = pseudoMatch[1];
165
  const date = dateMatch[1];
166
- const message = postMatch[1];
 
 
 
 
 
 
 
 
 
 
 
 
167
 
168
  const postDiv = document.createElement('div');
169
  postDiv.className = 'post';
@@ -195,11 +297,7 @@
195
 
196
  const contentDiv = document.createElement('div');
197
  contentDiv.className = 'post-content';
198
-
199
- const formattedMessage = message.replace(/https?:\/\/image\.noelshack\.com\/[^\s]+/g, (url) => {
200
- return `<img src="${url}" alt="Image">`;
201
- });
202
- contentDiv.innerHTML = formattedMessage;
203
 
204
  contentWrapper.appendChild(metaDiv);
205
  contentWrapper.appendChild(contentDiv);
@@ -209,8 +307,14 @@
209
  postsContainer.appendChild(postDiv);
210
  }
211
  });
 
 
 
 
 
212
  }
213
  </script>
214
 
 
215
  </body>
216
  </html>
 
76
  word-wrap: break-word;
77
  white-space: pre-wrap; /* Permet les retours à la ligne */
78
  }
 
 
 
 
 
 
79
  footer {
80
  text-align: center;
81
  margin: 20px 0;
 
108
  button:hover {
109
  background-color: #0056b3;
110
  }
111
+ /* Ne pas redimensionner les smileys */
112
+ .smiley-img {
113
+ width: auto;
114
+ height: auto;
115
+ }
116
+
117
+ /* Redimensionner uniquement les images NoelShack */
118
+ .post-content img:not(.smiley-img) {
119
+ width: 75px;
120
+ height: 50px;
121
+ }
122
+
123
  </style>
124
  </head>
125
  <body>
 
150
  const postsContainer = document.getElementById('posts-container');
151
  postsContainer.innerHTML = ''; // Clear previous posts
152
 
153
+ const smileyMap = {
154
+ ":)": "smileys/1.gif",
155
+ ":question:": "smileys/2.gif",
156
+ ":g)": "smileys/3.gif",
157
+ ":d)": "smileys/4.gif",
158
+ ":cd:": "smileys/5.gif",
159
+ ":globe:": "smileys/6.gif",
160
+ ":p)": "smileys/7.gif",
161
+ ":malade:": "smileys/8.gif",
162
+ ":pacg:": "smileys/9.gif",
163
+ ":pacd:": "smileys/10.gif",
164
+ ":noel:": "smileys/11.gif",
165
+ ":o))": "smileys/12.gif",
166
+ ":snif2:": "smileys/13.gif",
167
+ ":-(": "smileys/14.gif",
168
+ ":-((:": "smileys/15.gif",
169
+ ":mac:": "smileys/16.gif",
170
+ ":gba:": "smileys/17.gif",
171
+ ":hap:": "smileys/18.gif",
172
+ ":nah:": "smileys/19.gif",
173
+ ":snif:": "smileys/20.gif",
174
+ ":mort:": "smileys/21.gif",
175
+ ":ouch:": "smileys/22.gif",
176
+ ":-)))": "smileys/23.gif",
177
+ ":content:": "smileys/24.gif",
178
+ ":nonnon:": "smileys/25.gif",
179
+ ":cool:": "smileys/26.gif",
180
+ ":sleep:": "smileys/27.gif",
181
+ ":doute:": "smileys/28.gif",
182
+ ":hello:": "smileys/29.gif",
183
+ ":honte:": "smileys/30.gif",
184
+ ":-p": "smileys/31.gif",
185
+ ":lol:": "smileys/32.gif",
186
+ ":non2:": "smileys/33.gif",
187
+ ":monoeil:": "smileys/34.gif",
188
+ ":non:": "smileys/35.gif",
189
+ ":ok:": "smileys/36.gif",
190
+ ":oui:": "smileys/37.gif",
191
+ ":rechercher:": "smileys/38.gif",
192
+ ":rire:": "smileys/39.gif",
193
+ ":-D": "smileys/40.gif",
194
+ ":rire2:": "smileys/41.gif",
195
+ ":salut:": "smileys/42.gif",
196
+ ":sarcastic:": "smileys/43.gif",
197
+ ":up:": "smileys/44.gif",
198
+ ":(": "smileys/45.gif",
199
+ ":-)": "smileys/46.gif",
200
+ ":peur:": "smileys/47.gif",
201
+ ":bye:": "smileys/48.gif",
202
+ ":dpdr:": "smileys/49.gif",
203
+ ":fou:": "smileys/50.gif",
204
+ ":gne:": "smileys/51.gif",
205
+ ":dehors:": "smileys/52.gif",
206
+ ":fier:": "smileys/53.gif",
207
+ ":coeur:": "smileys/54.gif",
208
+ ":rouge:": "smileys/55.gif",
209
+ ":sors:": "smileys/56.gif",
210
+ ":ouch2:": "smileys/57.gif",
211
+ ":merci:": "smileys/58.gif",
212
+ ":svp:": "smileys/59.gif",
213
+ ":ange:": "smileys/60.gif",
214
+ ":diable:": "smileys/61.gif",
215
+ ":gni:": "smileys/62.gif",
216
+ ":spoiler:": "smileys/63.gif",
217
+ ":hs:": "smileys/64.gif",
218
+ ":desole:": "smileys/65.gif",
219
+ ":fete:": "smileys/66.gif",
220
+ ":sournois:": "smileys/67.gif",
221
+ ":hum:": "smileys/68.gif",
222
+ ":bravo:": "smileys/69.gif",
223
+ ":banzai:": "smileys/70.gif",
224
+ ":bave:": "smileys/71.gif",
225
+ ":ddb:": "smileys/ddb.gif",
226
+ ":fish:": "smileys/fish.gif",
227
+ ":cimer:": "smileys/cimer.gif",
228
+ ":hapoelparty:": "smileys/hapoelparty.gif",
229
+ ":loveyou:": "smileys/loveyou.gif",
230
+ ":cute:": "smileys/nyu.gif",
231
+ ":objection:": "smileys/objection.gif",
232
+ ":pf:": "smileys/pf.gif",
233
+ ":play:": "smileys/play.gif",
234
+ ":siffle:": "smileys/siffle.gif"
235
+ };
236
+
237
  const blocks = logs.split('<|eot_id|>');
238
  let topicTitleSet = false; // Ensure the topic title is set only once
239
 
 
253
  if (pseudoMatch && dateMatch && postMatch) {
254
  const username = pseudoMatch[1];
255
  const date = dateMatch[1];
256
+ let message = postMatch[1];
257
+
258
+ // Remplacement des codes smileys
259
+ Object.entries(smileyMap).forEach(([code, imgPath]) => {
260
+ const regex = new RegExp(escapeRegExp(code), "g");
261
+ message = message.replace(regex, `<img src="${imgPath}" alt="${code}" title="${code}" class="smiley-img" />`);
262
+ });
263
+
264
+ // Remplacement des URLs NoelShack
265
+ message = message.replace(/https?:\/\/image\.noelshack\.com\/[^\s]+/g, (url) => {
266
+ return `<img src="${url}" alt="Image">`;
267
+ });
268
+
269
 
270
  const postDiv = document.createElement('div');
271
  postDiv.className = 'post';
 
297
 
298
  const contentDiv = document.createElement('div');
299
  contentDiv.className = 'post-content';
300
+ contentDiv.innerHTML = message;
 
 
 
 
301
 
302
  contentWrapper.appendChild(metaDiv);
303
  contentWrapper.appendChild(contentDiv);
 
307
  postsContainer.appendChild(postDiv);
308
  }
309
  });
310
+
311
+ // Échapper les caractères spéciaux pour la RegExp
312
+ function escapeRegExp(string) {
313
+ return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
314
+ }
315
  }
316
  </script>
317
 
318
+
319
  </body>
320
  </html>