viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Take 2 on making wiki page resource table have resizable columns

Chris Pollett [2024-03-17 21:Mar:th]
Take 2 on making wiki page resource table have resizable columns
Filename
src/controllers/components/SocialComponent.php
src/css/search.css
src/views/elements/WikiElement.php
diff --git a/src/controllers/components/SocialComponent.php b/src/controllers/components/SocialComponent.php
index fc78ee03e..eef22af06 100644
--- a/src/controllers/components/SocialComponent.php
+++ b/src/controllers/components/SocialComponent.php
@@ -4519,7 +4519,7 @@ EOD;
             $name_parts = pathinfo($file_name);
             if (!empty($name_parts['extension']) &&
                 in_array($name_parts['extension'], ['csv', 'css', 'txt',
-                    'tex', 'php', 'sql', 'html', 'java', 'js', 'py',
+                    'tex', 'php', 'sql', 'html', 'java', 'js', 'py',
                     'pl', 'P', 'srt'])) {
                 $extension = $name_parts['extension'];
                 $data['RAW'] = !empty($_REQUEST['download']);
@@ -4912,7 +4912,7 @@ EOD;
         }
     }
     /**
-     * Used to set -up infor for drawing the mediaWikiDetail of a media
+     * Used to set-up information for drawing the mediaWikiDetail of a media
      * resource page
      *
      * @param array &$data array of field variables for view will be modified
diff --git a/src/css/search.css b/src/css/search.css
index 5f95f3587..d76297e71 100755
--- a/src/css/search.css
+++ b/src/css/search.css
@@ -773,6 +773,11 @@ grid-container div[data-badge]::after,
 {
     left: 0;
 }
+.resizable
+{
+    resize: horizontal;
+    overflow: auto;
+}
 h2.resource-field input
 {
     font-size: 24pt;
@@ -784,6 +789,7 @@ h2.resource-field input
     border:0;
     color:black;
     padding:2px;
+    width:calc(min(100% - 8px, 2in));
 }
 .resource-field input:hover
 {
@@ -804,12 +810,12 @@ h2.resource-field:focus-within button,
 .media-detail-description:focus-within button
 {
     background-color: #F0F0F6;
-    border:1px solid gray;
-    border-radius:5px;
-    color:black;
-    display:inline;
-    font-size:11pt;
-    font-weight:bold;
+    border: 1px solid gray;
+    border-radius: 5px;
+    color: black;
+    display: inline;
+    font-size: 11pt;
+    font-weight: bold;
 }
 .media-detail-description:focus-within div
 {
@@ -3945,9 +3951,9 @@ td.instruct
 {
     border-bottom: 1px solid gray;
 }
-.wiki-resources th:last-child
+ .wiki-resources th:last-child
 {
-    width:100%;
+    width: 5in;
 }
 .mobile .wiki-resources table
 {
@@ -4533,9 +4539,9 @@ table.wikitable > caption
 }
 .list-resource th
 {
-    width: 2in;
     vertical-align: middle;
     text-align: center;
+    width: 2in;
 }
 .mobile .list-resource th
 {
@@ -4578,7 +4584,7 @@ table.wikitable > caption
 }
 .mobile .list-resource input
 {
-    width: 300px;
+    width: calc(min(100% - 8px, 300px);
 }
 /*
 Styles for the classifiers settings pages
diff --git a/src/views/elements/WikiElement.php b/src/views/elements/WikiElement.php
index f3770fd3e..2c44daf66 100644
--- a/src/views/elements/WikiElement.php
+++ b/src/views/elements/WikiElement.php
@@ -1083,12 +1083,14 @@ class WikiElement extends Element implements CrawlConstants
                 }
                 if (empty($read_mode) && $data['MODE'] != 'source' &&
                     $data['CURRENT_LAYOUT'] == 'list') {
-                    ?><tr><th colspan="2"></th><th><a href='<?=
+                    ?><tr><th colspan="2"></th>
+                        <th class="resizable" ><a href='<?=
                         $sub_path_folder_prefix?>&amp;default_sort=name'><?=
                         tl('wiki_element_name')
                     ?></a></th><?php
                     if (!$_SERVER["MOBILE"]) {
-                        e("<th><a href='$sub_path_folder_prefix&amp;".
+                        e("<th class='resizable'
+                            ><a href='$sub_path_folder_prefix&amp;".
                             "default_sort=size'>" . tl('wiki_element_size').
                             '</a>');
                         e("</th><th ><a href='".
@@ -1456,7 +1458,7 @@ class WikiElement extends Element implements CrawlConstants
             }
         }
         $thumb_class = ($is_a_default_thumb) ? ' class="default-thumb" ' : "";
-        e("<$td_img class='split-adjuster resource-thumb'>".
+        e("<$td_img class='resource-thumb'>".
             "$num_files_indicator<a href='$current_url'  $dbl_click >");
         e("<img $style loading='lazy' $thumb_class src='" . $current_thumb .
             "'  alt='$written_name'  $animated_thumb_info >");
@@ -1466,7 +1468,7 @@ class WikiElement extends Element implements CrawlConstants
                 "$written_name</a></$td>");
         } else {
             // need tabindex to allow focus-within to work Safari
-            e("<$td class='split-adjuster resource-field' tabindex='0'
+            e("<$td class='resource-field' tabindex='0'
                 ><input type='text' ".
                 "id='resource-$i' aria-label='".tl('wiki_element_name')."' ".
                 "value='".str_replace("'", "&#39;", $name).
@@ -1533,10 +1535,10 @@ class WikiElement extends Element implements CrawlConstants
             }
             e("</$td>");
             if (!$_SERVER["MOBILE"]) {
-                e("<$td class='split-adjuster'>" .
+                e("<$td>" .
                     L\intToMetric($resource['size']) .
                     "B</$td>");
-                e("<$td class='split-adjuster'>" .
+                e("<$td>" .
                     date("r", $resource['modified']) .
                     "</$td>");
             }
ViewGit