just one last change at the word counter
4 posters
Page 1 of 1
just one last change at the word counter
i know i`m asking too much these days so forgive me please
the last solved topic
https://help.forumotion.com/t131805-something-not-right-i-just-noticed-about-word-counter
the one more change needed is like the tags i want the code also never count images if that possible so only words and letters with out tags and images
sorry for that too much requests
but i must say with help.forumotion
i found the best support
one more thing
i think smilies is same as images so if images wont count smilies wont be counted too
again
sorry for that too much requests
the last solved topic
https://help.forumotion.com/t131805-something-not-right-i-just-noticed-about-word-counter
the one more change needed is like the tags i want the code also never count images if that possible so only words and letters with out tags and images
sorry for that too much requests
but i must say with help.forumotion
i found the best support
one more thing
i think smilies is same as images so if images wont count smilies wont be counted too
again
sorry for that too much requests
Last edited by Michael_vx on March 29th 2014, 3:06 am; edited 3 times in total (Reason for editing : Fix wrong spelling + solved)
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: just one last change at the word counter
The smiles are two or more characters so that would be a bit difficult to match and remove them all. Try this for the images though :
- 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+|\[img\].*?\[\/img\]|\[.*?\]|\[\/.*?\]|/gi,'');
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+|\[img\].*?\[\/img\]|\[.*?\]|\[\/.*?\]|/gi,'');
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");
}
});
}
})});
Re: just one last change at the word counter
first thanks so much for add
2nd if most of my smiles are used to be
and not direct letters that might make it easy
almost all of my smiles are between : :
2nd if most of my smiles are used to be
and not direct letters that might make it easy
almost all of my smiles are between : :
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: just one last change at the word counter
emoticons that use the following text should not count :
:emoticon:
Replace your script with :
:emoticon:
Replace your script with :
- 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+|\[img\].*?\[\/img\]|\[.*?\]|\[\/.*?\]|:.*?:/gi,'');
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+|\[img\].*?\[\/img\]|\[.*?\]|\[\/.*?\]|:.*?:/gi,'');
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");
}
});
}
})});
Re: just one last change at the word counter
Umm.. Ange I have a request, can you put the modified codes from various topics in the main tutorial as well? coz I have temporarily removed this system and I will implement and would need to search all these threads again..
Thanks
Thanks
Re: just one last change at the word counter
reall thanks here in help.forumotion is the best support
solved nothing but normal letters are in the count
i`m sure there will be nothing will be needed more
and sorry for that too much requests
solved nothing but normal letters are in the count
i`m sure there will be nothing will be needed more
and sorry for that too much requests
Michael_vx- Forumember
- Posts : 659
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: just one last change at the word counter
Topic Solved & Archived
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» Word Counter Issue
» Word Counter in another language
» about word counter
» Help with word counter?
» something not right i just noticed about word counter
» Word Counter in another language
» about word counter
» Help with word counter?
» something not right i just noticed about word counter
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum