Merge pull request #2937 from rabuzarus/1811_jot_charackter_counter

frio: add a very simple character counter to the jot
This commit is contained in:
Tobias Diekershoff 2016-11-19 19:37:42 +01:00 committed by GitHub
commit ba24b1b651
3 changed files with 128 additions and 127 deletions

View file

@ -1157,6 +1157,9 @@ section #jotOpen {
#profile-jot-wrapper button#jot-submit {
margin-top: 5px;
}
#profile-jot-wrapper #character-counter {
padding: 10px 15px;
}
/* ACL */
/*#jot-modal-body {

View file

@ -1,14 +1,12 @@
<script type="text/javascript" src="{{$baseurl}}/js/ajaxupload.js" ></script>
{{*<script language="javascript" type="text/javascript">*}}
<script type="text/javascript">
var editor=false;
var textlen = 0;
var plaintext = '{{$editselect}}';
<script>
var editor=false;
var textlen = 0;
var plaintext = '{{$editselect}}';
function initEditor(cb){
function initEditor(cb){
if (editor==false){
$("#profile-jot-text-loading").show();
if(plaintext == 'none') {
@ -26,6 +24,10 @@ function initEditor(cb){
});
$(".jothidden").show();
if (typeof cb!="undefined") cb();
$("#profile-jot-text").keyup(function(){
var textlen = $(this).val().length;
$('#character-counter').text(textlen);
});
return;
}
tinyMCE.init({
@ -123,20 +125,16 @@ function initEditor(cb){
} else {
if (typeof cb!="undefined") cb();
}
}
}
function enableOnUser(){
function enableOnUser(){
if (editor) return;
//$(this).val("");
initEditor();
}
}
</script>
<script type="text/javascript" src="{{$baseurl}}/js/ajaxupload.js" ></script>
<script>
<script type="text/javascript">
var ispublic = '{{$ispublic}}';

View file

@ -38,7 +38,6 @@
<form id="profile-jot-form" action="{{$action}}" method="post">
<div id="profile-jot-wrapper">
<div>
<div id="character-counter" class="grey jothidden text-info pull-left"></div>
<!--<div id="profile-jot-desc" class="jothidden pull-right">&nbsp;</div>-->
</div>
@ -80,6 +79,7 @@
-->
<li class="pull-right"><button class="btn btn-primary" id="jot-submit" type="submit" id="profile-jot-submit" name="submit" ><i class="fa fa-slideshare fa-fw"></i> {{$share}}</button></li>
<li id="character-counter" class="grey jothidden text-info pull-right"></li>
<div id="profile-rotator-wrapper" style="display: {{$visitor}};" >
<img id="profile-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
</div>