]> git.mxchange.org Git - friendica.git/commitdiff
more tweakage. stylesheet and jot-header
authorSimon L'nu <simon.lnu@gmail.com>
Sun, 4 Mar 2012 17:21:08 +0000 (12:21 -0500)
committerSimon L'nu <simon.lnu@gmail.com>
Sun, 4 Mar 2012 17:21:08 +0000 (12:21 -0500)
Signed-off-by: Simon L'nu <simon.lnu@gmail.com>
view/theme/dispy/jot-header.tpl
view/theme/dispy/style.css

index 23883036b43e8cf1e90abe9dfe3aad486efe2e73..93df84aaebed0bc70671fdbdaa0e213c13e0b6de 100644 (file)
@@ -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>
index 4d5f51eb2e32702260d45d801520da37c8bbc7cd..95bc1c6f7da8b1eb0561e47ff7feeb284b61fdb7 100644 (file)
@@ -918,9 +918,12 @@ aside #viewcontacts {
 #acl-deny-text-end {
        clear: both;
 }
-#jot-title-desc, #profile-jot-desc {
+#jot-title-desc {
        color: #cccccc;
 }
+#profile-jot-desc {
+       color: #a00;
+}
 #jot-title-wrapper {
        margin-bottom: 5px;
 }