Thursday 5 June 2008
[Fun] searching google in a shell like
Par Vincent DEMAY, Thursday 5 June 2008 :: Javascript
Thursday 5 June 2008
Par Vincent DEMAY, Thursday 5 June 2008 :: Javascript
Thursday 14 February 2008
Par Vincent DEMAY, Thursday 14 February 2008 :: Javascript
/**
* Shape is an abstract base class. It is defined simply
* to have something to inherit from for geometric
* subclasses
* @constructor
*/
function Shape(color){
this.color = color;
}
// Bind the Shape_getColor method to the Shape class
Shape.prototype.getColor = Shape_getColor;
/**
* Get the name of the color for this shape
* @returns A color string for this shape
*/
function Shape_getColor(){
return this.color;
}
/**
* Circle is a subclass of Shape
*/
function Circle(radius){
this.radius = radius;
}
/**
* A very rough value for pi
*/
Circle.PI = 3.14;
/**
* Get the radius of this circle
* @returns The radius of this circle
*/
function Circle_getRadius(){
return this.radius;
}
// Circle is a subclass of Shape
Circle.prototype = new Shape(null);
dojo.provide("net.demay.geometry.Shape");
/**
* Shape is an abstract base class. It is defined simply
* to have something to inherit from for geometric
* subclassesl
* @class net.demay.geometry.Shape
* @author Vincent Demay
*/
dojo.declare("net.demay.geometry.Shape", null, {
/**
* Color of the shape
* @variable {net.demay.color.Color} color
color : null,
/**
* @constructor Shape
* @param {net.demay.color.Color} color
*/
constructor: function(color){
this.color = color;
},
/**
* Get the name of the color for this shape
* @function {net.demay.color.Color} return a color string for this shape
*/
getColor: function(){
return this.color;
}
}
dojo.provide("net.demay.geometry.Circle");
/**
* A circle is a specific {@link net.demay.geometry.Shape
* @class net.demay.geometry.Circle
* @author Vincent Demay
* @extends net.demay.geometry.Shape
*/
dojo.declare("net.demay.geometry.Circle", [net.demay.geometry.Shape], {
/**
* Circle radius
* @variable {Float} radius
*/
radius : null,
//private no doc
PI : 3.14,
/**
* @constructor Circle
* @param {Float} radius
*/
constructor: function(radius){
this.radius = radius;
},
/**
* Get the radius of this circle
* @function {Float} getRadius
*/
getRadius : function(){
return this.radius;
}
} Wednesday 30 May 2007
Par Vincent DEMAY, Wednesday 30 May 2007 :: Javascript
Monday 16 April 2007
Par Vincent DEMAY, Monday 16 April 2007 :: Javascript
Friday 13 April 2007
Par Vincent DEMAY, Friday 13 April 2007 :: Javascript
|
Effects in webpages are more and more used, but often packaged in a big librairy such as Dojo, Scriptaculous, etc... Animator.js is a single little js allowing to make advanced effect very easly : |
ex15 = new Animator().addSubject(new CSSStyleSubject(
$('ex15Button'),
"width: 10em; background-color: rgb(256, 256, 256); font-style: normal",
"width: 40em; background-color: #F39; font-style: italic"));
// note how you can use any unit, not just 'px'.
This simple code will make a fade between first styles attributes and second one.
Congratulation to the author for this very good library!
Tuesday 6 February 2007
Par Vincent DEMAY, Tuesday 6 February 2007 :: Javascript
![]() | Ajax and Javascripts allow developpers to make more and more awasone things in a web browser. The last I found "exciting" is playing sound with very goog javascript APIs?. Take a look at Sound Manager 2 (Using backgrounded flash player to play sound) - Project Home page - , it is crazy what we now can do with Javascript You can see also:
|
Sunday 10 December 2006
Par Vincent DEMAY, Sunday 10 December 2006 :: Javascript
function getProperties(/*Object*/ obj){
var msg = "";
for (prop in obj){
msg += "property : " + prop + "\t\t value : " + obj[prop] + "\n";
}
alert(msg);
}
Thursday 2 November 2006
Par Vincent DEMAY, Thursday 2 November 2006 :: Javascript
Wednesday 25 October 2006
Par Vincent DEMAY, Wednesday 25 October 2006 :: Javascript
Au menu de cette nouvelle version
|
Monday 26 June 2006
Par Vincent DEMAY, Monday 26 June 2006 :: Javascript
![]() |
Voici un petit tutorial pour faire de la gestion de cookies en Javascript cookie est en fait une propriété de l'objet document. Il s'agit donc de bien le manipuler : La syntaxe générale est la suivante : document.cookie="liste-des-attributs-du-cookie" Et voici la liste des attribute d'un cookie |
|
|
<script type="text/javascript" language="JavaScript">
<!--
function EcrireCookie(nom, valeur)
{
var argv=EcrireCookie.arguments;}
var argc=EcrireCookie.arguments.length;
var expires=(argc > 2) ? argv[2] : null;
var path=(argc > 3) ? argv[3] : null;
var domain=(argc > 4) ? argv[4] : null;
var secure=(argc > 5) ? argv[5] : false;
document.cookie=nom+"="+escape(valeur)+
((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
((path==null) ? "" : ("; path="+path))+
((domain==null) ? "" : ("; domain="+domain))+
((secure==true) ? "; secure" : "");
//-->
</script>
<script type="text/javascript" language="JavaScript">
<!--
function getCookieVal(offset)
{
var endstr=document.cookie.indexOf (";", offset);}
if (endstr==-1) endstr=document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
function LireCookie(nom)
{
var arg=nom+"=";}
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i<clen)
{
var j=i+alen;
if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
i=document.cookie.indexOf(" ",i)+1;
if (i==0) break;
}
return null;
//-->
</script>
<script type="text/javascript" language="JavaScript">
<!--
function EffaceCookie(nom)
{
date=new Date;}
date.setFullYear(date.getFullYear()-1);
EcrireCookie(nom,null,date);
//-->
</script>