something not right i just noticed about word counter
2 posters
Page 1 of 1
something not right i just noticed about word counter
1 i`m sorry for this to much requests i just noticed
the word counter at solved topic
https://help.forumotion.com/t131746-problem-in-add-a-word-counter-to-the-editor
dose recognize space and the new line (Enter)
the orginal code that dose not recognize arabic letters
id dose not count the spaces or the new lines
so if that possible and i say if it possible to make it never count spaces
this will be really great if only possible
and last thing sorry for being request many requests
the word counter at solved topic
https://help.forumotion.com/t131746-problem-in-add-a-word-counter-to-the-editor
dose recognize space and the new line (Enter)
the orginal code that dose not recognize arabic letters
id dose not count the spaces or the new lines
so if that possible and i say if it possible to make it never count spaces
this will be really great if only possible
and last thing sorry for being request many requests
Last edited by Michael_vx on March 25th 2014, 1:50 am; edited 1 time in total (Reason for editing : fix my worng spel)
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: something not right i just noticed about word counter
okay i`m guessing that is not posible
or its not easy as it looks
or its not easy as it looks
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: something not right i just noticed about word counter
Hello,
Replace the script by :
Replace the script by :
- Code:
$(function(){$(function(){
var MinNumberOfChars = 50;
var ico_compl = "http://i73.servimg.com/u/f73/18/10/89/49/ok-gre10.png";
var ico_incompl = "http://i73.servimg.com/u/f73/18/10/89/49/exclam10.png";
if($("#text_editor_textarea").length != 0){
$("input[type='submit'][name='post']").attr("disabled", true).css("opacity", "0.5");
$(".sceditor-container").after("<br/><div id='div_minchars' align='center'><div id='div_minchars_header'> Minimum characters to send a message: " + MinNumberOfChars + " </div><div id='div_minchars_info'></div></div>");
var sceditor = $("#text_editor_textarea").sceditor("instance");
var str = sceditor.val().replace(/ |\n/g,'');
var str_len = str.length;
if(str_len >= MinNumberOfChars) $("input[type='submit'][name='post']").attr("disabled", false).css("opacity", "1");
sceditor.keyUp(function(e) {
str = sceditor.val().replace(/ |\n/g,'');
str_len = str.length;
if(str_len >= MinNumberOfChars) {
$("#div_minchars_info").html("You've written <span style='color:green'>" + str_len + "</span> character(s). You can now send the message <img src='" + ico_compl + "' />");
$("input[type='submit'][name='post']").attr("disabled", false).css("opacity", "1");
}else{
$("#div_minchars_info").html("You've written <span style='color:red'>" + str_len + "</span> character(s). You need " + (MinNumberOfChars - str_len) + " character(s) to send this message <img src='" + ico_incompl + "' />");
$("input[type='submit'][name='post']").attr("disabled", true).css("opacity", "0.5");
}
});
}
})});
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: something not right i just noticed about word counter
Try this :
If that does not work, could you provide me a message that has that spacing ?
- Code:
$(function(){$(function(){
var MinNumberOfChars = 50;
var ico_compl = "http://i73.servimg.com/u/f73/18/10/89/49/ok-gre10.png";
var ico_incompl = "http://i73.servimg.com/u/f73/18/10/89/49/exclam10.png";
if($("#text_editor_textarea").length != 0){
$("input[type='submit'][name='post']").attr("disabled", true).css("opacity", "0.5");
$(".sceditor-container").after("<br/><div id='div_minchars' align='center'><div id='div_minchars_header'> Minimum characters to send a message: " + MinNumberOfChars + " </div><div id='div_minchars_info'></div></div>");
var sceditor = $("#text_editor_textarea").sceditor("instance");
var str = sceditor.val().replace(/ |\n|\s+/g,'');
var str_len = str.length;
if(str_len >= MinNumberOfChars) $("input[type='submit'][name='post']").attr("disabled", false).css("opacity", "1");
sceditor.keyUp(function(e) {
str = sceditor.val().replace(/ |\n|\s+/g,'');
str_len = str.length;
if(str_len >= MinNumberOfChars) {
$("#div_minchars_info").html("You've written <span style='color:green'>" + str_len + "</span> character(s). You can now send the message <img src='" + ico_compl + "' />");
$("input[type='submit'][name='post']").attr("disabled", false).css("opacity", "1");
}else{
$("#div_minchars_info").html("You've written <span style='color:red'>" + str_len + "</span> character(s). You need " + (MinNumberOfChars - str_len) + " character(s) to send this message <img src='" + ico_incompl + "' />");
$("input[type='submit'][name='post']").attr("disabled", true).css("opacity", "0.5");
}
});
}
})});
If that does not work, could you provide me a message that has that spacing ?
Re: something not right i just noticed about word counter
okay here is some thing
text wrote:
17 spaces hould be in the uper line
جملة بالاحرف العربية
the WYSIWIG mode is on
when i tried with out WYSIWIG its never count the spaces
and the WYSIWIG mode is needed to be on so if that possible
then i`m counting on you :Dif you don`t mind
one thing the 3rd just arabic letters
new add
i find out the problem its when i use bold or center if i didn`t use it it works fine
so i think the code must not count [b] and [b/] and [senter] and [center/] and should works fine
when i tried with out WYSIWIG its never count the spaces
and the WYSIWIG mode is needed to be on so if that possible
then i`m counting on you :Dif you don`t mind
one thing the 3rd just arabic letters
new add
i find out the problem its when i use bold or center if i didn`t use it it works fine
so i think the code must not count [b] and [b/] and [senter] and [center/] and should works fine
Last edited by Michael_vx on March 25th 2014, 5:14 am; edited 2 times in total (Reason for editing : add new note)
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: something not right i just noticed about word counter
Oh you don't want the tags to be counted ? This should do it :
That is most likely why the character count increases.
- Code:
$(function(){$(function(){
var MinNumberOfChars = 50;
var ico_compl = "http://i73.servimg.com/u/f73/18/10/89/49/ok-gre10.png";
var ico_incompl = "http://i73.servimg.com/u/f73/18/10/89/49/exclam10.png";
if($("#text_editor_textarea").length != 0){
$("input[type='submit'][name='post']").attr("disabled", true).css("opacity", "0.5");
$(".sceditor-container").after("<br/><div id='div_minchars' align='center'><div id='div_minchars_header'> Minimum characters to send a message: " + MinNumberOfChars + " </div><div id='div_minchars_info'></div></div>");
var sceditor = $("#text_editor_textarea").sceditor("instance");
var str = sceditor.val().replace(/ |\n|\s+|\[.*?\]|\[\/.*?\]/g,'');
var str_len = str.length;
if(str_len >= MinNumberOfChars) $("input[type='submit'][name='post']").attr("disabled", false).css("opacity", "1");
sceditor.keyUp(function(e) {
str = sceditor.val().replace(/ |\n|\s+|\[.*?\]|\[\/.*?\]/g,'');
str_len = str.length;
if(str_len >= MinNumberOfChars) {
$("#div_minchars_info").html("You've written <span style='color:green'>" + str_len + "</span> character(s). You can now send the message <img src='" + ico_compl + "' />");
$("input[type='submit'][name='post']").attr("disabled", false).css("opacity", "1");
}else{
$("#div_minchars_info").html("You've written <span style='color:red'>" + str_len + "</span> character(s). You need " + (MinNumberOfChars - str_len) + " character(s) to send this message <img src='" + ico_incompl + "' />");
$("input[type='submit'][name='post']").attr("disabled", true).css("opacity", "0.5");
}
});
}
})});
That is most likely why the character count increases.
Re: something not right i just noticed about word counter
solved
forgive my idiocy i didn`t know that the bold or center could the problem
thanks again solved 100%
i just tested
i don`t know how to thank you really i don`t know
thanks and 1 billion thanks
forgive my idiocy i didn`t know that the bold or center could the problem
thanks again solved 100%
i just tested
i don`t know how to thank you really i don`t know
thanks and 1 billion thanks
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: something not right i just noticed about word counter
You're welcome and don't worry about, the good thing is we figured out what was causing the extra characters.
Topic solved and archived
Topic solved and archived
Similar topics
» Word Counter in another language
» Help with word counter?
» Editor Word Counter
» about word counter
» just one last change at the word counter
» Help with word counter?
» Editor Word Counter
» about word counter
» just one last change at the word counter
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum