Use placeholder attribute for Share message

This commit is contained in:
Hypolite Petovan 2017-01-08 02:06:03 +11:00
parent daa8e4f901
commit b6ce646d71
7 changed files with 9 additions and 19 deletions

View File

@ -25,7 +25,7 @@
{{/if}} {{/if}}
<div id="jot-text-wrap"> <div id="jot-text-wrap">
<img id="profile-jot-text-loading" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" /> <img id="profile-jot-text-loading" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{if $content}}{{$content}}{{else}}{{$share}}{{/if}}</textarea> <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}">{{if $content}}{{$content}}{{/if}}</textarea>
</div> </div>
<div id="profile-jot-submit-wrapper" class="jothidden"> <div id="profile-jot-submit-wrapper" class="jothidden">

View File

@ -119,21 +119,16 @@ function commentCloseUI(obj, id) {
$(document).bind( "click.commentClose", handler ); $(document).bind( "click.commentClose", handler );
} }
// test if there is default content in the jot text box and remove it
function jotTextOpenUI(obj) { function jotTextOpenUI(obj) {
if(obj.value == aStr.share) { if (obj.value == '') {
obj.value = '';
$(".modal-body #profile-jot-text").addClass("profile-jot-text-full").removeClass("profile-jot-text-empty"); $(".modal-body #profile-jot-text").addClass("profile-jot-text-full").removeClass("profile-jot-text-empty");
// initiale autosize for the jot // initiale autosize for the jot
autosize($(".modal-body #profile-jot-text")); autosize($(".modal-body #profile-jot-text"));
} }
} }
// insert default content into the jot text box
// if it's empty
function jotTextCloseUI(obj) { function jotTextCloseUI(obj) {
if(obj.value === '') { if (obj.value === '') {
obj.value = aStr.share;
$(".modal-body #profile-jot-text").removeClass("profile-jot-text-full").addClass("profile-jot-text-empty"); $(".modal-body #profile-jot-text").removeClass("profile-jot-text-full").addClass("profile-jot-text-empty");
// destroy the automatic textarea resizing // destroy the automatic textarea resizing
autosize.destroy($(".modal-body #profile-jot-text")); autosize.destroy($(".modal-body #profile-jot-text"));

View File

@ -62,7 +62,7 @@
{{* The jot text field in which the post text is inserted *}} {{* The jot text field in which the post text is inserted *}}
<div id="jot-text-wrap"> <div id="jot-text-wrap">
<textarea rows="2" cols="64" class="profile-jot-text form-control text-autosize" id="profile-jot-text" name="body" onFocus="jotTextOpenUI(this);" onBlur="jotTextCloseUI(this);" style="min-width:100%; max-width:100%;">{{if $content}}{{$content}}{{else}}{{$share}}{{/if}}</textarea> <textarea rows="2" cols="64" class="profile-jot-text form-control text-autosize" id="profile-jot-text" name="body" placeholder="{{$share}}" onFocus="jotTextOpenUI(this);" onBlur="jotTextCloseUI(this);" style="min-width:100%; max-width:100%;">{{if $content}}{{$content}}{{/if}}</textarea>
</div> </div>
<ul id="profile-jot-submit-wrapper" class="jothidden nav nav-pills"> <ul id="profile-jot-submit-wrapper" class="jothidden nav nav-pills">
@ -123,9 +123,5 @@ can load different content into the jot moadl (e.g. the item edit jot)
$('iframe').load(function() { $('iframe').load(function() {
this.style.height = this.contentWindow.document.body.offsetHeight + 'px'; this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
}); });
// insert new object with value to aStr
// function jotTextOpenUI does make use of it
aStr.share = "{{$share}}";
</script> </script>

View File

@ -26,7 +26,7 @@
{{/if}} {{/if}}
<div id="jot-text-wrap"> <div id="jot-text-wrap">
{{*<!--<img id="profile-jot-text-loading" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />-->*}} {{*<!--<img id="profile-jot-text-loading" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />-->*}}
<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{if $content}}{{$content}}{{else}}{{$share}}{{/if}}</textarea> <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}">{{if $content}}{{$content}}{{/if}}</textarea>
</div> </div>
<div id="profile-jot-submit-wrapper" class="jothidden"> <div id="profile-jot-submit-wrapper" class="jothidden">

View File

@ -25,7 +25,7 @@
{{/if}} {{/if}}
<div id="jot-text-wrap"> <div id="jot-text-wrap">
<img id="profile-jot-text-loading" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" /> <img id="profile-jot-text-loading" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{if $content}}{{$content}}{{else}}{{$share}}{{/if}}</textarea> <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}">{{if $content}}{{$content}}{{/if}}</textarea>
</div> </div>
<div id="profile-jot-submit-wrapper" class="jothidden"> <div id="profile-jot-submit-wrapper" class="jothidden">

View File

@ -21,7 +21,7 @@
<input type="hidden" name="contact_allow[]" value="<{{$notes_cid}}>" /> <input type="hidden" name="contact_allow[]" value="<{{$notes_cid}}>" />
{{/if}} {{/if}}
<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{if $content}}{{$content}}{{else}}{{$share}}{{/if}}</textarea> <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}">{{if $content}}{{$content}}{{/if}}</textarea>
<ul id="jot-tools" class="jothidden" style="display:none"> <ul id="jot-tools" class="jothidden" style="display:none">
<li><a href="#" onclick="return false;" id="wall-image-upload" title="{{$upload}}">{{$shortupload}}</a></a></li> <li><a href="#" onclick="return false;" id="wall-image-upload" title="{{$upload}}">{{$shortupload}}</a></a></li>

View File

@ -26,9 +26,8 @@
{{/if}} {{/if}}
<div id="jot-text-wrap"> <div id="jot-text-wrap">
<img id="profile-jot-text-loading" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" /><br> <img id="profile-jot-text-loading" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" /><br>
<textarea rows="5" cols="80" class="profile-jot-text" id="profile-jot-text" name="body" > <textarea rows="5" cols="80" class="profile-jot-text" id="profile-jot-text" name="body" placeholder="{{$share}}">
{{if $content}}{{$content}}{{else}}{{$share}} {{if $content}}{{$content}}{{/if}}
{{/if}}
</textarea> </textarea>
</div> </div>