Changeset 3690

Show
Ignore:
Timestamp:
07/03/07 02:50:08 (1 year ago)
Author:
timothy
Message:

Make the iPhone interface work in landscape mode. In landscape mode the input field is hidden, since the keyboard takes up too much room.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Plug-Ins/Web Interface/Resources/iphone/index.html

    r3684 r3690  
    44        <title>Colloquy</title> 
    55        <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    6         <meta name="viewport" content="width=320, initial-scale=1.0, user-scalable=no"> 
     6        <meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> 
    77        <link rel="icon" href="../smallIcon.png" type="image/png" /> 
    88        <link rel="stylesheet" type="text/css" href="iphone.css" encoding="utf-8"> 
  • trunk/Plug-Ins/Web Interface/Resources/iphone/iphone.css

    r3689 r3690  
    22        margin: 0; 
    33        padding: 0; 
    4         width: 320px; 
    54        height: 416px; 
    65        font-family: Helvetica; 
     
    87        cursor: default; 
    98        -webkit-text-size-adjust: none; 
     9} 
     10 
     11body[orient="landscape"], body[orient="landscape"] .colloquy-members { 
     12        height: 268px; 
     13} 
     14 
     15body[orient="landscape"] #colloquies, body[orient="landscape"] .colloquy-panel, 
     16body[orient="landscape"] .colloquy-panel-transcript, body[orient="landscape"] .colloquy-member-list { 
     17        height: 224px; 
     18} 
     19 
     20body[orient="landscape"] .colloquy-panel-input { 
     21        display: none; 
    1022} 
    1123 
     
    118130        position: absolute; 
    119131        width: 100%; 
    120 } 
    121  
    122 #main-title { 
    123132        top: 0; 
    124133        left: 0; 
    125 
    126  
    127 #colloquy-title { 
    128         display: none; 
    129         opacity: 0; 
    130         top: 0; 
    131         left: 200px; 
    132         text-align: left; 
    133         -webkit-box-sizing: border-box; 
    134         box-sizing: border-box; 
    135         padding-left: 125px; 
    136         padding-right: 45px; 
     134        -webkit-box-sizing: border-box; 
     135        box-sizing: border-box; 
    137136        white-space: nowrap; 
    138137        overflow: hidden; 
     
    140139} 
    141140 
     141#colloquy-title { 
     142        display: none; 
     143        opacity: 0; 
     144} 
     145 
    142146#colloquies { 
    143147        position: relative; 
    144148        left: 0; 
    145         width: 320px
     149        width: 100%
    146150        height: 372px; 
    147151        overflow: auto; 
     
    151155        position: absolute; 
    152156        top: 44px; 
    153         left: 320px
    154         width: 320px
     157        left: 100%
     158        width: 100%
    155159        height: 372px; 
    156160        background-color: gray; 
     
    160164.colloquy-panel-transcript { 
    161165        background-color: white; 
    162         width: 100%; 
    163166        height: 335px; 
    164167        overflow: auto; 
     
    168171        white-space: nowrap; 
    169172        height: 38px; 
    170         width: 100%; 
    171173        background-color: rgb(66%, 66%, 66%); 
    172174        background-image: url(images/gradientHighlight.png); 
     
    203205        top: 416px; 
    204206        left: 0; 
    205         width: 320px
     207        width: 100%
    206208        height: 417px; 
    207209        background-color: white; 
     
    211213 
    212214.colloquy-members-title { 
    213         text-align: right; 
    214         -webkit-box-sizing: border-box; 
    215         box-sizing: border-box; 
    216         margin-left: 10px; 
    217         margin-right: 70px; 
     215        -webkit-box-sizing: border-box; 
     216        box-sizing: border-box; 
    218217        white-space: nowrap; 
    219218        overflow: hidden; 
     
    222221 
    223222.colloquy-member-list { 
    224         width: 100%; 
    225223        height: 372px; 
    226224        overflow: auto; 
     
    362360.message-wrapper.highlight { 
    363361        background-color: rgb(204, 255, 102); 
    364         background-image: url(http://10.0.1.3:6667/iphone/images/gradientHighlight.png); 
     362        background-image: url(images/gradientHighlight.png); 
    365363        background-repeat: repeat-x; 
    366364} 
     
    432430 
    433431.colloquy-member-list .member.server.operator:before { 
    434         content: url( /resources/admin.png ); 
     432        content: url(/resources/admin.png); 
    435433} 
    436434 
    437435.colloquy-member-list .member.operator:before { 
    438         content: url( /resources/op.png ); 
     436        content: url(/resources/op.png); 
    439437} 
    440438 
    441439.colloquy-member-list .member.administrator:before { 
    442         content: url( /resources/super-op.png ); 
     440        content: url(/resources/super-op.png); 
    443441} 
    444442 
    445443.colloquy-member-list .member.founder:before { 
    446         content: url( /resources/founder.png ); 
     444        content: url(/resources/founder.png); 
    447445} 
    448446 
    449447.colloquy-member-list .member.half.operator:before { 
    450         content: url( /resources/half-op.png ); 
     448        content: url(/resources/half-op.png); 
    451449} 
    452450 
    453451.colloquy-member-list .member.voice:before { 
    454         content: url( /resources/voice.png ); 
    455 } 
     452        content: url(/resources/voice.png); 
     453} 
  • trunk/Plug-Ins/Web Interface/Resources/iphone/iphone.js

    r3689 r3690  
    2020        // pan to the bottom, hides the location bar 
    2121        setTimeout(function() { window.scrollTo(0, 1) }, 100); 
     22 
     23        setInterval(Colloquy.updateLayout, 400); 
    2224 
    2325        new Ajax.Request( "/command/setup?overrideStyle=info.colloquy.style.xml&uinque=" + Math.round(Math.random() * 1000000), { 
     
    4244        window.addEventListener( "beforeunload", function(event) { Colloquy.teardown(event) }, false ); 
    4345        window.addEventListener( "unload", function(event) { Colloquy.teardown(event) }, false ); 
     46} 
     47 
     48Colloquy.updateLayout = function() 
     49{ 
     50        if (window.innerWidth !== Colloquy.currentWidth) { 
     51                Colloquy.currentWidth = window.innerWidth; 
     52 
     53                var orient = Colloquy.currentWidth == 320 ? "profile" : "landscape"; 
     54                document.body.setAttribute("orient", orient); 
     55 
     56                // pan to the bottom, hides the location bar 
     57                window.scrollTo(0, 1); 
     58        } 
    4459} 
    4560 
     
    89104        Colloquy.animatingMenu = true; 
    90105 
     106        Colloquy.joinElement.style.display = null; 
     107        Colloquy.mainTitleElement.style.display = null; 
     108 
    91109        var animations = [{element: this.backElement, end: {left: 120, opacity: 0}}, 
    92110                {element: this.joinElement, end: {opacity: 1}}, {element: this.membersElement, end: {opacity: 0}}, 
    93                 {element: this.colloquyTitleElement, end: {left: 200, opacity: 0}}, 
     111                {element: this.colloquyTitleElement, end: {left: document.body.offsetWidth / 2, opacity: 0}}, 
    94112                {element: this.mainTitleElement, end: {left: 0, top: 0, "font-size": 20, "line-height": 42}}, 
    95                 {element: this.colloquiesElement, end: {left: 0}}, {element: ChatController.activePanel.panelElement, end: {left: 320}}]; 
    96  
    97         Colloquy.joinElement.style.display = null; 
    98         Colloquy.mainTitleElement.style.display = null; 
     113                {element: this.colloquiesElement, end: {left: 0}}, {element: ChatController.activePanel.panelElement, end: {left: document.body.offsetWidth}}]; 
    99114 
    100115        var panel = this; 
     
    358373        Colloquy.animatingMenu = true; 
    359374 
    360         var animations = [{element: Colloquy.backElement, end: {left: 6, opacity: 1}}, 
    361                 {element: Colloquy.joinElement, end: {opacity: 0}}, 
    362                 {element: Colloquy.colloquyTitleElement, end: {left: 0, opacity: 1}}, 
    363                 {element: Colloquy.mainTitleElement, end: {left: -110, top: 6, "font-size": 12, "line-height": 28}}, 
    364                 {element: Colloquy.colloquiesElement, end: {left: -321}}, {element: this.panelElement, end: {left: 0}}]; 
    365  
    366         if (this.type == "JVChatRoomPanel") 
    367                 animations.push({element: Colloquy.membersElement, end: {opacity: 1}}); 
    368  
    369375        this.panelElement.style.display = "block"; 
    370376        Colloquy.backElement.style.display = "block"; 
    371377        Colloquy.colloquyTitleElement.style.display = "block"; 
    372378        Colloquy.membersElement.style.display = "block"; 
     379 
     380        var animations = [{element: Colloquy.backElement, end: {left: 6, opacity: 1}}, 
     381                {element: Colloquy.joinElement, end: {opacity: 0}}, 
     382                {element: Colloquy.colloquyTitleElement, end: {left: 0, opacity: 1}}, 
     383                {element: Colloquy.mainTitleElement, end: {left: (-document.body.offsetWidth / 2) + (Colloquy.backElement.offsetWidth / 2), top: 6, "font-size": 12, "line-height": 28}}, 
     384                {element: Colloquy.colloquiesElement, end: {left: -document.body.offsetWidth - 1}}, {element: this.panelElement, end: {left: 0}}]; 
     385 
     386        if (this.type == "JVChatRoomPanel") 
     387                animations.push({element: Colloquy.membersElement, end: {opacity: 1}}); 
    373388 
    374389        if (this.wasScrolledNearBottom) 
     
    734749        this.showingMembers = true; 
    735750 
     751        this.membersElement.style.display = "block"; 
     752 
    736753        var animations = [{element: this.membersElement, end: {top: 0}}]; 
    737  
    738         this.membersElement.style.display = "block"; 
    739754 
    740755        Colloquy.animateStyle(animations, (event.shiftKey ? 2500 : 250)); 
     
    745760                return; 
    746761 
    747         var animations = [{element: this.membersElement, end: {top: 416}}]; 
    748  
    749762        this.membersElement.style.display = "block"; 
     763 
     764        var animations = [{element: this.membersElement, end: {top: document.body.offsetHeight}}]; 
    750765 
    751766        var panel = this;