aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/dispy/jot-header.tpl
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-03-05 15:55:17 -0500
committerSimon L'nu <simon.lnu@gmail.com>2012-03-05 15:55:17 -0500
commit9d461846e28f90b120292a900af1328e275496ce (patch)
tree1cccb62a24f0a45e99577b7e10bd3e96de5ab16d /view/theme/dispy/jot-header.tpl
parent7f894794e4ecc820a2430a7c4362d60f0de63020 (diff)
downloadvolse-hubzilla-9d461846e28f90b120292a900af1328e275496ce.tar.gz
volse-hubzilla-9d461846e28f90b120292a900af1328e275496ce.tar.bz2
volse-hubzilla-9d461846e28f90b120292a900af1328e275496ce.zip
multiple fixes; the jot-header works as standalone, not sure what's up.
Signed-off-by: Simon L'nu <simon.lnu@gmail.com>
Diffstat (limited to 'view/theme/dispy/jot-header.tpl')
-rw-r--r--view/theme/dispy/jot-header.tpl69
1 files changed, 35 insertions, 34 deletions
diff --git a/view/theme/dispy/jot-header.tpl b/view/theme/dispy/jot-header.tpl
index 84f152340..e72000b4c 100644
--- a/view/theme/dispy/jot-header.tpl
+++ b/view/theme/dispy/jot-header.tpl
@@ -1,7 +1,8 @@
+<script type="text/javascript" src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
+<script type="text/javascript" src="$baseurl/js/ajaxupload.js"></script>
+<script type="text/javascript">
-<script language="javascript" type="text/javascript">
-
-var editor=false;
+var editor = false;
var textlen = 0;
var plaintext = '$editselect';
// this is here because of the silly tinymce error. didn't help.
@@ -113,47 +114,16 @@ function initEditor(cb) {
}
}
-function charCounter() {
- // character count part deux
- $('#profile-jot-text').keyup(function(event) {
- var textlen = $('#profile-jot-text').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($('#profile-jot-text').val().length);
- });
-}
-
function enableOnUser(){
if (editor) return;
$(this).val("");
initEditor();
}
-</script>
-<script type="text/javascript" src="$baseurl/js/ajaxupload.js" ></script>
-<script>
var ispublic = '$ispublic';
var addtitle = '$addtitle';
$(document).ready(function() {
-
/* enable tinymce on focus and click */
$("#profile-jot-text").focus(enableOnUser);
$("#profile-jot-text").click(enableOnUser);
@@ -309,5 +279,36 @@ function enableOnUser(){
$geotag
+ function charCounter() {
+ // character count part deux
+ //$(this).val().length is not a function Line 282(3)
+ $('#profile-jot-text').keyup(function() {
+ var textlen = 0;
+ var maxLen1 = 140;
+ var maxLen2 = 420;
+
+ $('#character-counter').removeClass('jothidden');
+
+ textLen = $(this).val().length;
+ 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').text( textLen );
+ });
+ $('#profile-jot-text').keyup();
+ }
+
</script>