mu(inheritance) : smal(lest?) inheritance javascript framework
µ(inheritance) allows :
- inheritance between function (class)
- multi-inheritance (but not recommended ;-))
- to declare and use a constructor otherwise, you have an abstract class (unable to instantiate)
- calling parent constructor (constructor name = function (class) name)
- to test type of an object
- using private variables without side effects with inheritance
This source code (<30 lines of code) is largely inspired by those books :
- Javascript patterns - Stoyan Stefanov
- JavaScript : the Good Parts - Douglas Crockford
- Javascript cookbook - Shelley Powers
- Pragmatic Guide to JavaScript - Christophe Porteneuve
I was guided by three rules :
- module pattern
- functional inheritance pattern
- no prototype
and a "desire" : each class has a constructor (and be able to call her parent's constructor).
Explanation :
µ(inheritance) source code :
JoApp StarterKit (II) : Split view version
A little add-on to JoApp starterkit : "splitview version of joapp starterkit for ipad"
... for iOS lovers :-)

Code here :
JoApp StarterKit
I started a Starterkit for JoApp for beginners. It is a set of simple "stack cards" easily reusable. For now, you will find the cards using the following components:
- joOption
- joSelect
- joToggle
- joExpando
- joHTML
- joTextArea
- joList
Some screenshots :


Source code is here :
http://code.google.com/p/jsmobilelab/source/browse/#svn%2Ftrunk%2Fjoappstarterkit.
this is not the most elegant Javascript code, but it is easy to understand for beginners. you can see it here (but the most up to date version is on Google code) :
Two columns iPad layout template for SenchaTouch
Hi, this is a little piece of javascript code for Sencha. The aim is to have a two columns layered screen like that :

Main screen structure is like that :

And now ... javascript code :
Html code :
Nice and very simple, isn't it ? ;-)
Have a nice day.
@+P.
Two columns iPad layout template for JoApp
This morning i've played again with Jo. The result is a "Two columns iPad layout template" for JoApp.
You can download it here : https://gist.github.com/718801.
If you want an "iPad look", i've modified my previous css sheet (cf. post : Ipad css sheet for JoApp ) (little update about stack transitions), you can download it here : https://gist.github.com/718804.
It looks like that with standard Jo css sheet :

and with ipad css sheet :

Prototype = evil ? (javascript)
When i want create a "pseudo" class with javascript from scratch (ie without any framework like mootools), i use this :
function animal(){
var name = "?";
this.getName=function(){return name;}
this.setName=function(value){name=value;}
}
var a1 = new animal();
var a2 = new animal();
a1.setName("Aglaë");
a2.setName("Sidonie");
console.log(a1.getName()+' and '+a2.getName());
and the result is :
Aglaë and Sidonie
Ok, fine, it's normal.
Update of last article about OOJS
I've updated my last article about javascript.
To instantiate objects, instead of use this very bad code :
var s_arguments="";
//get arguments
for(var i=0; i<arguments.length;i++){s_arguments=s_arguments+"arguments["+i+"]"+",";}
//put arguments in a string
s_arguments = s_arguments.substring(0,s_arguments.length-1);
//Call "constructor" with parameters
eval("myObject."+constructor_name+"("+s_arguments+");");
//I know, eval is evil ;-)
//return instance
return myObject;
use this :
Thanks to the "future" really good book of John Resig "Secrets of the JavaScript Ninja" (http://www.manning.com/resig/) i've found the "true way" : .apply()
if(constructor_name!=null){
myObject[constructor_name].apply(myObject,arguments);
}
No more eval() ;-), more beautiful code
Ugly but useful object oriented javascript notation
Hello, first of all, two things/points(?) :
- on the right hand : i try to improve my english, so sorry for the readers (and Google Translate is my friend)
- on the other hand : i'm not a javascript ninja
We are going to create a framework "à la MooTools".
how to have an almost "real" object-oriented notation in javascript ?
Be careful : The objective of this paper is primarily to "play" with javascript. I'm not sure my code is very clean ;-)
Simple JSON Object : create instance :
Ipad css sheet for JoApp
Yesterday, i've played with Jo, css and iPad. I need Jo css for iPad. Then this is my work (i'm not a css ninja but it seems working) :
You can test it here : http://www.k33g.org/m/test.html
An download it here : http://www.k33g.org/m/ipad4jo.css
You need also this png file : http://www.k33g.org/m/ipad_expando.png
SenchaTouch en ... 10 minutes, 1/4 d'heure
Dans la lignée des mini-tutos javascript dédiés "webapps mobiles", aujourd'hui, nous allons parler de SenchaTouch. SenchaTouch est un framework javascript destiné à créer des webapps mobiles pour les types majeures de terminaux.
SenchaTouch n'est pas open-source, il y a une licence à payer, mais quand on voit la qualité du rendu final (difficile de faire la distinction avec une application native), l'ensemble des composants, le comportement de l'ihm, etc. …, cela est compréhensible (le prix).


Recent comments
1 year 50 weeks ago
1 year 50 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago