]> git.mxchange.org Git - friendica.git/commitdiff
Update insertFormatting() definition
authorHypolite Petovan <mrpetovan@gmail.com>
Sat, 7 Jan 2017 15:16:03 +0000 (02:16 +1100)
committerHypolite Petovan <mrpetovan@gmail.com>
Sat, 7 Jan 2017 15:16:03 +0000 (02:16 +1100)
- Remove now useless comment parameter
- Formatting all around
- Update data-role=“insert-formatting” links
- Update onclick=“insertFormatting()” links

19 files changed:
js/main.js
view/theme/duepuntozero/templates/comment_item.tpl
view/theme/duepuntozero/templates/moderated_comment.tpl
view/theme/duepuntozero/theme.php
view/theme/frio/js/textedit.js
view/theme/frio/templates/comment_item.tpl
view/theme/frost-mobile/js/theme.js
view/theme/frost-mobile/templates/comment_item.tpl
view/theme/frost-mobile/templates/moderated_comment.tpl
view/theme/frost/js/theme.js
view/theme/frost/templates/comment_item.tpl
view/theme/frost/templates/moderated_comment.tpl
view/theme/quattro/js/quattro.js
view/theme/quattro/templates/comment_item.tpl
view/theme/smoothly/templates/bottom.tpl
view/theme/smoothly/theme.php
view/theme/vier/templates/comment_item.tpl
view/theme/vier/templates/event_form.tpl
view/theme/vier/theme.php

index 1b7b304a24083aba30d6272c493da03f2a675361..b08e4515091dbfbaf897c07c382e51ecd98d4957 100644 (file)
                /* setup comment textarea buttons */
                /* comment textarea buttons needs some "data-*" attributes to work:
                 *              data-role="insert-formatting" : to mark the element as a formatting button
-                *              data-comment="<string>" : string for "Comment", used by insertFormatting() function
                 *              data-bbcode="<string>" : name of the bbcode element to insert. insertFormatting() will insert it as "[name][/name]"
                 *              data-id="<string>" : id of the comment, used to find other comment-related element, like the textarea
                 * */
                $('body').on('click','[data-role="insert-formatting"]', function(e) {
                        e.preventDefault();
                        var o = $(this);
-                       var comment = o.data('comment');
                        var bbcode  = o.data('bbcode');
                        var id = o.data('id');
                        if (bbcode=="img") {
                                Dialog.doImageBrowser("comment", id);
                                return;
                        }
-                       insertFormatting(comment, bbcode, id);
+                       insertFormatting(bbcode, id);
                });
 
                /* event from comment textarea button popups */
index b7158f4eea06d3f2af7a1d61bba9602bd2ab0fcf..f1ef37f14bbab660a609ae54c31d491bdd1c3368 100644 (file)
                                <ul class="comment-edit-bb-{{$id}}">
                                        <li><a class="editicon boldbb shadow"
                                                style="cursor: pointer;" title="{{$edbold}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="b" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="b" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon italicbb shadow"
                                                style="cursor: pointer;" title="{{$editalic}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="i" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="i" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon underlinebb shadow"
                                                style="cursor: pointer;" title="{{$eduline}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="u" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="u" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon quotebb shadow"
                                                style="cursor: pointer;" title="{{$edquote}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="quote" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="quote" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon codebb shadow"
                                                style="cursor: pointer;" title="{{$edcode}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="code" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="code" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon imagebb shadow"
                                                style="cursor: pointer;" title="{{$edimg}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="img" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="img" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon urlbb shadow"
                                                style="cursor: pointer;" title="{{$edurl}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="url" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="url" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon videobb shadow"
                                                style="cursor: pointer;" title="{{$edvideo}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="video" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="video" data-id="{{$id}}"></a></li>
                                </ul>
                                <div class="comment-edit-bb-end"></div>
                                <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});cmtBbOpen(this, {{$id}});" onBlur="commentClose(this,{{$id}});cmtBbClose(this,{{$id}});"></textarea>
index ede08751a62ed187c45b4f1893b02ff5ca2c5a5d..e5c2e5b9ad25f23e149ab31b8f175dec40750173 100644 (file)
                                <ul class="comment-edit-bb-{{$id}}">
                                        <li><a class="editicon boldbb shadow"
                                                style="cursor: pointer;" title="{{$edbold}}"
-                                               onclick="insertFormatting('{{$comment}}','b', {{$id}});"></a></li>
+                                               onclick="insertFormatting('b', {{$id}});"></a></li>
                                        <li><a class="editicon italicbb shadow"
                                                style="cursor: pointer;" title="{{$editalic}}"
-                                               onclick="insertFormatting('{{$comment}}','i', {{$id}});"></a></li>
+                                               onclick="insertFormatting('i', {{$id}});"></a></li>
                                        <li><a class="editicon underlinebb shadow"
                                                style="cursor: pointer;" title="{{$eduline}}"
