mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 19:35:38 +00:00
Monotone-Parent: d03f591ee1abddc4729d4f012e2c8fbd7f9e7b20
Monotone-Revision: 9396acfed8c54ce550e7db6b46c96c7b9006d532 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-08-18T22:46:45 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
2006-08-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxDatePicker.m: removed the jsPopup, jsCode and
|
||||
calendarPageURL methods. The javascript code is handled by .js
|
||||
files as much as possible...
|
||||
|
||||
* UI/WebServerResources/ContactsUI.js,
|
||||
UI/WebServerResources/MailerUI.js: adapted to the code refactoring
|
||||
in generic.js.
|
||||
|
||||
@@ -127,61 +127,16 @@
|
||||
return [NSString stringWithCString:buf];
|
||||
}
|
||||
|
||||
- (NSString *)dateFormat {
|
||||
- (NSString *) dateFormat
|
||||
{
|
||||
return [self useISOFormats] ? @"%Y-%m-%d" : @"%d/%m/%Y";
|
||||
}
|
||||
|
||||
- (NSString *)jsDateFormat {
|
||||
- (NSString *) jsDateFormat
|
||||
{
|
||||
return [self useISOFormats] ? @"yyyy-mm-dd" : @"dd/mm/yyyy";
|
||||
}
|
||||
|
||||
|
||||
/* URLs */
|
||||
|
||||
- (NSString *)calendarPageURL {
|
||||
WOResourceManager *rm;
|
||||
WOContext *ctx;
|
||||
NSArray *languages;
|
||||
|
||||
if ((rm = [self resourceManager]) == nil)
|
||||
rm = [[WOApplication application] resourceManager];
|
||||
if (rm == nil)
|
||||
[self warnWithFormat:@"missing resource manager!"];
|
||||
|
||||
ctx = [self context];
|
||||
#if 0
|
||||
languages = [ctx resourceLookupLanguages];
|
||||
#else
|
||||
#warning !! FIX SoProduct to enable localizable resource, then disable this!
|
||||
languages = nil;
|
||||
#endif
|
||||
|
||||
return [rm urlForResourceNamed:@"skycalendar.html" inFramework:nil
|
||||
languages:languages request:[ctx request]];
|
||||
}
|
||||
|
||||
/* JavaScript */
|
||||
|
||||
- (NSString *)jsPopup {
|
||||
return [NSString stringWithFormat:@"javascript:calendar_%@.popup()",
|
||||
[self dateID]];
|
||||
}
|
||||
|
||||
- (NSString *)jsCode {
|
||||
static NSString *code = \
|
||||
@"var calendar_%@ = new skycalendar(document.getElementById('%@'));\n"
|
||||
@"calendar_%@.setCalendarPage('%@');\n"
|
||||
@"calendar_%@.setDateFormat('%@');\n";
|
||||
|
||||
return [NSString stringWithFormat:code,
|
||||
self->dateID,
|
||||
self->dateID,
|
||||
self->dateID,
|
||||
[self calendarPageURL],
|
||||
self->dateID,
|
||||
[self jsDateFormat]];
|
||||
}
|
||||
|
||||
/* action */
|
||||
|
||||
- (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
|
||||
|
||||
Reference in New Issue
Block a user