File: 1.06.3a/server/web/js/iphone.js (View as Code)

1: /* 2: 3: File:iphone.js 4: 5: Abstract: Some simple browser rules. [Modified for FreeNATS] 6: 7: 8: Disclaimer: IMPORTANT: This Apple software is supplied to you by 9: Apple Inc. ("Apple") in consideration of your agreement to the 10: following terms, and your use, installation, modification or 11: redistribution of this Apple software constitutes acceptance of these 12: terms. If you do not agree with these terms, please do not use, 13: install, modify or redistribute this Apple software. 14: 15: In consideration of your agreement to abide by the following terms, and 16: subject to these terms, Apple grants you a personal, non-exclusive 17: license, under Apple's copyrights in this original Apple software (the 18: "Apple Software"), to use, reproduce, modify and redistribute the Apple 19: Software, with or without modifications, in source and/or binary forms; 20: provided that if you redistribute the Apple Software in its entirety and 21: without modifications, you must retain this notice and the following 22: text and disclaimers in all such redistributions of the Apple Software. 23: Neither the name, trademarks, service marks or logos of Apple Inc. 24: may be used to endorse or promote products derived from the Apple 25: Software without specific prior written permission from Apple. Except 26: as expressly stated in this notice, no other rights or licenses, express 27: or implied, are granted by Apple herein, including but not limited to 28: any patent rights that may be infringed by your derivative works or by 29: other works in which the Apple Software may be incorporated. 30: 31: The Apple Software is provided by Apple on an "AS IS" basis. APPLE 32: MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 33: THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 34: FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 35: OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 36: 37: IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 38: OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 39: SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 40: INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 41: MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 42: AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 43: STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 44: POSSIBILITY OF SUCH DAMAGE. 45: 46: Copyright (C) 2008 Apple Inc. All Rights Reserved. 47: 48: 49: Modified for FreeNATS - September 2008 50: 51: 52: 53: */ 54: 55: 56: function pagego(url) 57: { 58: document.location.href=url; 59: } 60: 61: function liclick(index,url) 62: { 63: document.getElementById(index).style.background="#8080f0"; 64: pagego(url); 65: } 66: 67: function backbuttonclick(url) 68: { 69: pagego(url); 70: } 71: 72: // called when orientation changes 73: function orientation_changed () { 74: // update the global variable for tracking current orientation 75: is_portrait = (window.orientation == 0 || window.orientation == null); 76: // update the styles 77: document.body.className = is_portrait ? 'portrait' : 'landscape'; 78: // update the screen width 79: screen_width = is_portrait ? 320 : 480; 80: // ensure the canvas is positioned at top-left 81: window.setTimeout(function() { window.scrollTo(0, 1); }, 0); 82: }; 83: 84: var is_portrait=false; 85: window.addEventListener('orientationchange', orientation_changed, false); 86: // set up vars based on orientation 87: orientation_changed(); 88: