Monotone-Parent: 0ed0ef307cb74b67ba17424e0e8a0e04a8364e9f
Monotone-Revision: eeaa9b56be0dd1eff991c0e1fe8ba2884de77fe0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-10-18T20:08:35 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
aa0f8d2c4a
commit
6d93652dea
|
@ -5,6 +5,12 @@
|
|||
product-specific translation dictionary as a JSON hash.
|
||||
([UIxPageFrame -commonLocalizableStrings]): same as above but for
|
||||
the "Common" framework.
|
||||
([UIxPageFrame -setJsFiles:newJSFiles]): new setter that enables
|
||||
the requestor components to require additional Javascript files.
|
||||
This is useful now that all the scripts are loaded at the end of
|
||||
the HTML code.
|
||||
([UIxPageFrame -additionalJSFiles]): new getter related to the
|
||||
above.
|
||||
|
||||
2007-10-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@
|
|||
#import <SOGoUI/UIxComponent.h>
|
||||
#import <NGObjWeb/WEClientCapabilities.h>
|
||||
|
||||
@class NSString;
|
||||
@class NSMutableArray;
|
||||
|
||||
@interface WOComponent (PopupExtension)
|
||||
|
||||
- (BOOL) isPopup;
|
||||
|
@ -37,6 +40,7 @@
|
|||
NSString *toolbar;
|
||||
id item;
|
||||
BOOL isPopup;
|
||||
NSMutableArray *additionalJSFiles;
|
||||
}
|
||||
|
||||
- (NSString *) commonLocalizableStrings;
|
||||
|
@ -47,6 +51,8 @@
|
|||
- (BOOL) hasPageSpecificJavaScript;
|
||||
- (BOOL) hasProductSpecificJavaScript;
|
||||
|
||||
- (NSArray *) additionalJSFiles;
|
||||
|
||||
- (NSString *) pageCSSURL;
|
||||
- (NSString *) productCSSURL;
|
||||
- (BOOL) hasPageSpecificCSS;
|
||||
|
|
|
@ -38,7 +38,10 @@
|
|||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
item = nil;
|
||||
title = nil;
|
||||
toolbar = nil;
|
||||
additionalJSFiles = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -48,8 +51,8 @@
|
|||
{
|
||||
[item release];
|
||||
[title release];
|
||||
if (toolbar)
|
||||
[toolbar release];
|
||||
[toolbar release];
|
||||
[additionalJSFiles release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -57,7 +60,7 @@
|
|||
|
||||
- (void) setTitle: (NSString *) _value
|
||||
{
|
||||
ASSIGNCOPY(title, _value);
|
||||
ASSIGN (title, _value);
|
||||
}
|
||||
|
||||
- (NSString *) title
|
||||
|
@ -70,7 +73,7 @@
|
|||
|
||||
- (void) setItem: (id) _item
|
||||
{
|
||||
ASSIGN(item, _item);
|
||||
ASSIGN (item, _item);
|
||||
}
|
||||
|
||||
- (id) item
|
||||
|
@ -170,8 +173,8 @@
|
|||
|
||||
- (NSString *) _stringsForFramework: (NSString *) framework
|
||||
{
|
||||
NSDictionary *table;
|
||||
NSString *language, *frameworkName;
|
||||
id table;
|
||||
|
||||
frameworkName = [NSString stringWithFormat: @"%@.SOGo",
|
||||
(framework ? framework : [self frameworkName])];
|
||||
|
@ -180,10 +183,9 @@
|
|||
= [[self resourceManager] stringTableWithName: @"Localizable"
|
||||
inFramework: frameworkName
|
||||
languages: [NSArray arrayWithObject: language]];
|
||||
/* table is not really an NSDict44ionary but a hackish variation thereof */
|
||||
table = [NSDictionary dictionaryWithDictionary: table];
|
||||
|
||||
return [table jsonRepresentation];
|
||||
/* table is not really an NSDictionary but a hackish variation thereof */
|
||||
return [[NSDictionary dictionaryWithDictionary: table] jsonRepresentation];
|
||||
}
|
||||
|
||||
- (NSString *) commonLocalizableStrings
|
||||
|
@ -236,6 +238,28 @@
|
|||
return ([[self productJavaScriptURL] length] > 0);
|
||||
}
|
||||
|
||||
- (void) setJsFiles: (NSString *) newJSFiles
|
||||
{
|
||||
NSEnumerator *jsFiles;
|
||||
NSString *currentFile, *filename;
|
||||
|
||||
[additionalJSFiles release];
|
||||
additionalJSFiles = [NSMutableArray new];
|
||||
|
||||
jsFiles = [[newJSFiles componentsSeparatedByString: @","] objectEnumerator];
|
||||
while ((currentFile = [jsFiles nextObject]))
|
||||
{
|
||||
filename = [self urlForResourceFilename:
|
||||
[currentFile stringByTrimmingSpaces]];
|
||||
[additionalJSFiles addObject: filename];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSArray *) additionalJSFiles
|
||||
{
|
||||
return additionalJSFiles;
|
||||
}
|
||||
|
||||
- (NSString *) pageCSSURL
|
||||
{
|
||||
WOComponent *page;
|
||||
|
|
Loading…
Reference in New Issue