-                                               onclick="insertFormatting('{{$comment}}','u', {{$id}});"></a></li>
+                                               onclick="insertFormatting('u', {{$id}});"></a></li>
                                        <li><a class="editicon quotebb shadow"
                                                style="cursor: pointer;" title="{{$edquote}}"
-                                               onclick="insertFormatting('{{$comment}}','quote', {{$id}});"></a></li>
+                                               onclick="insertFormatting('quote', {{$id}});"></a></li>
                                        <li><a class="editicon codebb shadow"
                                                style="cursor: pointer;" title="{{$edcode}}"
-                                               onclick="insertFormatting('{{$comment}}','code', {{$id}});"></a></li>
+                                               onclick="insertFormatting('code', {{$id}});"></a></li>
                                        <li><a class="editicon imagebb shadow"
                                                style="cursor: pointer;" title="{{$edimg}}"
-                                               onclick="insertFormatting('{{$comment}}','img', {{$id}});"></a></li>
+                                               onclick="insertFormatting('img', {{$id}});"></a></li>
                                        <li><a class="editicon urlbb shadow"
                                                style="cursor: pointer;" title="{{$edurl}}"
-                                               onclick="insertFormatting('{{$comment}}','url', {{$id}});"></a></li>
+                                               onclick="insertFormatting('url', {{$id}});"></a></li>
                                        <li><a class="editicon videobb shadow"
                                                style="cursor: pointer;" title="{{$edvideo}}"
-                                               onclick="insertFormatting('{{$comment}}','video', {{$id}});"></a></li>
+                                               onclick="insertFormatting('video', {{$id}});"></a></li>
                                </ul>
                                <div class="comment-edit-bb-end"></div>
                                <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});cmtBbOpen({{$id}});" onBlur="commentClose(this,{{$id}});"></textarea>
index 347e542e1c253b57f4c9b664dcee636bb8719f1a..c1a1321ae07c09e07aa94c37c0010c19b6e0e4b0 100644 (file)
@@ -23,33 +23,34 @@ set_template_engine($a, 'smarty3');
     }
 $a->page['htmlhead'] .= <<< EOT
 <script>
-function insertFormatting(comment,BBcode,id) {
-       
-               var tmpStr = $("#comment-edit-text-" + id).val();
-               if(tmpStr == comment) {
-                       tmpStr = "";
-                       $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
-                       $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
-                       openMenu("comment-edit-submit-wrapper-" + id);
-                       $("#comment-edit-text-" + id).val(tmpStr);
-               }
+function insertFormatting(BBcode, id) {
+       var tmpStr = $("#comment-edit-text-" + id).val();
+       if (tmpStr == "") {
+               $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+               $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+               openMenu("comment-edit-submit-wrapper-" + id);
+               $("#comment-edit-text-" + id).val(tmpStr);
+       }
 
        textarea = document.getElementById("comment-edit-text-" +id);
        if (document.selection) {
                textarea.focus();
                selected = document.selection.createRange();
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
-                       } else                  
-               selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               } else {
+                       selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               }
        } else if (textarea.selectionStart || textarea.selectionStart == "0") {
                var start = textarea.selectionStart;
                var end = textarea.selectionEnd;
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
-                       } else
-               textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               } else {
+                       textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               }
        }
+
        return true;
 }
 
index ccb05116d84026d0b3d23d5c062a1c61e731d437..d3b090d537af6faa97762cb79f98f91c58bf97a1 100644 (file)
@@ -3,33 +3,34 @@
  */
 
 
-function insertFormatting(comment,BBcode,id) {
-
-               var tmpStr = $("#comment-edit-text-" + id).val();
-               if(tmpStr == comment) {
-                       tmpStr = "";
-                       $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
-                       $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
-                       openMenu("comment-edit-submit-wrapper-" + id);
-                       $("#comment-edit-text-" + id).val(tmpStr);
-               }
+function insertFormatting(BBcode,id) {
+       var tmpStr = $("#comment-edit-text-" + id).val();
+       if (tmpStr == '') {
+               $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+               $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+               openMenu("comment-edit-submit-wrapper-" + id);
+               $("#comment-edit-text-" + id).val(tmpStr);
+       }
 
        textarea = document.getElementById("comment-edit-text-" +id);
        if (document.selection) {
                textarea.focus();
                selected = document.selection.createRange();
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
-                       } else
-               selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               } else {
+                       selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               }
        } else if (textarea.selectionStart || textarea.selectionStart == "0") {
                var start = textarea.selectionStart;
                var end = textarea.selectionEnd;
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
-                       } else
-               textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               } else {
+                       textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               }
        }
+
        return true;
 }
 
