isActive:(BOOL)_isActive isLeft:(BOOL)_isLeft
doScript:(BOOL)_doScript keys:(NSArray *)_keys
{
- NSString *headUri = nil;
- NSString *label = nil;
- NSString *scriptHref = nil;
- NSString *styleName = nil;
-
+ NSString *headUri = nil;
+ NSString *label = nil;
+ NSString *styleName = nil;
WEClientCapabilities *ccaps;
WOComponent *comp;
[_response appendContentString:@"<a href=\""];
- if (_doScript && (_info->isScript || _isActive)) {
- scriptHref =
- [self scriptHref:_info inContext:_ctx isLeft:_isLeft keys:_keys];
- [_response appendContentHTMLAttributeValue:scriptHref];
- }
- else {
- [_response appendContentHTMLAttributeValue:headUri];
- }
+ [_response appendContentHTMLAttributeValue:headUri];
[_response appendContentString:@"\" "];
[_response appendContentString:
[_response appendContentString:@"</a>"];
[_response appendContentString:@"</td>"];
-
-#if 0
- if (_doScript && (_info->isScript || _isActive)) {
- NSString *k; // key
- NSString *s; // selected tab icon
- NSString *u; // unselected tab icon
- //NSString *out;
-
- k = _info->key;
- s = _info->selIcon; // selectedTabIcon
- u = (_isLeft) ? _info->leftIcon : _info->tabIcon;
-
- s = WEUriOfResource(s, _ctx);
- u = WEUriOfResource(u, _ctx);
-
- s = ([s length] < 1) ? imgUri : s;
- u = ([u length] < 1) ? imgUri : u;
-
-#if 0
- out = [NSString alloc];
- out = [out initWithFormat:
- @"<script language=\"JavaScript\">\n"
- @"<!--\n"
- @"var %@Tab = new Array();\n"
- @"%@Tab[\"link\"] = %@TabLink;\n"
- @"%@Tab[\"href1\"] = \"%@\";\n"
- @"%@Tab[\"href2\"] = \"%@\";\n"
- @"%@Tab[\"Img\"] = window.document.%@TabImg;\n"
- @"%@Tab[\"Ar\"] = new Array();\n"
- @"%@Tab[\"Ar\"][0] = new Image();\n"
- @"%@Tab[\"Ar\"][0].src = \"%@\";\n"
- @"%@Tab[\"Ar\"][1] = new Image();\n"
- @"%@Tab[\"Ar\"][1].src = \"%@\";\n"
- @"//-->\n</script>",
- k, k, k, k, scriptHref, k, headUri,
- k, k, k, k,
- k, u, k, k, s
- ];
-
- [_response appendContentString:out];
- RELEASE(out);
-#else
-# define _appendStr_(_str_) [_response appendContentString:_str_]
- _appendStr_(@"<script language=\"JavaScript\">\n<!--\nvar ");
- _appendStr_(k); _appendStr_(@"Tab = new Array();\n");
-
- _appendStr_(k); _appendStr_(@"Tab[\"link\"] = ");
- _appendStr_(k); _appendStr_(@"TabLink;\n"); // linkName
-
- _appendStr_(k); _appendStr_(@"Tab[\"href1\"] = \"");
- _appendStr_(scriptHref); _appendStr_(@"\";\n"); // scriptHref
-
- _appendStr_(k); _appendStr_(@"Tab[\"href2\"] = \"");
- _appendStr_(_info->uri); _appendStr_(@"\";\n"); // actionHref
-
- _appendStr_(k); _appendStr_(@"Tab[\"Img\"] = window.document.");
- _appendStr_(k); _appendStr_(@"TabImg;\n");
- _appendStr_(k); _appendStr_(@"Tab[\"Ar\"] = new Array();\n");
- _appendStr_(k); _appendStr_(@"Tab[\"Ar\"][0] = new Image();\n");
- _appendStr_(k); _appendStr_(@"Tab[\"Ar\"][0].src = \"");
- _appendStr_(u); _appendStr_(@"\";\n"); // unselected img
- _appendStr_(k); _appendStr_(@"Tab[\"Ar\"][1] = new Image();\n");
- _appendStr_(k); _appendStr_(@"Tab[\"Ar\"][1].src = \"");
- _appendStr_(s); _appendStr_(@"\";\n"); // selected img
- _appendStr_(@"//-->\n</script>");
-#undef _appendStr_
-#endif
- }
-#endif
}
- (void)appendSubmitButton:(UIxTabItemInfo *)_info
toResponse:_response
inContext:_ctx
isActive:_isActive isLeft:_left
- doScript:_doScript keys:_keys];
+ doScript:NO keys:_keys];
}
- (void)_appendTabViewJSScriptToResponse:(WOResponse *)_response
inContext:_ctx
isActive:isActive
isLeft:(i == 0) ? YES : NO
- doScript:doScript
+ doScript:NO
keys:keys];
}
else {
inContext:_ctx
isActive:isActive
isLeft:(i == 0) ? YES : NO
- doScript:doScript
+ doScript:NO
keys:keys];
}
/* left corner */
[_response appendContentString:@" <td align=\"left\" width=\"10\">"];
- if (doScript) {
- [_response appendContentString:@"<div id=\"tabCorner"];
- [_response appendContentString:[self _tabViewCountInContext:_ctx]];
- [_response appendContentString:@"\" "];
- [_response appendContentString:@"style=\"display: "];
- [_response appendContentString:(isLeftActive) ? @"" : @"none"];
- [_response appendContentString:@";\">"];
- [_response appendContentString:@" "];
- [_response appendContentString:@"</div>"];
- }
- else if (isLeftActive)
+ if (isLeftActive)
[_response appendContentString:@" "];
- if (doScript) {
- [_response appendContentString:@"<div id=\"tabCornerLeft"];
- [_response appendContentString:[self _tabViewCountInContext:_ctx]];
- [_response appendContentString:@"\" "];
- [_response appendContentString:@"style=\"display: "];
- [_response appendContentString:(!isLeftActive) ? @"visible" : @"none"];
- [_response appendContentString:@";\">"];
- }
-
- if (!isLeftActive || doScript) {
+ if (!isLeftActive) {
NSString *uri;
uri = [self->leftCornerIcon stringValueInComponent:[_ctx component]];
if ((uri = WEUriOfResource(uri, _ctx))) {
[_response appendContentString:@"<img border=\"0\" alt=\"\" src=\""];
[_response appendContentString:uri];
- [_response appendContentString:@"\">"];
+ [_response appendContentString:@"\" />"];
}
else
[_response appendContentString:@" "];
}
- if (doScript)
- [_response appendContentString:@"</div>"];
-
- [_response appendContentString:@"</td>\n"];
+
+ [_response appendContentString:@"</td>"];
/* right corner */
[_response appendContentString:@" <td align=\"right\">"];
WOComponent *cmp;
NSString *bgcolor;
BOOL isLeftActive;
- BOOL doScript;
id nestedState;
NSString *activeKey;
NSArray *keys;
int tabViewCount; /* used for image id's and writing script once */
- doScript = NO; /* perform tab-clicks on browser (use javascript) */
tabViewCount = [[_ctx valueForKey:@"UIxTabViewScriptDone"] intValue];
cmp = [_ctx component];
- /* check for browser */
- {
- WEClientCapabilities *ccaps;
- //BOOL isJavaScriptBrowser;
-
- ccaps = [[_ctx request] clientCapabilities];
- doScript = [ccaps isInternetExplorer] && [ccaps isJavaScriptBrowser];
- doScript = (doScript &&
- [[[cmp session]
- valueForKey:@"isJavaScriptEnabled"] boolValue]);
- }
-
- /* disable javascript */
- doScript = NO;
-
/* save state */
nestedState = [self saveNestedStateInContext:_ctx];
if ([self->selection isValueSettable])
[self->selection setValue:activeKey inComponent:[_ctx component]];
}
-
- if (doScript) {
- doScript = [[keys valueForKey:@"isScript"] containsObject:YesNumber];
- [_ctx setObject:[NSNumber numberWithBool:doScript]
- forKey:UIxTabView_SCRIPT];
- }
-
- /* start appending */
- if ((doScript) && (tabViewCount == 0))
- [self _appendTabViewJSScriptToResponse:_response inContext:_ctx];
+ /* start appending */
/* count up for unique tabCorner/tabCornerLeft images */
[_ctx takeValue:[NSNumber numberWithInt:(tabViewCount + 1)]
[self _appendHeaderRowToResponse:_response inContext:_ctx
keys:keys activeKey:activeKey
- doScript:doScript];
+ doScript:NO];
[_ctx deleteLastElementIDComponent]; // 'h' for head
[_ctx removeObjectForKey:UIxTabView_HEAD];
-#if 0
- /* header foot row */
-
- [self _appendHeaderFootRowToResponse:_response inContext:_ctx
- bgcolor:bgcolor
- doScript:doScript
- isLeftActive:isLeftActive];
-#endif
-
/* body row */
[self _appendBodyRowToResponse:_response inContext:_ctx