Closed Thread
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22

Thread: Vista Sidebar Gadgets

  1. #16
    stop staring krakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to behold krakjoe's Avatar
    Join Date
    May 2006
    Location
    UK
    Posts
    3,616
    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 ......
    (\__/) Joe Watkins
    (='.'=) Software Architect
    (")_(") http://pthreads.org
    Copy and paste bunny into your sig, help him gain world domination.

  2. #17
    Jay Street iBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond repute iBrightDev's Avatar
    Join Date
    Oct 2005
    Location
    Not sure, need a GPS.
    Posts
    7,138
    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
    Full-service digital agency based in Scottsdale, Arizona - iBright Development

  3. #18
    Devious Deviant Kwek is a glorious beacon of lightKwek is a glorious beacon of lightKwek is a glorious beacon of lightKwek is a glorious beacon of lightKwek is a glorious beacon of lightKwek is a glorious beacon of lightKwek is a glorious beacon of light Kwek's Avatar
    Join Date
    Feb 2004
    Location
    Singapore
    Posts
    1,649
    Your FWS gadget sounds cool. Too bad I don't have Vista, else I would use it for sure.


  4. #19
    NLC DarkBlood is just really niceDarkBlood is just really niceDarkBlood is just really niceDarkBlood is just really nice DarkBlood's Avatar
    Join Date
    Aug 2002
    Location
    Madison, WI
    Posts
    4,506
    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.

  5. #20
    Jay Street iBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond repute iBrightDev's Avatar
    Join Date
    Oct 2005
    Location
    Not sure, need a GPS.
    Posts
    7,138
    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.
    Full-service digital agency based in Scottsdale, Arizona - iBright Development

  6. #21
    stop staring krakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to beholdkrakjoe is a splendid one to behold krakjoe's Avatar
    Join Date
    May 2006
    Location
    UK
    Posts
    3,616
    Good for you, they are fun to make.....

    I don't know the wxwdigets library, and the bindings for php are unfinished ( as in not existing at all yet, I don't think, not even on svn ).....when the php library comes out I'll take a look, I can use my compiler ( it's not actually a compiler, and I'm fully aware of that ) to get them to work on windows once the binding is available......

    @mct .....

    HTML Code:
    var Ajax = {
     
     	name: 'Ajax',
    	version: '0.0.1',
    	description: 'Multi platform Ajax interaction',
    	progress: 'Ajax in Progress',
    	
    	Create: function( )
    	{
    		var Socket = null ;
    		/*@cc_on @*/
    		/*@if (@_jscript_version >= 5)
    		 try { Socket = new ActiveXObject("Msxml2.XMLHTTP"); } 
    		 catch( error ) { try { Socket = new ActiveXObject("Microsoft.XMLHTTP"); } catch( error ) { Socket = false; } }
    		@end @*/
    		if ( !Socket && typeof XMLHttpRequest != 'undefined' ) 
    		{ try { Socket = new XMLHttpRequest(); } catch( error ) { Socket = false; } }
    		if ( !Socket && window.createRequest ) 
    		{ try { Socket = window.createRequest( ); }  catch( error ) { Socket = false; } }
    		return Socket;
    	},
    	Request: function( url, config )
    	{
    		var Sock = Ajax.Create( );
    		
    		if( !Sock ) { return false; }
    		
    		if( !config.contain || !url )
    		{
    		 	alert( 'I require at least a url, method and container' );
    			return false;
    		}
    		
    		if( !config.method )
    			config.method = 'GET';
    		
    		if( !config.contain || !document.getElementById( config.contain ) )
    			return false;	
    			
    		if( config.errors && !document.getElementById( config.errors ) )
    			return false;
    			
    		if( typeof config.loading == 'function' )
    			Ajax.Loading = config.loading;
    		
    		if( typeof config.onComplete == 'function' )
    			Ajax.onComplete = config.onComplete;
    			
    		if( typeof config.onSuccess == 'function' )
    			Ajax.onSuccess = config.onSuccess;
    		
    		if( typeof config.onFailure == 'function' )
    			Ajax.onFailure = config.onFailure;
    		
    		Sock.onreadystatechange = function( )
    		{
    			if( Sock.readyState == 4 )
    			{
    				Ajax.onComplete( Sock, config );
    			}
    			if( Sock.readyState < 4 && Sock.readyState > 0 )
    			{
    				Ajax.Loading( config );
    			}
    		}
    		Sock.open( config.method, url, true );
    
    		if( config.method && ( config.method == 'POST' ) && config.params )
    		{
    			Sock.setRequestHeader( "Content-Type", 		"application/x-www-form-urlencoded" );
    			Sock.setRequestHeader( "Content-length", 	config.params.length );
    			Sock.setRequestHeader( "Connection", 		"close" );
    		}
    		if( config.headers && typeof config.headers == 'object' )
    		{
    			for( var header in config.headers )
    			{
    				Sock.setRequestHeader( header, config.headers[ header ] );
    			}
    		}
    		if( config.poll == parseInt( config.poll ) )
    		{	
    		 	Ajax.onSuccess = function( Sock, config )
    		 	{	
    				if( document.getElementById( config.contain ) )
    				{
    					document.getElementById( config.contain ).innerHTML = Sock.responseText ;
    				}
    				window.setTimeout( function( )
    				{
    					new Ajax.Request( url, config );
    				}, 1000 * config.poll );
    			};
    		}
    		Sock.send( config.params );
    	},
    	onComplete: function( Sock, config )
    	{
    		if( Sock.status > 199 && Sock.status < 299 || Sock.status == "" )
    			Ajax.onSuccess( Sock, config );
    		else
    			Ajax.onFailure( Sock, config );	
    	},
    	onSuccess: function( Sock, config )
    	{
    		if( config.contain && document.getElementById( config.contain ) )
    		{
    			document.getElementById( config.contain ).innerHTML = Sock.responseText ;
    		}
    		return false;
    	},
    	onFailure: function( Sock, config )
    	{
    		if( config.errors && document.getElementById( config.errors ) )
    		{
    			document.getElementById( config.errors ).innerHTML = 'Ajax request failed with error code ' + Sock.status ;
    		}	
    		return false;
    	},
    	Loading: function( config )
    	{
    	 	var Element = null ;
    		if( config.contain && ( Element = document.getElementById( config.contain ) ) )
    		{
    		 	if( Element.innerHTML == '' )
    		 	{
    				Element.innerHTML = typeof config.loading == 'string' ? config.loading : Ajax.progress ;
    			}
    		}
    		return false;
    	}
    };
    thats the javascript library .....

    HTML Code:
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script language="javascript" src="codeabove.js"></script>
    </head>
    
    <body>
    <script language="javascript">
    	window.onload=function( )
    	{
    		new Ajax.Request( 'http://krakjoe.com/post-ajax.php', {
    			contain: 'notice',
    			method: 'POST',
    			params: 'user=whatever&pass=whoever',
    			errors: 'errors'
    		});
    		
    	}
    </script>
    <div id="notice"></div>
    <div id="errors"></div>
    </body>
    </html>
    Theres some primitive usage....

    the prototype for the Ajax.Request object is as follows..

    Ajax.Request( string url, hash config );

    the config hash MUST have the following ....

    contain: 'id of element for page content'

    the config can optionally accept any of the following .....

    method: 'POST'|'GET'|'HEAD'
    errors: 'id of element to show errors in'
    params: 'for post data'
    poll: '3' // would repeat the request if it suceeds every 3 seconds after a sucessfull response
    loading: function( config );|'loading message' // function is called when ajax is loading, config is this config hash, all of it, or alternatively just pass a string to display while the request is in progress, could be an image tag also
    onComplete: function( Sock, config ) called when the request is complete to determine wether it was a success
    onSuccess: function( Sock, config ) called when the request has a 2** or no response code inline with http1.* spex
    onFailure: function( Sock, config ) called when the request failed

    Sock is the xmlhttp request object with all its normal methods
    config is the hash you passed to the object

    please please please use it, else I wasted my time, lemme know how it goes......

    I just found out that ajax won't let you spoof the referer, so making the gadget from only js won't be possible on a vb forum with the whitelist feature enabled......
    Last edited by krakjoe; May 27th, 2007 at 06:19.
    (\__/) Joe Watkins
    (='.'=) Software Architect
    (")_(") http://pthreads.org
    Copy and paste bunny into your sig, help him gain world domination.

  7. #22
    Jay Street iBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond reputeiBrightDev has a reputation beyond repute iBrightDev's Avatar
    Join Date
    Oct 2005
    Location
    Not sure, need a GPS.
    Posts
    7,138
    i will mess with it tonight. i an finally gong back to work today. i had a 4 day weekend. only supposed to be 3, but, i got sick. i think it was food poisoning.
    Full-service digital agency based in Scottsdale, Arizona - iBright Development

Closed Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts