Changeset 234


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

Look apple

Location:
ether_megapoli/trunk/web
Files:
2 added
2 deleted
10 edited
3 copied
5 moved

Legend:

Unmodified
Added
Removed
  • ether_megapoli/trunk/web/resources/css/etherApple.css

    r228 r234  
    106106/** ************************************ **/ 
    107107.loading-classic { 
    108     background-image: url(../../resources/icons/loading.gif); 
    109     height: 35px; 
    110     width: 35px; 
     108    background-image: url(../../resources/icons/transparent_loading.gif); 
     109    height: 16px; 
     110    width: 16px; 
    111111} 
  • ether_megapoli/trunk/web/resources/css/select.css

    r131 r234  
    77 
    88.select_selectLeft { 
    9     background: url(../images/select_left.gif) no-repeat top left; 
     9    background: url(../images/elements/select_left.gif) no-repeat top left; 
    1010    height: 20px; 
    1111    width: 6px; 
     
    1414 
    1515.select_selectMiddle { 
    16     background: transparent url(../images/select_middle.gif) repeat-x; 
     16    background: transparent url(../images/elements/select_middle.gif) repeat-x; 
    1717    height: 20px; 
    1818    float: left; 
     
    2828 
    2929.select_selectRight { 
    30     background: url(../images/select_right.gif) no-repeat top right; 
     30    background: url(../images/elements/select_right.gif) no-repeat top right; 
    3131    height: 20px; 
    3232    width: 20px; 
  • ether_megapoli/trunk/web/resources/css/visu_parameter_by_pf.css

    r228 r234  
    3838#loadingForPlateforms, #loadingForParameters { 
    3939    position: relative; 
    40     top: 102px; 
    41     left: 100px; 
     40    top: 105px; 
     41    left: 91px; 
    4242} 
    4343 
  • 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 
  • ether_megapoli/trunk/web/resources/jsp/apple_etherHead.jsp

    r233 r234  
    2828        { 
    2929            this.containerTitle.addClass( "containerTitle" ); 
    30             this.containerTitle.html( interfaceTexts["app.fulltitle"] ); 
     30            this.containerTitle.html( templateTexts["app.fulltitle"] ); 
    3131 
    3232            this.createLogin(); 
    33             var mailButton = new ComplexButton( {value:interfaceTexts["data.upload.metadata.contact.mail"], parent:this.containerTools, id:"button_mail", onClick:jQuery.proxy( this.onClickMail, this )} ); 
     33            var mailButton = new ComplexButton( {value:templateTexts["data.upload.metadata.contact.mail"], parent:this.containerTools, id:"button_mail", onClick:jQuery.proxy( this.onClickMail, this )} ); 
    3434 
    35             var valueLanguage = interfaceTexts["app.fr"]; 
     35            var valueLanguage = templateTexts["app.fr"]; 
    3636            if( this.isLanguageFr ) 
    37                 valueLanguage = interfaceTexts["app.en"]; 
     37                valueLanguage = templateTexts["app.en"]; 
    3838 
    3939            var languageButton = new ComplexButton( {value:valueLanguage, parent:this.containerTools, id:"button_language", onClick:jQuery.proxy( this.onClickLanguage, this )} ); 
    40             var homeButton = new ComplexButton( {value:interfaceTexts["app.home"], parent:this.containerTools, id:"button_home", onClick:this.onClickHome} ); 
     40            var homeButton = new ComplexButton( {value:templateTexts["app.home"], parent:this.containerTools, id:"button_home", onClick:this.onClickHome} ); 
    4141 
    4242            var divSmallLogoEther = $( document.createElement( "div" ) ); 
     
    5454                var textLogin = this.jSONUser.name + " " + this.jSONUser.firstName; 
    5555                if( this.jSONUser.role && this.jSONUser.role == "coordinateur" ) 
    56                     textLogin += " (" + interfaceTexts["app.admin"] + ")"; 
     56                    textLogin += " (" + templateTexts["app.admin"] + ")"; 
    5757 
    5858                var loginButton = new ComplexButton( {value:textLogin, parent:this.containerTools, id:"button_login"} ); 
     
    6969            else 
    7070            { 
    71                 var loginButton = new ComplexButton( {value:interfaceTexts["app.connexion"], parent:this.containerTools, id:"button_login"} ); 
     71                var loginButton = new ComplexButton( {value:templateTexts["app.connexion"], parent:this.containerTools, id:"button_login"} ); 
    7272 
    7373                var loginMiddle = $( "#button_login #button_middle" ); 
     
    7676                var aLogin = $( document.createElement( "a" ) ); 
    7777                aLogin.attr( {href:"login", class:"signin"} ); 
    78                 aLogin.html( "<span>" + interfaceTexts["app.connexion"] + "</span>" ); 
     78                aLogin.html( "<span>" + templateTexts["app.connexion"] + "</span>" ); 
    7979                loginMiddle.append( aLogin ); 
    8080 
  • ether_megapoli/trunk/web/resources/templates/appleTemplate.jsp

    r233 r234  
    2525    <ether:htmlJs jsFile="library/jquery.class"/> 
    2626    <ether:htmlJs jsFile="library/jquery.protify-0.3"/> 
    27     <ether:htmlJs jsFile="Request"/> 
    28     <ether:htmlJs jsFile="etherHelper"/> 
     27    <ether:htmlJs jsFile="classesForJQuery/etherHelper"/> 
    2928    <ether:htmlJs jsFile="classesForJQuery/ComplexButton"/> 
    3029    <ether:htmlJs jsFile="classesForJQuery/Slide"/> 
     
    145144                    <ul> 
    146145                        <li><html:link page="/visualization?methodName=viewParametersByPlateform"><span><bean:message key="data.visualization"/></span></html:link></li> 
    147                         <li><html:link page="/visualization/inWork.jsp"><span><bean:message key="simulation.visualization"/></span></html:link></li> 
     146                        <li><html:link page="/visualization?methodName=viewInWork"><span><bean:message key="simulation.visualization"/></span></html:link></li> 
    148147                    </ul> 
    149148                </div> 
     
    180179 
    181180<script type="text/javascript"> 
    182     var interfaceTexts = $A( "" ); 
    183     interfaceTexts["app.home"] = '<bean:message key="app.home"/>'; 
    184     interfaceTexts["app.fulltitle"] = '<bean:message key="app.fulltitle"/>'; 
    185     interfaceTexts["app.en"] = '<bean:message key="app.en"/>'; 
    186     interfaceTexts["app.fr"] = '<bean:message key="app.fr"/>'; 
    187     interfaceTexts["app.connexion"] = '<bean:message key="app.connexion"/>'; 
    188     interfaceTexts["data.upload.metadata.contact.mail"] = '<bean:message key="data.upload.metadata.contact.mail"/>'; 
    189     interfaceTexts["app.admin"] = '<bean:message key="app.admin"/>'; 
     181    var templateTexts = $A( "" ); 
     182    templateTexts["app.home"] = '<bean:message key="app.home"/>'; 
     183    templateTexts["app.fulltitle"] = '<bean:message key="app.fulltitle"/>'; 
     184    templateTexts["app.en"] = '<bean:message key="app.en"/>'; 
     185    templateTexts["app.fr"] = '<bean:message key="app.fr"/>'; 
     186    templateTexts["app.connexion"] = '<bean:message key="app.connexion"/>'; 
     187    templateTexts["data.upload.metadata.contact.mail"] = '<bean:message key="data.upload.metadata.contact.mail"/>'; 
     188    templateTexts["app.admin"] = '<bean:message key="app.admin"/>'; 
    190189 
    191190    var interfaceTemplate = new InterfaceTemplate(); 
  • ether_megapoli/trunk/web/src/com/ether/Controller.java

    r220 r234  
    4444    /** *********************************************************** **/ 
    4545    /** *********************** VIEWS ***************************** **/ 
    46     /** 
    47      * ********************************************************** * 
    48      */ 
     46    /** *********************************************************** **/ 
    4947    // Default view if methodName is unknown 
    5048    public ModelAndView home( final HttpServletRequest request, final HttpServletResponse response ) 
     
    5250    { 
    5351        return new ModelAndView( "index" ); 
     52    } 
     53 
     54    @ControllerMethod(view = VIEW_WORK) 
     55    public Map<String, Object> viewInWork() 
     56            throws ServiceException 
     57    { 
     58        return new HashMap<String, Object>(); 
    5459    } 
    5560 
     
    8085    /** *********************************************************** **/ 
    8186    /** *********************** CALLS ***************************** **/ 
    82     /** 
    83      * ********************************************************** * 
    84      */ 
     87    /** *********************************************************** **/ 
    8588    @ControllerMethod(jsonResult = true) 
    8689    public JSONObject searchParametersByPlateform( @Mandatory @ParamName(ParameterConstants.PARAMETER_ID) final Integer plateformId ) 
     
    252255    private static final Log LOGGER = LogFactory.getLog( Controller.class ); 
    253256 
     257    private static final String VIEW_WORK = "visualization/inWork"; 
    254258    private static final String VIEW_VISUALIZATION = "visualization/visu"; 
    255259    private static final String VIEW_VISUALIZATION_PARAMETER_BY_PLATEFORM = "visualization/visu_parameter_by_pf"; 
  • ether_megapoli/trunk/web/visualization/inWork.jsp

    r170 r234  
    1 <%@ page import="com.medias.Context" %> 
    21<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 
    32<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> 
     
    54<%@ taglib prefix="ether" tagdir="/WEB-INF/tags" %> 
    65 
    7 <tiles:insert page="/resources/templates/template.jsp" flush="true"> 
     6<tiles:insert page="/resources/templates/appleTemplate.jsp" flush="true"> 
    87 
    9         <tiles:put name="nav" value=''/> 
     8    <tiles:put name="insertCss" type="string"></tiles:put> 
     9    <tiles:put name="insertJsOrJsp" type="string"></tiles:put> 
    1010 
    11     <tiles:put name="title" type="string"> 
    12         <bean:message key="app.title"/> - <bean:message key="app.welcome"/> 
    13     </tiles:put> 
     11    <tiles:put name="title" type="string"><bean:message key="app.title"/> - <bean:message key="app.welcome"/></tiles:put> 
     12    <tiles:put name="nav" type="string"></tiles:put> 
    1413 
     14 
     15    <%--****************** CONTENT ****************** --%> 
    1516    <tiles:put name="bodytitle" type="string"> 
    1617        <bean:message key="inWork"/> 
  • ether_megapoli/trunk/web/visualization/visu_parameter_by_pf-script.jsp

    r220 r234  
    77    { 
    88        // Values 
    9         this.parent = $( "txt" ); 
    10         this.superParent = $( "pageContent" ); // need to resize in function of containerParameters 
    11         this.generalContainerPlateforms = $( "generalContainerPlateforms" ); 
    12         this.generalContainerParameters = $( "generalContainerParameters" ); 
    13         this.generalContainerOptions = $( "generalContainerOptions" ); 
     9        this.parent = $( "#txt" ); 
     10        this.superParent = $( "#pageContent" ); // need to resize in function of containerParameters 
     11        this.generalContainerPlateforms = $( "#generalContainerPlateforms" ); 
     12        this.generalContainerParameters = $( "#generalContainerParameters" ); 
     13        this.generalContainerOptions = $( "#generalContainerOptions" ); 
    1414        this.jsonPlateforms = jsonPlateforms || null; 
    1515        this.jsonAxeTypesForFixedPlateforms = axeTypesForFixedPlateforms || null; 
     
    2424 
    2525        /** *********** CONTAINERS *********** **/ 
    26         this.containerPlateforms = $( "containerPlateforms" ); 
    27         this.containerParameters = $( "containerParameters" ); 
    28         this.containerButtons = $( "containerButtons" ); 
    29         this.containerOptionCalendar = $( "containerOptionCalendar" ); 
    30         this.containerOptionType = $( "containerOptionType" ); 
    31         this.containerOptionPlotsSelect = $( "containerOptionPlotsSelect" ); 
    32         this.containerOptionPlotsButtons = $( "containerOptionPlotsButtons" ); 
     26        this.containerPlateforms = $( "#containerPlateforms" ); 
     27        this.containerParameters = $( "#containerParameters" ); 
     28        this.containerButtons = $( "#containerButtons" ); 
     29        this.containerOptionCalendar = $( "#containerOptionCalendar" ); 
     30        this.containerOptionType = $( "#containerOptionType" ); 
     31        this.containerOptionPlotsSelect = $( "#containerOptionPlotsSelect" ); 
     32        this.containerOptionPlotsButtons = $( "#containerOptionPlotsButtons" ); 
    3333 
    3434        /** *********** LOADING *********** **/ 
     
    4848 
    4949        /** *********** WINDOW FOR THE PLOT *********** **/ 
    50         this.plotWindow = new Window( {className: "dialog", zIndex: 100, 
    51             resizable: true, draggable:true, wiredDrag: true, 
    52             showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff } ); 
    53         this.plotWindow.setTitle( interfaceTexts["app.title"] + "-" + interfaceTexts["data.visualization.quicklook"] ); 
     50//        this.plotWindow = new Window( {className: "dialog", zIndex: 100, 
     51//            resizable: true, draggable:true, wiredDrag: true, 
     52//            showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff } ); 
     53//        this.plotWindow.setTitle( interfaceTexts["app.title"] + "-" + interfaceTexts["data.visualization.quicklook"] ); 
    5454 
    5555        this.createOptions(); 
     
    6262        // Calendar 
    6363        this.calendarFormat = "%Y-%m-%d %H:%i"; 
    64         this.calendarConverter = new AnyTime.Converter( { format: this.calendarFormat } ); 
    65  
    66         AnyTime.picker( "beginDate", { format: this.calendarFormat, firstDOW: 1, 
    67             labelTitle: interfaceTexts["data.visualization.selectDate"], labelYear: interfaceTexts["data.visualization.selectYear"], labelMonth: interfaceTexts["data.visualization.selectMonth"], labelDayOfMonth: interfaceTexts["data.visualization.selectDay"], 
    68             labelHour: interfaceTexts["data.visualization.selectHour"], labelMinute: interfaceTexts["data.visualization.selectMinute"], 
    69             methodToCall: this.onClickBeginDate.bindAsEventListener( this ) 
    70         } ); 
    71  
    72         AnyTime.picker( "endDate", { format: this.calendarFormat, firstDOW: 1, 
    73             labelTitle: interfaceTexts["data.visualization.selectDate"], labelYear: interfaceTexts["data.visualization.selectYear"], labelMonth: interfaceTexts["data.visualization.selectMonth"], labelDayOfMonth: interfaceTexts["data.visualization.selectDay"], 
    74             labelHour: interfaceTexts["data.visualization.selectHour"], labelMinute: interfaceTexts["data.visualization.selectMinute"], 
    75             methodToCall: this.onClickEndDate.bindAsEventListener( this ), 
    76             idToUpdateEarliest: "beginDate" 
    77         } ); 
    78  
    79         $( "beginDate" ).value = this.firstDate; 
    80         $( "endDate" ).value = this.lastDate; 
    81         this.clearCalendarButton = new Button( {value:interfaceTexts["data.visualization.button.clear"], parent:this.containerOptionCalendar, id:"button_clear_calendar", className:"small", onClick:this.onClickClear.bind( this )} ); 
     64//        this.calendarConverter = new AnyTime.Converter( { format: this.calendarFormat } ); 
     65 
     66//        AnyTime.picker( "beginDate", { format: this.calendarFormat, firstDOW: 1, 
     67//            labelTitle: interfaceTexts["data.visualization.selectDate"], labelYear: interfaceTexts["data.visualization.selectYear"], labelMonth: interfaceTexts["data.visualization.selectMonth"], labelDayOfMonth: interfaceTexts["data.visualization.selectDay"], 
     68//            labelHour: interfaceTexts["data.visualization.selectHour"], labelMinute: interfaceTexts["data.visualization.selectMinute"], 
     69//            methodToCall: this.onClickBeginDate.bindAsEventListener( this ) 
     70//        } ); 
     71// 
     72//        AnyTime.picker( "endDate", { format: this.calendarFormat, firstDOW: 1, 
     73//            labelTitle: interfaceTexts["data.visualization.selectDate"], labelYear: interfaceTexts["data.visualization.selectYear"], labelMonth: interfaceTexts["data.visualization.selectMonth"], labelDayOfMonth: interfaceTexts["data.visualization.selectDay"], 
     74//            labelHour: interfaceTexts["data.visualization.selectHour"], labelMinute: interfaceTexts["data.visualization.selectMinute"], 
     75//            methodToCall: this.onClickEndDate.bindAsEventListener( this ), 
     76//            idToUpdateEarliest: "beginDate" 
     77//        } ); 
     78// 
     79//        $( "beginDate" ).value = this.firstDate; 
     80//        $( "endDate" ).value = this.lastDate; 
     81        this.clearCalendarButton = new Button( {value:interfaceTexts["data.visualization.button.clear"], parent:this.containerOptionCalendar, id:"button_clear_calendar", className:"small", onClick:jQuery.proxy( this.onClickClear, this )} ); 
    8282 
    8383        // Buttons and axe's types 
     
    8989    createButtons: function() 
    9090    { 
    91         this.visualizeButton = new Button( {value:interfaceTexts["data.visualization.button.visualize"], parent:this.containerButtons, id:"button_visualize", onClick:this.onClickVisualize.bind( this )} ); 
     91        this.visualizeButton = new Button( {value:interfaceTexts["data.visualization.button.visualize"], parent:this.containerButtons, id:"button_visualize", onClick:jQuery.proxy( this.onClickVisualize, this )} ); 
    9292        this.visualizeButton.disable(); 
    93         this.downloadButton = new Button( {value:interfaceTexts["data.visualization.button.download"], parent:this.containerButtons, id:"button_download", onClick:this.onClickDownload.bind( this )} ); 
     93        this.downloadButton = new Button( {value:interfaceTexts["data.visualization.button.download"], parent:this.containerButtons, id:"button_download", onClick:jQuery.proxy( this.onClickDownload, this )} ); 
    9494        this.downloadButton.disable(); 
    9595    }, 
     
    110110        paramSelect.classNameOption = "select_plot_option"; 
    111111        this.selectPlots = new Select( paramSelect ); 
    112         this.selectParameters = $A(); 
     112        this.selectParameters = $(); 
    113113        this.selectPlots.add( null, interfaceTexts["data.visualization.graph.noPlot"] ); 
    114114        this.selectPlots.selectFirst( false ); 
     
    116116        this.selectPlotsPlateformType = false; 
    117117 
    118         this.addPlotButton = new Button( {value:interfaceTexts["data.visualization.add"], parent:this.containerOptionPlotsButtons, id:"button_add_plot", className:"small", onClick:this.onClickAddPlot.bind( this )} ); 
     118        this.addPlotButton = new Button( {value:interfaceTexts["data.visualization.add"], parent:this.containerOptionPlotsButtons, id:"button_add_plot", className:"small", onClick:jQuery.proxy( this.onClickAddPlot, this )} ); 
    119119        this.addPlotButton.disable(); 
    120         this.initPlotButton = new Button( {value:interfaceTexts["data.visualization.button.init"], parent:this.containerOptionPlotsButtons, id:"button_init_plot", className:"small", onClick:this.onClickInitPlot.bind( this )} ); 
     120        this.initPlotButton = new Button( {value:interfaceTexts["data.visualization.button.init"], parent:this.containerOptionPlotsButtons, id:"button_init_plot", className:"small", onClick:jQuery.proxy( this.onClickInitPlot, this )} ); 
    121121    }, 
    122122 
     
    125125    { 
    126126        if( this.selectedPlateform ) 
    127             new Ajax.Request( "visualization?methodName=searchParametersByPlateform&id=" + this.selectedPlateform.getId(), 
    128             { 
    129                 onSuccess:this.handleParametersBySelectedPlateform.bind( this ) 
     127            $.ajax( { 
     128                url: "visualization?methodName=searchParametersByPlateform&id=" + this.selectedPlateform.getId(), 
     129                success:jQuery.proxy( this.handleParametersBySelectedPlateform, this ) 
    130130            } ); 
    131131    }, 
     
    143143    handleParametersBySelectedPlateform: function( result ) 
    144144    { 
    145         this.jsonParameters = result.responseText.evalJSON().parameters; 
     145        this.jsonParameters = jQuery.parseJSON( result ).parameters; 
    146146        this.displayParameters(); 
    147147    }, 
     
    171171        this.plateforms = new ListPlatforms( this.jsonPlateforms, new Object() ); 
    172172 
    173         this.plateforms.addOpenListener( this.onSelectPlateform.bind( this ) ); 
     173        this.plateforms.addOpenListener( jQuery.proxy( this.onSelectPlateform, this ) ); 
    174174        this.loadingPlateforms.hide(); 
    175175        this.plateforms.displayWithPairImpair( this.containerPlateforms, "NoPlateform", interfaceTexts["data.visualization.noPlateform"] ); 
     
    187187    { 
    188188        var objectParameter = new Object(); 
    189         objectParameter.onMouseOverContainer = this.onMouseOverParameter; 
    190         objectParameter.onMouseOutContainer = this.onMouseOutParameter; 
    191189        this.parameters = new ListParameters( this.jsonParameters, objectParameter ); 
    192190 
    193         this.parameters.addOpenListener( this.onSelectParameter.bind( this ) ); 
     191        this.parameters.addOpenListener( jQuery.proxy( this.onSelectParameter, this ) ); 
    194192        this.loadingParameters.hide(); 
    195193        this.parameters.displayWithPairImpair( this.containerParameters, "NoParameter", interfaceTexts["data.visualization.noParameter"] ); 
    196  
    197         this.resizeContainers(); 
    198194    }, 
    199195 
     
    220216        this.addPlotButton.disable(); 
    221217 
    222         $( "textareaTitle" ).value = this.selectedPlateform.getName(); 
     218        $( "#textareaTitle" ).html( this.selectedPlateform.getName() ); 
    223219 
    224220        // Init number and list of parameter to display 
     
    246242 
    247243        // Change title 
    248         $( "textareaTitle" ).value = this.selectedPlateform.getName() + " - " + this.selectedParameter.getName(); 
     244        $( "textareaTitle" ).html( this.selectedPlateform.getName() + " - " + this.selectedParameter.getName() ); 
    249245 
    250246        // Update number and list of parameter to display 
     
    258254 
    259255        this.testAllFields(); 
    260     }, 
    261  
    262     onMouseOverParameter: function() 
    263     { 
    264         this.divContainer.innerHTML = this.jsonElement.name + " (" + this.jsonElement.code + ")"; 
    265     }, 
    266  
    267     onMouseOutParameter: function() 
    268     { 
    269         this.divContainer.innerHTML = this.jsonElement.name; 
    270256    }, 
    271257 
     
    346332 
    347333    // OTHERS ******************************************************** 
    348     resizeContainers: function() 
    349     { 
    350         var titleSize = document.getElementById( "nav" ).offsetHeight + document.getElementById( "title" ).offsetHeight + 30; 
    351         var parentHeight = this.superParent.offsetHeight - titleSize; 
    352         var containerPlateformsHeight = this.generalContainerParameters.offsetHeight; 
    353         var containerParametersHeight = this.generalContainerParameters.offsetHeight; 
    354  
    355         var containerPlateforms = this.containerPlateforms.offsetHeight; 
    356         var containerParameters = this.containerParameters.offsetHeight; 
    357         var containerOptionsHeight = this.generalContainerOptions.offsetHeight; 
    358  
    359         var maxHeight = Math.max( containerPlateforms, containerParameters, containerOptionsHeight ); 
    360  
    361         this.superParent.style.height = maxHeight + titleSize + 35 + "px"; 
    362         this.generalContainerPlateforms.style.height = maxHeight + 20 + "px"; 
    363         this.generalContainerParameters.style.height = maxHeight + 20 + "px"; 
    364     }, 
    365  
    366334    testAllFields: function() 
    367335    { 
     
    387355            jsonAxeTypes = this.jsonAxeTypesForFixedPlateforms; 
    388356 
    389         jsonAxeTypes.each( function ( axeType ) 
     357        jQuery.each( jsonAxeTypes, jQuery.proxy( function ( i, axeType ) 
    390358        { 
    391359            this.selectAxes.add( axeType.value, interfaceTexts[axeType.text] ); 
    392         }.bind( this ) ); 
     360        }, this ) ); 
    393361 
    394362        this.selectAxes.selectFirst( false ); 
     
    407375                // INIT 
    408376                this.selectPlots.clear(); 
    409                 this.selectParameters.clear(); 
     377                this.selectParameters.empty(); 
    410378                this.selectPlotsPlateformType = false; 
    411379 
     
    415383 
    416384                    this.numberParameterToDisplay = 1; 
    417                     $( "messages_number_parameters" ).innerHTML = this.numberParameterToDisplay + " " + interfaceTexts["data.visualization.parameter"]; 
     385                    $( "#messages_number_parameters" ).html( this.numberParameterToDisplay + " " + interfaceTexts["data.visualization.parameter"] ); 
    418386                } 
    419387                else 
     
    423391 
    424392                    this.numberParameterToDisplay = 0; 
    425                     $( "messages_number_parameters" ).innerHTML = ""; 
     393                    $( "#messages_number_parameters" ).html( "" ); 
    426394                } 
    427395                break; 
     
    432400                { 
    433401                    this.selectPlots.clear(); 
    434                     this.selectParameters.clear(); 
     402                    this.selectParameters.empty(); 
    435403                    this.numberParameterToDisplay = 1; 
    436404                } 
    437405 
    438406                this.selectPlots.changeSelectMiddle( this.selectedPlateform.getId() + "-" + this.selectedParameter.getId(), this.selectedPlateform.getName() + " - " + this.selectedParameter.getName() ); 
    439                 $( "messages_number_parameters" ).innerHTML = this.numberParameterToDisplay + " " + interfaceTexts["data.visualization.parameter"]; 
     407                $( "#messages_number_parameters" ).html( this.numberParameterToDisplay + " " + interfaceTexts["data.visualization.parameter"] ); 
    440408                break; 
    441409 
     
    449417                    this.selectPlots.select( plotValue, false ); 
    450418                    this.selectPlotsPlateformType = this.selectedPlateform.jsonElement.type; 
    451                     if( !isParameterAlreadySelected ) 
    452                         this.selectParameters[this.selectParameters.size()] = this.selectedParameter.getId(); 
     419//                    if( !isParameterAlreadySelected ) 
     420                        this.selectParameters.push( this.selectedParameter.getId() ); 
    453421 
    454422                    this.numberParameterToDisplay = this.selectPlots.getSize(); 
    455423                } 
    456424 
    457                 $( "messages_number_parameters" ).innerHTML = this.numberParameterToDisplay + " " + interfaceTexts["data.visualization.parameter"]; 
     425                $( "#messages_number_parameters" ).html( this.numberParameterToDisplay + " " + interfaceTexts["data.visualization.parameter"] ); 
    458426                break; 
    459427        } 
  • ether_megapoli/trunk/web/visualization/visu_parameter_by_pf.jsp

    r228 r234  
    11<%@ page import="com.ether.AxeTypeForFixedPlateform" %> 
    22<%@ page import="com.ether.AxeTypeForMobilePlateform" %> 
    3 <%@ page import="com.medias.Context" %> 
    4  
    53<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> 
    64<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> 
     
    97<%@ taglib prefix="ether" tagdir="/WEB-INF/tags" %> 
    108 
    11 <tiles:insert page="/resources/templates/templateEther.jsp" flush="true"> 
    12  
    13     <tiles:put name="title" type="string"> 
    14         <bean:message key="app.title"/> - <bean:message key="app.welcome"/> 
    15     </tiles:put> 
     9<tiles:insert page="/resources/templates/appleTemplate.jsp" flush="true"> 
    1610 
    1711    <tiles:put name="insertCss" type="string"> 
    18         <ether:htmlCss cssFile="ether"/> 
    1912        <ether:htmlCss cssFile="button"/> 
    2013        <ether:htmlCss cssFile="blueprint-css/blueprint/src/grid"/> 
    21  
    2214        <ether:htmlCss cssFile="visu_parameter_by_pf"/> 
    2315        <ether:htmlCss cssFile="select"/> 
    24  
    2516        <%-- Calendar --%> 
    2617        <ether:htmlCss cssFile="calendar/anytime"/> 
    2718        <ether:htmlCss cssFile="windows_js_1.3/themes/default"/> 
    2819        <ether:htmlCss cssFile="windows_js_1.3/themes/mac_os_x"/> 
    29  
    3020    </tiles:put> 
    3121 
    3222    <tiles:put name="insertJsOrJsp" type="string"> 
    33         <ether:htmlResourceJsp jspFile="etherHead"/> 
    34         <ether:htmlJs jsFile="etherClasses"/> 
     23        <ether:htmlJs jsFile="classesForJQuery/etherClasses"/> 
    3524        <ether:htmlJsp jspFile="visu_parameter_by_pf-script"/> 
    3625        <ether:htmlJsp jspFile="visu_parameter_by_pf-classes"/> 
    37         <ether:htmlJs jsFile="Button"/> 
    38         <ether:htmlJs jsFile="Select"/> 
    39         <ether:htmlJs jsFile="Loading"/> 
    40  
    41         <ether:htmlJs jsFile="library/jquery-1.4.2.min"/> 
    42         <ether:htmlJs jsFile="library/prototype"/> 
    43  
     26        <ether:htmlJs jsFile="classesForJQuery/Button"/> 
     27        <ether:htmlJs jsFile="classesForJQuery/Select"/> 
     28        <ether:htmlJs jsFile="classesForJQuery/Loading"/> 
    4429        <%-- Calendar --%> 
    45         <ether:htmlJs jsFile="calendar/anytime"/> 
    46         <ether:htmlJs jsFile="windows_js_1.3/javascripts/debug"/> 
    47         <ether:htmlJs jsFile="windows_js_1.3/javascripts/effects"/> 
    48         <ether:htmlJs jsFile="windows_js_1.3/javascripts/window"/> 
    49         <ether:htmlJs jsFile="windows_js_1.3/javascripts/window_ext"/> 
    50  
     30        <%--<ether:htmlJs jsFile="calendar/anytime"/>--%> 
     31        <%--<ether:htmlJs jsFile="windows_js_1.3/javascripts/debug"/>--%> 
     32        <%--<ether:htmlJs jsFile="windows_js_1.3/javascripts/effects"/>--%> 
     33        <%--<ether:htmlJs jsFile="windows_js_1.3/javascripts/window"/>--%> 
     34        <%--<ether:htmlJs jsFile="windows_js_1.3/javascripts/window_ext"/>--%> 
    5135    </tiles:put> 
    5236 
    53     <bean:define type="java.lang.String" id="relativePath" value="<%=Context.getRelativePath(request)%>"/> 
    54     <tiles:put name="nav" value='<%=relativePath+"/nav_visu_parameter.jsp"%>'/> 
    55  
    56  
    57     <tiles:put name="bodytitle" type="string"> 
    58         <bean:message key="data.visualization.title"/> 
     37    <tiles:put name="title" type="string"><bean:message key="app.title"/> - <bean:message key="data.visualization.title"/></tiles:put> 
     38    <tiles:put name="nav" type="string"> 
     39        <html:link page="/index.jsp"><bean:message key="app.home"/></html:link>&nbsp;&gt; 
     40        <html:link page="/visualization?methodName=view"><bean:message key="all.visualization"/></html:link>&nbsp;&gt; 
     41        <html:link page="/visualization?methodName=viewParametersByPlateform"><bean:message key="data.visualization"/></html:link> 
    5942    </tiles:put> 
    6043 
    6144 
     45    <%--****************** CONTENT ****************** --%> 
     46    <tiles:put name="bodytitle" type="string"><bean:message key="data.visualization.title"/></tiles:put> 
     47 
    6248    <tiles:put name="body" type="string"> 
    6349 
    64         <div class="span-25"> 
    65             <div id="generalContainerPlateforms" class="span-6 colborder"> 
     50            <div id="generalContainerPlateforms" class="span-5 colborder"> 
    6651                <div id="messages"><bean:message key="data.visualization.selectPf"/></div> 
    6752 
     
    6954            </div> 
    7055 
    71             <div id="generalContainerParameters" class="span-7 colborder"> 
     56            <div id="generalContainerParameters" class="span-6 colborder"> 
    7257                <div id="messages"><bean:message key="data.visualization.selectParameter"/></div> 
    7358 
     
    10489                </div> 
    10590            </div> 
    106         </div> 
    10791 
    10892        <script type="text/javascript"> 
    109             var interfaceTexts = $A(); 
     93            var interfaceTexts = $A( "" ); 
    11094            interfaceTexts["app.title"] = '<bean:message key="app.title"/>'; 
    11195            interfaceTexts["data.visualization.noPlateform"] = '<bean:message key="data.visualization.noPf"/>'; 
     
    150134 
    151135    </tiles:put> 
    152  
    153136</tiles:insert> 
    154  
    155 <!-- /*** ****************** FIN VISU ******************** **/ --> 
Note: See TracChangeset for help on using the changeset viewer.