index 440d5f02c6b66dbf3f9fde934c5701a940ca9fe3..a195c4dc04cd13444f877525ecb1f628428131cb 100644 (file)
                        {{/if}}
                        <ul class="comment-edit-bb-{{$id}} comment-icon-list nav nav-pills pull-right">
                                <li>
-                                       <a class="icon" style="cursor: pointer;" title="{{$edimg}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="img" data-id="{{$id}}">
+                                       <a class="icon" style="cursor: pointer;" title="{{$edimg}}" data-role="insert-formatting" data-bbcode="img" data-id="{{$id}}">
                                                <i class="fa fa-picture-o"></i>
                                        </a>
                                </li>
                                <li>
-                                       <a class="icon bb-url" style="cursor: pointer;" title="{{$edurl}}" onclick="insertFormatting('{{$comment}}','url',{{$id}});">
+                                       <a class="icon bb-url" style="cursor: pointer;" title="{{$edurl}}" onclick="insertFormatting('url',{{$id}});">
                                                <i class="fa fa-link"></i>
                                        </a>
                                </li>
                                <li>
-                                       <a class="icon bb-video" style="cursor: pointer;" title="{{$edvideo}}" onclick="insertFormatting('{{$comment}}','video',{{$id}});">
+                                       <a class="icon bb-video" style="cursor: pointer;" title="{{$edvideo}}" onclick="insertFormatting('video',{{$id}});">
                                                <i class="fa fa-video-camera"></i>
                                        </a>
                                </li>
 
                                <li>
-                                       <a class="icon underline" style="cursor: pointer;" title="{{$eduline}}" onclick="insertFormatting('{{$comment}}','u',{{$id}});">
+                                       <a class="icon underline" style="cursor: pointer;" title="{{$eduline}}" onclick="insertFormatting('u',{{$id}});">
                                                <i class="fa fa-underline"></i>
                                        </a>
                                </li>
                                <li>
-                                       <a class="icon italic" style="cursor: pointer;" title="{{$editalic}}" onclick="insertFormatting('{{$comment}}','i',{{$id}});">
+                                       <a class="icon italic" style="cursor: pointer;" title="{{$editalic}}" onclick="insertFormatting('i',{{$id}});">
                                                <i class="fa fa-italic"></i>
                                        </a>
                                </li>
                                <li>
-                                       <a class="icon bold" style="cursor: pointer;"  title="{{$edbold}}" onclick="insertFormatting('{{$comment}}','b',{{$id}});">
+                                       <a class="icon bold" style="cursor: pointer;"  title="{{$edbold}}" onclick="insertFormatting('b',{{$id}});">
                                                <i class="fa fa-bold"></i>
                                        </a>
                                </li>
                                <li>
-                                       <a class="icon quote" style="cursor: pointer;" title="{{$edquote}}" onclick="insertFormatting('{{$comment}}','quote',{{$id}});">
+                                       <a class="icon quote" style="cursor: pointer;" title="{{$edquote}}" onclick="insertFormatting('quote',{{$id}});">
                                                <i class="fa fa-quote-left"></i>
                                        </a>
                                </li>
index dfc272eb66ed6ada8a308697da8482e612ee64a9..04e391ed6ca85709186527cbbcebbc95c5880d31 100644 (file)
@@ -424,11 +424,9 @@ function qCommentInsert(obj,id) {
        $(obj).val("");
 }
 
-function insertFormatting(comment,BBcode,id) {
-       
+function insertFormatting(BBcode,id) {
        var tmpStr = $("#comment-edit-text-" + id).val();
-       if(tmpStr == comment) {
-               tmpStr = "";
+       if (tmpStr == "") {
                $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
                $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
                openMenu("comment-edit-submit-wrapper-" + id);
@@ -439,18 +437,21 @@ function insertFormatting(comment,BBcode,id) {
        if (document.selection) {
                textarea.focus();
                selected = document.selection.createRange();
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        selected.text = "["+BBcode+"=http://]" +  selected.text + "[/"+BBcode+"]";
-                       } else                  
-               selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               } else {
+                       selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               }
        } else if (textarea.selectionStart || textarea.selectionStart == "0") {
                var start = textarea.selectionStart;
                var end = textarea.selectionEnd;
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        textarea.value = textarea.value.substring(0, start) + "["+BBcode+"=http://]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
-                       } else
-               textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               } else {
+                       textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               }
        }
+
        return true;
 }
 
