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

@ -121,8 +121,7 @@ var FileBrowser = {
// work as expected (we need a way to wait until commentOpenUI would be finished).
// As for now we insert pieces of this function here
if ((commentElm !== null) && (typeof commentElm !== "undefined")) {
if (commentElm.value == aStr.comment){
commentElm.value = "";
if (commentElm.value == "") {
$("#comment-edit-text-" + FileBrowser.id).addClass("comment-edit-text-full").removeClass("comment-edit-text-empty");
$("#comment-edit-submit-wrapper-" + FileBrowser.id).show();
$("#comment-edit-text-" + FileBrowser.id).attr('tabindex','9');

View file

@ -61,8 +61,7 @@ function commentExpand(id) {
}
function commentClose(obj,id) {
if(obj.value == '') {
obj.value = aStr.comment;
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();
@ -85,8 +84,7 @@ function commentOpenUI(obj, id) {
$(document).unbind( "click.commentOpen", handler );
var handler = function() {
if(obj.value == aStr.comment) {
obj.value = '';
if (obj.value == '') {
$("#comment-edit-text-" + id).addClass("comment-edit-text-full").removeClass("comment-edit-text-empty");
// Choose an arbitrary tab index that's greater than what we're using in jot (3 of them)
// The submit button gets tabindex + 1
@ -105,8 +103,7 @@ function commentCloseUI(obj, id) {
$(document).unbind( "click.commentClose", handler );
var handler = function() {
if(obj.value === '') {
obj.value = aStr.comment;
if (obj.value === '') {
$("#comment-edit-text-" + id).removeClass("comment-edit-text-full").addClass("comment-edit-text-empty");
$("#comment-edit-text-" + id).removeAttr('tabindex');
$("#comment-edit-submit-" + id).removeAttr('tabindex');
@ -136,8 +133,7 @@ function jotTextCloseUI(obj) {
}
function commentOpen(obj,id) {
if(obj.value == aStr.comment) {
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();
@ -149,8 +145,7 @@ function commentOpen(obj,id) {
function commentInsert(obj,id) {
var tmpStr = $("#comment-edit-text-" + id).val();
if(tmpStr == aStr.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);
@ -165,8 +160,7 @@ function commentInsert(obj,id) {
function qCommentInsert(obj,id) {
var tmpStr = $("#comment-edit-text-" + id).val();
if(tmpStr == aStr.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);