(feat) Configurable Web animation level

pull/236/head
Francis Lachapelle 2017-04-25 16:35:39 -04:00
parent 59dbef5ee7
commit 663a0b60dd
7 changed files with 60 additions and 9 deletions

View File

@ -87,6 +87,7 @@
SOGoExternalAvatarsEnabled = YES;
SOGoGravatarEnabled = NO;
SOGoAlternateAvatar = "none";
SOGoAnimationMode = "normal";
SOGoIMAPServer = "localhost";
SOGoMailDomain = "localhost";

View File

@ -1,6 +1,6 @@
/* SOGoUserDefaults.h - this file is part of SOGo
*
* Copyright (C) 2011-2016 Inverse inc.
* Copyright (C) 2011-2017 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -130,6 +130,9 @@ extern NSString *SOGoWeekStartFirstFullWeek;
- (void) setAlternateAvatar: (NSString *) newValue;
- (NSString *) alternateAvatar;
- (void) setAnimationMode: (NSString *) newValue;
- (NSString *) animationMode;
- (void) setMailComposeMessageType: (NSString *) newValue;
- (NSString *) mailComposeMessageType;

View File

@ -1,6 +1,6 @@
/* SOGoUserDefaults.m - this file is part of SOGo
*
* Copyright (C) 2009-2016 Inverse inc.
* Copyright (C) 2009-2017 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -494,7 +494,7 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
return [self stringArrayForKey: @"SOGoMailListViewColumnsOrder"];
}
- (void) setSelectedAddressBook:(NSString *) newValue
- (void) setSelectedAddressBook: (NSString *) newValue
{
[self setObject: newValue forKey: @"SOGoSelectedAddressBook"];
}
@ -529,6 +529,19 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
return [self stringForKey: @"SOGoAlternateAvatar"];
}
- (void) setAnimationMode: (NSString *) newValue
{
if ([newValue isEqualToString: @"normal"] ||
[newValue isEqualToString: @"limited"] ||
[newValue isEqualToString: @"none"])
[self setObject: newValue forKey: @"SOGoAnimationMode"];
}
- (NSString *) animationMode
{
return [self stringForKey: @"SOGoAnimationMode"];
}
- (void) setMailComposeMessageType: (NSString *) newValue
{
[self setObject: newValue forKey: @"SOGoMailComposeMessageType"];

View File

@ -39,16 +39,27 @@
- (id) init
{
if ((self = [super init]))
{
NSString *filename;
SOGoUserDefaults *ud;
item = nil;
title = nil;
toolbar = nil;
udKeys = nil;
usKeys = nil;
additionalJSFiles = nil;
additionalCSSFiles = nil;
additionalCSSFiles = [NSMutableArray new];
systemAdditionalJSFiles = nil;
ud = [[context activeUser] userDefaults];
if ([[ud animationMode] isEqualToString: @"none"])
{
filename = [self urlForResourceFilename: @"css/no-animation.css"];
[additionalCSSFiles addObject: filename];
}
}
return self;
@ -335,9 +346,6 @@
NSEnumerator *cssFiles;
NSString *currentFile, *filename;
[additionalCSSFiles release];
additionalCSSFiles = [NSMutableArray new];
cssFiles = [[newCSSFiles componentsSeparatedByString: @","] objectEnumerator];
while ((currentFile = [cssFiles nextObject]))
{
@ -587,15 +595,20 @@
return [self _dictionaryWithKeys: usKeys fromSource: us];
}
/* browser/os identification */
- (BOOL) disableInk
{
SOGoUserDefaults *ud;
WEClientCapabilities *cc;
ud = [[context activeUser] userDefaults];
cc = [[context request] clientCapabilities];
return [[cc userAgentType] isEqualToString: @"IE"];
return [[cc userAgentType] isEqualToString: @"IE"] ||
[[ud animationMode] isEqualToString: @"limited"] ||
[[ud animationMode] isEqualToString: @"none"];
}
- (BOOL) isCompatibleBrowser

View File

@ -400,3 +400,11 @@
"monsterid" = "Monster";
"wavatar" = "Wavatar";
"retro" = "Retro";
/* Animation Level */
"Animation Level" = "Animation Level";
/* Normal Animation Mode */
"animation_NORMAL" = "Normal";
/* Limited Animation Mode */
"animation_LIMITED" = "Limited";
"animation_NONE" = "None";

View File

@ -1,6 +1,6 @@
/* UIxJSONPreferences.m - this file is part of SOGo
*
* Copyright (C) 2007-2016 Inverse inc.
* Copyright (C) 2007-2017 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -126,6 +126,9 @@ static SoProduct *preferencesProduct = nil;
[[defaults source] removeObjectForKey: @"SOGoAlternateAvatar"];
}
if (![[defaults source] objectForKey: @"SOGoAnimationMode"])
[[defaults source] setObject: [defaults animationMode] forKey: @"SOGoAnimationMode"];
//
// Default Calendar preferences
//

View File

@ -219,6 +219,16 @@
</md-input-container>
</div>
</var:if>
<md-input-container class="md-block md-input-has-value">
<label><var:string label:value="Animation Level"/></label>
<md-radio-group ng-model="app.preferences.defaults.SOGoAnimationMode">
<md-radio-button value="normal"><var:string label:value="animation_NORMAL"/></md-radio-button>
<md-radio-button value="limited"><var:string label:value="animation_LIMITED"/></md-radio-button>
<md-radio-button value="none"><var:string label:value="animation_NONE"/></md-radio-button>
</md-radio-group>
</md-input-container>
</div>
</md-content>
</md-tab>