What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Release] Punctuator

[Release] Punctuator
Author: Message:
Cleofide
New Member
*


Posts: 1
30 / Male / Flag
Joined: Aug 2008
RE: [Release] Punctuator
Hi,

As some people might have noticed, adding punctuation to an URL often results in getting a wrong or improper link, especially when it contains variables.

Thus, http://www.youtube.com/watch?v is turned into Http://www.Youtube.Com/watch?V because of the ? (not here, but if you add a variable, it will), generating an erroneous link. As those alterations caused me some snags, I concluded to add a slight modification.

Despite that I use a French version of Punctuator, I think it should work with the English one; I haven't tested it yet though.

Just after the var stuff ends, add:

code:
var exp2=new RegExp("http", "gi");
if (sMessage_.search(exp2)==-1) {

And then conclude with:
code:
}
at the very end. You should get something like:

code:
function OnEvent_ChatWndSendMessage(pChatWnd, sMessage){
sMessage_ = sMessage
sLast = sMessage_.substr(sMessage_.length-1,1)
var exp=new
RegExp("[a-zA-Z0-9éèêëàáâäóòôöíìîïçÉÈÊËÀÁÂÄÒÓÔÖÌÍÎÏÇ-]+","g");
var Mots=sMessage_.match(exp)

var exp2=new RegExp("http", "gi");
if (sMessage_.search(exp2)==-1) {

    if (Mots.length == 1) {}
    else if (sLast != "!" && sLast != "?" && sLast != ".")
        {sMessage = sMessage_.substr(0,1).toUpperCase() + sMessage_.substr(1) + '.';}
    else
        {sMessage = sMessage_.substr(0,1).toUpperCase() + sMessage_.substr(1);}
   
    sMessage_ = sMessage
   
    for (i=0; i<sMessage.length; i++)
        if (sMessage.substr(i,1) == "!" || sMessage.substr(i,1) == "?" || sMessage.substr(i,1) == ".") {
            u=(i+1);
            while (u<sMessage.length && sMessage_.substr(u,1)==" ") {
            u++;
            }
            sMessage = sMessage_.substr(0,u)+sMessage_.substr(u,1).toUpperCase()+sMessage_.substr(u+1)
            sMessage_ = sMessage
        }
   
         return sMessage;
    }
}


Thought it was gonna be a tough nut to crack, but no.

This post was edited on 08-18-2008 at 12:16 PM by Cleofide.
08-18-2008 12:09 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Release] Punctuator - by Jimbo on 11-30-2006 at 05:13 PM
RE: [Release] Punctuator - by Pure_BY on 11-30-2006 at 11:03 PM
RE: [Release] Punctuator - by Spunky on 11-30-2006 at 11:47 PM
RE: [Release] Punctuator - by aNILEator on 12-01-2006 at 12:23 AM
RE: [Release] Punctuator - by Voldemort on 12-01-2006 at 12:40 AM
RE: [Release] Punctuator - by TechkNighT on 03-16-2007 at 11:28 AM
RE: [Release] Punctuator - by riahc4 on 03-21-2007 at 08:22 PM
RE: [Release] Punctuator - by Jimbo on 03-22-2007 at 07:42 AM
RE: [Release] Punctuator - by vikke on 03-22-2007 at 02:10 PM
RE: [Release] Punctuator - by the DtTvB on 03-22-2007 at 02:39 PM
RE: [Release] Punctuator - by Mizgoody2shoes92 on 06-23-2007 at 03:30 AM
RE: [Release] Punctuator - by Zahid™ on 06-23-2007 at 08:18 AM
RE: [Release] Punctuator - by Vampire_Kitty on 09-19-2007 at 07:31 PM
RE: [Release] Punctuator - by TimJ07 on 01-30-2008 at 07:58 AM
RE: [Release] Punctuator - by Swanny on 07-11-2008 at 07:45 AM
RE: [Release] Punctuator - by aNILEator on 07-11-2008 at 08:34 AM
RE: [Release] Punctuator - by Th3rmal on 07-11-2008 at 08:47 AM
RE: [Release] Punctuator - by Swanny on 07-11-2008 at 10:43 AM
RE: [Release] Punctuator - by vaccination on 07-11-2008 at 10:30 PM
[update] Punctuator - by roflmao456 on 07-12-2008 at 04:52 AM
RE: [update] Punctuator - by XAaronX on 09-21-2008 at 02:04 AM
RE: [Release] Punctuator - by Swanny on 07-13-2008 at 01:55 PM
RE: [Release] Punctuator - by roflmao456 on 07-13-2008 at 04:39 PM
RE: [Release] Punctuator - by Jimbo on 07-13-2008 at 08:40 PM
RE: [Release] Punctuator - by roflmao456 on 07-13-2008 at 09:32 PM
RE: [Release] Punctuator - by aNILEator on 07-14-2008 at 05:17 AM
RE: [Release] Punctuator - by Cleofide on 08-18-2008 at 12:09 PM
RE: [Release] Punctuator - by Spunky on 08-18-2008 at 01:20 PM
RE: [Release] Punctuator - by BüYüCü on 09-29-2008 at 07:04 PM
RE: [Release] Punctuator - by XAaronX on 01-31-2009 at 04:53 AM
RE: [Release] Punctuator - by AylaAsperger on 04-28-2009 at 08:35 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On