_binary From f4d09c72d4931f34c4f9ebade03cf67c87324f67 Mon Sep 17 00:00:00 2001
From: Anirudh Mallya <anirudh.mallya09@gmail.com>
Date: Fri, 14 May 2021 12:16:04 -0700
Subject: [PATCH] Adding a pastebin burner to yioop & Adding a Grid view for
 media list wiki page

---
 src/controllers/GroupController.php           |  10 +-
 .../components/SocialComponent.php            |  50 ++++++--
 src/css/search.css                            |  29 +++++
 src/models/GroupModel.php                     |   6 +-
 src/resources/paste-bin-line-numbers.png      | Bin 0 -> 16556 bytes
 src/scripts/wiki.js                           |  44 +++++++
 src/views/elements/Element.php                |  12 +-
 src/views/elements/GroupfeedElement.php       |   1 +
 src/views/elements/WikiElement.php            | 108 ++++++++++++++----
 src/views/layouts/WebLayout.php               |  11 +-
 10 files changed, 228 insertions(+), 43 deletions(-)
 create mode 100644 src/resources/paste-bin-line-numbers.png

diff --git a/src/controllers/GroupController.php b/src/controllers/GroupController.php
index 2e9fbef2b..9a43d3227 100644
--- a/src/controllers/GroupController.php
+++ b/src/controllers/GroupController.php
@@ -85,9 +85,9 @@ class GroupController extends Controller implements CrawlConstants
             $_REQUEST = [];
             foreach ($keep_fields as $field) {
                 if (isset($request[$field])) {
-                    if ($field == "arg" && (!in_array($request[$field],
-                        ["diff", "history", "read", "pages", "media",
-                        "source", "statistics"]) )) {
+                    if ($field == "arg" && !in_array($request[$field],
+                        ["diff", "history", "read", "pages", "media", "source",
+                        "statistics"]) && $request['paste_bin_page'] == "") {
                         continue;
                     }
                     $_REQUEST[$field] =
@@ -95,6 +95,10 @@ class GroupController extends Controller implements CrawlConstants
                 }
             }
             $_REQUEST["c"] = "group";
+            if (isset($request["paste_bin_page"])) {
+                $_REQUEST["a"] = $request['a'];
+                $_REQUEST["paste_bin_page"] = $request['paste_bin_page'];
+            }
         }
         $data = array_merge($data, $this->processSession());
         $data['MENU'] = 'groupmenu';
diff --git a/src/controllers/components/SocialComponent.php b/src/controllers/components/SocialComponent.php
index a434271e9..e06f2c655 100644
--- a/src/controllers/components/SocialComponent.php
+++ b/src/controllers/components/SocialComponent.php
@@ -2523,7 +2523,11 @@ class SocialComponent extends Component implements CrawlConstants
                         }
                     }
                 }
-                $$field = $tmp;
+                if ($field == 'paste_bin_page') {
+                    $page = $tmp;
+                } else {
+                    $$field = $tmp;
+                }
                 if ($user_id == C\PUBLIC_USER_ID) {
                     $_SESSION['LAST_ACTIVITY'][$field] = $tmp;
                 }
