Changeset 691 for ether_statistics/web/project/statistics-script.jsp
- Timestamp:
- 01/07/13 17:30:29 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_statistics/web/project/statistics-script.jsp
r688 r691 33 33 {id:"GEISA", img:"logo_geisa_50.jpg", top:"22px", left:"167.667px"}, 34 34 {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"}, 36 36 {id:"OMER7A", img:"logo_omer7A_50.jpg", top:"22.6667px", left:"76.3334px"}, 37 37 {id:"GIRAFE", img:"logo_girafe_50.JPG", top:"-79.6667px", left:"192.333px"}, … … 45 45 this.bindButtons(); 46 46 this.createMenuLogo(); 47 this.isMonthAndYearSelected = false; 47 48 48 49 $( document ).ready( jQuery.proxy( function() 49 50 { 50 $( ".containerToDrag" ).draggable();51 51 // Menu 52 52 this.animateMenuLogos(); … … 65 65 bindButtons: function() 66 66 { 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 ) ); 70 70 $( "#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 ) ); 73 73 $( "#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 ) ); 75 75 }, 76 76 … … 83 83 { 84 84 var divLogo = $( document.createElement( "div" ) ); 85 divLogo.addClass( "divLogo containerToDrag" );85 divLogo.addClass( "divLogo" ); 86 86 divLogo.attr( {id:logo.id, style:"position:absolute; top:" + initTop + "; left:" + initLeft} ); 87 87 divLogo.html( '<img id="img_' + logo.id + '"src="resources/images/' + logo.img + '" width="' + this.logoSizeSmall + 'px" height="' + this.logoSizeSmall + 'px"/>' ); … … 95 95 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 96 96 97 this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"180", height:"32 0", top:"212px", left:"750px",97 this.rightSlide = new DragSlide( {id:"right", parent:this.parent, width:"180", height:"325", top:"212px", left:"750px", 98 98 specificClass:"containerStatistics", specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent"} ); 99 99 … … 121 121 divLogo.addClass( "divLogo" ); 122 122 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 + '"/>' ); 124 124 this.projectsSlide.getDivContent().append( divLogo ); 125 125 }, this ) ); 126 126 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 ); 127 167 }, 128 168 … … 228 268 if( "ADMINISTRATOR" == this.jSONUser.role ) 229 269 { 230 this.awstatsSlide = new DragSlide( {id:"awstats", parent:this.parent, width:"180", height:"25", top:"54 0px", left:"750px",270 this.awstatsSlide = new DragSlide( {id:"awstats", parent:this.parent, width:"180", height:"25", top:"545px", left:"750px", 231 271 specificTitleClass:"containerStatisticsTitle", specificContentClass:"containerStatisticsContent", 232 272 title:'<spring:message code="label.awstats"/> ', activeDbClick:"None"} ); 233 this.awstatsSlide.getDivContainer(). dblclick( jQuery.proxy( this.displayAwstatsStatistics, this ) );273 this.awstatsSlide.getDivContainer().click( jQuery.proxy( this.displayAwstatsStatistics, this ) ); 234 274 } 235 275 … … 334 374 { 335 375 this.isSelectedLogoEther = (this.selectedLogo == $( "#ETHER" )[0]); 376 this.isMonthAndYearSelected = false; 336 377 337 378 if( this.jSONUser ) … … 351 392 printContent.addContent( this.middleSlide.getDivContainer().clone().animate( {'marginLeft' : "+=93px", 'width' : "667px"} ) ); 352 393 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() ); 353 402 }, 354 403 … … 469 518 bindLogos:function() 470 519 { 471 $( '.divLogo' ). dblclick( jQuery.proxy( function( element )520 $( '.divLogo' ).click( jQuery.proxy( function( element ) 472 521 { 473 522 this.selectedLogo = element.currentTarget; … … 496 545 changeMiddleSlide: function( title, url ) 497 546 { 547 var selectedMonth = this.selectMonths ? this.selectMonths.getValue() : false; 548 var selectedYear = this.selectYears ? this.selectYears.getValue() : false; 549 498 550 this.middleSlide.setTitle( this.selectedLogo.id + ' : ' + title ); 499 551 this.middleSlide.getDivContent().empty(); 500 552 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() ); 502 581 }, 503 582
Note: See TracChangeset
for help on using the changeset viewer.