index 13fcfebde4f9367b5ffc16eb7d0bf24188f0f9a3..ba68b4604dbb8886ab11a49de9c5b4aa089fe4ff 100644 (file)
                                <ul class="comment-edit-bb-{{$id}}">
                                        <li><a class="editicon boldbb shadow"
                                                style="cursor: pointer;" title="{{$edbold}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="b" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="b" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon italicbb shadow"
                                                style="cursor: pointer;" title="{{$editalic}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="i" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="i" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon underlinebb shadow"
                                                style="cursor: pointer;" title="{{$eduline}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="u" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="u" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon quotebb shadow"
                                                style="cursor: pointer;" title="{{$edquote}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="quote" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="quote" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon codebb shadow"
                                                style="cursor: pointer;" title="{{$edcode}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="code" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="code" data-id="{{$id}}"></a></li>
                                </ul>
                                <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});cmtBbOpen({{$id}});"></textarea>
                                {{if $qcomment}}
index ede08751a62ed187c45b4f1893b02ff5ca2c5a5d..e5c2e5b9ad25f23e149ab31b8f175dec40750173 100644 (file)
                                <ul class="comment-edit-bb-{{$id}}">
                                        <li><a class="editicon boldbb shadow"
                                                style="cursor: pointer;" title="{{$edbold}}"
-                                               onclick="insertFormatting('{{$comment}}','b', {{$id}});"></a></li>
+                                               onclick="insertFormatting('b', {{$id}});"></a></li>
                                        <li><a class="editicon italicbb shadow"
                                                style="cursor: pointer;" title="{{$editalic}}"
-                                               onclick="insertFormatting('{{$comment}}','i', {{$id}});"></a></li>
+                                               onclick="insertFormatting('i', {{$id}});"></a></li>
                                        <li><a class="editicon underlinebb shadow"
                                                style="cursor: pointer;" title="{{$eduline}}"
-                                               onclick="insertFormatting('{{$comment}}','u', {{$id}});"></a></li>
+                                               onclick="insertFormatting('u', {{$id}});"></a></li>
                                        <li><a class="editicon quotebb shadow"
                                                style="cursor: pointer;" title="{{$edquote}}"
-                                               onclick="insertFormatting('{{$comment}}','quote', {{$id}});"></a></li>
+                                               onclick="insertFormatting('quote', {{$id}});"></a></li>
                                        <li><a class="editicon codebb shadow"
                                                style="cursor: pointer;" title="{{$edcode}}"
-                                               onclick="insertFormatting('{{$comment}}','code', {{$id}});"></a></li>
+                                               onclick="insertFormatting('code', {{$id}});"></a></li>
                                        <li><a class="editicon imagebb shadow"
                                                style="cursor: pointer;" title="{{$edimg}}"
-                                               onclick="insertFormatting('{{$comment}}','img', {{$id}});"></a></li>
+                                               onclick="insertFormatting('img', {{$id}});"></a></li>
                                        <li><a class="editicon urlbb shadow"
                                                style="cursor: pointer;" title="{{$edurl}}"
-                                               onclick="insertFormatting('{{$comment}}','url', {{$id}});"></a></li>
+                                               onclick="insertFormatting('url', {{$id}});"></a></li>
                                        <li><a class="editicon videobb shadow"
                                                style="cursor: pointer;" title="{{$edvideo}}"
-                                               onclick="insertFormatting('{{$comment}}','video', {{$id}});"></a></li>
+                                               onclick="insertFormatting('video', {{$id}});"></a></li>
                                </ul>
                                <div class="comment-edit-bb-end"></div>
                                <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});cmtBbOpen({{$id}});" onBlur="commentClose(this,{{$id}});"></textarea>
index 5597247e1d6e679638045753b236fc86fc36b154..130580de891a14faf7a8613d89376c882d7e2b71 100644 (file)
@@ -797,11 +797,9 @@ function itemFiler(id) {
  * Comments
  */
 
-function insertFormatting(comment,BBcode,id) {
-       
+function insertFormatting(BBcode, id) {
        var tmpStr = $("#comment-edit-text-" + id).val();
-       if(tmpStr == comment) {
-               tmpStr = "";
+       if (tmpStr == "") {
                $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
                $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
                openMenu("comment-edit-submit-wrapper-" + id);
@@ -812,18 +810,21 @@ function insertFormatting(comment,BBcode,id) {
        if (document.selection) {
                textarea.focus();
                selected = document.selection.createRange();
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        selected.text = "["+BBcode+"=http://]" +  selected.text + "[/"+BBcode+"]";
-                       } else                  
-               selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               } else {
+                       selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               }
        } else if (textarea.selectionStart || textarea.selectionStart == "0") {
                var start = textarea.selectionStart;
                var end = textarea.selectionEnd;
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        textarea.value = textarea.value.substring(0, start) + "["+BBcode+"=http://]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
-                       } else
-               textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               } else {
+                       textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               }
        }
+
        return true;
 }
 
index a30b7ba477fcbb00caa3bdc37c73397e75fad27b..4de33ca782e423a457042c4433ac9261cd99747c 100644 (file)
                                <ul class="comment-edit-bb" id="comment-edit-bb-{{$id}}">
                                        <li><a class="editicon boldbb shadow"
                                                style="cursor: pointer;" title="{{$edbold}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="b" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="b" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon italicbb shadow"
                                                style="cursor: pointer;" title="{{$editalic}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="i" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="i" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon underlinebb shadow"
                                                style="cursor: pointer;" title="{{$eduline}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="u" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="u" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon quotebb shadow"
                                                style="cursor: pointer;" title="{{$edquote}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="quote" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="quote" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon codebb shadow"
                                                style="cursor: pointer;" title="{{$edcode}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="code" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="code" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon imagebb shadow"
                                                style="cursor: pointer;" title="{{$edimg}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="img" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="img" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon urlbb shadow"
                                                style="cursor: pointer;" title="{{$edurl}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="url" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="url" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon videobb shadow"
                                                style="cursor: pointer;" title="{{$edvideo}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="video" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="video" data-id="{{$id}}"></a></li>
                                </ul>
                                <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});cmtBbOpen({{$id}});"></textarea>
                                {{if $qcomment}}
