Suite à quelques déboires d’éditions, Thibaults Imbert nous annonce la sortie proche de son livre Pratique d’ActionScript 3 en nous offrant sa version pdf

Je n’ai pas encore jeté un oeil dessus mais si l’ouvrage me plaît, il va de soi que j’investirai
ActionScript 3
ActionScript, Actus du web |
En bon croyant j’ai renouvelé ma bible. Ainsi ma bibliothèque s’enrichit d’un pavé de 982 pages
Merci Colin Moock

ActionScript 3, O'Reilly
ActionScript |
Suite à la réalisation du labo, j’en suis venu à développer mon propre plugin pour jQuery. J’étais tombé au moment sur ce projet mais le code et les fonctionnalités ne me satisfaisant pas, j’ai préféré refaire le mien.
J’ai bien cherché des icônes différentes pour me démarquer mais je n’ai rien trouvé de mieux. Alors merci FAMFAMFAM pour ton superbe set
Todo list
- Documentation plus complète en français et en anglais
- Possibilité de sauvegarder le contenu des dossiers pour diminuer le nombre de requêtes et de transferts inutiles (option)
- Tri par date, poids ou nom des fichiers
- Fond alternatif pour une meilleur lecture (option)
- Effet rollOver (option)
- Bibliothèque de skins
- …
Avant cela je dois corriger les potentiels bugs et compléter au mieux le skin actuel en fonction des extensions. Votre aide est d’ailleurs la bienvenue
Prérequis
Utilisation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/* Default values */
directory: "/",
webDirectoryPath: "/",
scriptLocation: "dirlister.php",
filesIgnored: ".htaccess, .htpasswd, robots.txt",
onEvent: "click",
openEasing: "jswing",
closeEasing: "jswing",
openSpeed: "normal",
closeSpeed: "normal",
multiOpen: false,
dateFormat: "d/m/y H:i",
loadText: "Loading…",
emptyText: "Empty",
lang: "en",
showDirPath: true,
dirPathPosi: "top",
filesLinkFollow: true
/* Usage */
$('#tree').dirLister(
{
directory: "…",
webDirectoryPath: "…",
scriptLocation: "…",
…
}, function(file)
{
alert(file.name+" - "+file.path+" - "+file.ext);
}); |
Vous trouverez la dernière version du plugin dans la partie javascript du Labo.
AJAX, dirLister, jQuery, PHP 5
JavaScript |
Je viens d’ajouter un paramètre à la class dirtoxml. Le but étant de la rendre récursive ou non.
Les prochaines évolutions porteront quant à elles sur le format de sortie. À savoir, JSON et XHTML (simple liste) La class changera donc de nom
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
| <?php
/*
* Class Name : dirToXml
* Version : 1.1
* Release Date : 11/04/2008
*
* Requires : PHP5
*
* Usage : $example = new dirToXml(pathOfRootDirecory:String, recursive:Boolean);
*
* Copyright : © 2008 Simon Pottier
* Site : www.guistalk.com
*/
class dirToXml
{
private $rootdir; // ROOT PATH DIRECTORY
private $xml; // XML RETURN
public function __construct($rootdir, $recursive)
{
$this->rootdir = $rootdir;
$this->recursive = $recursive;
$this->listdir($_SERVER["DOCUMENT_ROOT"].$this->rootdir, $recursive);
}
public function __destruct()
{
echo "<?xml version='1.0' encoding='UTF-8' ?>\n<root>".$this->xml."\n</root>";
}
/*******************************************
******* DIRECTORY TO XML ********
*******************************************/
private function listdir($currentdir, $recursive)
{
$content = scandir($currentdir);
natcasesort($content);
foreach($content as $file)
{
if (count($content) > 2) // 2 IS FOR . AND ..
{
$filepath = $this->filepath($currentdir, $file);
if (file_exists($filepath) && $file != '.' && $file != '..' && !is_dir($filepath)) // ITS FILE
{
$date = $this->date($filepath);
$filetype = $this->ext($file);
$filesize = $this->size($filepath);
$filewebpath = $this->webpath($file);
$this->xml .= "\n<file label='$file' date='$date' size='$filesize' type='$filetype' path='$filewebpath' />";
}
else if (file_exists($filepath) && $file != '.' && $file != '..' && is_dir($filepath)) // ITS DIRECTORY
{
$filetype = $this->ext($file);
$this->xml .= "\n<folder label='$file' type='$filetype'>";
if ($recursive == true) $this->listdir($filepath);
$this->xml .= "\n</folder>";
}
}
}
}
/*******************************************
******** RETURN SERVER FILE PATH ********
*******************************************/
private function filepath($currentdir, $currentfile) // RETURN PATH OF FILE
{
return $currentdir."/".$currentfile;
}
/*******************************************
******** RETURN WEB FILE PATH ********
*******************************************/
private function webpath($currentfile)
{
return $this->rootdir.$currentfile;
}
/*******************************************
******** RETURN TYPE OF FILE ********
*******************************************/
private function ext($currentfile)
{
if (strpos($currentfile, ".") === false)
{
return "folder";
}
else
{
$array = explode(".", $currentfile);
$ext = strtolower($array[count($array)-1]);
return $ext;
}
}
/*******************************************
******** RETURN DATE OF FILE ********
*******************************************/
private function date($currentfile)
{
return date("d/m/y H:i", filemtime($currentfile));
}
/*******************************************
******** RETURN SIZE OF FILE ********
*******************************************/
private function size($currentfile)
{
$octets = filesize($currentfile);
$multiples = array('octets', 'ko', 'Mo', 'Go', 'To');
for ($i=0; $octets > 1024; $i++) $octets /= 1024;
if(strpos($octets, ".") != 0) $octets = number_format($octets, 2, ",", " ");
return $octets." ".$multiples[$i];
}
}
?> |
PHP 5
PHP |