2 <script type="text/javascript" src="{{$baseurl}}/view/theme/smoothly/js/jquery.autogrow.textarea.js"></script>
3 <script type="text/javascript">
4 $(document).ready(function() {
7 function tautogrow(id) {
8 $("textarea#comment-edit-text-" + id).autogrow();
11 function insertFormatting(BBcode, id) {
12 var tmpStr = $("#comment-edit-text-" + id).val();
14 $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
15 $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
16 openMenu("comment-edit-submit-wrapper-" + id);
19 textarea = document.getElementById("comment-edit-text-" + id);
20 if (document.selection) {
22 selected = document.selection.createRange();
23 if (BBcode == "url") {
24 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
26 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
28 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
29 var start = textarea.selectionStart;
30 var end = textarea.selectionEnd;
31 if (BBcode == "url") {
32 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]"
33 + "http://" + textarea.value.substring(start, end)
34 + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
36 textarea.value = textarea.value.substring(0, start)
37 + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]"
38 + textarea.value.substring(end, textarea.value.length);
45 function cmtBbOpen(id) {
46 $(".comment-edit-bb-" + id).show();
48 function cmtBbClose(id) {
49 $(".comment-edit-bb-" + id).hide();