index ede08751a62ed187c45b4f1893b02ff5ca2c5a5d..e5c2e5b9ad25f23e149ab31b8f175dec40750173 100644 (file)
                                <ul class="comment-edit-bb-{{$id}}">
                                        <li><a class="editicon boldbb shadow"
                                                style="cursor: pointer;" title="{{$edbold}}"
-                                               onclick="insertFormatting('{{$comment}}','b', {{$id}});"></a></li>
+                                               onclick="insertFormatting('b', {{$id}});"></a></li>
                                        <li><a class="editicon italicbb shadow"
                                                style="cursor: pointer;" title="{{$editalic}}"
-                                               onclick="insertFormatting('{{$comment}}','i', {{$id}});"></a></li>
+                                               onclick="insertFormatting('i', {{$id}});"></a></li>
                                        <li><a class="editicon underlinebb shadow"
                                                style="cursor: pointer;" title="{{$eduline}}"
-                                               onclick="insertFormatting('{{$comment}}','u', {{$id}});"></a></li>
+                                               onclick="insertFormatting('u', {{$id}});"></a></li>
                                        <li><a class="editicon quotebb shadow"
                                                style="cursor: pointer;" title="{{$edquote}}"
-                                               onclick="insertFormatting('{{$comment}}','quote', {{$id}});"></a></li>
+                                               onclick="insertFormatting('quote', {{$id}});"></a></li>
                                        <li><a class="editicon codebb shadow"
                                                style="cursor: pointer;" title="{{$edcode}}"
-                                               onclick="insertFormatting('{{$comment}}','code', {{$id}});"></a></li>
+                                               onclick="insertFormatting('code', {{$id}});"></a></li>
                                        <li><a class="editicon imagebb shadow"
                                                style="cursor: pointer;" title="{{$edimg}}"
-                                               onclick="insertFormatting('{{$comment}}','img', {{$id}});"></a></li>
+                                               onclick="insertFormatting('img', {{$id}});"></a></li>
                                        <li><a class="editicon urlbb shadow"
                                                style="cursor: pointer;" title="{{$edurl}}"
-                                               onclick="insertFormatting('{{$comment}}','url', {{$id}});"></a></li>
+                                               onclick="insertFormatting('url', {{$id}});"></a></li>
                                        <li><a class="editicon videobb shadow"
                                                style="cursor: pointer;" title="{{$edvideo}}"
-                                               onclick="insertFormatting('{{$comment}}','video', {{$id}});"></a></li>
+                                               onclick="insertFormatting('video', {{$id}});"></a></li>
                                </ul>
                                <div class="comment-edit-bb-end"></div>
                                <textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" placeholder="{{$comment}}" onFocus="commentOpen(this,{{$id}});cmtBbOpen({{$id}});" onBlur="commentClose(this,{{$id}});"></textarea>
index 259874a299d4fb634852ead2c2fc19dc221bf90b..c44e6d07403d5a899804f8e18309c8e770492767 100644 (file)
@@ -59,33 +59,34 @@ $(document).ready(function(){
        });
 });
 
-function insertFormatting(comment,BBcode,id) {
-
-               var tmpStr = $("#comment-edit-text-" + id).val();
-               if(tmpStr == comment) {
-                       tmpStr = "";
-                       $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
-                       $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
-                       openMenu("comment-edit-submit-wrapper-" + id);
-                       $("#comment-edit-text-" + id).val(tmpStr);
-               }
+function insertFormatting(BBcode, id) {
+       var tmpStr = $("#comment-edit-text-" + id).val();
+       if (tmpStr == "") {
+               $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+               $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+               openMenu("comment-edit-submit-wrapper-" + id);
+               $("#comment-edit-text-" + id).val(tmpStr);
+       }
 
        textarea = document.getElementById("comment-edit-text-" +id);
        if (document.selection) {
                textarea.focus();
                selected = document.selection.createRange();
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
-                       } else
-               selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               } else {
+                       selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               }
        } else if (textarea.selectionStart || textarea.selectionStart == "0") {
                var start = textarea.selectionStart;
                var end = textarea.selectionEnd;
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
-                       } else
-               textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               } else {
+                       textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               }
        }
