Commit 5131e6f6 authored by Zéfling's avatar Zéfling 🎨
Browse files

Début de projet

J'ai commercé par xajax 0.2.5 (la 0.5 beta ne veut pas marcher chez moi).

html, body {
background-color : #c8c8c8;
font-family:Helvetica, Arial, sans-serif;
body {
display : table;
border-spacing: 3px;
#conteneur {
display : table-row-group;
#chemin, #arbre, #fichiers {
border-top : 1px solid #959595;
border-left : 1px solid #959595;
border-bottom : 1px solid white;
border-right : 1px solid white;
padding : 1px;
background-color : #dbdbdb;
#tete {
display : table-row;
width : 100%;
height: 20px;
#chemin {
white-space: nowrap;
border-left : 1px solid #dbdbdb;
#exploreur {
display : table;
#arbre {
display: table-cell;
#arbre ul{
#arbre li{
list-style-type: none;
padding : 1px 0px 1px 17px;
background-image: url('icones/folder.png');
background-repeat: no-repeat;
background-position: 0 0;
#fichiers {
display: table-cell;
overflow: auto;
#fichiers #tab {
border-spacing: 1px;
display: table;
#fichiers #tab div {
display: table-cell;
#fichiers #tab #barre_type, #fichiers #tab #ligne_fichier {
display : table-row;
#fichiers #tab #barre_type div {
border-top : 1px solid #959595;
border-left : 1px solid #959595;
border-bottom : 1px solid white;
border-right : 1px solid white;
#fichiers #tab #ligne_fichier div {
border-bottom : 1px solid #959595;
#fichiers #tab #ligne_fichier:hover {
display : table-row;
\ No newline at end of file
function arbreDossier ($rep) {
$objResponse = new xajaxResponse();
$objResponse->addClear($rep, "innerHTML");
$objResponse->addAppend($rep, "innerHTML", lireDossier ($rep));
$r1 = afficherDossier ($rep);
return $objResponse->getXML();
function afficherDossier ($rep) {
$objResponse = new xajaxResponse();
$objResponse->addClear("tab", "innerHTML");
$objResponse->addAppend("tab", "innerHTML", listerDossier ($rep));
$objResponse->addClear("chemin", "innerHTML");
$objResponse->addAppend("chemin", "innerHTML", 'Chemin : '.$rep);
return $objResponse->getXML();
$xajax = new xajax(); //On initialise l'objet xajax
//Fonction qui va se charger de faire les requetes
function lireDossier ($rep, $ret = 1) {
$aRep = explode ('/', $rep);
$repCourant = $aRep[count($aRep)-1];
$rep .= '/';
$dir = opendir($rep);
$liste = '';
while ($f = readdir($dir)) {
if(!is_file($rep.$f) && $f != '.' && $f != '..') {
// test si il y a des sous dossiers
$ssDir = opendir($rep.$f.'/');
$ssDossier = false;
while (($ssf = readdir($ssDir)) && !$ssDossier) {
if(!is_file($rep.$f.'/'.$ssf) && $ssf != '.' && $ssf != '..') {
$ssDossier = true;
// si il y a des sous-dossiers ou non
if ($ssDossier) {
$id = ' id="'.$rep.$f.'"';
$onclick = ' onclick="xajax_arbreDossier(\''.$rep.$f.'\');return false;"';
} else {
$id = '';
$onclick = ' onclick="xajax_afficherDossier(\''.$rep.$f.'\');return false;"';
$liste .= '<li'.$id.'><a href=""'.$onclick.'>'.$f.'</a></li>';
return (($ret == 1) ? '<a href="" onclick="xajax_afficherDossier(\''.$rep.$f.'\');return false;">'.$repCourant.'</a>' : '').'<ul id="'.$rep.'">'.$liste.'</ul>';
function listerDossier ($rep) {
$rep .= '/';
$dir = opendir($rep);
$liste = '<div id="barre_type"><div class="nom">Nom</div><div class="taille">Taille</div><div class="type">Type</div><div class="date">Date Modification</div></div>';
while ($f = readdir($dir)) {
if ($f != '.' && $f != '..') {
$liste .= '<div id="ligne_fichier">';
$liste .= '<div class="nom">'.$f.'</div>';
$liste .= '<div class="taille">'.filesize($rep.$f).'</div>';
$liste .= '<div class="type">'.filetype($rep.$f).'</div>';
$liste .= '<div class="date">'.filemtime($rep.$f).'</div>';
$liste .= '</div>';
return $liste;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="" xml:lang="fr" >
<title>Gestionnaire de fichiers</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="w3c.css" rel="stylesheet" type="text/css" />
<link href="index.css" rel="stylesheet" type="text/css" />
<?php $xajax->printJavascript('xajax/'); ?>
<script src="scriptaculous/lib/prototype.js" type="text/javascript"></script>
<script src="scriptaculous/src/scriptaculous.js" type="text/javascript"></script>
<body onload="xajax_arbreDossier('racine');">
<div id="conteneur">
<div id="tete">
<div id="chemin"></div>
<div id="exploreur">
<div id="arbre"><?php echo lireDossier ('racine', 0) ?></div>
<div id="fichiers">
<div id="tab">
<div id="barre_type">
<div class="nom">Nom</div>
<div class="taille">Taille</div>
<div class="type">Type</div>
<div class="date">Date Modification</div>
\ No newline at end of file
*V1.8.1* (January 3, 2008)
* Fix Element#getStyles in IE. Closes #10563. [Tobie Langel]
* Update to Prototype as of 8551.
* Fix a regression with autocompleters not responding correctly to cursor keys on both Safari and IE. Closes #10107. [thx Zman771]
*V1.8.0* (November 6, 2007)
* Update to Prototype 1.6.0 final
* Ajax.InPlaceEditor now can deal with callbacks that return an object. Closes #10064. [tdd]
* Fix a potential problem with the loader and Firefox 2.0 on the Mac. Closes #9951. [awaters]
* Add duration and distance options to Effect.Shake. Closes #8637. [amiel, rmm5t]
* Update code to use new Hash implemention in Prototype 1.6. Update InPlaceEditor to use new Class.create syntax. [tdd]
*V1.8.0 preview 0* (October 12, 2007)
* Update to new Class.create syntax in Prototype 1.6; update to latest Prototype 1.6 trunk.
* Fix bottom CSS property reassignment and initialization in queues for Effect#SlideUp. Closes #7412, #7761.
* Fix an issue with String#parseStyle that could sometimes cause errors on Safari 2.
* Refactoring to use Prototype 1.6. Remove dependency of Effect.tagifyText from builder. Use Prototype code style rules more consistently.
* Remove the deprecated Effect2 namespace.
* Update to Prototype 1.6.0_rc0.
* Some effect code refactoring to take advantage of new Prototype 1.6 features.
* Effect.ScrollTo is now no longer a core effect (returns a Effect.Tween instance now).
* Add Effect.Tween, a new core effect. This effect tweens between two values and sets a property or calls a method on an object (including DOM elements); or allows for a callback method, which will be automatically bound to the object.
var whatever = { blech: 0 };
new Effect.Tween(whatever, 5, 0, 'blech'); // sets property on the object
new Effect.Tween('foo', 10, 20, 'innerHTML'); // sets property on the 'foo' DOM element
new Effect.Tween('foo', 10, 20, 'update'); // method call on 'foo' DOM element
new Effect.Tween('foo', 50, 0, { duration: 2.0 }, function(p){
this.setStyle({border:p.toFixed(3)+'px solid red'});
new Effect.Tween(null, 0, 100, function(p){ scrollTo(0,p) }); // scrolls the window
* Revert the workaround for the Firefox issue that makes autocompleter input field values be remembered correctly when the back button is hit to return to a page that contains autocompleted values, as this can cause "Are you sure you want to navigate away?" popups. Closes #8411. [okada]
* Improve the way deactivating the active droppable is handled. Closes #9072. [Karsten Sperling]
* Next version will be 1.8.0. Update to Prototype 1.6.0_pre1.
* Make draggable initialization faster. Closes #8697. [ssinghi]
* Make BDD-style testing compatible with IE6 and IE7. Closes #8972. [steveluscher]
* Add BDD methods to booleans. Closes #9147. [steveluscher]
* Add support for full CSS inheritance in Effect.Morph. Closes #9054. [Tobie]
IMPORTANT: Note that this could potentially change the outcome of classname-based morphs, so be sure to check your morph effects if you use this feature.
For this feature, the new method Element#getStyles is introduced, which returns an objects which properties correspond to the CSS properties found in Element.CSS_PROPERTIES. Note that this method doesn't work seemlessly across browsers for certain non-measurable CSS properties, such as float.
* Add the externalControlOnly option to the in-place editors to allow for external controls to exclusively trigger the in-place editing. Closes #9024. [tdd]
* Complete rewrite of Ajax.InPlaceEditor and Ajax.InPlaceCollectionEditor. [tdd]
Be sure to properly test, especially if you're using multi-line editing and/or monkeypatching.
Read more about all the added goodness in this article:
* Update to Prototype 1.5.2_rc0 r7076:
- Works around bugs in Safari 1 and Safari 2 Regexp engines that could cause crashes
- Fixes a rendering issue with opacity-based effects and floating elements on Safari
* Mild refactoring of sound.js to take advantage of new Prototype features.
* Add highlight element method as a shortcut to Effect.Highlight.
* Improve performance of String.prototype.parseStyle by caching the dummy element used.
* Add combined effects as element methods.
$('message').appear().update('Oh noes!');
$('login').shake({ duration: 2 });
* Add Effect.Transitions.spring, which simulates a spring which oscillates while coming to rest. This transition is specifically targeted towards use with Effect.Move, for example as a reverteffect when using Draggables, as it will have return values >1 and cause temporary "overshooting" of the effect. Closes #8474. [edg2s]
* Fix effects initialization if no options are given. Fixes #7809. [thx Kroc Camen]
* Fix incorrect placement on drop for absolute ghosting elements. Update to Prototype 1.5.2_rc0 r6955 (required for #8581). Closes #8581. [tdd]
* Make sure the autocompletion happens on the token where the cursor is, not the last token when using tokenized autocompleting text fields. Closes #8588. [tdd]
* Fix that non-Mozilla browsers would display messages with the autocompleter back-button fix introduced in 1.7.1 beta 2. Fixes #7752, #8411. [josh, stetz]
*V1.7.1 beta 3* (May 19, 2007)
* Update to Prototype 1.5.1 final
* New elements and handles options for Sortable.create which take arrays of elements or element ids. These overrule the normal handle and elements finding options on initialization of the sortable, and can yield huge performance increases in situations where these elements or ids are known at call time. [Thomas Fuchs]
* Major performance improvement of Sortable.create when using the handle option. [Tobie Langel]
* Fix Builder.node double quote escaping in attributes, fixes #8125. [Aa!]
*V1.7.1 beta 2* (April 28, 2007)
* Update to Prototype 1.5.1_rc4
- Various optimizations and fixes
* Fix autocompleter indicator not appearing when calling activate() directly. Don't show indicator for local autocompleting. Fixes #7770. [pyro8019]
* Don't clear out autocompleting fields in Mozilla-based browsers when navigating back to a page with the Back button, fixes #7752. [seanc]
*V1.7.1 beta 1* (March 12, 2007)
* Update to Prototype 1.5.1 r6386
- Fixes SlideUp/SlideDown on IE
- Fixes an opacity problem with IE
- Performance optimizations
- See for more information
* Make builder unit tests work on IE
* Fix id assignment for sounds on Firefox/Windows, fixes #7709 [Robert Wallis]
* Add Sound.enable() and Sound.disable() to globally turn off
* Added,options) in new sound.js file. scriptaculous.js automatically includes this file.
Based on code by Jules Gravinese, used with permission.
The sound player uses native sound support on IE, and falls back to using <embed> on other browsers,
which means it uses QuickTime for most cases. The recommended format to use is MP3.
// --> plays sound immediately in 'global' track'blah.mp3',{replace:true});
// --> stop playing all sounds in 'global' track, and play new sound'blah.mp3',{track:'mytrack'});
// --> places the sound in the 'mytrack' track'blah.mp3',{track:'mytrack',replace:true});
// --> stop playing all sounds in 'mytrack' track, and play new sound
The sound effect used in the functional test is "Sword being drawn" by James Greever, released as freeware.
* Various effects engine optimizations [Tobie Langel, Thomas Fuchs]
* Make Ajax.InPlaceEditor more customizable: [thx godlie]
- Add an okLink option to Ajax.InPlaceEditor so you can have a link instead of a button. Uses the 'editor_ok_link' CSS class for styling, fixes #6455
- Add an cancelButton option to Ajax.InPlaceEditor, uses the 'editor_cancel_button' CSS class
- Add textBefore-, textBetween- and textAfterControls (which default to empty strings)
- For consistency, cancel link now also gets 'editor_cancel_link' CSS class
* Add an onDropped callback to Draggables, that fires at the end of a drag when the Draggable was dropped on a Droppable
* Add revert: 'failure' option to Draggables to only revert if not dropped on a valid drop target, fixes #6909 [davidw]
* Update to new Prototype Browser detection
* Fix a memory leak with Effect.Morph in Firefox, fixes #7558 [Malard]
* Add ability to nest single nodes in Builder.node in addition to arrays of nodes.
var element = Builder.node('div', Builder.node('span','blah'));
var element = DIV(SPAN('blah'));
*V1.7.0* (January 19, 2007)
* Cleanups for Effect.Morph
* Monkeypatch Prototype 1.5.0 to incorporate [6002], fixes setStyle({opacity:0}) for IE
* Fix Effect.inspect() for Prototype 1.5.0 final hash changes
* Update to Prototype 1.5.0 final
* New option keepBackgroundImage: true for Effect.Highlight, fixes #5037 [docwhat, tomg]
* Minor tweaks for issues with application/xhtml+xml documents on Firefox, fixes #6836 [sjinks]
* Fix a possible exception with Sortables, fixes #6828 [craiggwilson]
* Update to Prototype 1.5.0_rc2 revision [5844] (as of Rails 1.2 RC 2)
*V1.7.0 beta 2* (December 18, 2006)
* Change the default setting for effects to support up to 60fps, if renderable by the browser. Add performance info to effects unit test.
* Change get/setOpacity to use Prototype's new support for cross-browser opacity.
* Update to Prototype 1.5.0_rc2 revision [5741], which fixes some of the reported issues with beta 1 (see Prototype's CHANGELOG for more):
* Opera 9, while not officially supported, should work now with Prototype and
* Fixes issue with Safari when using Prototype's Ajax helpers with HTTP authorization
* Add hash and CSS className support to Effect.Morph, fixes #6674 [Tobie]
// will morph to all the properties specified
// in .className (in your external stylesheet).
// All properties which cannot be morphed (such as font-style)
// will be applied AfterFinish
$(element).morph('font-size: 10px') // or
$(element).morph({fontSize: '10px'}) // will morph the font-size to 10px
*V1.7.0 beta 1* (November 21, 2006)
* Add Element.morph() and Element.Methods.morph() as a shortcut to Effect.Morph
// basic Effect.Morph
// fade out after a while
* Update to Prototype 1.5.0_rc2 revision [5580]
* Add a paramName option to the inplace editor for overriding the default parameter name of "value"
* Add Effect.Transform that generates parallel executing Effect.Morph sets
// set up transformation
var transformation = new Effect.Transform([
{ 'div.morphing': 'font-size:20px;padding-left:40em' },
{ 'blah' : 'width:480px;border-width:10px;border-right-width:20px;margin:200px;margin-bottom:-20px;font-size:30px' }
],{ duration: 0.5 });
// play transformation (can be called more than once);
* Add Effect.Morph core effect that morphs to a given CSS style rule. Effect.Morph does take orginal styles given by CSS style rules or the style attribute into consideration when calculating the transforms. It works with all length and color based CSS properties, including margins, paddings, borders, opacity and text/background colors.
new Effect.Morph('mydiv',{
style: 'font-size:3em;color:#f00;border-width:2em',
duration: 2.0
*V1.6.5* (November 8, 2006)
* Update to Prototype 1.5.0_rc1 revision [5462]
* Support the HTML 'for' attribute in Builder by using 'htmlFor', fixes #6472 [gjones, tdd]
var node = Builder.node('label', { htmlFor: 'myinput' });
* Add support to run a specific failing unit test by clicking on the corresponding test result, fixes #6290 [leeo]
* Add modifier key support to Event.simulateMouse, fixes #6391 [savetheclocktower]
* Add rails-trunk update task, clean up references to MIT license
* Add new 'with-last' queue position option to queue effects to occur in parallel with the last effect to start in the queue
* Add new special core effect Effect.Event for one-shot events that follow timelines defined by effect queues
new Effect.Event({ afterFinish:function(){
// do some code here
}, position: 'end' });
* Do some refactoring to make use of Prototype 1.5 functionalities and save LOC
* Fix an possible crash of IE on Effect.SlideUp, fixes #3192 [thx nel]
* Add to create nodes from strings containing HTML, [DHH]
var node ="<p>this is <b>neat!</b></p>");
* Add a pulses parameter to Effect.Pulsate to control the amount of pulses, fixes #6245 [leeo]
For example, Effect.Pulsate('d8', {pulses: 2}) would pulsate twice. If the option is not given, it defaults to five pulses.
* Fix an issue with clicking on a slider span resulting in an exception, fixes #4707 [thx sergeykojin]
* Fix an issue with Draggables when no options are supplied, fixes #6045 [thx tdd]
*V1.6.4* (September 6, 2006)
* Hotfix IE issues with patched Prototype V1.5.0_rc1
*V1.6.3* (September 5, 2006)
* Update Prototype to V1.5.0_rc1
* Merge assertElementsMatch and assertElementMatches from Prototype's [4986] unittest.js [Sam Stephenson]
* Update Prototype to revision [4930]
* Fix various issues with IE detection and Opera, and setOpacity, fixes #3886, #5973
* Make Sortable.serialize handle DOM IDs like "some_element_1" correctly, fixes #5324
* Add assertRespondsTo and shouldRespondTo assertions
* Add experimental alternate syntax for unit tests (Behaviour Driven Development-style)
* Add support for onStart, onDrag and onEnd events directly on Draggables (invoked from the Draggables.notify), fixes #4747 [thx scriptkitchen]
* Add element shortcuts to Builder that can be activated by calling Builder.dump() (see the unit test), fixes #4260 [thx napalm]
* Fix selection of correct option in SELECT element generated by InPlaceCollectionEditor for indexed option arrays, fixes #4789 [thx steve]
* Add autoSelect option to Autocompleters to auto select an entry if only one is returned, fixes #5183 [thx cassiano dandrea]
* Added delay option to Draggables and Sortables, see test/functional/dragdrop_delay_test.html for usage, implements #3325 [thx lsimon, tomg]
* Remove revert cache code obsoleted by #4706, fixes #3436 (again) [thx tomg]
* Fix autoscrolling inside scrollable containers when window is scrolled too, fixes #5200 [thx wseitz]
* Make Effect.Puff work correctly for floating elements, fixes #3777 [thx michael hartl]
* Add version and timestamp to indvidual library files for easier identification (the files are preprocessed by the Rake fresh_scriptaculous task), fixes #3015 [thx Tobie]
* Add assertIndentical and assertNotIdentical unit test assertions, which test for equality and common type, fixes #5822 [thx glazedginger]
* Add integration test for Ajax autocompleter for results with no linebreaks, #4149
* Fix an issue with redrawing ghosted draggables that are inside a scrolled container, fixes #3860 [thx gkupps, tsukue]
* Added a custom exception to all base effects when used on non-existing DOM elements, added a assertRaise method to unit tests
* Fix autoscrolling when dragging an element unto a scrollable container, fixes #5017 [thx tomg]
* Fix a condition where overriding the endeffect on Draggables without overriding the starteffect too leads to a Javascript error [thx Javier Martinez]
* Fix a possible error with the drag/drop logic (affects the solution to #4706)
* Fix a problem in the drag and drop logic if an reverting/drag ending draggable was initialized for a new drag (for example by clicking repeatedly) for all cases where the default start/revert/end-effects are used, fixes #4706 [thx tecM0]
* Fix possible memory leaks with Draggables, fixes #3436 [thx aal]
* Throw nicer errors when requires libraries are not loaded, fixes #5339
* Make slider handles work when not displayed initially by using CSS width/height, fixes #4011 [thx foysavas]
* Update sortable functional test with onUpdate counter
* Make more Element extensions unit tests work on Safari
* Add the assertMatch unit test assertion for asserts with RegExps [thx Ian Tyndall]
* Fix a problem with Effect.Move causing "jumping" elements because of very low float numbers in some situations
* Fix a missing semicolon in dragdrop.js, fixes #5569 [thx mackalicious]
* Fix a slight inaccuracy with Effect.Scale that could lead the scaling to be one pixel off
* Be more prototypish with Effect.Transitions.linear
* Make Effect.Scale recognize font sizes that use the pt unit, fixes #4136 [thx aljoscha]
* Fix IE hack in Effect.Opacity, fixes #5444 [thx nicholas]
* Fix IFRAME layout fix for IE and Autocompleter, fixes #5192 [thx tommy skaue]
* Fix only option in onEmptyHover, fiex #5348 [thx glenn nilsson]
* Fix Effect.BlindDown and SwitchOff handling of supplied callbacks, fixes #5089 [thx martinstrom]
* Fix a problem with field focus on Ajax.InPlaceEditor and loading external text, fixes #4988, #5244 [thx rob]
* Do not attempt to scroll if scrollspeed is 0/0, fixes #5035 [thx tomg]
* Fix a problem with Sortable Tree serialization, fixes #4939, #4688, #4767 [thx Sammi Williams]
* Fix an endless loop with sliders, fixes #3226, #4051, #4765 [thx jeff]
* Make autocompleter work with update DIVs that have scrollbars, fixes #4782 [thx Tommy Skaue]
* Corrected options parsing on switchoff effect, fixes #4710 [thx haldini]
* Update to Prototype 1.5.0_rc0
* Add Draggable object as third parameter to snap, fixes #4074 [thx mdaines]
* Fix an IE flicker with SlideUp/SlideDown, fixes #3774, [thx sbbowers]
* Add parsing/setting of any currently set opacity CSS rule to default opacity effect on draggables, fixes #3682 [thx Mike A. Owens]