What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Auto Web Address Opener

1 votes - 5 average   Auto Web Address Opener
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Auto Web Address Opener
Javascript code:
var oChatWnds = {}
 
function OnEvent_ChatWndSendMessage( pChatWnd, sMessage ){
    oChatWnds[ pChatWnd.Handle ] = sMessage;
}
 
 
function OnEvent_ChatWndReceiveMessage( pChatWnd, sOrigin, sMessage, nMessageKind ){
    if ( oChatWnds[ pChatWnd.Handle ] === sMessage ) return;
    var regexp = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
    var urls = sMessage.match(regexp);
   
    if ( urls.length === 0 ) return;
   
    var oWnd = MsgPlus.CreateWnd( 'wUrlOpener', 'Window.xml' );
    for ( var url in urls ) oWnd.LstView_AddItem( 'LvUrls', urls[url] );
}
 
function OnEvent_ChatWndDestroyed( pChatWnd ){
    delete oChatWnds[ pChatWnd.Handle ];
}
 
function OnwUrlOpenerEvent_CtrlClicked( pPlusWnd, sControlId ){
    if(sControlId.match(/^BaseBtn/)) return;
   
    for (var j=0; j<pPlusWnd.LstView_GetCount('LvUrls'); j++){
            if (pPlusWnd.LstView_GetCheckedState('LvUrls', j)){
                Debug.Trace( pPlusWnd.LstView_GetItemText('LvUrls', j , 0) );
               
                /**
                    Open the windows here
                **/

            }
        }
       
    }
}


XML code:
<?xml version="1.0" encoding="UTF-16"?>
<Interfaces xmlns="urn:msgplus:interface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:msgplus:interface PlusInterface.xsd" Name="urlOpener">
    <Window Id="wUrlOpener" Version="1">
        <Attributes>
            <Caption>URL Opener</Caption>
        </Attributes>
        <TitleBar>
            <Title><Text></Text></Title>
        </TitleBar>
        <Position Width="350" Height="213">
            <Resizeable Allowed="BothSides">
                <MinWidth>250</MinWidth>
                <MinHeight>158</MinHeight>
            </Resizeable>
        </Position>
        <DialogTmpl>
            <BottomBar Style="Plain">
                <LeftControls>
                    <Control xsi:type="ButtonControl" Id="BtnCancel">
                        <Position Left="0" Top="0" Width="50"/>
                        <Caption>&amp;Cancel</Caption>
                    </Control>
                </LeftControls>
                <RightControls>
                    <Control xsi:type="ButtonControl" Id="BtnSend">
                        <Position Left="0" Top="0" Width="75"/>
                        <Caption>&amp;Open URL(s)</Caption>
                    </Control>
                </RightControls>
            </BottomBar>
        </DialogTmpl>
        <Controls>
            <Control xsi:type="StaticControl" Id="lblTitle">
                <Position Top="3" Left="5" Width="210" Height="10"/>
                <Caption>Select a URL to open</Caption>
                <Attributes>
                    <AutoAdjustWidth>true</AutoAdjustWidth>
                </Attributes>
            </Control>
            <Control xsi:type="ListViewControl" Id="LvUrls">
                <Position Top="15" Left="5" Width="330" Height="126">
                    <Anchor Horizontal="LeftRightFixed" Vertical="TopBottomFixed"/>
                </Position>
                <Attributes>
                    <AutoTip>true</AutoTip>
                    <AlwaysShowSelection>True</AlwaysShowSelection>
                </Attributes>
                <ReportView>
                    <FullRowSelect>True</FullRowSelect>
                    <HasCheckboxes>True</HasCheckboxes>
                </ReportView>
                <Images>
                <Columns WidthFormat="Absolute">
                    <Column>
                        <ColumnId>ColUrl</ColumnId>
                        <Label>URLs</Label>
                        <Width>250</Width>
                    </Column>
                </Columns>
            </Control>
        </Controls>
    </Window>
</Interfaces>


Clearly I was bored...

This post was edited on 04-01-2009 at 03:40 PM by matty.
04-01-2009 01:12 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Auto Web Address Opener - by Barneyvxd on 03-31-2009 at 10:29 PM
RE: Auto Web Address Opener - by rtsfg on 04-01-2009 at 10:56 AM
RE: Auto Web Address Opener - by James Potter on 04-01-2009 at 11:19 AM
RE: Auto Web Address Opener - by Spunky on 04-01-2009 at 12:18 PM
RE: Auto Web Address Opener - by matty on 04-01-2009 at 01:12 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