+
        return true;
 }
 
index 18b1a5155ff185e1d246d704c4246ea0a9b97863..c314acc66cde55f94705817b5a9bca71d385d8c8 100644 (file)
                                        class="comment-edit-bb">
                                        <li><a class="editicon boldbb shadow"
                                                style="cursor: pointer;" title="{{$edbold}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="b" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="b" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon italicbb shadow"
                                                style="cursor: pointer;" title="{{$editalic}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="i" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="i" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon underlinebb shadow"
                                                style="cursor: pointer;" title="{{$eduline}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="u" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="u" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon quotebb shadow"
                                                style="cursor: pointer;" title="{{$edquote}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="quote" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="quote" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon codebb shadow"
                                                style="cursor: pointer;" title="{{$edcode}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="code" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="code" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon imagebb shadow"
                                                style="cursor: pointer;" title="{{$edimg}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="img" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="img" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon urlbb shadow"
                                                style="cursor: pointer;" title="{{$edurl}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="url" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="url" data-id="{{$id}}"></a></li>
                                        <li><a class="editicon videobb shadow"
                                                style="cursor: pointer;" title="{{$edvideo}}"
-                                               data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="video" data-id="{{$id}}"></a></li>
+                                               data-role="insert-formatting" data-bbcode="video" data-id="{{$id}}"></a></li>
                                </ul>
                                <textarea id="comment-edit-text-{{$id}}"
                                        class="comment-edit-text-empty"
index dbc8a59132733bfccd9adc17a2c4b296533c44a8..caebe37711b9475a5c42de9eb76f6e132551086b 100644 (file)
@@ -8,37 +8,38 @@ function tautogrow(id) {
        $("textarea#comment-edit-text-" + id).autogrow();
 };
 
-function insertFormatting(comment, BBcode, id) {
-var tmpStr = $("#comment-edit-text-" + id).val();
-if(tmpStr == comment) {
-tmpStr = "";
-$("#comment-edit-text-" + id).addClass("comment-edit-text-full");
-$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
-openMenu("comment-edit-submit-wrapper-" + id);
-}
-textarea = document.getElementById("comment-edit-text-" + id);
-if (document.selection) {
-textarea.focus();
-selected = document.selection.createRange();
-if (BBcode == "url") {
-selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
-} else {
-selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
-}
-} else if (textarea.selectionStart || textarea.selectionStart == "0") {
-var start = textarea.selectionStart;
-var end = textarea.selectionEnd;
-if (BBcode == "url") {
-textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]"
-+ "http://" + textarea.value.substring(start, end)
-+ "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
-} else {
-textarea.value = textarea.value.substring(0, start)
-+ "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]"
-+ textarea.value.substring(end, textarea.value.length);
-}
-}
-return true;
+function insertFormatting(BBcode, id) {
+       var tmpStr = $("#comment-edit-text-" + id).val();
+       if (tmpStr == "") {
+               $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+               $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+               openMenu("comment-edit-submit-wrapper-" + id);
+       }
+
+       textarea = document.getElementById("comment-edit-text-" + id);
+       if (document.selection) {
+               textarea.focus();
+               selected = document.selection.createRange();
+               if (BBcode == "url") {
+                       selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
+               } else {
+                       selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               }
+       } else if (textarea.selectionStart || textarea.selectionStart == "0") {
+               var start = textarea.selectionStart;
+               var end = textarea.selectionEnd;
+               if (BBcode == "url") {
+                       textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]"
+                               + "http://" + textarea.value.substring(start, end)
+                               + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               } else {
+                       textarea.value = textarea.value.substring(0, start)
+                               + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]"
+                               + textarea.value.substring(end, textarea.value.length);
+               }
+       }
+
+       return true;
 }
 
 function cmtBbOpen(id) {
index 74f1c0b1e1bb7de134ce0c4196b5e46f2072a952..a10a071392aea4df8b5078a4ad4b5f7843053056 100644 (file)
@@ -19,33 +19,34 @@ function smoothly_init(&$a) {
 $a->page['htmlhead'] .= <<< EOT
 
 <script>
-function insertFormatting(comment,BBcode,id) {
-       
-               var tmpStr = $("#comment-edit-text-" + id).val();
-               if(tmpStr == comment) {
-                       tmpStr = "";
-                       $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
-                       $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
-                       openMenu("comment-edit-submit-wrapper-" + id);
-                       $("#comment-edit-text-" + id).val(tmpStr);
-               }
+function insertFormatting(BBcode, id) {
+       var tmpStr = $("#comment-edit-text-" + id).val();
+       if (tmpStr == "") {
+               $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+               $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+               openMenu("comment-edit-submit-wrapper-" + id);
+               $("#comment-edit-text-" + id).val(tmpStr);
+       }
 
        textarea = document.getElementById("comment-edit-text-" +id);
        if (document.selection) {
                textarea.focus();
                selected = document.selection.createRange();
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
-                       } else                  
-               selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               } else {
+                       selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               }
        } else if (textarea.selectionStart || textarea.selectionStart == "0") {
                var start = textarea.selectionStart;
                var end = textarea.selectionEnd;
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
-                       } else
-               textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               } else {
+                       textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               }
        }