@@ -3449,7 +3453,8 @@ EOD;
                 || isset($_REQUEST['sort'])) {
                 $action = "wikiupdate_".
                     "group=" . $group_id . "&page=" . $page_name;
-                if (!$parent->checkCSRFTime(C\CSRF_TOKEN, $action)) {
+                    if (!$parent->checkCSRFTime(C\CSRF_TOKEN, $action) &&
+                        $head_object["page_type"] != "paste_bin") {
                     $data['SCRIPT'] .= "doMessage('<h1 class=\"red\" >".
                         tl('social_component_wiki_edited_elsewhere').
                         "</h1>');";
@@ -4113,7 +4118,11 @@ EOD;
             $data['SUB_PATH'] = htmlentities($sub_path);
         }
         $data['ORIGINAL_SUB_PATH'] = $sub_path;
-        $data["CAN_EDIT"] = false;
+        if ($_REQUEST['paste_bin_page'] != "" && $_REQUEST['arg'] == "edit") {
+            $data["CAN_EDIT"] = true;
+        } else {
+            $data["CAN_EDIT"] = false;
+        }
         if ((isset($_REQUEST['c'])) && $_REQUEST['c'] == "api") {
             //wiki help request
             $data['MODE'] = 'api';
@@ -4131,7 +4140,8 @@ EOD;
             "page_alias" => tl('social_component_page_alias'),
             "media_list" => tl('social_component_media_list'),
             "presentation" => tl('social_component_presentation'),
-            "url_shortener" => tl('social_component_url_shortener')
+            "url_shortener" => tl('social_component_url_shortener'),
+            "paste_bin" => tl('social_component_paste_bin')
         ];
         $data['page_borders'] = [
             "solid-border" => tl('social_component_solid'),
@@ -4175,6 +4185,7 @@ EOD;
             'resource_filter' => 'file_name',
             "revert" => 'int',
             "group_name" => 'string',
+            "paste_bin_page" => 'string'
         ];
         $strings_array = [
             "page_name" => C\TITLE_LEN,
@@ -4264,19 +4275,25 @@ EOD;
             is_settings = {$data['settings']};
             is_page_alias = ('page_alias'=='{$data['current_page_type']}');
             is_url_shortener = ('url_shortener'=='{$data['current_page_type']}');
+            is_paste_bin = ('paste_bin'=='{$data['current_page_type']}');
             setDisplay('page-settings', is_settings || is_page_alias);
-            setDisplay("media-list-page", is_media_list && !is_page_alias && !is_url_shortener);
-            setDisplay("page-container", !is_media_list && !is_page_alias && !is_url_shortener);
-            setDisplay("non-alias-type", !is_page_alias && !is_url_shortener);
+            setDisplay("media-list-page", is_media_list && !is_page_alias &&
+            !is_url_shortener && !is_paste_bin);
+            setDisplay("page-container", !is_media_list && !is_page_alias &&
+            !is_url_shortener && !is_paste_bin);
+            setDisplay("non-alias-type", !is_page_alias && !is_url_shortener &&
+            !is_paste_bin);
             setDisplay("alias-type", is_page_alias);
             setDisplay("url-shortener", is_url_shortener);
             setDisplay("short-url-label", is_url_shortener);
+            setDisplay("paste-bin", is_paste_bin);
             if (mode == 'edit') {
                 setDisplay('save-container', !is_media_list || is_settings);
                 setDisplay('resource-upload-form', is_media_list);
             }
             $init_toggle_settings
-            setDisplay("page-resources", !is_page_alias);
+            setDisplay("page-resources", !is_page_alias && !is_url_shortener &&
+            !is_paste_bin);
             ptype.onchange = function() {
                 var cur_type = ptype.options[ptype.selectedIndex].value;
                 if (cur_type == "media_list") {
@@ -4287,6 +4304,7 @@ EOD;
                     setDisplay("alias-type", false);
                     setDisplay("url-shortener", false);
                     setDisplay("short-url-label", false);
+                    setDisplay("paste-bin", false);
                     setDisplay("page-resources", true);
                     if (mode == 'edit') {
                         setDisplay("resource-upload-form", true);
@@ -4299,6 +4317,7 @@ EOD;
                     setDisplay("alias-type", true);
                     setDisplay("url-shortener", false);
                     setDisplay("short-url-label", false);
+                    setDisplay("paste-bin", false);
                     setDisplay("page-resources", false);
                 } else if (cur_type == "url_shortener") {
                      $toggle_settings_false
@@ -4308,9 +4327,21 @@ EOD;
                      setDisplay("alias-type", false);
                      setDisplay("url-shortener", true);
                      setDisplay("short-url-label", true);
+                     setDisplay("paste-bin", false);
                      setDisplay("page-resources", false);
                      setDisplay("resource_msg", false);
-                } else {
+                    }  else if (cur_type == "paste_bin") {
+                        $toggle_settings_false
+                        setDisplay("media-list-page", false);
+                        setDisplay("page-container", false);
+                        setDisplay("non-alias-type", false);
+                        setDisplay("alias-type", false);
+                        setDisplay("url-shortener", false);
+                        setDisplay("short-url-label", false);
+                        setDisplay("paste-bin", true);
+                        setDisplay("page-resources", false);
+                        setDisplay("resource_msg", false);
+                    } else {
                     setDisplay("page-container", true);
                     setDisplay("media-list-page", false);
                     $toggle_settings_inline
@@ -4318,6 +4349,7 @@ EOD;
                     setDisplay("alias-type", false);
                     setDisplay("url-shortener", false);
                     setDisplay("short-url-label", false);
+                    setDisplay("paste-bin", false);
                     setDisplay("page-resources", true);
                     if (mode == 'edit') {
                         setDisplay("resource-upload-form", false);
diff --git a/src/css/search.css b/src/css/search.css
index e2f8c35b9..316b80445 100755
--- a/src/css/search.css
+++ b/src/css/search.css
@@ -466,6 +466,25 @@ a.hover-link:hover
     height: 2.5in;
     width: 100%;
 }
+.tall-text-area.paste-bin-text-area
+{
+    background: url(../resources/paste-bin-line-numbers.png);
+    background-attachment: local;
+    background-repeat: no-repeat;
+    padding-left: 35px;
+    padding-top: 10px;
+    border-color:#ccc;
+    width: 96.2%;
+}
+
+.grid-container {
+    display: grid;
+    grid-template-columns: auto auto auto;
+}
+.solid-border .grid-item {
+    width:3in;
+    text-align: center;
+}
 .mobile .tall-text-area
 {
     width: 90%;
@@ -3328,6 +3347,16 @@ table.wikitable > caption
 {
     width:150px;
 }
+.list-container div
+{
+    padding:3px;
+    vertical-align:middle;
+}
+.list-container img
+{
+    height: 0.6in;
+    width:auto;
+}
 /*
   Styles for the classifiers settings pages
  */
diff --git a/src/models/GroupModel.php b/src/models/GroupModel.php
index 73aa0de82..910e20ed3 100644
--- a/src/models/GroupModel.php
+++ b/src/models/GroupModel.php
@@ -1297,7 +1297,11 @@ class GroupModel extends Model implements MediaConstants
         $pubdate = time();
         $parser = new WikiParser($base_address, $additional_substitutions);
         $links_relationships = $parser->fetchLinks($page);
-        $parsed_page = $parser->parse($page);
+        if (str_contains($page,"page_type=paste_bin")) {
+            $parsed_page = $page;
+        } else {
+            $parsed_page = $parser->parse($page);
+        }
         if ($page_id = $this->getPageId($group_id, $page_name, $locale_tag)) {
             //can only add and use resources for a page that exists
             $parsed_page = $this->insertResourcesParsePage($group_id, $page_id,
diff --git a/src/resources/paste-bin-line-numbers.png b/src/resources/paste-bin-line-numbers.png
new file mode 100644
index 0000000000000000000000000000000000000000..ffea4e6aa163ba2cf184e2970ef11724bce4ef72
GIT binary patch
diff --git a/src/scripts/wiki.js b/src/scripts/wiki.js
index 305a7980b..fb379bb74 100755
--- a/src/scripts/wiki.js
+++ b/src/scripts/wiki.js
@@ -805,3 +805,47 @@ function addToPage(resource_name, textarea_id, sub_path)
             resource_name.replace('&quot;', '"'), textarea_id);
     }
 }
+/* Used to dynamically set view for media-list type wiki page*/
+function getView()
+{
+    if (document.getElementById("view_button").innerHTML
+        == "⊞ Grid") {
+        var val = "≣ List";
+        var e = document.getElementById("view_container");
+        e.setAttribute("class","list-container");
+        e = document.querySelectorAll("#container-items");
+        e.forEach(function(userItem) {
+            userItem.removeAttribute("class",
+            "solid-border grid-item");
+        });
+        e = document.querySelectorAll("#container-item");
+        e.forEach(function(userItem) {
+            userItem.setAttribute("style",
+            "display: inline-block");
+            var c = userItem.childNodes;
+            if (c[1] && c[1].innerText == "") {
+                c[1].className = "small-margin-current-activity";
+                c[1].style = "padding-right:0.03in";
+            }
+        });
+    } else {
+        var val = "⊞ Grid";
+        var e = document.getElementById("view_container");
+        e.setAttribute("class","grid-container");
+        e = document.querySelectorAll("#container-items");
+        e.forEach(function(userItem) {
+            userItem.setAttribute("class",
+            "solid-border grid-item");;
+        });
+        e = document.querySelectorAll("#container-item");
+        e.forEach(function(userItem) {
+            userItem.removeAttribute("style");
+            var c = userItem.childNodes;
+            if (c[1] && c[1].innerText == "") {
+                c[1].className = null;
+                c[1].style = null;
+            }
+        });
+    }
+    document.getElementById("view_button").innerHTML = val;
+}
\ No newline at end of file
diff --git a/src/views/elements/Element.php b/src/views/elements/Element.php
index 44b687d7e..799bebb2a 100755
--- a/src/views/elements/Element.php
+++ b/src/views/elements/Element.php
@@ -129,15 +129,17 @@ abstract class Element
                 if (strpos($group_value['GROUP_NAME'], "Chats\$") !== false) {
                     $data['GROUPS'][$key]['GROUP_NAME'] =
                         tl('element_chat_name');
-                    break;
                 }
             }
         }
-        if (isset($data['PAGES'])) {
+        if (isset($data['SUBTITLE']) &&
+            str_contains($data['SUBTITLE'], "Chats" . "$")) {
             $data['SUBTITLE'] = tl('element_chat_name');
+        }
+        if (isset($data['PAGES'])) {
             foreach ($data['PAGES'] as $key  => $page_value) {
                 if (strpos($data['PAGES'][$key][CrawlConstants::SOURCE_NAME],
-                    "Chats\$" . $data['USERNAME']) !== false) {
+                    "Chats\$") !== false) {
                     if (isset($data['GROUP_NAME'])) {
                         $data['GROUP_NAME'] = tl('element_chat_name');
                     }
@@ -161,11 +163,11 @@ abstract class Element
             }
         }
         if (isset($data['GROUP']) && strpos($data['GROUP']['GROUP_NAME'],
-            "Chats\$" . $data['USERNAME']) !== false) {
+            "Chats\$") !== false) {
             $data['GROUP']['GROUP_NAME'] = tl('element_chat_name');
         }
         if (isset($data['CURRENT_GROUP']) && strpos(
-            $data['CURRENT_GROUP']['name'], "Chats\$" . $data['USERNAME'])
+            $data['CURRENT_GROUP']['name'], "Chats\$")
             !== false) {
             $data['CURRENT_GROUP']['name'] = tl('element_chat_name');
         }
diff --git a/src/views/elements/GroupfeedElement.php b/src/views/elements/GroupfeedElement.php
index 345d7c577..2d7789462 100644
--- a/src/views/elements/GroupfeedElement.php
+++ b/src/views/elements/GroupfeedElement.php
@@ -190,6 +190,7 @@ class GroupfeedElement extends Element implements CrawlConstants
     public function renderUngroupedView($logged_in, $base_query, $paging_query,
         &$data)
     {
+        $data = $this->editChatGroupName($data);
         $is_api = !empty($data['API']);
         $is_status = !empty($data['STATUS']);
         $open_in_tabs = $data['OPEN_IN_TABS'];
diff --git a/src/views/elements/WikiElement.php b/src/views/elements/WikiElement.php
index c9d429098..0e725f78a 100644
--- a/src/views/elements/WikiElement.php
+++ b/src/views/elements/WikiElement.php
@@ -196,6 +196,34 @@ class WikiElement extends Element implements CrawlConstants
         if (isset($data["HEAD"]['page_type']) && $data["HEAD"]['page_type'] ==
             'media_list') {
             $this->renderResources($data, true, $logged_in);
+        } elseif (!empty($data["PAGE"]) && isset($data["HEAD"]['page_type']) &&
+            $data["HEAD"]['page_type'] == 'paste_bin') {
+            ?><div id="paste-bin-readonly">
+            <textarea id="paste_bin_textarea"
+                class="tall-text-area paste-bin-text-area"
+                name="paste_bin_readonly" style="overflow:hidden" readonly>
+                <?= $data["PAGE"] ?></textarea>
+            </div>
+            <form id="editpageForm" method="post"
+            enctype="multipart/form-data">
+            <input type="hidden" name="c" value="<?=$data['CONTROLLER']
+            ?>" />
+            <input type="hidden" name="a" value="wiki" />
+            <input type="hidden" name="arg" value="edit" />
+            <div id="paste-bin">
+            <div class="top-margin">
+            <label><b><?=tl("wiki_element_paste_bin_label")
+            ?></b></label>
+            </div>
+            <textarea id="paste_bin_page"
+                class="tall-text-area" name="paste_bin_page">
+                <?= $data["PAGE"] ?></textarea>
+            </div>
+            <div id="save-container" class="top-margin center">
+                <button class="button-box" type="submit">
+                <?=tl("wiki_element_savebutton")?></button>
+            </div>
+            </form><?php
         } elseif (!empty($data["PAGE"])) {
             $sub_path = (empty($data['SUB_PATH'])) ? "": $data['SUB_PATH'];
             $media_id = "";
@@ -482,7 +510,8 @@ class WikiElement extends Element implements CrawlConstants
             </div>
             <?php $shortenedURL = '';
             if ($data['url_shortener']) {
-                $shortenedURL = C\BASE_URL . "group/" . $_REQUEST['group_id'] . "/" . $_REQUEST['page_name'];
+                $shortenedURL = C\BASE_URL . "group/" . $_REQUEST['group_id'] .
+                "/" . $_REQUEST['page_name'];
             }?>
             <div id='url-shortener'>
             <div class="top-margin">
@@ -499,6 +528,16 @@ class WikiElement extends Element implements CrawlConstants
             <?=$shortenedURL?></b></label>
             </div>
             </div>
+            <div id='paste-bin'>
+            <div class="top-margin">
+            <label><b><?=tl('wiki_element_paste_bin_label')
+            ?></b></label>
+            </div>
+            <textarea id="paste_bin_page"
+                class="tall-text-area" name="paste_bin_page"
+                data-buttons="none">
+                <?=$data['PAGE']?></textarea>
+            </div>
             <div id='non-alias-type'>
             <div class="top-margin">
             <label for="page-border"><b><?=tl('wiki_element_page_border')
@@ -632,7 +671,7 @@ class WikiElement extends Element implements CrawlConstants
         <p><?= tl('wiki_element_ml_description')?></p>
         </div>
         <?php
-        if ($show_resources && $data['page_type'] != "url_shortener") {
+        if ($show_resources) {
         ?>
         <div id="page-resources">
         <h3><?= tl('wiki_element_page_resources')?></h3>
@@ -676,10 +715,12 @@ class WikiElement extends Element implements CrawlConstants
         ?>
         </div>
         </form>
-        </div>
         <?php
             $this->renderResources($data, false);
+            $wiki_js = C\SHORT_BASE_URL . "scripts/wiki.js";
         ?>
+        </div>
+        <script src="<?=$wiki_js ?>" ></script>
         <script>
         function renameResource(old_name, id)
         {
@@ -768,6 +809,9 @@ class WikiElement extends Element implements CrawlConstants
             $default_folder_thumb = C\SHORT_BASE_URL .
                 $data['RESOURCES_INFO']['default_folder_thumb'];
             ?>
+            <div>
+            <div>
+            <div  style="display: inline-block;">
             <form>
             <div><b><?=tl('wiki_element_places')?></b><?php
             $sub_path = $this->renderPath('resource-path',
@@ -796,7 +840,13 @@ class WikiElement extends Element implements CrawlConstants
                 id='resource-filter' value="<?=$data['RESOURCE_FILTER']?>" />
             <button type='submit' name='filter_resources'
                 class="button-box"><?=tl('wiki_element_go') ?></button>
-            </div></form>
+            </form>
+            </div>
+            </div>
+            <div  style="display: inline-block;">
+                <button id='view_button' class="button-box"
+            onclick='javascript:getView();' ><?= "≣ List" ?></button>
+            </div>
             <?php
             if (!empty($data['SUB_PATH'])) {
                 $folder_prefix = "$folder_prefix&amp;sf=".urlencode($sub_path);
@@ -845,7 +895,7 @@ class WikiElement extends Element implements CrawlConstants
                <?php
             }
             if (count($data['RESOURCES_INFO']['resources']) > 0 || !$read_mode){
-                ?><div class="wiki-resources"><table><thead><?php
+                ?></div><div><table><thead><?php
                 if (!$read_mode && $data['MODE'] != 'source') {
                     ?><tr><th colspan="2"></th><th><a href='<?=
                         $folder_prefix?>&amp;sort=name'><?=
@@ -879,8 +929,9 @@ class WikiElement extends Element implements CrawlConstants
                     } else {
                         e("</th>");
                     } ?>
-                </tr></thead><tbody><?php
+                </tr></thead><table><?php
                 }
+                e('<div id="view_container" class="list-container">');
                 $seen_resources = []; /* these are video and audio which
                    appear in different version such as mp4 and mov
                    This array keeps track if have seen an alternative version
@@ -983,15 +1034,21 @@ class WikiElement extends Element implements CrawlConstants
                             $current_thumb = $default_folder_thumb;
                         }
                     }
-                    e("<tr class='resource-list' >");
+                    e("<div id='container-items'>");
                     if (!empty($_SESSION['seen_media']) &&
                         in_array($hash_id, $_SESSION['seen_media'])) {
-                        e("<td class='sidebar-color huge-font'><span " .
+                            e("<div id='container-item'
+                            style='display: inline-block;'><span " .
                             "id='$hash2_id' class='marked' onclick='" .
                             "clearResource(this.id, \"". $clear_url . "\")' ".
-                            ">&diams;</span></td>");
+                            ">&diams;</span></div>");
                     } else {
-                        e("<td></td>");
+                        e("<div id='container-item'
+                        style='display: inline-block;'>
+                        <span " . "id='$hash2_id'
+                        class='small-margin-current-activity'
+                        style='padding-right:0.03in'>
+                        </span></div>");
                     }
                     $animated_thumb_info = "";
                     if ($resource['has_animated_thumb']) {
@@ -1004,19 +1061,21 @@ class WikiElement extends Element implements CrawlConstants
                             "this.src = this.dataset.src; ".
                             "this.dataset.src =src' ";
                     }
-                    e("<td><a href='$current_url' >");
+                    e("<div  id='container-item'
+                    style='display: inline-block;'><a href='$current_url' >");
                     e("<img src='" . $current_thumb .
                         "'  alt='$written_name'  $animated_thumb_info />");
-                    e("</a></td>");
+                    e("</a></div>");
                     if ($read_mode) {
-                        e("<td><a href='$current_url'>".
-                            "$written_name</a></td>");
+                        e("<div  id='container-item'
+                        style='display: inline-block;'><a href='$current_url'>".
+                            "$written_name</a></div>");
                     } else {
-                        e("<td><input type='text' id='resource-$i' ".
+                        e("<div><input type='text' id='resource-$i' ".
                             "aria-label='".tl('wiki_element_name')."' ".
                             "value='".str_replace("'", "&#39;", $name).
-                            "' $disabled /></td>");
-                        ?><td><?php if (!$disabled) {
+                            "' $disabled /></div>");
+                        ?><div><?php if (!$disabled) {
                             ?><button onclick='javascript:renameResource("<?=
                             urlencode($name);?>",
                             <?= $i ?>)' ><?=
@@ -1073,18 +1132,18 @@ class WikiElement extends Element implements CrawlConstants
                             tl('wiki_element_delete');
                             ?>">🗑<span class="none"><?=
                             tl('wiki_element_delete');
-                            ?></span></span></a></td><?php
+                            ?></span></span></a></div><?php
                         } else {
-                            e("</td>");
+                            e("</div>");
                         }
                         if (!$_SERVER["MOBILE"]) {
-                            e("<td>" . L\intToMetric($resource['size']) .
-                                "B</td>");
-                            e("<td>" . date("r", $resource['modified']) .
-                                "</td>");
+                            e("<div>" . L\intToMetric($resource['size']) .
+                                "B</div>");
+                            e("<div>" . date("r", $resource['modified']) .
+                                "</div>");
                         }
                     }
-                    e("</tr>");
+                    e("</div>");
                     $i++;
                 }
                 ?></tbody></table></div><?php
@@ -1278,6 +1337,7 @@ class WikiElement extends Element implements CrawlConstants
      */
     public function renderPages($data, $can_edit, $logged_in)
     {
+        $data = $this->editChatGroupName($data);
         $token_string = ($logged_in) ? C\CSRF_TOKEN ."=". $data[C\CSRF_TOKEN] :
             "";
         $group_id = $data["GROUP"]["GROUP_ID"];
diff --git a/src/views/layouts/WebLayout.php b/src/views/layouts/WebLayout.php
index 63b1fff76..efc339f59 100755
--- a/src/views/layouts/WebLayout.php
+++ b/src/views/layouts/WebLayout.php
@@ -346,12 +346,14 @@ class WebLayout extends Layout
         }
         $script_path = C\APP_DIR . "/scripts/basic.js";
         $basic_js = $path_url . "scripts/basic.js";
+        $wiki_js = $path_url . "scripts/wiki.js";
         if (file_exists($script_path)) {
             $basic_js = "$path_url?c=resource&amp;a=get" .
                 "&amp;f=scripts&amp;n=basic.js";
         }
         ?>
-        <script src="<?=$basic_js ?>" ></script><?php
+        <script src="<?=$basic_js ?>" ></script>
+        <script src="<?=$wiki_js ?>" ></script><?php
         if ($this->view->helper('helpbutton')->is_help_initialized) {
             if (!isset($data["INCLUDE_SCRIPTS"])) {
                 $data["INCLUDE_SCRIPTS"] = [];
@@ -437,6 +439,13 @@ class WebLayout extends Layout
                 yioop_post_scripts[callback_index]();
             }
         }
+        function textAreaAdjust(elementStr)
+        {
+            element = elt(elementStr);
+            element.style.height = "4in";
+            element.style.height = (25+element.scrollHeight)+"px";
+        }
+        window.textAreaAdjust("paste_bin_textarea");
         </script>
         </div>
         </body>
-- 
2.29.2.windows.3

