aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/dispy/jot-header.tpl
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-04 13:39:53 -0800
committerfriendica <info@friendica.com>2012-03-04 13:39:53 -0800
commit4b1f3555f14ba645f5c05fd61d869e8c3d656c08 (patch)
tree194c4421d934a4e6ed752ceaefff28935088a11a /view/theme/dispy/jot-header.tpl
parentcd5a11bb0f29d94d3503a74cbf974c4eaf0633fe (diff)
parent7d8ed95e782ddc3b94d7f44deb0a73737500ed7e (diff)
downloadvolse-hubzilla-4b1f3555f14ba645f5c05fd61d869e8c3d656c08.tar.gz
volse-hubzilla-4b1f3555f14ba645f5c05fd61d869e8c3d656c08.tar.bz2
volse-hubzilla-4b1f3555f14ba645f5c05fd61d869e8c3d656c08.zip
Merge branch 'pull'
Diffstat (limited to 'view/theme/dispy/jot-header.tpl')
-rw-r--r--view/theme/dispy/jot-header.tpl56
1 files changed, 28 insertions, 28 deletions
diff --git a/view/theme/dispy/jot-header.tpl b/view/theme/dispy/jot-header.tpl
index 23883036b..93df84aae 100644
--- a/view/theme/dispy/jot-header.tpl
+++ b/view/theme/dispy/jot-header.tpl
@@ -104,34 +104,6 @@ function initEditor(cb) {
$(".jothidden").show();
if (typeof cb!="undefined") { cb(); }
-
- // character count part deux
- //
- // get # of chars
- var textlen = $('#profile-jot-text').val().length();
- $('#character-counter').html(textlen);
-
- $('#profile-jot-text').keyup(function() {
- $('#character-counter').removeClass('jothidden');
- if(textlen <= 140) {
- $('#character-counter').removeClass('red');
- $('#character-counter').removeClass('orange');
- $('#character-counter').addClass('grey');
- }
- if((textlen > 140) && (textlen <= 420)) {
- $('#character-counter').removeClass('grey');
- $('#character-counter').removeClass('red');
- $('#character-counter').addClass('orange');
- }
- if(textlen > 420) {
- $('#character-counter').removeClass('grey');
- $('#character-counter').removeClass('orange');
- $('#character-counter').addClass('red');
- }
- // get new len
- $('#character-counter').html($(this).val().length);
- });
-
});
}
});
@@ -146,10 +118,38 @@ function initEditor(cb) {
}
}
+function charCounter() {
+ // character count part deux
+ $('#profile-jot-text').keyup(function(event) {
+ var textlen = $(this).val().length();
+ var maxLen1 = 140;
+ var maxLen2 = 420;
+
+ $('#character-counter').removeClass('jothidden');
+ if(textlen <= maxLen1) {
+ $('#character-counter').removeClass('red');
+ $('#character-counter').removeClass('orange');
+ $('#character-counter').addClass('grey');
+ }
+ if((textlen > maxLen1) && (textlen <= maxLen2)) {
+ $('#character-counter').removeClass('grey');
+ $('#character-counter').removeClass('red');
+ $('#character-counter').addClass('orange');
+ }
+ if(textlen > maxLen2) {
+ $('#character-counter').removeClass('grey');
+ $('#character-counter').removeClass('orange');
+ $('#character-counter').addClass('red');
+ }
+ $('#character-counter').html($(this).val().length);
+ });
+}
+
function enableOnUser(){
if (editor) return;
$(this).val("");
initEditor();
+ charCounter();
}
</script>