+
        return true;
 }
 
index 2621b039b14d578ca638b34b92bf4e3a6c4f35fc..3e72df6dc6cf40d61640195dfa3902202b816af2 100644 (file)
                                <div class="comment-edit-submit-wrapper" id="comment-edit-submit-wrapper-{{$id}}" style="display: none;">
 
                                <div class="comment-edit-bb">
-                                       <a title="{{$edimg}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="img" data-id="{{$id}}"><i class="icon-picture"></i></a>      
-                                       <a title="{{$edurl}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="url" data-id="{{$id}}"><i class="icon-link"></i></a>
-                                       <a title="{{$edvideo}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="video" data-id="{{$id}}"><i class="icon-film"></i></a>
-                                                                                
-                                       <a title="{{$eduline}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="u" data-id="{{$id}}"><i class="icon-underline"></i></a>
-                                       <a title="{{$editalic}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="i" data-id="{{$id}}"><i class="icon-italic"></i></a>
-                                       <a title="{{$edbold}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="b" data-id="{{$id}}"><i class="icon-bold"></i></a>
-                                       <a title="{{$edquote}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="quote" data-id="{{$id}}"><i class="icon-quote-left"></i></a>
+                                       <a title="{{$edimg}}" data-role="insert-formatting" data-bbcode="img" data-id="{{$id}}"><i class="icon-picture"></i></a>
+                                       <a title="{{$edurl}}" data-role="insert-formatting" data-bbcode="url" data-id="{{$id}}"><i class="icon-link"></i></a>
+                                       <a title="{{$edvideo}}" data-role="insert-formatting" data-bbcode="video" data-id="{{$id}}"><i class="icon-film"></i></a>
+
+                                       <a title="{{$eduline}}" data-role="insert-formatting" data-bbcode="u" data-id="{{$id}}"><i class="icon-underline"></i></a>
+                                       <a title="{{$editalic}}" data-role="insert-formatting" data-bbcode="i" data-id="{{$id}}"><i class="icon-italic"></i></a>
+                                       <a title="{{$edbold}}" data-role="insert-formatting" data-bbcode="b" data-id="{{$id}}"><i class="icon-bold"></i></a>
+                                       <a title="{{$edquote}}" data-role="insert-formatting" data-bbcode="quote" data-id="{{$id}}"><i class="icon-quote-left"></i></a>
 
                                 </div>
                                        <input type="submit" onclick="post_comment({{$id}}); return false;" id="comment-edit-submit-{{$id}}" class="comment-edit-submit" name="submit" value="{{$submit}}" />
index 0507c36aa19e17429c99f8f8aa4c16da027c36dc..35e05c02d502fac307eae582b4c0cae88943fc38 100644 (file)
 <div id="event-desc-text">{{$d_text}}</div>
 <textarea id="comment-edit-text-desc" rows="8" cols="64" name="desc" autocomplete="off">{{$d_orig}}</textarea>
 <div id="event-desc-text-edit-bb" class="comment-edit-bb">
