-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtablo.html
More file actions
1324 lines (1194 loc) · 64.8 KB
/
Copy pathtablo.html
File metadata and controls
1324 lines (1194 loc) · 64.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="tr">
<head>
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="PsykoLink'in bilişsel terapi tablolarını oluşturma, düzenleme ve dışa aktarma aracı. Düşüncelerinizi organize etmek için profesyonel tablolar.">
<meta name="keywords" content="bilişsel terapi, terapi tabloları, düşünce kayıt tablosu, duygu takip, davranış aktivasyon, problem çözme, PsykoLink">
<meta name="author" content="PsykoLink">
<meta name="robots" content="index, follow">
<link rel="canonical" href="https://www.psykolink.com/tablo.html">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.psykolink.com/tablo.html">
<meta property="og:title" content="Bilişsel Terapi Tabloları - PsykoLink">
<meta property="og:description" content="Bilişsel terapi süreciniz için profesyonel tablolar oluşturun, düzenleyin ve dışa aktarın.">
<meta property="og:image" content="https://www.psykolink.com/images/tablo-og.jpg">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://www.psykolink.com/tablo.html">
<meta property="twitter:title" content="Bilişsel Terapi Tabloları - PsykoLink">
<meta property="twitter:description" content="Bilişsel terapi süreciniz için profesyonel tablolar oluşturun, düzenleyin ve dışa aktarın.">
<meta property="twitter:image" content="https://www.psykolink.com/images/tablo-og.jpg">
<title>Bilişsel Terapi Tabloları - PsykoLink</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> <link rel="stylesheet" href="style.css">
<style>
/* Table editing feedback styles */
.table-updating {
opacity: 0.7;
transition: opacity 0.2s ease;
position: relative;
}
.table-updating::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 24px;
height: 24px;
border: 3px solid rgba(0, 0, 0, 0.1);
border-top: 3px solid #007bff;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
0% { transform: translate(-50%, -50%) rotate(0deg); }
100% { transform: translate(-50%, -50%) rotate(360deg); }
}
.table-updated {
animation: flash-update 0.3s ease;
}
@keyframes flash-update {
0% { background-color: rgba(40, 167, 69, 0); }
50% { background-color: rgba(40, 167, 69, 0.1); }
100% { background-color: rgba(40, 167, 69, 0); }
}
/* Input validation styles */
input[type="number"].invalid {
border-color: #dc3545;
box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}
/* Table container responsive improvements */
.table-preview {
overflow-x: auto;
position: relative;
margin: 20px 0;
padding: 5px;
border-radius: 4px;
transition: all 0.3s ease;
}
/* Improve table inputs */
#editableTable input {
width: 100%;
padding: 6px 8px;
border: 1px solid #ced4da;
border-radius: 4px;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
#editableTable input:focus {
border-color: #80bdff;
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
</style>
<!-- Schema.org markup for Google -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebPage",
"name": "Bilişsel Terapi Tabloları - PsykoLink",
"description": "Bilişsel terapi süreciniz için profesyonel tablolar oluşturun, düzenleyin ve dışa aktarın.",
"publisher": {
"@type": "Organization",
"name": "PsykoLink",
"logo": "https://www.psykolink.com/images/logo.png"
},
"mainEntity": {
"@type": "SoftwareApplication",
"name": "PsykoLink Tablo Oluşturucu",
"applicationCategory": "HealthApplication",
"operatingSystem": "Web",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "TRY"
}
}
}
</script>
<!-- Required for PDF Generation -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<!-- Required for DOCX Generation -->
<script src="https://cdn.jsdelivr.net/npm/docx@7.3.0/build/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/file-saver@2.0.5/dist/FileSaver.min.js"></script>
</head>
<body>
<div class="content-wrapper">
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top">
<div class="container">
<a class="navbar-brand" href="index.html"><i class="fas fa-brain"></i> PsykoLink</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link" href="index.html">Ana Sayfa</a></li>
<li class="nav-item"><a class="nav-link" href="index.html#services">Hizmetlerimiz</a></li>
<li class="nav-item"><a class="nav-link" href="blog.html">Blog</a></li>
<li class="nav-item"><a class="nav-link" href="hakkimizda.html">Hakkımızda</a></li>
<li class="nav-item"><a class="nav-link" href="index.html#contact">İletişim</a></li>
<li class="nav-item"><a class="nav-link" href="BilisselTerapi.html">Bilişsel Terapi</a></li>
</ul>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="therapy-hero small-hero">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-8 mx-auto text-center">
<h1 id="tableTitle">Bilişsel Terapi Tabloları</h1>
<p class="lead" id="tableDescription">Düşüncelerinizi, duygularınızı ve davranışlarınızı düzenlemek için profesyonel tablolar oluşturun.</p>
</div>
</div>
</div>
</section>
<!-- Main Content -->
<section class="py-5">
<div class="container">
<!-- Cookie Notice -->
<div class="cookie-notice">
<div class="d-flex align-items-start">
<i class="fas fa-cookie-bite text-primary me-3 mt-1 fa-lg"></i>
<div>
<h5 class="mb-2">Tablo Verileriniz Hakkında</h5>
<p class="mb-0">Oluşturduğunuz tablolar tarayıcınızın çerezlerinde yerel olarak saklanır ve PsykoLink sunucularına gönderilmez. Tablolarınız yalnızca siz tarafından görüntülenebilir ve dışa aktarılabilir. Tarayıcı çerezlerinizi temizlerseniz, kaydedilmiş tablolarınız da silinecektir.</p>
</div>
</div>
</div>
<!-- Table Editor -->
<div class="table-editor-container">
<div class="table-controls">
<div class="row">
<div class="col-md-6">
<div class="mb-3">
<label for="tableNameInput" class="form-label">Tablo Adı</label>
<input type="text" class="form-control" id="tableNameInput" placeholder="Tablonuzun adını girin">
</div>
</div>
<div class="col-md-6">
<div class="d-flex justify-content-between align-items-end h-100 mb-3">
<div class="btn-group">
<button class="btn btn-sm btn-outline-secondary" id="darkModeToggle">
<i class="fas fa-moon"></i> Karanlık Mod
</button>
<button class="btn btn-sm btn-outline-danger" id="clearTableBtn">
<i class="fas fa-eraser"></i> Temizle
</button>
</div>
<div class="btn-group">
<button class="btn btn-sm btn-primary" id="saveTableBtn">
<i class="fas fa-save"></i> Kaydet
</button>
</div>
</div>
</div>
</div>
<div class="row mt-3">
<div class="col-md-4">
<div class="input-group mb-3">
<span class="input-group-text">Sütunlar</span>
<input type="number" class="form-control" id="columnCountInput" min="1" max="10" value="3">
<button class="btn btn-outline-secondary" id="addColumnBtn">
<i class="fas fa-plus"></i>
</button>
<button class="btn btn-outline-secondary" id="removeColumnBtn">
<i class="fas fa-minus"></i>
</button>
</div>
</div>
<div class="col-md-4">
<div class="input-group mb-3">
<span class="input-group-text">Satırlar</span>
<input type="number" class="form-control" id="rowCountInput" min="1" max="20" value="5">
<button class="btn btn-outline-secondary" id="addRowBtn">
<i class="fas fa-plus"></i>
</button>
<button class="btn btn-outline-secondary" id="removeRowBtn">
<i class="fas fa-minus"></i>
</button>
</div>
</div>
<div class="col-md-4">
<div class="d-grid">
<button class="btn btn-success" id="updateTableBtn">
<i class="fas fa-sync-alt"></i> Tabloyu Güncelle
</button>
</div>
</div>
</div>
</div>
<div class="table-preview" id="tableContainer">
<table class="table table-bordered" id="editableTable">
<thead>
<tr id="headerRow">
<th><input type="text" placeholder="Başlık 1" value="Durum"></th>
<th><input type="text" placeholder="Başlık 2" value="Düşünceler"></th>
<th><input type="text" placeholder="Başlık 3" value="Duygular"></th>
</tr>
</thead> <tbody id="tableBody">
<tr>
<td><input type="text" placeholder="Hücre içeriği"></td>
<td><input type="text" placeholder="Hücre içeriği"></td>
<td><input type="text" placeholder="Hücre içeriği"></td>
</tr>
<tr>
<td><input type="text" placeholder="Hücre içeriği"></td>
<td><input type="text" placeholder="Hücre içeriği"></td>
<td><input type="text" placeholder="Hücre içeriği"></td>
</tr>
<tr>
<td><input type="text" placeholder="Hücre içeriği"></td>
<td><input type="text" placeholder="Hücre içeriği"></td>
<td><input type="text" placeholder="Hücre içeriği"></td>
</tr>
<tr>
<td><input type="text" placeholder="Hücre içeriği"></td>
<td><input type="text" placeholder="Hücre içeriği"></td>
<td><input type="text" placeholder="Hücre içeriği"></td>
</tr>
<tr>
<td><input type="text" placeholder="Hücre içeriği"></td>
<td><input type="text" placeholder="Hücre içeriği"></td>
<td><input type="text" placeholder="Hücre içeriği"></td>
</tr>
</tbody>
</table>
</div>
<div class="export-buttons">
<div class="btn-group">
<button class="btn btn-outline-primary" id="exportPdfBtn">
<i class="fas fa-file-pdf"></i> PDF olarak kaydet
</button>
<button class="btn btn-outline-primary" id="exportDocxBtn">
<i class="fas fa-file-word"></i> DOCX olarak kaydet
</button>
<button class="btn btn-outline-primary" id="exportJpgBtn">
<i class="fas fa-file-image"></i> JPEG olarak kaydet
</button>
</div>
</div>
</div>
<!-- Saved Tables -->
<div class="saved-tables-container mt-5">
<h3><i class="fas fa-save me-2"></i>Kaydedilmiş Tablolarım</h3>
<p class="text-muted">Daha önce kaydettiğiniz tablolar burada görünecektir.</p>
<div class="row" id="savedTablesContainer">
<!-- Saved tables will be dynamically added here -->
<div class="col-12 text-center text-muted py-4" id="noTablesMessage">
<i class="fas fa-table fa-3x mb-3"></i>
<p>Henüz kaydedilmiş tablonuz bulunmuyor.</p>
</div>
</div>
</div>
<!-- Table Templates -->
<div class="table-templates-container mt-5">
<h3><i class="fas fa-th me-2"></i>Örnek Şablonlar</h3>
<p class="text-muted">Bilişsel terapi tekniklerine uygun hazır şablonları kullanabilirsiniz.</p>
<div class="row row-cols-1 row-cols-md-2 g-4" id="templateContainer">
<!-- Template cards will be dynamically added here -->
</div>
</div>
</div>
</section>
</div>
<!-- Footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-md-4">
<a href="index.html"><h3><i class="fas fa-brain"></i> PsykoLink</h3></a>
<p>Herkes için erişilebilir psikolojik destek</p>
</div>
<div class="col-md-4">
<h4>Hızlı Bağlantılar</h4>
<ul class="footer-links">
<li><a href="index.html#services">Hizmetlerimiz</a></li>
<li><a href="index.html#appointment">Randevu Al</a></li>
<li><a href="index.html#join">Ekibe Katıl</a></li>
<li><a href="index.html#donate">Bağış Yap</a></li>
</ul>
</div>
<div class="col-md-4">
<h4>Bizi Takip Edin</h4>
<div class="social-links">
<a href="#"><i class="fab fa-facebook"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-linkedin"></i></a>
</div>
</div>
</div>
<div class="footer-bottom">
<p>© 2025 PsykoLink. Tüm hakları saklıdır.</p>
</div>
</div>
</footer> <!-- Table Templates Data -->
<script>
// Template data for different cognitive therapy tables
window.tableTemplates = {
"dusunce-kayit": {
"name": "Düşünce Kayıt Tablosu",
"description": "Otomatik düşünceleri ve bunların etkilerini analiz etmek için kullanılır.",
"columns": [
"Durum/Olay",
"Otomatik Düşünce",
"Duygular",
"Bilişsel Çarpıtma",
"Alternatif Düşünce"
],
"rows": 5,
"example": [
["Toplantıda sunum yaparken takıldım", "Herkes benim beceriksiz olduğumu düşünecek", "Utanç, Kaygı (80%)", "Felaketleştirme, Zihin Okuma", "Herkes hata yapabilir. Takılmak normal bir durum."],
["Arkadaşım mesajıma cevap vermedi", "Bana kızgın olmalı, bir şey yanlış yaptım", "Endişe, Suçluluk (70%)", "Kişiselleştirme, Varsayımda Bulunma", "Meşgul olabilir, mesajı görmemiş olabilir"],
["İş başvurum reddedildi", "Asla iyi bir iş bulamayacağım", "Umutsuzluk, Hayal Kırıklığı (85%)", "Aşırı Genelleme, Ya Hep Ya Hiç Düşüncesi", "Bu sadece bir başvuruydu, başka fırsatlar olacak"],
["", "", "", "", ""],
["", "", "", "", ""]
],
"icon": "fas fa-brain"
},
"duygu-takip": {
"name": "Duygu Takip Tablosu",
"description": "Gün içinde yaşadığınız duyguları ve tetikleyicilerini izlemek için kullanılır.",
"columns": [
"Tarih/Saat",
"Duygu",
"Yoğunluk (0-100)",
"Tetikleyici Olay",
"Bedensel Tepkiler",
"Davranışım"
],
"rows": 5,
"example": [
["12 Haziran, 09:30", "Kaygı", "75", "İş toplantısı öncesi", "Kalp çarpıntısı, Terleme", "Sürekli notlarımı kontrol ettim"],
["12 Haziran, 13:15", "Öfke", "60", "Meslektaşım sözümü kesti", "Yüzüm kızardı, Gerginlik", "Toplantıdan sonra konuşmayı tercih ettim"],
["12 Haziran, 18:30", "Mutluluk", "80", "Çocuğumla oyun oynamak", "Gevşeme, Enerji artışı", "Daha fazla vakit geçirmeye karar verdim"],
["", "", "", "", "", ""],
["", "", "", "", "", ""]
],
"icon": "fas fa-heart"
},
"davranis-aktivasyon": {
"name": "Davranış Aktivasyon Tablosu",
"description": "Olumlu duygular uyandıran aktiviteleri planlama ve takip etme tablosu.",
"columns": [
"Aktivite",
"Haftanın Günü",
"Saat",
"Keyif (0-10)",
"Başarı (0-10)",
"Notlar"
],
"rows": 5,
"example": [
["15 dakika yürüyüş", "Pazartesi", "08:00", "6", "7", "Sabah yürüyüşü enerji verdi"],
["Kitap okuma", "Salı", "21:30", "8", "5", "Yatmadan önce rahatlattı"],
["Arkadaşla kahve", "Çarşamba", "14:00", "9", "8", "Sosyalleşmek iyi geldi"],
["", "", "", "", "", ""],
["", "", "", "", "", ""]
],
"icon": "fas fa-running"
},
"problem-cozme": {
"name": "Problem Çözme Tablosu",
"description": "Sorunları tanımlama ve çözüm stratejileri geliştirme tablosu.",
"columns": [
"Problem Tanımı",
"Olası Çözümler",
"Avantajları",
"Dezavantajları",
"Seçilen Çözüm",
"Aksiyon Planı"
],
"rows": 4,
"example": [
["İş-yaşam dengesi kuramıyorum", "Çalışma saatlerimi sınırlandırmak", "Daha fazla kişisel zaman", "Bazı işler yetişmeyebilir", "Sınırlar belirlemek", "18:00'den sonra e-postaları kontrol etmemek"],
["Sunumlar sırasında aşırı kaygı", "Sunum pratiği yapmak", "Daha hazırlıklı olma", "Zaman alıcı", "Pratik + Nefes teknikleri", "Haftada 2 kez 15dk pratik yapmak"],
["", "", "", "", "", ""],
["", "", "", "", "", ""]
],
"icon": "fas fa-puzzle-piece"
},
"iliski-dinamikleri": {
"name": "İlişki Dinamikleri Tablosu",
"description": "İlişkilerdeki iletişim kalıplarını ve etkileşim örüntülerini analiz etme tablosu.",
"columns": [
"İlişki/Kişi",
"İletişim Durumu",
"Benim Tepkim",
"Karşı Tarafın Tepkisi",
"İletişim Kalıbı",
"Alternatif Yaklaşım"
],
"rows": 4,
"example": [
["Eşim", "Eve geç gelmesi", "Suçlayıcı sözler söyledim", "Savunmaya geçti ve karşı suçlamalar yaptı", "Eleştiri-Savunma döngüsü", "Duygularımı 'Ben dili' ile ifade etmek"],
["İş arkadaşı", "Projede gecikme", "Sorunu görmezden geldim", "Pasif-agresif davrandı", "Kaçınma-gerginlik döngüsü", "Sorunu doğrudan ve yapıcı şekilde konuşmak"],
["", "", "", "", "", ""],
["", "", "", "", "", ""]
],
"icon": "fas fa-users"
},
"custom": {
"name": "Özel Tablo",
"description": "İhtiyaçlarınıza göre özelleştirebileceğiniz boş bir tablo.",
"columns": [
"Sütun 1",
"Sütun 2",
"Sütun 3"
],
"rows": 5,
"example": [
["", "", ""],
["", "", ""],
["", "", ""],
["", "", ""],
["", "", ""]
],
"icon": "fas fa-plus-circle"
}
};
</script>
<!-- Table Editor JS -->
<script>
document.addEventListener('DOMContentLoaded', function() {
// DOM Elements
const tableNameInput = document.getElementById('tableNameInput');
const columnCountInput = document.getElementById('columnCountInput');
const rowCountInput = document.getElementById('rowCountInput');
const addColumnBtn = document.getElementById('addColumnBtn');
const removeColumnBtn = document.getElementById('removeColumnBtn');
const addRowBtn = document.getElementById('addRowBtn');
const removeRowBtn = document.getElementById('removeRowBtn');
const updateTableBtn = document.getElementById('updateTableBtn');
const clearTableBtn = document.getElementById('clearTableBtn');
const saveTableBtn = document.getElementById('saveTableBtn');
const exportPdfBtn = document.getElementById('exportPdfBtn');
const exportDocxBtn = document.getElementById('exportDocxBtn');
const exportJpgBtn = document.getElementById('exportJpgBtn');
const darkModeToggle = document.getElementById('darkModeToggle');
const headerRow = document.getElementById('headerRow');
const tableBody = document.getElementById('tableBody');
const savedTablesContainer = document.getElementById('savedTablesContainer');
const noTablesMessage = document.getElementById('noTablesMessage');
const templateContainer = document.getElementById('templateContainer');
const tableTitle = document.getElementById('tableTitle');
const tableDescription = document.getElementById('tableDescription');
const tableToast = document.getElementById('tableToast');
const toastTitle = document.getElementById('toastTitle');
const toastMessage = document.getElementById('toastMessage');
// Variables
let currentTableType = 'custom';
// Check for dark mode preference
if (localStorage.getItem('darkMode') === 'enabled') {
document.body.classList.add('dark-mode');
darkModeToggle.innerHTML = '<i class="fas fa-sun"></i> Aydınlık Mod';
}
// Parse URL parameters
const urlParams = new URLSearchParams(window.location.search);
const tableType = urlParams.get('type');
// Initialize table based on URL parameter
if (tableType && tableTemplates[tableType]) {
currentTableType = tableType;
initializeEmptyTableWithStructure(tableType);
// Show example table alert
showTemplateExampleAlert(tableType);
}
// Initialize template cards
initializeTemplateCards();
// Load saved tables
loadSavedTables();
// Event Listeners
// Event Listeners for column and row buttons
addColumnBtn.addEventListener('click', function() {
const currentValue = parseInt(columnCountInput.value);
if (currentValue < 10) {
columnCountInput.value = currentValue + 1;
// Otomatik olarak tabloyu güncelle
updateTable();
}
});
removeColumnBtn.addEventListener('click', function() {
const currentValue = parseInt(columnCountInput.value);
if (currentValue > 1) {
columnCountInput.value = currentValue - 1;
// Otomatik olarak tabloyu güncelle
updateTable();
}
});
addRowBtn.addEventListener('click', function() {
const currentValue = parseInt(rowCountInput.value);
if (currentValue < 20) {
rowCountInput.value = currentValue + 1;
// Otomatik olarak tabloyu güncelle
updateTable();
}
});
removeRowBtn.addEventListener('click', function() {
const currentValue = parseInt(rowCountInput.value);
if (currentValue > 1) {
rowCountInput.value = currentValue - 1;
// Otomatik olarak tabloyu güncelle
updateTable();
}
});
// Input değerlerindeki değişimleri dinle
columnCountInput.addEventListener('change', function() {
// Input değeri sınırları kontrol et
const value = parseInt(this.value);
if (value < 1) this.value = 1;
if (value > 10) this.value = 10;
// Değer geçerliyse tabloyu güncelle
if (!isNaN(value) && value >= 1 && value <= 10) {
updateTable();
}
});
rowCountInput.addEventListener('change', function() {
// Input değeri sınırları kontrol et
const value = parseInt(this.value);
if (value < 1) this.value = 1;
if (value > 20) this.value = 20;
// Değer geçerliyse tabloyu güncelle
if (!isNaN(value) && value >= 1 && value <= 20) {
updateTable();
}
});
updateTableBtn.addEventListener('click', updateTable);
clearTableBtn.addEventListener('click', clearTable);
saveTableBtn.addEventListener('click', saveTable);
exportPdfBtn.addEventListener('click', exportToPdf);
exportDocxBtn.addEventListener('click', exportToDocx);
exportJpgBtn.addEventListener('click', exportToJpg);
darkModeToggle.addEventListener('click', toggleDarkMode);
// Functions function initializeTableFromTemplate(templateId) {
const template = tableTemplates[templateId];
if (!template) return;
// Update UI elements
tableTitle.textContent = template.name;
tableDescription.textContent = template.description;
tableNameInput.value = template.name;
// Önce input değerlerini güncelle, sonra tabloyu oluştur
columnCountInput.value = template.columns.length;
rowCountInput.value = template.rows;
// Update header row
headerRow.innerHTML = '';
template.columns.forEach(column => {
const th = document.createElement('th');
const input = document.createElement('input');
input.type = 'text';
input.value = column;
input.placeholder = 'Başlık';
th.appendChild(input);
headerRow.appendChild(th);
});
// Update table body
tableBody.innerHTML = '';
for (let i = 0; i < template.rows; i++) {
const tr = document.createElement('tr');
for (let j = 0; j < template.columns.length; j++) {
const td = document.createElement('td');
const input = document.createElement('input');
input.type = 'text';
input.placeholder = 'Hücre içeriği';
// If example data exists, use it
if (template.example && template.example[i] && template.example[i][j]) {
input.value = template.example[i][j];
}
td.appendChild(input);
tr.appendChild(td);
}
tableBody.appendChild(tr);
}
}
function initializeEmptyTableWithStructure(templateId) {
const template = tableTemplates[templateId];
if (!template) return;
// Update UI elements
tableTitle.textContent = template.name;
tableDescription.textContent = template.description;
tableNameInput.value = template.name;
// Önce input değerlerini güncelle
columnCountInput.value = template.columns.length;
rowCountInput.value = template.rows;
// Update header row
headerRow.innerHTML = '';
template.columns.forEach(column => {
const th = document.createElement('th');
const input = document.createElement('input');
input.type = 'text';
input.value = column;
input.placeholder = 'Başlık';
th.appendChild(input);
headerRow.appendChild(th);
});
// Update table body with empty cells
tableBody.innerHTML = '';
for (let i = 0; i < template.rows; i++) {
const tr = document.createElement('tr');
for (let j = 0; j < template.columns.length; j++) {
const td = document.createElement('td');
const input = document.createElement('input');
input.type = 'text';
input.placeholder = 'Hücre içeriği';
td.appendChild(input);
tr.appendChild(td);
}
tableBody.appendChild(tr);
}
}
function showTemplateExampleAlert(templateId) {
const template = tableTemplates[templateId];
if (!template || !template.example) return;
// Create table HTML for the alert
let tableHTML = '<table class="table table-bordered table-striped">';
// Add header row
tableHTML += '<thead><tr>';
template.columns.forEach(column => {
tableHTML += `<th>${column}</th>`;
});
tableHTML += '</tr></thead>';
// Add body rows with example data
tableHTML += '<tbody>';
for (let i = 0; i < Math.min(3, template.example.length); i++) {
tableHTML += '<tr>';
for (let j = 0; j < template.columns.length; j++) {
if (template.example[i] && template.example[i][j]) {
tableHTML += `<td>${template.example[i][j]}</td>`;
} else {
tableHTML += '<td></td>';
}
}
tableHTML += '</tr>';
}
tableHTML += '</tbody></table>';
// Create custom alert content
const alertContent = `
<div class="modal fade" id="exampleTableModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="${template.icon} me-2"></i>${template.name} - Örnek</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>Bu tablo tipi için bir örnek aşağıda gösterilmiştir. Kendi tablonuzu oluşturmak için bu örneği referans alabilirsiniz.</p>
<div class="table-responsive">
${tableHTML}
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Anladım</button>
</div>
</div>
</div>
</div>
`;
// Append modal to body
document.body.insertAdjacentHTML('beforeend', alertContent);
// Show modal
const modal = new bootstrap.Modal(document.getElementById('exampleTableModal'));
modal.show();
// Remove modal from DOM after it's hidden
document.getElementById('exampleTableModal').addEventListener('hidden.bs.modal', function() {
this.remove();
});
}
function initializeTemplateCards() {
templateContainer.innerHTML = '';
for (const [id, template] of Object.entries(tableTemplates)) {
if (id === 'custom') continue; // Skip the custom template
const colDiv = document.createElement('div');
colDiv.className = 'col';
colDiv.innerHTML = `
<div class="card template-card h-100" data-template-id="${id}">
<div class="card-body">
<h5 class="card-title"><i class="${template.icon} me-2"></i>${template.name}</h5>
<p class="card-text">${template.description}</p>
<div class="d-grid gap-2">
<button class="btn btn-outline-primary btn-sm load-template-btn">
<i class="fas fa-table me-1"></i> Bu şablonu kullan
</button>
</div>
</div>
</div>
`;
templateContainer.appendChild(colDiv);
}
// Add event listeners to template cards
document.querySelectorAll('.load-template-btn').forEach(btn => {
btn.addEventListener('click', function() {
const templateId = this.closest('.template-card').dataset.templateId;
currentTableType = templateId;
initializeEmptyTableWithStructure(templateId);
showTemplateExampleAlert(templateId);
});
});
}
function updateTable() {
const columns = parseInt(columnCountInput.value);
const rows = parseInt(rowCountInput.value);
// Update header row
const currentHeaders = headerRow.querySelectorAll('input');
const headerValues = Array.from(currentHeaders).map(input => input.value);
headerRow.innerHTML = '';
for (let i = 0; i < columns; i++) {
const th = document.createElement('th');
const input = document.createElement('input');
input.type = 'text';
input.placeholder = `Başlık ${i + 1}`;
if (headerValues[i]) {
input.value = headerValues[i];
}
th.appendChild(input);
headerRow.appendChild(th);
}
// Get current table data
const tableData = [];
const rows_existing = tableBody.querySelectorAll('tr');
rows_existing.forEach(row => {
const rowData = [];
const cells = row.querySelectorAll('input');
cells.forEach(cell => {
rowData.push(cell.value);
});
tableData.push(rowData);
});
// Update table body
tableBody.innerHTML = '';
for (let i = 0; i < rows; i++) {
const tr = document.createElement('tr');
for (let j = 0; j < columns; j++) {
const td = document.createElement('td');
const input = document.createElement('input');
input.type = 'text';
input.placeholder = 'Hücre içeriği';
if (tableData[i] && tableData[i][j]) {
input.value = tableData[i][j];
}
td.appendChild(input);
tr.appendChild(td);
}
tableBody.appendChild(tr);
}
}
function clearTable() {
if (confirm('Tablo içeriğini temizlemek istediğinize emin misiniz?')) {
tableNameInput.value = '';
// Clear all input values but keep structure
document.querySelectorAll('#editableTable input').forEach(input => {
input.value = '';
});
}
}
function saveTable() {
const tableName = tableNameInput.value || 'İsimsiz Tablo';
const tableId = 'table_' + Date.now();
// Get headers
const headers = [];
headerRow.querySelectorAll('input').forEach(input => {
headers.push(input.value || input.placeholder);
});
// Get table data
const tableData = [];
tableBody.querySelectorAll('tr').forEach(row => {
const rowData = [];
row.querySelectorAll('input').forEach(cell => {
rowData.push(cell.value);
});
tableData.push(rowData);
});
// Create table object
const tableObject = {
id: tableId,
name: tableName,
type: currentTableType,
headers: headers,
data: tableData,
columns: headers.length,
rows: tableData.length,
createdAt: new Date().toISOString()
};
// Save to localStorage
let savedTables = JSON.parse(localStorage.getItem('psykolink_tables') || '[]');
savedTables.push(tableObject);
localStorage.setItem('psykolink_tables', JSON.stringify(savedTables));
// Update UI
loadSavedTables();
// Show success toast
toastTitle.textContent = 'Başarılı';
toastMessage.textContent = 'Tablonuz başarıyla kaydedildi!';
tableToast.classList.add('bg-success', 'text-white');
const toast = new bootstrap.Toast(tableToast);
toast.show();
}
function loadSavedTables() {
const savedTables = JSON.parse(localStorage.getItem('psykolink_tables') || '[]');
if (savedTables.length === 0) {
noTablesMessage.style.display = 'block';
savedTablesContainer.innerHTML = '';
savedTablesContainer.appendChild(noTablesMessage);
return;
}
noTablesMessage.style.display = 'none';
savedTablesContainer.innerHTML = '';
// Sort tables by date (newest first)
savedTables.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt));
savedTables.forEach(table => {
const tableCard = document.createElement('div');
tableCard.className = 'col-md-4 mb-4';
// Get icon for the table type
const tableType = table.type || 'custom';
const tableIcon = tableTemplates[tableType] ? tableTemplates[tableType].icon : 'fas fa-table';
tableCard.innerHTML = `
<div class="card h-100 saved-table-card" data-table-id="${table.id}">
<div class="card-body">
<h5 class="card-title"><i class="${tableIcon} me-2"></i>${table.name}</h5>
<p class="card-text small text-muted">
<i class="far fa-calendar-alt me-1"></i>
${new Date(table.createdAt).toLocaleDateString('tr-TR')}
• ${table.columns} sütun • ${table.rows} satır
</p>
<div class="table-preview-mini">
<div class="table-preview-overflow">
<table class="table table-sm table-bordered">
<thead>
<tr>
${table.headers.map(header => `<th>${header}</th>`).join('')}
</tr>
</thead>
<tbody>
${table.data.slice(0, 2).map(row =>
`<tr>${row.map(cell => `<td>${cell}</td>`).join('')}</tr>`
).join('')}
</tbody>
</table>
</div>
</div>
</div>
<div class="card-footer bg-transparent">
<div class="d-flex justify-content-between">
<button class="btn btn-sm btn-outline-primary load-saved-table-btn">
<i class="fas fa-edit me-1"></i>Düzenle
</button>
<button class="btn btn-sm btn-outline-danger delete-saved-table-btn">
<i class="fas fa-trash-alt me-1"></i>Sil
</button>
</div>
</div>
</div>
`;
savedTablesContainer.appendChild(tableCard);
});
// Add event listeners to saved table cards
document.querySelectorAll('.load-saved-table-btn').forEach(btn => {
btn.addEventListener('click', function() {
const tableId = this.closest('.saved-table-card').dataset.tableId;
loadTableById(tableId);
});
});
document.querySelectorAll('.delete-saved-table-btn').forEach(btn => {
btn.addEventListener('click', function() {
const tableId = this.closest('.saved-table-card').dataset.tableId;
deleteTableById(tableId);
});
});
}
function loadTableById(tableId) {