Ignore:
Timestamp:
10/26/11 17:22:50 (13 years ago)
Author:
vmipsl
Message:

Look apple

Location:
ether_megapoli/trunk/web/resources/js
Files:
2 added
1 edited
3 copied
5 moved

Legend:

Unmodified
Added
Removed
  • ether_megapoli/trunk/web/resources/js/classesForJQuery/Button.js

    r227 r234  
    33// Display a button 
    44// 
     5// use JQuery 
    56// str value: Value to display in the button 
    67// dom parent: in which dom element to draw the button 
     
    3132        if( this.className ) 
    3233            this.divContainer.className = this.className; 
    33         this.divContainer.atMe = this; 
    34         this.divContainer.id = this.id; 
     34        this.divContainer.attr( {id:this.id} ); 
    3535        if( this.parent ) 
    36             this.parent.appendChild( this.divContainer ); 
     36            this.parent.append( this.divContainer ); 
    3737 
    3838        this.divText = $( document.createElement( "div" ) ); 
    3939        if( this.classNameText ) 
    4040            this.divText.className = "button_text"; 
    41         this.divText.innerHTML = this.value; 
    42         this.divContainer.appendChild( this.divText ); 
     41        this.divText.html( this.value ); 
     42        this.divContainer.append( this.divText ); 
    4343 
    4444        // Define button events 
    45         Event.observe( this.divContainer, 'click', this.onClick.bindAsEventListener( this ) ); 
    46         Event.observe( this.divContainer, 'mouseover', this.onHover.bindAsEventListener( this ) ); 
    47         Event.observe( this.divContainer, 'mouseout', this.onOut.bindAsEventListener( this ) ); 
     45        this.divContainer.bind( 'click', this, this.onClick ); 
     46        this.divContainer.bind( 'mouseover', this, this.onHover ); 
     47        this.divContainer.bind( 'mouseout', this, this.onOut ); 
    4848    }, 
    4949 
     
    6868    { 
    6969        this.value = value; 
    70         this.divText.innerHTML = this.value; 
     70        this.divText.html( this.value ); 
    7171    }, 
    7272 
     
    7777 
    7878    // Actions ******************************************************** 
    79  
    8079    disable : function() 
    8180    { 
    8281        this.boolDisabled = true; 
    83         this.divContainer.addClassName( "disable" ); 
     82        this.divContainer.addClass( "disable" ); 
    8483    }, 
    8584 
     
    8786    { 
    8887        this.boolDisabled = false; 
    89         this.divContainer.removeClassName( "disable" ); 
     88        this.divContainer.removeClass( "disable" ); 
    9089    }, 
    9190 
     
    9493        this.boolSelected = value; 
    9594        if( this.boolSelected ) 
    96             this.divContainer.addClassName( "selected" ); 
     95            this.divContainer.addClass( "selected" ); 
    9796        else 
    98             this.divContainer.removeClassName( "selected" ); 
     97            this.divContainer.removeClass( "selected" ); 
    9998    }, 
    10099 
     
    102101    { 
    103102        this.boolDisplayed = true; 
    104         this.divContainer.style.display = ""; 
     103        this.divContainer.show(); 
    105104    }, 
    106105 
     
    108107    { 
    109108        this.boolDisplayed = false; 
    110         this.divContainer.style.display = "none"; 
     109        this.divContainer.hide(); 
    111110    }, 
    112111 
    113112    // Events ******************************************************** 
    114  
    115113    onClick : function( event ) 
    116114    { 
    117         if( !this.isDisable() && (undefined == event.detail || 1 == event.detail) ) 
    118         { 
    119             if( this.callbackOnClick ) 
    120                 this.callbackOnClick(); 
    121         } 
    122         Event.stop( event ); 
     115        var contextButton = event.data; 
     116        if( !contextButton.isDisable() && (undefined == event.detail || 1 == event.detail) && contextButton.callbackOnClick ) 
     117            contextButton.callbackOnClick(); 
    123118    }, 
    124119 
    125120    onHover : function( event ) 
    126121    { 
    127         if( !this.isDisable() && this.callbackOnMouseOver ) 
    128             this.callbackOnMouseOver(); 
    129  
    130         Event.stop( event ); 
     122        var contextButton = event.data; 
     123        if( !contextButton.isDisable() && contextButton.callbackOnMouseOver ) 
     124            contextButton.callbackOnMouseOver(); 
    131125    }, 
    132126 
    133     onOut: function() 
     127    onOut: function( event ) 
    134128    { 
    135         if( !this.isDisable() && this.callbackOnMouseOut ) 
    136             this.callbackOnMouseOut(); 
     129        var contextButton = event.data; 
     130        if( !contextButton.isDisable() && contextButton.callbackOnMouseOut ) 
     131            contextButton.callbackOnMouseOut(); 
    137132    } 
    138133} ); 
  • ether_megapoli/trunk/web/resources/js/classesForJQuery/ComplexButton.js

    r228 r234  
    152152    onClick : function( event ) 
    153153    { 
    154         var contextButton = event.data; 
    155         if( !contextButton.getDisable() && (undefined == event.detail || 1 == event.detail) && contextButton.callbackOnClick ) 
    156             contextButton.callbackOnClick(); 
     154        var contextEvent = event.data; 
     155        if( !contextEvent.getDisable() && (undefined == event.detail || 1 == event.detail) && contextButton.callbackOnClick ) 
     156            contextEvent.callbackOnClick(); 
    157157    } 
    158158} ); 
  • ether_megapoli/trunk/web/resources/js/classesForJQuery/Loading.js

    r160 r234  
    11//****************************************************************************** 
    22// Loading interface 
     3// 
     4// use JQuery 
    35// parameters : 
    46// parent : specify the parent of loading component 
     
    68//****************************************************************************** 
    79 
    8 var Loading = Class.create({ 
     10var Loading = Class.create( { 
    911 
    1012    initialize:function( parameters ) 
     
    1517 
    1618        //Create loading component 
    17         this.loadingDiv = document.createElement("div"); 
    18         this.loadingDiv.id = this.id; 
    19         this.loadingDiv.className = "loading-classic"; 
    20         this.parent.appendChild(this.loadingDiv); 
     19        this.loadingDiv = $( document.createElement( "div" ) ); 
     20        this.loadingDiv.attr( {id:this.id, class:"loading-classic"} ); 
     21        this.parent.append( this.loadingDiv ); 
    2122        this.hide(); 
    2223    } , 
     
    2425    display:function() 
    2526    { 
    26         this.loadingDiv.style.display = ""; 
     27        this.loadingDiv.show(); 
    2728    }, 
    2829 
    2930    hide:function() 
    3031    { 
    31         this.loadingDiv.style.display = "none"; 
     32        this.loadingDiv.hide(); 
    3233    } 
    33 }) ; 
     34} ); 
  • ether_megapoli/trunk/web/resources/js/classesForJQuery/etherClasses.js

    r172 r234  
    66    initialize: function( plateforms, objectParameter ) 
    77    { 
    8         this.array = $A(); 
    9         $A( plateforms ).each( function( jsonObject ) 
    10         { 
    11             this.addItem( jsonObject, objectParameter ); 
    12         }.bind( this ) ); 
     8        this.array = []; 
     9        jQuery.each( plateforms, 
     10                jQuery.proxy( function( i, jsonObject ) 
     11                { 
     12                    this.addItem( jsonObject, objectParameter ); 
     13                }, this ) ); 
    1314    }, 
    1415 
     
    3132    addOpenListener : function( func ) 
    3233    { 
    33         this.array.each( function( objectItem ) 
     34        jQuery.each( this.array, function( i, objectItem ) 
    3435        { 
    3536            objectItem.divItem.addOpenListener( func ); 
     
    4445            divNoItem.id = idIfNoItem; 
    4546            divNoItem.textContent = textIfNoItem; 
    46             parentNode.appendChild( divNoItem ); 
     47            parentNode.append( divNoItem ); 
    4748        } 
    4849        else 
    49             this.array.each( function( item ) 
     50            jQuery.each( this.array, function( item ) 
    5051            { 
    5152                item.divItem.display( parentNode ); 
     
    5556    displayWithPairImpair : function( parentNode, idIfNoItem, textIfNoItem ) 
    5657    { 
    57         Dom.clearContainer( parentNode ); 
    58         if( 0 >= this.array.size() ) 
     58        parentNode.empty(); 
     59//        Dom.clearContainer( parentNode ); 
     60        if( 0 >= this.array.length ) 
    5961        { 
    6062            var divNoItem = $( document.createElement( "div" ) ); 
    6163            divNoItem.id = idIfNoItem; 
    6264            divNoItem.textContent = textIfNoItem; 
    63             parentNode.appendChild( divNoItem ); 
     65            parentNode.append( divNoItem ); 
    6466        } 
    6567        else 
    6668        { 
    6769            var rowNumber = 0; 
    68             this.array.each( function( item ) 
     70            jQuery.each( this.array, function( i, item ) 
    6971            { 
    7072                if( rowNumber % 2 == 0 ) 
     
    8082    { 
    8183        var returnObj = false; 
    82         this.array.each( function( objItem ) 
     84        jQuery.each( this.array, jQuery.proxy( function( i, objItem ) 
    8385        { 
    8486            if( objItem.jsonElement.id == itemId ) 
    8587                returnObj = objItem; 
    86         }.bind( this ) ); 
     88        }, this ) ); 
    8789 
    8890        return returnObj; 
     
    98100    initialize: function( jsonElement, objectParameter ) 
    99101    { 
    100         this.jsonElement = Object.clone( jsonElement ); // Warning: This is only a shallow copy 
    101         this.listeners = $A(); 
    102  
    103         // HACK: No deep copy in Javascript 
     102        this.jsonElement = jsonElement; 
     103        this.listeners = []; 
     104 
    104105        if( objectParameter ) 
    105106        { 
    106107            this.language = objectParameter.language || "fr"; 
    107             if( objectParameter.currentTitleId ) 
    108                 this.currentTitleId = objectParameter.currentTitleId; 
    109             if( objectParameter.isExpiredTitle ) 
    110                 this.isExpiredTitle = objectParameter.isExpiredTitle; 
    111108            this.onMouseOverContainer = objectParameter.onMouseOverContainer ? objectParameter.onMouseOverContainer : false; 
    112109            this.onMouseOutContainer = objectParameter.onMouseOutContainer ? objectParameter.onMouseOutContainer : false; 
     
    129126        this.divContainer.item = this; 
    130127        if( classNameValue ) 
    131             this.divContainer.className = classNameValue; 
    132         this.divContainer.id = containerName + "_" + this.jsonElement.id; 
     128            this.divContainer.addClass( classNameValue ); 
     129        this.divContainer.attr( {id:containerName + "_" + this.jsonElement.id} ); 
    133130    }, 
    134131 
     
    136133    { 
    137134        this.parentNode = parentNode; 
    138         parentNode.appendChild( this.divContainer ); 
     135        parentNode.append( this.divContainer ); 
    139136    }, 
    140137 
    141138    onHoverContainer: function( event ) 
    142139    { 
     140        var contextEvent = event.data; 
    143141        if( !event || (event.detail == undefined || 1 == event.detail) ) 
    144             this.executeListenersFunction(); 
     142            contextEvent.executeListenersFunction(); 
    145143    }, 
    146144 
    147145    onClickContainer: function( event ) 
    148146    { 
     147        var contextEvent = event.data; 
    149148        if( !event || (event.detail == undefined || 1 == event.detail) ) 
    150             this.executeListenersFunction(); 
     149            contextEvent.executeListenersFunction(); 
    151150    }, 
    152151 
     
    154153    { 
    155154        if( classNameValue ) 
    156             this.divContainer.addClassName( classNameValue ); 
     155            this.divContainer.addClass( classNameValue ); 
    157156    }, 
    158157 
     
    160159    { 
    161160        if( classNameValue ) 
    162             this.divContainer.removeClassName( classNameValue ); 
     161            this.divContainer.removeClass( classNameValue ); 
    163162    }, 
    164163 
    165164    executeListenersFunction: function() 
    166165    { 
    167         this.listeners.each( function ( func ) 
     166        jQuery.each( this.listeners, jQuery.proxy( function ( i, func ) 
    168167        { 
    169168            func( this ); 
    170         }.bind( this ) ); 
     169        }, this ) ); 
    171170    }, 
    172171 
     
    174173    { 
    175174        if( this.divContainer ) 
    176             Event.observe( this.divContainer, 'click', this.onClickContainer.bindAsEventListener( this ) ); 
     175            this.divContainer.bind( 'click', this, this.onClickContainer ); 
    177176        if( this.divContainer && this.onMouseOverContainer ) 
    178             Event.observe( this.divContainer, 'mouseover', this.onMouseOverContainer.bindAsEventListener( this ) ); 
     177            this.divContainer.bind( 'mouseover', this, this.onMouseOverContainer ); 
    179178        if( this.divContainer && this.onMouseOutContainer ) 
    180             Event.observe( this.divContainer, 'mouseout', this.onMouseOutContainer.bindAsEventListener( this ) ); 
     179            this.divContainer.bind( 'mouseout', this, this.onMouseOutContainer ); 
    181180    }, 
    182181 
     
    192191 
    193192        this.divName = $( document.createElement( "div" ) ); 
    194         this.divName.className = classNameValue; 
    195         this.divName.innerHTML = this.jsonElement.name; 
    196  
    197         this.divContainer.appendChild( this.divName ); 
     193        this.divName.addClass( classNameValue ); 
     194        this.divName.html( this.jsonElement.name ); 
     195 
     196        this.divContainer.append( this.divName ); 
    198197    }, 
    199198 
  • ether_megapoli/trunk/web/resources/js/classesForPrototype/etherClasses.js

    r172 r234  
    66    initialize: function( plateforms, objectParameter ) 
    77    { 
    8         this.array = $A(); 
     8        this.array = $A(""); 
    99        $A( plateforms ).each( function( jsonObject ) 
    1010        { 
     
    9999    { 
    100100        this.jsonElement = Object.clone( jsonElement ); // Warning: This is only a shallow copy 
    101         this.listeners = $A(); 
     101        this.listeners = $A(""); 
    102102 
    103103        // HACK: No deep copy in Javascript 
Note: See TracChangeset for help on using the changeset viewer.