mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-05-30 16:50:52 +00:00
* GSWExtensions/GSWPageRestorationErrorPage.gswc/GSWPageRestorationErrorPage.gswd
* GSWExtensions/GSWSessionCreationErrorPage.gswc/GSWSessionCreationErrorPage.gswd * GSWExtensions/GNUmakefile * GSWExtensions/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.gswd * GSWExtensions/GSWExceptionPage.gswc/GSWExceptionPage.gswd use exclamation.png. exclamation.svg is not displayed inline in mozilla due to a bug in mozilla. * GSWExtensions/WebServerResources/exclamation.png * GSWExtensions/WebServerResources/exclamation.svg new file * GSWExtensions/GSWSessionRestorationErrorPage.gswc/GSWSessionRestorationErrorPage.html * GSWExtensions/GSWExceptionPage.gswc/GSWExceptionPage.html better web design * GSWeb/GSWApplication.m -path get path from _resourceManager _resetCache do not call _clearCache, maybe we should trash the _componentDefinitionCache? _finishInitializingSession: make empty, still seems to work +_applicationClass don not use _applicationGSWBundle * GSWeb/GSWResourceManager.h * GSWeb/GSWResourceManager.m major redesign with WO 4.5 docs in mind. * GSWeb/GSWImageButton.m refactor resourceManager code * GSWeb/GSWeb.h remove GSWBundle class * Testing/DynamicElements added Image test. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@30806 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c5b731b3ca
commit
39c130d0f5
40 changed files with 1306 additions and 3053 deletions
162
GSWeb/GSWImage.m
162
GSWeb/GSWImage.m
|
@ -110,109 +110,99 @@ RCS_ID("$Id$")
|
|||
NSString *fileNameValue;
|
||||
NSString *frameworkName = nil;
|
||||
NSString *resourceURL;
|
||||
|
||||
|
||||
resourcemanager = [GSWApp resourceManager];
|
||||
component = GSWContext_component(context);
|
||||
fileNameValue = [filename valueInComponent:component];
|
||||
frameworkName
|
||||
= [GSWHTMLDynamicElement _frameworkNameForAssociation: framework
|
||||
inComponent: component];
|
||||
|
||||
frameworkName = [framework valueInComponent:component];
|
||||
|
||||
resourceURL = [context _urlForResourceNamed: fileNameValue
|
||||
inFramework: frameworkName];
|
||||
|
||||
inFramework: frameworkName];
|
||||
|
||||
if (resourceURL != nil)
|
||||
{
|
||||
NSString *widthStr = nil;
|
||||
NSString *heightStr = nil;
|
||||
BOOL calculateWidth = NO;
|
||||
BOOL calculateHeight = NO;
|
||||
|
||||
if (width != nil)
|
||||
{
|
||||
NSString *widthStr = nil;
|
||||
NSString *heightStr = nil;
|
||||
BOOL calculateWidth = NO;
|
||||
BOOL calculateHeight = NO;
|
||||
|
||||
if (width != nil || height != nil)
|
||||
{
|
||||
if (width != nil)
|
||||
{
|
||||
id widthValue;
|
||||
widthValue = [width valueInComponent:component];
|
||||
if (widthValue)
|
||||
{
|
||||
widthStr = NSStringWithObject(widthValue);
|
||||
}
|
||||
calculateWidth = (widthStr == nil || [widthStr isEqual:@"*"]);
|
||||
}
|
||||
if (height != nil)
|
||||
{
|
||||
id heightValue;
|
||||
heightValue = [height valueInComponent:component];
|
||||
if (heightValue)
|
||||
{
|
||||
heightStr = NSStringWithObject(heightValue);
|
||||
}
|
||||
calculateHeight = (heightStr == nil || [heightStr isEqual:@"*"]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
calculateWidth = YES;
|
||||
calculateHeight = YES;
|
||||
|
||||
GSOnceMLog(@"%@: No height or width information provided for '%@'. If possible, this information should be provided for best performance.",
|
||||
NSStringFromClass([self class]), fileNameValue);
|
||||
}
|
||||
|
||||
if (calculateWidth || calculateHeight)
|
||||
{
|
||||
GSWImageInfo * imageinfo;
|
||||
|
||||
imageinfo = [resourcemanager _imageInfoForUrl: resourceURL
|
||||
fileName: fileNameValue
|
||||
framework: frameworkName
|
||||
languages: [context languages]];
|
||||
if (imageinfo != nil)
|
||||
id widthValue;
|
||||
widthValue = [width valueInComponent:component];
|
||||
if (widthValue)
|
||||
{
|
||||
widthStr = NSStringWithObject(widthValue);
|
||||
}
|
||||
calculateWidth = (widthStr == nil || [widthStr isEqual:@"*"]);
|
||||
}
|
||||
if (height != nil)
|
||||
{
|
||||
id heightValue;
|
||||
heightValue = [height valueInComponent:component];
|
||||
if (heightValue)
|
||||
{
|
||||
heightStr = NSStringWithObject(heightValue);
|
||||
}
|
||||
calculateHeight = (heightStr == nil || [heightStr isEqual:@"*"]);
|
||||
}
|
||||
|
||||
if (calculateWidth || calculateHeight)
|
||||
{
|
||||
GSWImageInfo * imageinfo;
|
||||
|
||||
GSOnceMLog(@"%@: No height or width information provided for '%@'. If possible, this information should be provided for best performance.",
|
||||
NSStringFromClass([self class]), fileNameValue);
|
||||
|
||||
imageinfo = [resourcemanager _imageInfoForUrl: resourceURL
|
||||
fileName: fileNameValue
|
||||
framework: frameworkName
|
||||
languages: [context languages]];
|
||||
if (imageinfo != nil)
|
||||
{
|
||||
if (calculateWidth)
|
||||
{
|
||||
widthStr = [imageinfo widthString];
|
||||
}
|
||||
{
|
||||
widthStr = [imageinfo widthString];
|
||||
}
|
||||
if (calculateHeight)
|
||||
{
|
||||
heightStr = [imageinfo heightString];
|
||||
}
|
||||
{
|
||||
heightStr = [imageinfo heightString];
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
NSLog(@"%@: Could not get height/width information for image at '%@' '%@' '%@'",
|
||||
NSStringFromClass([self class]), resourceURL,
|
||||
fileNameValue, frameworkName);
|
||||
fileNameValue, frameworkName);
|
||||
}
|
||||
}
|
||||
|
||||
[response _appendTagAttribute: @"src"
|
||||
value: resourceURL
|
||||
escapingHTMLAttributeValue: NO];
|
||||
|
||||
if (widthStr != nil)
|
||||
{
|
||||
[response _appendTagAttribute: @"width"
|
||||
value: widthStr
|
||||
escapingHTMLAttributeValue: NO];
|
||||
}
|
||||
if (heightStr != nil)
|
||||
{
|
||||
[response _appendTagAttribute: @"height"
|
||||
value: heightStr
|
||||
escapingHTMLAttributeValue: NO];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
[response _appendTagAttribute: @"src"
|
||||
value: resourceURL
|
||||
escapingHTMLAttributeValue: NO];
|
||||
|
||||
if (widthStr != nil)
|
||||
{
|
||||
NSString *message
|
||||
= [resourcemanager errorMessageUrlForResourceNamed: fileNameValue
|
||||
inFramework: frameworkName];
|
||||
[response _appendTagAttribute:@"src"
|
||||
value: message
|
||||
escapingHTMLAttributeValue:NO];
|
||||
[response _appendTagAttribute: @"width"
|
||||
value: widthStr
|
||||
escapingHTMLAttributeValue: NO];
|
||||
}
|
||||
if (heightStr != nil)
|
||||
{
|
||||
[response _appendTagAttribute: @"height"
|
||||
value: heightStr
|
||||
escapingHTMLAttributeValue: NO];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *message
|
||||
= [resourcemanager errorMessageUrlForResourceNamed: fileNameValue
|
||||
inFramework: frameworkName];
|
||||
[response _appendTagAttribute:@"src"
|
||||
value: message
|
||||
escapingHTMLAttributeValue:NO];
|
||||
}
|
||||
}
|
||||
|
||||
// used from GSWActiveImage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue