1 <script type="text/javascript" src="$baseurl/view/theme/smoothly/js/jquery.autogrow.textarea.js"></script>
2 <script type="text/javascript">
3 $(document).ready(function() {
6 function tautogrow(id) {
7 $("textarea#comment-edit-text-" + id).autogrow();
10 function insertFormatting(comment, BBcode, id) {
11 var tmpStr = $("#comment-edit-text-" + id).val();
12 if(tmpStr == comment) {
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);
18 textarea = document.getElementById("comment-edit-text-" + id);
19 if (document.selection) {
21 selected = document.selection.createRange();
22 if (BBcode == "url") {
23 selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
25 selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
27 } else if (textarea.selectionStart || textarea.selectionStart == "0") {
28 var start = textarea.selectionStart;
29 var end = textarea.selectionEnd;
30 if (BBcode == "url") {
31 textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]"
32 + "http://" + textarea.value.substring(start, end)
33 + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
35 textarea.value = textarea.value.substring(0, start)
36 + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]"
37 + textarea.value.substring(end, textarea.value.length);
43 function cmtBbOpen(id) {
44 $(".comment-edit-bb-" + id).show();
46 function cmtBbClose(id) {
47 $(".comment-edit-bb-" + id).hide();