1. Howdy! Welcome to our community of more than 125.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
    Dismiss Notice
  2. Add your web host to our brand new web hosting directory (beta).
    Dismiss Notice

Vista Sidebar Gadgets

Discussion in 'Selected best free scripts' started by krakjoe, May 19, 2007.

  1. krakjoe

    krakjoe stop staring NLC

    Anyone made any yet ???

    They are just javascript and html .....

    Heres a little one I made to get information about my wireless network

    Do this :

    Win Key + R
    %userprofile%\AppData\Local\Microsoft\Windows Sidebar\Gadgets
    Create a folder named Wifi-info.Gadget
    Create a file inside the above folder named "Wifi-info.html"

    HTML:
    <html>
    <head>
        <title>Wifi-info</title>
        <style>
            body
            {
                width: 130px;
                height: 100%;
                text-align: center;
                font-family: Tahoma;
                font-size: 10pt;
                position: absolute;
            }
        </style>
        <script language="javascript">
        
        var ssid ;
        var secure ;
        var ip ;
        
        function load( )
        {
    		if( ssid )
    		{
    			ssidContent.innerText = ssid ;
    			secureContent.innerText = secure ? 'Secure Network' : 'Insecure';	
    			signalContent.innerText = 'Signal : ' + strength + '%';
    			addressContent.innerText = 'IP : ' + address ;
    		}
    		else
    		{
    			ssidContent.innerText = 'Not Connected';
    			secureContent.innerText = '';
    			signalContent.innerText = '';
    			addressContent.innerText = '';
    		}
    	}
    	function detect( )
    	{
    	 	window.setTimeout( 'detect()', 1000 );
    		ssid = System.Network.Wireless.ssid ;
    		if( ssid )
    		{
    			strength = System.Network.Wireless.signalStrength ;
    			address = System.Network.Wireless.address ;
    			secure = System.Network.Wireless.secureConnection ;	
    		}
    		load( );
    	}
        </script>
    </head>
    <body onload="detect( );">
    <span id="ssidContent"></span>
    <br />
    <span id="secureContent"></span>
    <br />
    <span id="signalContent"></span>
    <br />
    <span id="addressContent"></span>
    </body>
    </html>
    
    Create another file named "gadget.xml"

    HTML:
    <?xml version="1.0" encoding="utf-8" ?>
    <gadget>
        <name>Wifi-Info</name>
        <namespace>Wifi-Info</namespace>
        <version>1.0.0.0</version>
        <author name="Joe Watkins aka krakjoe">
            <info url="www.krakjoe.com" />
        </author>
        <copyright>© 2008-2010 J Watkins</copyright>
        <description>Simple Wifi Monitor</description>
        <hosts>
            <host name="sidebar">
                <base type="HTML" apiVersion="1.0.0" src="Wifi-info.html" />
                <permissions>Full</permissions>
                <platform minPlatformVersion="1.0" />
            </host>
        </hosts>
    </gadget>
    
    Now open the sidebar, and it'll be in the list of gadgets [ + at top of screen ]

    Seriously, I think microsoft got it right for once, javascript is REAL easy to use and if I knew how to make things look nice that would be real easy too.....

    Anyone have any suggestions for cool gadgets, I'm ---- at coming up with ideas .....
     
  2. Matt8

    Matt8 All? No, ALL! NLC

    Have a screeny of your gadget?

    I had an idea for one but I have no idea if it would be simple or not. Something that would check the number of Unread posts at various forums, like here and refresh by itself. Now that would make me more productive!
     
  3. krakjoe

    krakjoe stop staring NLC

    I can do that, you can use ajax so it's possible to achieve it I think, I'll mess around for a while.....

    The one I made so far is real plain, just a white box with the information about my wifi network in it ....

    http://krakjoe.com/images/Wifi-info.png

    I'm gonna have a mess about to see if it'll make ajax requests across networks without giving error messages, ajax can do that, but in interenet explorer the requests are blocked to squash xss, I don't imagine it to be a problem the weather gadget will be doing exactly that .....

    EDIT:

    Wait ......
     
    Last edited: May 19, 2007
  4. krakjoe

    krakjoe stop staring NLC

    I did it ....

    that tells you new posts since last visit and number of pms, however it only works for fws as the data is different on this website to other vb forums .....

    http://krakjoe.com/images/FWStatos.png preview .....

    just gonna put some finishing touches on it, couple of bugs arisen .....
     
    Last edited: May 19, 2007
  5. Matt8

    Matt8 All? No, ALL! NLC

    You are the man, simply put.

    Finish it up and hook me up with the download link!!!! I'd give you a +rep but I can't yet...
     
  6. krakjoe

    krakjoe stop staring NLC

    http://krakjoe.com/FWStatos.gadget

    I think that's it .... we'll see how it goes, the "Frequency" in the settings part is seconds inbetween requests not minutes........

    I have too go to bed, it's half two in the morning .... I'm shattered.....
     
    Karlo S likes this.
  7. Matt8

    Matt8 All? No, ALL! NLC

    Awesome. Love it. My only recommendation would be that you could click on it and launch freewebspace.net/forums

    Love it man, seriously.
     
  8. stuffradio

    stuffradio Super Moderator#1 NLC

    Well... I might have a look at developing some gadgets... just upgraded to Home Premium from a RC1 version Rofl, I must say... way more stable and quicker too! :lol:

    Edit:

    wth do you need all that code for in prototype.js? It makes me cry :)
     
    Last edited: May 20, 2007
  9. krakjoe

    krakjoe stop staring NLC

    done, download it again and as if by magic your wish will come true ....

    I'm glad you like it, it was fun to make .......

    @stuff .... prototype is hardly ever needed completely, it's a habit of mine when I work with ( marginally ) complicated js - not to reinvent the wheel everytime, prototype has a LOT of very useful functions, it's always good to have around.....although the js code for communication is only a few lines, had I coded it entirely myself without prototype it would be far far more .......
     
  10. Matt8

    Matt8 All? No, ALL! NLC

    You have definitely earned a spot in my vista sidebar. Thanks a ton.
     
  11. krakjoe

    krakjoe stop staring NLC

    I'm trying to rewrite it, but for some reason, krakjoe.com is allowed to post data to here, but localhost ( 127.0.0.1 ) isn't, see at the moment, I wrote a sort of "Webservice" for it, as you would if you were using asp.net ajax ( which is what you should do ), the code for the service is good, and it's working really well ( as you know ) I'm just a little worried about security, don't panic, it's as secure as code can be, it would be far better for your own computer to make the requests though ......

    I don't see the difference between your pc making a request automatically and you making request physically on the site ( browsing ), I don't suppose you know anything about the rules surrounding posting data to here ???

    I want to make some more "features" like the ability to change your usertitle to something else, as I noticed you stay logged in even when you're not here, simply because you keep creating a session to get the data you want, and also, the ability to stop polling would be good ( you can set the frequency below 30 to do that, but still a button would be nice ), and the ability to carry on the session ( when you click on the gadget, it logs you in ), I can't do that with a webservice, the session is invalid for the ip, but if I can generate a session with javascripts only, then I can store the session id and append it to the url when you click on the gadget like ?s=sessionid

    Can someone tell me why I can't post, it's quite unlikely I'm doing something wrong I think ...... also why can krakjoe.com post here ??? ( for the love of god don't change that ) ?????

    If you don't know the answer to that, you have any more ideas ??? couple of hours to kill tonight .....
     
    Last edited: May 20, 2007
  12. iBrightDev

    iBrightDev Jay Street NLC NLC

    Joe, I love your stuff. keep them coming. :D going to install your gadget as soon as i get home
     
  13. iBrightDev

    iBrightDev Jay Street NLC NLC

    do you need something else for the Wifi Info gadget? all it says for me when i copy your code is...

    Not Connected
     
  14. stuffradio

    stuffradio Super Moderator#1 NLC

    did you try clicking on the wrench tool bar thing and entering any info? I'm guessing you have to do that... haven't personally tried it
     
  15. iBrightDev

    iBrightDev Jay Street NLC NLC

    there is no wrench unless a Settings.html file is created, but, he gave no html for such a file.
     
  16. krakjoe

    krakjoe stop staring NLC

    There is no settings for the wifi one, and that's not really a "gadget" as such, it's an example of how to make a gadget, it worked on my system, but I don't plan to "make" it work on others .....

    All of those methods are part of the gadget object, so it's not real programming, I just read it off the msdn website and wrote it down, hence it's too boring to bother with really .....

    I have written a javascript, akin to prototype, with an Ajax.Request method not unlike prototypes, only my one is about 3kb and prototype is 70 ..... it has some neat features, like you can replace most methods with your own on initialization, you can specify a loading message or html, or a loading function to perform while requests are in progress, you can poll ( make continuous requests ) at set intervals, just like PeriodicalUpdater, it is written with gadgets in mind however it works cross browser anyway for websites, but I'm looking for a couple of javascript know it alls, ( or some at least ), to test this out for me, and find bugs with it ( possibly even develop it ), which I'm sure there are plenty, as it's quite an unbelivable size difference ......

    Anyone up for testing it ?? I'm not so keen on just posting the code, not unless I have some takers .......

    The reason I wrote my own, is mostly boredom, NOT to be better than prototype, nor as advanced as prototype is, I dunno how to use JSON or anything like that, apart from boredom, I took on board what stuff said, and 70kb is quite large when most of it is not needed, this object is for AJAX ONLY, not document manipulation, so it uses native methods and doesn't rely on prototype itself ......
     
  17. iBrightDev

    iBrightDev Jay Street NLC NLC

    well, ,if you decide to make the wifi thing work on other comps too, let me know. i would like to utilize its functionality.

    also, i am up for testing your script. get on MSN to message me
     
  18. Kwek

    Kwek Devious Deviant NLC

    Your FWS gadget sounds cool. Too bad I don't have Vista, else I would use it for sure. ;)
     
  19. DarkBlood

    DarkBlood NLC NLC

    I'd love them, but I don't plan on getting Vista. You should try making some widgets for wxWidgets (Which is free for WinXP) as well krakjoe.
     
  20. iBrightDev

    iBrightDev Jay Street NLC NLC

    i made a couple small gadgets just ot see how easy it was, and now my work, ITtoolbox. is going to have me make gadgets for them that will relay how many messages you have, new connection posts ect. i got the idea from the FWS gadget you made. thanks. :D
     

Share This Page