Code
1function Tab(title, url, type, content_type, data, tabbar_obj, tabbar_gName, content_container, hasClose, clickMethod, hasInfoBar, cs_load_order, lineNumber)
2{
3 //alert(title+"001")
4 this.title = title; // title to display on tab
5 this.url = url;
6 this.type = type; // scrolling div or iframe pane?
7 this.content_type = content_type; // type of content in tab: hits, info, code, project, etc.
8 this.data = data; // data to display in tab, if div type
9
10 this.tabbar = tabbar_obj; // Javascript object reference to parent tab bar
11 this.tb_gName = this.tabbar.gName; // name of global variable for tab bar
12 this.id = this.tabbar.nextTabId();
13 this.paneId = "pane" + this.id;
14 this.visible = true;
15 this.selected = false;
16 this.hasClose = hasClose;
17 this.hasInfoBar = hasInfoBar;
18 this.cs_load_order = cs_load_order; // the load order of this tab in a code space reload
19 this.content_container = content_container;
20 this.clickMethod = clickMethod; // method to call when clicked - false if none
21 this.width = 135; // the fixed width of the tab = width of background image
22 this.binaryDownloaded = false; // set to true when a PDF or DOC file (files that some browsers can display)
23 // when the proxy document (templates/pdf_file.html) sets it's href to the
24 // filer URL to trigger either a download or display of the file, depending
25 // on the client browser preferences. This flag prevents the file from being
26 if(typeof krugleSearch!="undefined")
27 {
28 this.keywords=krugleSearch.keywords.value; // store the keyword query terms in place when this tab is shown
29
30 }
31
32 // used to determine whether the tab should be redisplayed when query changes
33 this.lineNumber = lineNumber; // if set, and if this is a code file, then scroll to this line number
34
35 // methods
36 this.getHTML = tab_getHTML;
37 this.click = tab_click;
38 this.close = tab_close;
39 this.select = tab_select;
40 this.unselect = tab_unselect;
41 this.getTitle = tab_getTitle;
42 this.getDisplayTitle = tab_getDisplayTitle;
43 this.updateTitle = tab_updateTitle;
44 this.isCodeFile = tab_isCodeFile;
45 this.isContentPage = tab_isContentPage;
46 this.getURL = tab_getURL;
47 this.getDeepLinkURL = tab_getDeepLinkURL;
48 this.updateDeepLinkURL = tab_updateDeepLinkURL;
49 this.serializeState = tab_serializeState;
50 this.initializeHighlightItems = tab_initializeHighlightItems;
51 this.mapContentTypeToStreamType = tab_mapContentTypeToStreamType;
52 this.scrollToLineNumber = tab_scrollToLineNumber;
53
54 this.title = this.getTitle();
55 this.displayTitle = this.getDisplayTitle();
56 this.highlightedItems = null;
57 this.currentHighlight = -1;
58 this.maxHighlight = -1;
59
60 // if lineNumber set, the "internal" line number id's are 0 indexed, so use one less than the line number
61 if (this.lineNumber) {
62 this.lineNumber--;
63 }
64
65 // create a new container for content of the correct type
66 if (this.type == "div") {
67
68 /**//* displaying DIV in the tab */
69 if (this.hasInfoBar) {
70
71 var bgColor = "#CCCCCC";
72 var linkColor = "#333333";
73 if (this.content_type == "info") {
74 bgColor = "#BDB7CE";
75 linkColor = "#413A6F";
76 }
77
78 var html = "<div class=\"code_frame\" id=\"" + this.paneId + "\">";
79
80 /**//* display the information bar */
81 if (this.content_type == "code"
82 || this.content_type == "project"
83 || this.content_type == "entprojects"
84 || this.content_type == "term"
85 || this.content_type == "scmComments"
86 || this.content_type == "entcode"
87 || this.content_type == "enthome"
88 || this.content_type == "dfResult"
89
90 ) {
91 // alert(this.content_type)
92 // split the info bar out of the HTML data passed in from the XSLT
93 var htmlParts = this.data.split(/<p[^>]*>__SPLIT__<\/p>/i);
94 //alert(this.data)
95 // replace token __PANEID__ globally in the infobar HTML with this paneId
96 html += htmlParts[0].replace(/__PANEID__/g, this.paneId);
97
98 this.data = htmlParts[1];
99
100
101 }else if(this.content_type=="Bugs" || this.content_type == "dcResults")
102 {
103
104 // add the information bar
105 html += "<div id='kib" + this.paneId + "' class='info_bar'><div style='padding:4px;'>";
106
107 html += "<table width='100%' cellspacing='0' cellpadding='0' border='0'>";
108 html += "<tr align='left' valign='middle'><td height='19' bgcolor='" + bgColor + "'>";
109
110 // add tag insertion point
111 html += "<span id=\"ktagpoint" + this.paneId + "\"><img src='/media/img/tp.gif' width='11' height='9' border='0' /></span>";
112
113 html += "<a href='javascript:void 0;' class='hit_link' style='color:" + linkColor + ";' title='" + this.url + "'>" + this.title + "</a>";
114
115 html += "</td></tr></table>";
116 html += "<table width='100%' cellspacing='0' cellpadding='0' border='0'>";
117 html += "<tr valign='middle'>";
118 html += "<td align='left' style='border-bottom:1px dotted " + bgColor + ";' height='17'><span class='hit_range'>";
119
120
121
122 html += "</span></td>";
123 html += "<td align='right' style='border-bottom:1px dotted " + bgColor + ";' height='17'>";
124 html += "</td></tr></table>";
125
126 html += "</div></div>";
127
128 }
1function Tab(title, url, type, content_type, data, tabbar_obj, tabbar_gName, content_container, hasClose, clickMethod, hasInfoBar, cs_load_order, lineNumber)
2{
3 //alert(title+"001")
4 this.title = title; // title to display on tab
5 this.url = url;
6 this.type = type; // scrolling div or iframe pane?
7 this.content_type = content_type; // type of content in tab: hits, info, code, project, etc.
8 this.data = data; // data to display in tab, if div type
9
10 this.tabbar = tabbar_obj; // Javascript object reference to parent tab bar
11 this.tb_gName = this.tabbar.gName; // name of global variable for tab bar
12 this.id = this.tabbar.nextTabId();
13 this.paneId = "pane" + this.id;
14 this.visible = true;
15 this.selected = false;
16 this.hasClose = hasClose;
17 this.hasInfoBar = hasInfoBar;
18 this.cs_load_order = cs_load_order; // the load order of this tab in a code space reload
19 this.content_container = content_container;
20 this.clickMethod = clickMethod; // method to call when clicked - false if none
21 this.width = 135; // the fixed width of the tab = width of background image
22 this.binaryDownloaded = false; // set to true when a PDF or DOC file (files that some browsers can display)
23 // when the proxy document (templates/pdf_file.html) sets it's href to the
24 // filer URL to trigger either a download or display of the file, depending
25 // on the client browser preferences. This flag prevents the file from being
26 if(typeof krugleSearch!="undefined")
27 {
28 this.keywords=krugleSearch.keywords.value; // store the keyword query terms in place when this tab is shown
29
30 }
31
32 // used to determine whether the tab should be redisplayed when query changes
33 this.lineNumber = lineNumber; // if set, and if this is a code file, then scroll to this line number
34
35 // methods
36 this.getHTML = tab_getHTML;
37 this.click = tab_click;
38 this.close = tab_close;
39 this.select = tab_select;
40 this.unselect = tab_unselect;
41 this.getTitle = tab_getTitle;
42 this.getDisplayTitle = tab_getDisplayTitle;
43 this.updateTitle = tab_updateTitle;
44 this.isCodeFile = tab_isCodeFile;
45 this.isContentPage = tab_isContentPage;
46 this.getURL = tab_getURL;
47 this.getDeepLinkURL = tab_getDeepLinkURL;
48 this.updateDeepLinkURL = tab_updateDeepLinkURL;
49 this.serializeState = tab_serializeState;
50 this.initializeHighlightItems = tab_initializeHighlightItems;
51 this.mapContentTypeToStreamType = tab_mapContentTypeToStreamType;
52 this.scrollToLineNumber = tab_scrollToLineNumber;
53
54 this.title = this.getTitle();
55 this.displayTitle = this.getDisplayTitle();
56 this.highlightedItems = null;
57 this.currentHighlight = -1;
58 this.maxHighlight = -1;
59
60 // if lineNumber set, the "internal" line number id's are 0 indexed, so use one less than the line number
61 if (this.lineNumber) {
62 this.lineNumber--;
63 }
64
65 // create a new container for content of the correct type
66 if (this.type == "div") {
67
68 /**//* displaying DIV in the tab */
69 if (this.hasInfoBar) {
70
71 var bgColor = "#CCCCCC";
72 var linkColor = "#333333";
73 if (this.content_type == "info") {
74 bgColor = "#BDB7CE";
75 linkColor = "#413A6F";
76 }
77
78 var html = "<div class=\"code_frame\" id=\"" + this.paneId + "\">";
79
80 /**//* display the information bar */
81 if (this.content_type == "code"
82 || this.content_type == "project"
83 || this.content_type == "entprojects"
84 || this.content_type == "term"
85 || this.content_type == "scmComments"
86 || this.content_type == "entcode"
87 || this.content_type == "enthome"
88 || this.content_type == "dfResult"
89
90 ) {
91 // alert(this.content_type)
92 // split the info bar out of the HTML data passed in from the XSLT
93 var htmlParts = this.data.split(/<p[^>]*>__SPLIT__<\/p>/i);
94 //alert(this.data)
95 // replace token __PANEID__ globally in the infobar HTML with this paneId
96 html += htmlParts[0].replace(/__PANEID__/g, this.paneId);
97
98 this.data = htmlParts[1];
99
100
101 }else if(this.content_type=="Bugs" || this.content_type == "dcResults")
102 {
103
104 // add the information bar
105 html += "<div id='kib" + this.paneId + "' class='info_bar'><div style='padding:4px;'>";
106
107 html += "<table width='100%' cellspacing='0' cellpadding='0' border='0'>";
108 html += "<tr align='left' valign='middle'><td height='19' bgcolor='" + bgColor + "'>";
109
110 // add tag insertion point
111 html += "<span id=\"ktagpoint" + this.paneId + "\"><img src='/media/img/tp.gif' width='11' height='9' border='0' /></span>";
112
113 html += "<a href='javascript:void 0;' class='hit_link' style='color:" + linkColor + ";' title='" + this.url + "'>" + this.title + "</a>";
114
115 html += "</td></tr></table>";
116 html += "<table width='100%' cellspacing='0' cellpadding='0' border='0'>";
117 html += "<tr valign='middle'>";
118 html += "<td align='left' style='border-bottom:1px dotted " + bgColor + ";' height='17'><span class='hit_range'>";
119
120
121
122 html += "</span></td>";
123 html += "<td align='right' style='border-bottom:1px dotted " + bgColor + ";' height='17'>";
124 html += "</td></tr></table>";
125
126 html += "</div></div>";
127
128 }