Ignore:
Timestamp:
01/07/13 17:30:29 (12 years ago)
Author:
vmipsl
Message:

remove drag and drop
clean
select months

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ether_statistics/web/project/statistics-script.jsp

    r688 r691  
    3333            {id:"GEISA", img:"logo_geisa_50.jpg", top:"22px", left:"167.667px"}, 
    3434            {id:"TAPAS", img:"logo_tapas_50.png", top:"58.3333px", left:"125px"}, 
    35             {id:"OUTREACH", img:"logo_acomida_50.jpg", top:"-77.3333px", left:"225px"}, 
     35            {id:"ACOMIDA", img:"logo_acomida_50.jpg", top:"-77.3333px", left:"225px"}, 
    3636            {id:"OMER7A", img:"logo_omer7A_50.jpg", top:"22.6667px", left:"76.3334px"}, 
    3737            {id:"GIRAFE", img:"logo_girafe_50.JPG", top:"-79.6667px", left:"192.333px"}, 
     
    4545        this.bindButtons(); 
    4646        this.createMenuLogo(); 
     47        this.isMonthAndYearSelected = false; 
    4748 
    4849        $( document ).ready( jQuery.proxy( function() 
    4950        { 
    50             $( ".containerToDrag" ).draggable(); 
    5151            // Menu 
    5252            this.animateMenuLogos(); 
     
    6565    bindButtons: function() 
    6666    { 
    67         $( "#home_button" ).bind( "dblclick", this.onClickHome ); 
    68         $( "#language_button" ).bind( "dblclick", jQuery.proxy( this.onClickLanguage, this ) ); 
    69         $( "#mail_button" ).bind( "dblclick", jQuery.proxy( this.onClickMail, this ) ); 
     67        $( "#home_button" ).bind( "click", this.onClickHome ); 
     68        $( "#language_button" ).bind( "click", jQuery.proxy( this.onClickLanguage, this ) ); 
     69        $( "#mail_button" ).bind( "click", jQuery.proxy( this.onClickMail, this ) ); 
    7070        $( "#help" ).bind( "click", jQuery.proxy( this.onClickHelp, this ) ); 
    71         $( "#credits" ).bind( "dblclick", jQuery.proxy( this.onClickCredits, this ) ); 
    72         $( "#mentions" ).bind( "dblclick", jQuery.proxy( this.onClickMentions, this ) ); 
     71        $( "#credits" ).bind( "click", jQuery.proxy( this.onClickCredits, this ) ); 
     72        $( "#mentions" ).bind( "click", jQuery.proxy( this.onClickMentions, this ) ); 
    7373        $( "#login_button" ).bind( "click", jQuery.proxy( this.onClickLogin, this ) ); 
    74         $( "#logout_button" ).bind( "dblclick", jQuery.proxy( this.onClickLogout, this ) ); 
     74        $( "#logout_button" ).bind( "click", jQuery.proxy( this.onClickLogout, this ) ); 
    7575    }, 
    7676 
     
    8383        { 
    8484            var divLogo = $( document.createElement( "div" ) ); 
    85             divLogo.addClass( "divLogo containerToDrag" ); 
     85            divLogo.addClass( "divLogo" ); 
    8686            divLogo.attr( {id:logo.id, style:"position:absolute; top:" + initTop + "; left:" + initLeft} ); 
    8787            divLogo.html( '<img id="img_' + logo.id + '"src="resources/images/' + logo.img + '" width="' + this.logoSizeSmall + 'px" height="' + this.logoSizeSmall + 'px"/>' ); 
     
    9595            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
    9696 
    97         this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"180", height:"320", top:"212px", left:"750px", 
     97        this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"180", height:"325", top:"212px", left:"750px", 
    9898            specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 
    9999 
     
    121121            divLogo.addClass( "divLogo" ); 
    122122            divLogo.attr( {id:logo.id} ); 
    123             divLogo.html( '<img id="img_' + logo.id + '"src="resources/images/' + logo.img + '" width="' + this.logoSizeBigger + 'px" height="' + this.logoSizeBigger + 'px"/>' ); 
     123            divLogo.html( '<img id="img_' + logo.id + '"src="resources/images/' + logo.img + '" width="' + this.logoSizeBigger + 'px" height="' + this.logoSizeBigger + 'px" title="' + logo.id + '"/>' ); 
    124124            this.projectsSlide.getDivContent().append( divLogo ); 
    125125        }, this ) ); 
    126126        this.projectsSlide.hideContainerContent(); 
     127    }, 
     128 
     129    createSelectMonths: function() 
     130    { 
     131        var div = $( document.createElement( "div" ) ); 
     132        div.addClass( "selectDates" ); 
     133        this.middleSlide.getDivContent().append( div ); 
     134 
     135        var paramSelect = new Object(); 
     136        paramSelect.id = "selectMonths"; 
     137        paramSelect.parent = div; 
     138        this.selectMonths = new Select( paramSelect ); 
     139        this.selectMonths.add( 1, '<spring:message code="label.january"/>' ); 
     140        this.selectMonths.add( 2, '<spring:message code="label.february"/>' ); 
     141        this.selectMonths.add( 3, '<spring:message code="label.march"/>' ); 
     142        this.selectMonths.add( 4, '<spring:message code="label.april"/>' ); 
     143        this.selectMonths.add( 5, '<spring:message code="label.may"/>' ); 
     144        this.selectMonths.add( 6, '<spring:message code="label.june"/>' ); 
     145        this.selectMonths.add( 7, '<spring:message code="label.july"/>' ); 
     146        this.selectMonths.add( 8, '<spring:message code="label.august"/>' ); 
     147        this.selectMonths.add( 9, '<spring:message code="label.september"/>' ); 
     148        this.selectMonths.add( 10, '<spring:message code="label.october"/>' ); 
     149        this.selectMonths.add( 11, '<spring:message code="label.november"/>' ); 
     150        this.selectMonths.add( 12, '<spring:message code="label.december"/>' ); 
     151    }, 
     152 
     153    createSelectYears: function() 
     154    { 
     155        var div = $( document.createElement( "div" ) ); 
     156        div.addClass( "selectDates" ); 
     157        this.middleSlide.getDivContent().append( div ); 
     158 
     159        var paramSelect = new Object(); 
     160        paramSelect.id = "selectYears"; 
     161        paramSelect.parent = div; 
     162        this.selectYears = new Select( paramSelect ); 
     163 
     164        var currentYear = (new Date()).getFullYear(); 
     165        for( var i = 0; i < 5; i++ ) 
     166            this.selectYears.add( currentYear - i, currentYear - i ); 
    127167    }, 
    128168 
     
    228268            if( "ADMINISTRATOR" == this.jSONUser.role ) 
    229269            { 
    230                 this.awstatsSlide = new DragSlide( {id:"awstats", parent:this.parent, width:"180", height:"25", top:"540px", left:"750px", 
     270                this.awstatsSlide = new DragSlide( {id:"awstats", parent:this.parent, width:"180", height:"25", top:"545px", left:"750px", 
    231271                    specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent", 
    232272                    title:'<spring:message code="label.awstats"/>&nbsp;&nbsp;', activeDbClick:"None"} ); 
    233                 this.awstatsSlide.getDivContainer().dblclick( jQuery.proxy( this.displayAwstatsStatistics, this ) ); 
     273                this.awstatsSlide.getDivContainer().click( jQuery.proxy( this.displayAwstatsStatistics, this ) ); 
    234274            } 
    235275 
     
    334374    { 
    335375        this.isSelectedLogoEther = (this.selectedLogo == $( "#ETHER" )[0]); 
     376        this.isMonthAndYearSelected = false; 
    336377 
    337378        if( this.jSONUser ) 
     
    351392        printContent.addContent( this.middleSlide.getDivContainer().clone().animate( {'marginLeft' : "+=93px", 'width' : "667px"} ) ); 
    352393        printContent.displayPrintPreview(); 
     394    }, 
     395 
     396    onClickGo: function() 
     397    { 
     398        var url = this[0]; 
     399        var context = this[1]; 
     400 
     401        $( "divAwstats" ).load( url + context.selectedLogo.id + "&month=" + context.selectMonths.getValue() + "&year=" + context.selectYears.getValue() ); 
    353402    }, 
    354403 
     
    469518    bindLogos:function() 
    470519    { 
    471         $( '.divLogo' ).dblclick( jQuery.proxy( function( element ) 
     520        $( '.divLogo' ).click( jQuery.proxy( function( element ) 
    472521        { 
    473522            this.selectedLogo = element.currentTarget; 
     
    496545    changeMiddleSlide: function( title, url ) 
    497546    { 
     547        var selectedMonth = this.selectMonths ? this.selectMonths.getValue() : false; 
     548        var selectedYear = this.selectYears ? this.selectYears.getValue() : false; 
     549 
    498550        this.middleSlide.setTitle( this.selectedLogo.id + ' : ' + title ); 
    499551        this.middleSlide.getDivContent().empty(); 
    500552 
    501         this.middleSlide.getDivContent().load( url + this.selectedLogo.id ); 
     553        // Button 
     554        new Button( {value:"<spring:message code="label.go"/>", parent:this.middleSlide.getDivContent(), className: "blue selectDates", onClick:jQuery.proxy( this.onClickGo, [url, this] )} ); 
     555 
     556        // Years 
     557        this.createSelectYears(); 
     558        if( !this.isMonthAndYearSelected ) 
     559            this.selectYears.selectFirst( true ); 
     560        else 
     561            this.selectYears.select( selectedYear ); 
     562 
     563        // Months 
     564        this.createSelectMonths(); 
     565        if( !this.isMonthAndYearSelected ) 
     566        { 
     567            var currentMonth = (new Date()).getMonth() + 1; 
     568            this.selectMonths.select( currentMonth ); 
     569        } 
     570        else 
     571            this.selectMonths.select( selectedMonth ); 
     572 
     573        this.isMonthAndYearSelected = true; 
     574 
     575        var div = $( document.createElement( "div" ) ); 
     576        div.attr( {id:"divAwstats"} ); 
     577        div.addClass( "containerAwstats" ); 
     578        this.middleSlide.getDivContent().append( div ); 
     579 
     580        div.load( url + this.selectedLogo.id + "&month=" + this.selectMonths.getValue() + "&year=" + this.selectYears.getValue() ); 
    502581    }, 
    503582 
Note: See TracChangeset for help on using the changeset viewer.