-       <a title="{{$edimg}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="img" data-id="desc"><i class="icon-picture"></i></a>      
-       <a title="{{$edurl}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="url" data-id="desc"><i class="icon-link"></i></a>
-       <a title="{{$edvideo}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="video" data-id="desc"><i class="icon-film"></i></a>
-
-       <a title="{{$eduline}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="u" data-id="desc"><i class="icon-underline"></i></a>
-       <a title="{{$editalic}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="i" data-id="desc"><i class="icon-italic"></i></a>
-       <a title="{{$edbold}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="b" data-id="desc"><i class="icon-bold"></i></a>
-       <a title="{{$edquote}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="quote" data-id="desc"><i class="icon-quote-left"></i></a>
+       <a title="{{$edimg}}" data-role="insert-formatting" data-bbcode="img" data-id="desc"><i class="icon-picture"></i></a>
+       <a title="{{$edurl}}" data-role="insert-formatting" data-bbcode="url" data-id="desc"><i class="icon-link"></i></a>
+       <a title="{{$edvideo}}" data-role="insert-formatting" data-bbcode="video" data-id="desc"><i class="icon-film"></i></a>
+
+       <a title="{{$eduline}}" data-role="insert-formatting" data-bbcode="u" data-id="desc"><i class="icon-underline"></i></a>
+       <a title="{{$editalic}}" data-role="insert-formatting" data-bbcode="i" data-id="desc"><i class="icon-italic"></i></a>
+       <a title="{{$edbold}}" data-role="insert-formatting" data-bbcode="b" data-id="desc"><i class="icon-bold"></i></a>
+       <a title="{{$edquote}}" data-role="insert-formatting" data-bbcode="quote" data-id="desc"><i class="icon-quote-left"></i></a>
 </div>
 
 <div id="event-location-text">{{$l_text}}</div>
 <textarea id="comment-edit-text-location" rows="4" cols="64" name="location">{{$l_orig}}</textarea>
 <div id="event-location-text-edit-bb" class="comment-edit-bb">
-       <a title="{{$edimg}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="img" data-id="location"><i class="icon-picture"></i></a>      
-       <a title="{{$edurl}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="url" data-id="location"><i class="icon-link"></i></a>
-       <a title="{{$edvideo}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="video" data-id="location"><i class="icon-film"></i></a>
-
-       <a title="{{$eduline}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="u" data-id="location"><i class="icon-underline"></i></a>
-       <a title="{{$editalic}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="i" data-id="location"><i class="icon-italic"></i></a>
-       <a title="{{$edbold}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="b" data-id="location"><i class="icon-bold"></i></a>
-       <a title="{{$edquote}}" data-role="insert-formatting" data-comment="{{$comment}}" data-bbcode="quote" data-id="location"><i class="icon-quote-left"></i></a>
+       <a title="{{$edimg}}" data-role="insert-formatting" data-bbcode="img" data-id="location"><i class="icon-picture"></i></a>
+       <a title="{{$edurl}}" data-role="insert-formatting" data-bbcode="url" data-id="location"><i class="icon-link"></i></a>
+       <a title="{{$edvideo}}" data-role="insert-formatting" data-bbcode="video" data-id="location"><i class="icon-film"></i></a>
+
+       <a title="{{$eduline}}" data-role="insert-formatting" data-bbcode="u" data-id="location"><i class="icon-underline"></i></a>
+       <a title="{{$editalic}}" data-role="insert-formatting" data-bbcode="i" data-id="location"><i class="icon-italic"></i></a>
+       <a title="{{$edbold}}" data-role="insert-formatting" data-bbcode="b" data-id="location"><i class="icon-bold"></i></a>
+       <a title="{{$edquote}}" data-role="insert-formatting" data-bbcode="quote" data-id="location"><i class="icon-quote-left"></i></a>
 </div>
 
 <div id="event-location-break"></div>
index 4abc9d2a81001cb9e7d33b8a0550b8efc0a0aa98..bc87063527732dd7e40a4e59c99ceb897a3c15bd 100644 (file)
@@ -36,33 +36,34 @@ function vier_init(&$a) {
 <link rel='stylesheet' type='text/css' href='view/theme/vier/narrow.css' media='screen and (max-width: 1100px)' />
 <script type="text/javascript">
 
-function insertFormatting(comment,BBcode,id) {
-
-               var tmpStr = $("#comment-edit-text-" + id).val();
-               if(tmpStr == comment) {
-                       tmpStr = "";
-                       $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
-                       $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
-                       openMenu("comment-edit-submit-wrapper-" + id);
-                       $("#comment-edit-text-" + id).val(tmpStr);
-               }
+function insertFormatting(BBcode, id) {
+       var tmpStr = $("#comment-edit-text-" + id).val();
+       if (tmpStr == "") {
+               $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+               $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+               openMenu("comment-edit-submit-wrapper-" + id);
+               $("#comment-edit-text-" + id).val(tmpStr);
+       }
 
        textarea = document.getElementById("comment-edit-text-" +id);
        if (document.selection) {
                textarea.focus();
                selected = document.selection.createRange();
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        selected.text = "["+BBcode+"]" + "http://" +  selected.text + "[/"+BBcode+"]";
-                       } else
-               selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               } else {
+                       selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+               }
        } else if (textarea.selectionStart || textarea.selectionStart == "0") {
                var start = textarea.selectionStart;
                var end = textarea.selectionEnd;
-               if (BBcode == "url"){
+               if (BBcode == "url") {
                        textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
-                       } else
-               textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               } else {
+                       textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+               }
        }
+
        return true;
 }