Use html5 placeholder for title text input

This commit is contained in:
Fabio Comuni 2012-01-06 09:11:25 +01:00
parent a9670cbb7d
commit efe308b5ac
5 changed files with 49 additions and 61 deletions

View file

@ -873,6 +873,7 @@ function status_editor($a,$x, $notes_cid = 0) {
'$placeholdertitle' => t('Set title'), '$placeholdertitle' => t('Set title'),
'$wait' => t('Please wait'), '$wait' => t('Please wait'),
'$permset' => t('Permission settings'), '$permset' => t('Permission settings'),
'$shortpermset' => t('permissions'),
'$ptyp' => (($notes_cid) ? 'note' : 'wall'), '$ptyp' => (($notes_cid) ? 'note' : 'wall'),
'$content' => '', '$content' => '',
'$post_id' => '', '$post_id' => '',
@ -962,4 +963,4 @@ function find_thread_parent_index($arr,$x) {
if($v['id'] == $x['parent']) if($v['id'] == $x['parent'])
return $k; return $k;
return false; return false;
} }

View file

@ -113,42 +113,10 @@ function enableOnUser(){
$(document).ready(function() { $(document).ready(function() {
<<<<<<< HEAD
/* enable tinymce on focus and click */ /* enable tinymce on focus and click */
$("#profile-jot-text").focus(enableOnUser); $("#profile-jot-text").focus(enableOnUser);
$("#profile-jot-text").click(enableOnUser); $("#profile-jot-text").click(enableOnUser);
=======
/* enable tinymce on focus */
$("#profile-jot-text").focus(function(){
if (editor) return;
$(this).val("");
initEditor();
});
$("#jot-title").mouseout(function() {
$("#jot-title").hide();
var ttl = $("#jot-title").val();
$('#jot-title-display').html(ttl);
if(ttl.length) {
$("#jot-title-display").show();
}
else {
$("#jot-title-desc").show();
}
});
$("#jot-title-display").hover(function() {
$("#jot-title-display").hide();
$("#jot-title").show();
$("#jot-title").focus();
});
$("#jot-title-desc").click(function() {
$("#jot-title-desc").hide();
$("#jot-title").show();
$("#jot-title").focus();
});
>>>>>>> friendica/master
var uploader = new window.AjaxUpload( var uploader = new window.AjaxUpload(
'wall-image-upload', 'wall-image-upload',

View file

@ -70,3 +70,21 @@ input#dfrn-url {
color: #000088; color: #000088;
} }
#jot-perms-icon {
float: left;
}
#jot-title {
background-color: #333333;
border: 1px solid #333333;
}
#jot-title::-webkit-input-placeholder{ color: #555555!important;}
#jot-title:-moz-placeholder{color: #555555!important;}
#jot-title:hover,
#jot-title:focus {
border: 1px solid #cccccc;
}

View file

@ -14,42 +14,37 @@
<input type="hidden" name="coord" id="jot-coord" value="" /> <input type="hidden" name="coord" id="jot-coord" value="" />
<input type="hidden" name="post_id" value="$post_id" /> <input type="hidden" name="post_id" value="$post_id" />
<input type="hidden" name="preview" id="jot-preview" value="0" /> <input type="hidden" name="preview" id="jot-preview" value="0" />
<div id="jot-title-wrapper"> <input name="title" id="jot-title" type="text" placeholder="$placeholdertitle" value="$title" class="jothidden" style="display:none">
<span id="jot-title-desc" style="display: none;">$addtitle</span>
<span id="jot-title-display" style="display: none;"></span>
<input type="text" name="title" id="jot-title" value="" style="display: none;" />
</div>
<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{{ endif }}</textarea> <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea>
{{ if $content }}<script>initEditor();</script>{{ endif }} {{ if $content }}<script>initEditor();</script>{{ endif }}
<div id="profile-jot-submit-wrapper" style="display:none"> <div id="profile-jot-submit-wrapper" class="jothidden">
<div id="profile-upload-wrapper" style="display: $visitor;" > <div id="profile-upload-wrapper" style="display: $visitor;" >
<div id="wall-image-upload-div" ><a href="#" onclick="return false;" id="wall-image-upload" class="camera" title="$upload">image upload</a></div> <div id="wall-image-upload-div" ><a href="#" onclick="return false;" id="wall-image-upload" class="camera" title="$upload">$shortupload</a></div>
</div> </div>
<div id="profile-attach-wrapper" style="display: $visitor;" > <div id="profile-attach-wrapper" style="display: $visitor;" >
<div id="wall-file-upload-div" ><a href="#" onclick="return false;" id="wall-file-upload" class="attach" title="$attach">attach file</a></div> <div id="wall-file-upload-div" ><a href="#" onclick="return false;" id="wall-file-upload" class="attach" title="$attach">$shortattach</a></div>
</div> </div>
<div id="profile-link-wrapper" style="display: $visitor;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" > <div id="profile-link-wrapper" style="display: $visitor;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" >
<a id="profile-link" class="link" title="$weblink" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;">enter link</a> <a id="profile-link" class="link" title="$weblink" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;">$shortweblink</a>
</div> </div>
<div id="profile-video-wrapper" style="display: $visitor;" > <div id="profile-video-wrapper" style="display: $visitor;" >
<a id="profile-video" class="video" title="$video" onclick="jotVideoURL();return false;">video url</a> <a id="profile-video" class="video" title="$video" onclick="jotVideoURL();return false;">$shortvideo</a>
</div> </div>
<div id="profile-audio-wrapper" style="display: $visitor;" > <div id="profile-audio-wrapper" style="display: $visitor;" >
<a id="profile-audio" class="audio" title="$audio" onclick="jotAudioURL();return false;">audio url</a> <a id="profile-audio" class="audio" title="$audio" onclick="jotAudioURL();return false;">$shortaudio</a>
</div> </div>
<div id="profile-location-wrapper" style="display: $visitor;" > <div id="profile-location-wrapper" style="display: $visitor;" >
<a id="profile-location" class="globe" title="$setloc" onclick="jotGetLocation();return false;">set location</a> <a id="profile-location" class="globe" title="$setloc" onclick="jotGetLocation();return false;">$shortsetloc</a>
</div> </div>
<div id="profile-nolocation-wrapper" style="display: none;" > <div id="profile-nolocation-wrapper" style="display: none;" >
<a id="profile-nolocation" class="noglobe" title="$noloc" onclick="jotClearLocation();return false;">no location</a> <a id="profile-nolocation" class="noglobe" title="$noloc" onclick="jotClearLocation();return false;">$shortnoloc</a>
</div> </div>
<div id="profile-jot-perms" class="profile-jot-perms" style="display: $pvisit;" > <div id="profile-jot-perms" class="profile-jot-perms" style="display: $pvisit;" >
<a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="$lockstate" title="$permset" >permissions</a>$bang <a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="$lockstate" title="$permset" >$shortpermset</a>$bang
</div> </div>
<input type="submit" id="profile-jot-submit" name="submit" value="$share" /> <input type="submit" id="profile-jot-submit" name="submit" value="$share" />
<div id="profile-jot-perms-end"></div> <div id="profile-jot-perms-end"></div>

View file

@ -269,22 +269,28 @@ div.wall-item-content-wrapper.shiny {
float: left; float: left;
} }
#jot-title-desc {
color: #cccccc;
}
#jot-title-wrapper {
margin-bottom: 5px;
}
#jot-title-display {
font-weight: bold;
}
#jot-title { #jot-title {
border: 1px solid #cccccc; border: 0px;
width: 530px; margin: 0px;
height: 20px;
width: 90%;
font-weight: bold;
border: 1px solid #ffffff;
} }
#jot-title::-webkit-input-placeholder{font-weight: normal;}
#jot-title:-moz-placeholder{font-weight: normal;}
#jot-title:hover,
#jot-title:focus {
border: 1px solid #cccccc;
}
.jothidden { display:none; }
.fakelink, .fakelink:visited, .fakelink:link { .fakelink, .fakelink:visited, .fakelink:link {
color: #3465a4; color: #3465a4;
text-decoration: none; text-decoration: none;
@ -1540,7 +1546,7 @@ input#dfrn-url {
padding: 3px 0px 0px 5px; padding: 3px 0px 0px 5px;
-moz-border-radius: 3px; -moz-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
width: 100%;
} }