Monotone-Parent: ebea63a163ebf08fba3b02873febbe9dcaaaeb2c

Monotone-Revision: a486856eb1c20d59b444f05d1ce45177d7ccc66e

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2007-09-18T20:52:32
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2007-09-18 20:52:32 +00:00
parent b9393f0dd6
commit 0c538f0fbc
5 changed files with 82 additions and 7 deletions

View File

@ -23,6 +23,7 @@
#define UIXPAGEFRAME_H #define UIXPAGEFRAME_H
#import <SOGoUI/UIxComponent.h> #import <SOGoUI/UIxComponent.h>
#import <NGObjWeb/WEClientCapabilities.h>
@interface WOComponent (PopupExtension) @interface WOComponent (PopupExtension)
@ -56,6 +57,10 @@
- (void) setToolbar: (NSString *) newToolbar; - (void) setToolbar: (NSString *) newToolbar;
- (NSString *) toolbar; - (NSString *) toolbar;
- (BOOL) isBrowserCompatible;
- (BOOL) isIE7Compatible;
- (BOOL) isMac;
@end @end
#endif /* UIXPAGEFRAME_H */ #endif /* UIXPAGEFRAME_H */

View File

@ -258,4 +258,44 @@
return toolbar; return toolbar;
} }
/* browser/os identification */
- (BOOL) isCompatibleBrowser
{
WEClientCapabilities *cc;
cc = [[context request] clientCapabilities];
//NSLog(@"Browser = %@", [cc description]);
//NSLog(@"User agent = %@", [cc userAgent]);
//NSLog(@"Browser major version = %i", [cc majorVersion]);
return (
([[cc userAgentType] isEqualToString: @"IE"] && [cc majorVersion] >= 7) ||
([[cc userAgentType] isEqualToString: @"Mozilla"] && [cc majorVersion] >= 5) ||
([[cc userAgentType] isEqualToString: @"Safari"] && [cc majorVersion] >= 4)
);
}
- (BOOL) isIE7Compatible
{
WEClientCapabilities *cc;
cc = [[context request] clientCapabilities];
return ([cc isWindowsBrowser] &&
([[cc userAgent] rangeOfString: @"NT 5.1"].location != NSNotFound ||
[[cc userAgent] rangeOfString: @"NT 6"].location != NSNotFound));
}
- (BOOL) isMac
{
WEClientCapabilities *cc;
cc = [[context request] clientCapabilities];
return [cc isMacBrowser];
}
@end /* UIxPageFrame */ @end /* UIxPageFrame */

View File

@ -7,10 +7,10 @@
xmlns:const="http://www.skyrix.com/od/constant" xmlns:const="http://www.skyrix.com/od/constant"
xmlns:rsrc="OGo:url" xmlns:rsrc="OGo:url"
xmlns:label="OGo:label" xmlns:label="OGo:label"
><var:string var:value="doctype" const:escapeHTML="NO" /> ><var:string var:value="doctype" const:escapeHTML="NO"/>
<form id="connectForm" var:href="connectURL"> <form id="connectForm" var:href="connectURL">
<div id="loginScreen"> <div id="loginScreen">
<img rsrc:src="lori-login.jpg"/><br/><br/> <img id="splash" rsrc:src="lori-login.jpg"/><br/><br/>
<label><var:string label:value="Login:"/><br/> <label><var:string label:value="Login:"/><br/>
<input class="textField" id="userName" name="userName" <input class="textField" id="userName" name="userName"
type="text" var:value="userName" /></label><br/> type="text" var:value="userName" /></label><br/>
@ -21,6 +21,6 @@
<input class="button" id="submit" name="submit" type="submit" label:value="Connect" /> <input class="button" id="submit" name="submit" type="submit" label:value="Connect" />
</div> </div>
</div> </div>
</form> </form
<img id="preparedAnimation" rsrc:src="busy.gif"/> ><img id="preparedAnimation" rsrc:src="busy.gif"/>
</var:component> </var:component>

View File

@ -33,8 +33,9 @@
/></var:if-ie> /></var:if-ie>
</head> </head>
<body var:class="bodyClasses"> <body var:class="bodyClasses"
<script type="text/javascript"> ><var:if condition="isCompatibleBrowser"
><script type="text/javascript">
var ApplicationBaseURL = '<var:string value="applicationPath" />'; var ApplicationBaseURL = '<var:string value="applicationPath" />';
var ResourcesURL = '/SOGo.woa/WebServerResources'; var ResourcesURL = '/SOGo.woa/WebServerResources';
<var:if condition="shortUserNameForDisplay" const:value="anonymous" <var:if condition="shortUserNameForDisplay" const:value="anonymous"
@ -92,6 +93,23 @@
<div class="pageContent" <div class="pageContent"
><var:component-content ><var:component-content
/></div> /></div>
</var:if>
<var:if condition="isCompatibleBrowser" const:negate="YES">
<div id="loginScreen">
<img id="splash" rsrc:src="lori-login.jpg"/><br/><br/>
<p>SOGo requires a modern browser to work properly. We suggest to use the latest version of Firefox.</p>
<p class="browser"><a href="http://www.getfirefox.com/"><img rsrc:src="browser_firefox.gif"/>Download Firefox</a></p>
<var:if condition="isIE7Compatible">
<p>Alternatively, you can also use the following compatible browsers:</p>
<p class="browser"><a href="http://www.microsoft.com/ie/download/"><img rsrc:src="browser_ie.gif"/>Download Internet Explorer 7</a></p>
<p class="browser"><a href="http://www.apple.com/safari/download/"><img rsrc:src="browser_safari.gif"/>Download Safari 3</a></p>
</var:if>
<var:if condition="isMac">
<p>Alternatively, you can also use Safari.</p>
<p><a href="http://www.apple.com/safari/download/"><img rsrc:src="browser_safari.gif"/>Download Safari 3</a></p>
</var:if>
</div>
</var:if>
<noscript> <noscript>
<div class="javascriptPopupBackground"> <div class="javascriptPopupBackground">
</div> </div>

View File

@ -22,7 +22,7 @@ DIV#loginScreen
-moz-border-bottom-colors: #000 #9c9a94 transparent; -moz-border-bottom-colors: #000 #9c9a94 transparent;
} }
DIV#loginScreen IMG IMG#splash
{ border: 0px; { border: 0px;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
@ -46,3 +46,15 @@ DIV#loginButton IMG#progressIndicator
border: 0px none; border: 0px none;
margin-top: 5px; margin-top: 5px;
margin-left: 5px; } margin-left: 5px; }
P.browser
{ background-color: #fff;
border-top: 1px solid #888;
border-left: 1px solid #888;
border-right: 1px solid #eee;
border-bottom: 1px solid #eee;
line-height: 32px; }
P.browser img
{ padding: 2px;
vertical-align: middle; }