Use placeholder attribute for Comment message

- Remove global aStr.comment
- Remove global window.commentEmptyText
- Remove head.tpl $comment parameter
This commit is contained in:
Hypolite Petovan 2017-01-08 02:13:55 +11:00
parent b6ce646d71
commit b50f1f970f
20 changed files with 37 additions and 59 deletions

View file

@ -835,8 +835,7 @@ function cmtBbClose(id) {
}
function commentOpen(obj,id) {
if(obj.value == window.commentEmptyText) {
obj.value = "";
if (obj.value == "") {
$("#comment-edit-text-" + id).addClass("comment-edit-text-full");
$("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
$("#mod-cmnt-wrap-" + id).show();
@ -844,8 +843,7 @@ function commentOpen(obj,id) {
}
}
function commentClose(obj,id) {
if(obj.value == "") {
obj.value = window.commentEmptyText;
if (obj.value == "") {
$("#comment-edit-text-" + id).removeClass("comment-edit-text-full");
$("#comment-edit-text-" + id).addClass("comment-edit-text-empty");
$("#mod-cmnt-wrap-" + id).hide();
@ -856,8 +854,7 @@ function commentClose(obj,id) {
function commentInsert(obj,id) {
var tmpStr = $("#comment-edit-text-" + id).val();
if(tmpStr == window.commentEmptyText) {
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);
@ -872,8 +869,7 @@ function commentInsert(obj,id) {
function qCommentInsert(obj,id) {
var tmpStr = $("#comment-edit-text-" + id).val();
if(tmpStr == window.commentEmptyText) {
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);

View file

@ -34,8 +34,8 @@
<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>
</ul>
<textarea id="comment-edit-text-{{$id}}" class="comment-edit-text-empty" name="body" onFocus="commentOpen(this,{{$id}});cmtBbOpen({{$id}});" >{{$comment}}</textarea>
</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}}
<select id="qcomment-select-{{$id}}" name="qcomment-{{$id}}" class="qcomment" onchange="qCommentInsert(this,{{$id}});">
<option value=""></option>

View file

@ -19,7 +19,6 @@
<script>
window.delItem = "{{$delitem}}";
window.commentEmptyText = "{{$comment}}";
window.showMore = "{{$showmore}}";
window.showFewer = "{{$showfewer}}";
var updateInterval = {{$update_interval}};

View file

@ -47,7 +47,7 @@
onclick="insertFormatting('{{$comment}}','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" onFocus="commentOpen(this,{{$id}});cmtBbOpen({{$id}});" onBlur="commentClose(this,{{$id}});" >{{$comment}}</textarea>
<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>
<div class="comment-edit-text-end"></div>
<div class="comment-edit-submit-wrapper" id="comment-edit-submit-wrapper-{{$id}}" style="display: none;">