Changeset b7daaf in indico


Ignore:
Timestamp:
04/09/10 18:05:02 (3 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
b03b51
Parents:
bbf23d
git-author:
Jose Benito <jose.benito.gonzalez@…> (04/09/10 18:03:35)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (04/09/10 18:05:02)
Message:

[IMP] Added Timetable fullscreen mode

  • also removed the 'reload' on windows resize
Location:
indico
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/webinterface/pages/conferences.py

    r7bea4a rb7daaf  
    66286628            abstracts.append(abstract.getId()) 
    66296629        if len(abstracts) > 0 : 
    6630             generateIcon = Config.getInstance().getSystemIconURL("excel") 
     6630            generateExcelIcon = Config.getInstance().getSystemIconURL("excel") 
    66316631            generateExcelURL = urlHandlers.UHAbstractsConfManagerDisplayExcel.getURL(self._conf) 
    66326632            hiddenAbstracts=[] 
  • indico/MaKaC/webinterface/tpls/ConfModifScheduleGraphic.tpl

    rbbf23d rb7daaf  
    1717 
    1818//Variables used to resize the timetable. 
    19 var minWidth = 600; 
     19var minWidth = 900; 
    2020var widthOffset = 300; 
    21 var previousWidth = document.body.clientWidth - widthOffset; 
    22 var minResize = 30; 
    23  
    2421var historyBroker = new BrowserHistoryBroker(); 
    2522var timetable = new TopLevelManagementTimeTable(ttdata, eventInfo, document.body.clientWidth - widthOffset < minWidth ? minWidth : document.body.clientWidth - widthOffset,$E('timetableDiv'), false, historyBroker); 
     
    3128 
    3229}); 
    33  
    34 //Inefficient way of resizing a timetable 
    35 window.onresize = function (){ 
    36  
    37     //Updating only if a window was resized by certain legnth 
    38     if(previousWidth - document.body.clientWidth + widthOffset > minResize || previousWidth - document.body.clientWidth + widthOffset < -minResize) 
    39         //Updating only if a window size is greater than minimal timetable size 
    40         if(timetable.width > minWidth || document.body.clientWidth - widthOffset > minWidth) 
    41         { 
    42             var newWidth = document.body.clientWidth - widthOffset < minWidth ? minWidth : document.body.clientWidth - widthOffset; 
    43             //timetable.width = window.innerWidth - widthOffset < minWidth ? minWidth : window.innerWidth - widthOffset; 
    44             timetable = new TopLevelManagementTimeTable(ttdata, eventInfo, newWidth, $E('timetableDiv'), false, historyBroker); 
    45             $E('timetableDiv').set(timetable.draw()); 
    46             timetable.postDraw(); 
    47             previousWidth = newWidth; 
    48         } 
    49 } 
    50  
    5130</script> 
  • indico/htdocs/js/indico/Timetable/Base.js

    r45d38f rb7daaf  
    176176        var elements = translate($E(document.body).dom.childNodes, function(value) {return $E(value);}); 
    177177 
    178         var goBackLink = Html.a({href: '#', style: {fontSize: '17px'}}, 'Go back'); 
    179         var printLink = Html.a({href: '#', style: {fontSize: '17px'}}, 'Print'); 
     178        var goBackLink = Html.a({href: window.location.hash, style: {fontSize: '17px'}}, $T('Go back')); 
     179        var printLink = Html.a({href: window.location.hash, style: {fontSize: '17px'}}, $T('Print')); 
    180180 
    181181        var links = Html.span({style: {cssFloat: 'right'}}, printLink, ' | ', goBackLink); 
     
    200200        $E(document.body).set(header, timetableDiv); 
    201201        $E(document.body).setStyle('padding', pixels(30)); 
     202    }, 
     203 
     204    fullScreen: function() { 
     205        var self = this; 
     206 
     207        //self.timetableDrawer.setPrintableVersion(true); 
     208 
     209        var bodyPadding = $E(document.body).dom.style.padding; 
     210        var elements = translate($E(document.body).dom.childNodes, function(value) {return $E(value);}); 
     211        IndicoUI.Dialogs.Util.progress($T("Switching to full screen mode...")); 
     212 
     213        var goBackLink = Html.a({href: window.location.hash, style: {fontSize: '17px'}}, $T('Go back')); 
     214 
     215        var links = Html.span({style: {cssFloat: 'right'}}, goBackLink); 
     216 
     217        self.previousWidth = self.timetableDrawer.width; 
     218 
     219        goBackLink.observeClick(function(e) { 
     220            IndicoUI.Dialogs.Util.progress($T("Switching to normal mode...")); 
     221            // This timeout is needed in order to give time to the progress indicator to be rendered 
     222            setTimeout(function(){ 
     223                self.timetableDrawer.width = self.previousWidth; 
     224                self.timetableDrawer.setPrintableVersion(false); 
     225                $E(document.body).setStyle('padding', bodyPadding); 
     226                $E(document.body).set(elements); 
     227                self.timetableDrawer.redraw(self.currentDay); 
     228            }, 50); 
     229        }); 
     230 
     231     // This timeout is needed in order to give time to the progress indicator to be rendered 
     232        setTimeout(function(){ 
     233            self.timetableDrawer.width = $E(document.body).dom.clientWidth - 50; // 50 is a width offset. 
     234 
     235            var headerStyle = {padding: '0px 5px 5px 5px', 
     236                    borderBottom: '1px solid black', 
     237                    textAlign: 'center', 
     238                    width: pixels(self.timetableDrawer.width)}; 
     239            var header = Html.div({className: 'timetableHeader clearfix', style: headerStyle}, links, 
     240                Html.span({style: {cssFloat: 'left'}}, self._titleTemplate(self.timetableDrawer.day))); 
     241 
     242            self.timetableDrawer.redraw(self.currentDay); 
     243            var timetableElements = translate(self.timetableDrawer.canvas.dom.childNodes, function(value) {return $E(value);}); 
     244            var timetableDiv = Html.div({style: {paddingTop: pixels(20), position: 'relative'}}, timetableElements); 
     245            $E(document.body).set(header, timetableDiv); 
     246            $E(document.body).setStyle('padding', pixels(30)); 
     247        }, 50); 
    202248    }, 
    203249 
     
    230276                self.print(); 
    231277            } 
    232                           }; 
     278        }; 
     279 
     280        var fullScreenButton = {'btn': Html.div('buttonWhite', $T('Full screen')), 
     281                'onclick': function(btnContainer) { 
     282                    self.fullScreen(); 
     283                } 
     284        }; 
    233285 
    234286        // TODO: Needs to be implemented 
     
    247299                btnContainer.dom.style.background = state ? "#9F883B" : ""; 
    248300            } 
    249                            }; 
     301        }; 
    250302 
    251303        return [printButton, 
     304                fullScreenButton, 
    252305                this.detailsButton, 
    253306                filterButton]; 
Note: See TracChangeset for help on using the changeset viewer.