Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5f68c975

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

Refactoring: DHTML-Tab-Dialog durch Variante aus jQuery-UI ersetzt

Unterschiede anzeigen:

SL/Form.pm
467 467
  # standard css for all
468 468
  # this should gradually move to the layouts that need it
469 469
  $layout->use_stylesheet("$_.css") for qw(
470
    main menu tabcontent list_accounts jquery.autocomplete
470
    main menu list_accounts jquery.autocomplete
471 471
    jquery.multiselect2side frame_header/header
472 472
    ui-lightness/jquery-ui-1.8.12.custom
473
    jquery-ui.custom
473 474
    js/jscalendar/calendar-win2k-1
474 475
  );
475 476

  
......
515 516
  print "  $_\n" for @header;
516 517
  print <<EOT;
517 518
  <meta name="robots" content="noindex,nofollow">
518
  <script type="text/javascript" src="js/tabcontent.js">
519

  
520
  /***********************************************
521
   * Tab Content script v2.2- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
522
   * This notice MUST stay intact for legal use
523
   * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
524
   ***********************************************/
525

  
526
  </script>
527 519
 </head>
528 520
 <body>
529 521

  
SL/Template/Plugin/L.pm
464 464

  
465 465
    next if $tab eq '';
466 466

  
467
    my $selected = $params{selected} == $i;
468
    my $tab_id   = "__tab_id_$i";
469
    push @header, $self->li_tag(
470
      $self->link('', $tab->{name}, rel => $tab_id),
471
        ($selected ? (class => 'selected') : ())
472
    );
473
    push @blocks, $self->div_tag($tab->{data},
474
      id => $tab_id, class => 'tabcontent');
467
    my $tab_id = "__tab_id_$i";
468
    push @header, $self->li_tag($self->link('#' . $tab_id, $tab->{name}));
469
    push @blocks, $self->div_tag($tab->{data}, id => $tab_id);
475 470
  }
476 471

  
477 472
  return '' unless @header;
478
  return $self->ul_tag(
479
    join('', @header), id => $id, class => 'shadetabs'
480
  ) .
481
  $self->div_tag(
482
    join('', @blocks), class => 'tabcontentstyle'
483
  ) .
484
  $self->javascript(
485
    qq|var $id = new ddtabcontent("$id");$id.setpersist(true);| .
486
    qq|$id.setselectedClassTarget("link");$id.init();|
487
  );
473

  
474
  my $ul = $self->ul_tag(join('', @header), id => $id);
475
  return $self->div_tag(join('', $ul, @blocks), class => 'tabwidget');
488 476
}
489 477

  
490 478
sub tab {
......
890 878
    L.tab(LxERP.t8('Custom Variables'), 'part/_cvar_tab.html', if => SELF.display_cvar_tab),
891 879
  ]) %]
892 880

  
893
An optional attribute is C<selected>, which accepts the ordinal of a tab which
894
should be selected by default.
895

  
896 881
=item C<areainput_tag $name, $content, %PARAMS>
897 882

  
898 883
Creates a generic input tag or textarea tag, depending on content size. The
css/kivitendo/jquery-ui.custom.css
1
.tabwidget {
2
  background: white;
3
  position: relative;
4
  padding: .2em;
5
  zoom: 1;
6
  -webkit-border-radius: 4px;
7
  border-radius: 4px;
8
  border: 1px solid #dddddd;
9
  color: #333333;
10
  font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
11
  font-size: 1.1em;
12
}
13

  
14
.tabwidget ul {
15
  margin: 0;
16
  padding: .2em .2em 0;
17
  outline: 0;
18
  line-height: 1.3;
19
  text-decoration: none;
20
  font-size: 100%;
21
  font-weight: bold;
22
  list-style: none;
23
  display: block;
24
  background: #dddddd;
25
  border: 1px #dddddd;
26
  color: #fe5f14;
27
  margin: 0;
28
  padding: .2em .2em 0;
29
}
30

  
31
.tabwidget ul::after {
32
  content: ".";
33
  display: block;
34
  height: 0;
35
  clear: both;
36
  visibility: hidden;
37
}
38

  
39
.tabwidget ul li {
40
  list-style: none;
41
  float: left;
42
  position: relative;
43
  top: 1px;
44
  margin: 0 .2em 1px 0;
45
  border-bottom: 0 !important;
46
  border-top-right-radius: 4px;
47
  padding: 0;
48
  white-space: nowrap;
49
  border: 1px solid #cccccc;
50
  background: #f6f6f6 url(ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x;
51
  font-weight: bold;
52
  color: #1c94c4;
53
}
54

  
55
.tabwidget ul li a { float: left; padding: .5em 1em; text-decoration: none; }
56
.tabwidget ul li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
57
.tabwidget ul li.ui-tabs-selected a, .tabwidget.ui-tabs-nav li.ui-state-disabled a, .tabwidget.ui-tabs-nav li.ui-state-processing a { cursor: text; }
58
.tabwidget ul li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; }
59

  
60
.tabwidget div {
61
  display: none;
62
}
63

  
64
.tabwidget.ui-state-active {
65
}
66

  
67
.tabwidget .ui-widget-header {
68
  background: #dddddd;
69
  border: 1px #dddddd;
70
  color: #fe5f14;
71
}
72

  
73

  
74
.tabwidget .ui-state-active a, .tabwidget .ui-state-active a:link, .tabwidget .ui-state-active a:visited {
75
  color: #fe5f14;
76
}
77

  
78
.tabwidget .ui-state-active, .tabwidget.ui-widget-content .ui-state-active, .tabwidget .ui-widget-header .ui-state-active {
79
  color: #fe5f14;
80
}
81

  
82
.tabwidget .ui-state-default a, .tabwidget .ui-state-default a:link {
83
  color: #006400;
84
}
85

  
86
.tabwidget .ui-state-active a, .tabwidget .ui-state-active a:link {
87
  color: #fe5f14;
88
}
89

  
90
.tabwidget .ui-state-hover a, .tabwidget .ui-state-hover a:hover {
91
  color: #fe5f14;
92
}
css/kivitendo/tabcontent.css
1
/* ######### CSS for Shade Tabs. Remove if not using ######### */
2

  
3
.shadetabs{
4
padding: 3px 0;
5
margin-left: 0;
6
margin-top: 1px;
7
margin-bottom: 0;
8
font: bold 12px Verdana;
9
list-style-type: none;
10
text-align: left; /*set to left, center, or right to align the menu as desired*/
11
}
12

  
13
.shadetabs li{
14
display: inline;
15
margin: 0;
16
}
17

  
18
.shadetabs li a{
19
text-decoration: none;
20
position: relative;
21
z-index: 1;
22
padding: 3px 7px;
23
margin-right: 3px;
24
background-color:#A1A1A1;
25
border-bottom: none ;
26
color: #000000;
27
-moz-border-radius:0.4em 0.4em 0 0; /* Firefox */
28
-webkit-border-radius:0.4em 0.4em 0 0; /* Safari, Chrome */
29
-khtml-border-radius:0.4em 0.4em 0 0; /* Konqueror */
30
border-radius:0.4em 0.4em 0 0 ; /* CSS3 */
31
behavior:url(border-radius.htc);
32
border-bottom: thin solid #FE5F14;
33
}
34

  
35
.shadetabs li a:visited{
36
color: #000000;
37
border: none;
38
background-color:#A1A1A1;
39
border-bottom: none ;
40
}
41

  
42
.shadetabs li a:hover{
43
color: #FE5F14;
44
background-color:#EBEBEB;
45
}
46

  
47
.shadetabs li a.selected{ /*selected main tab style */
48
position: relative;
49
top: 1px;
50
background-color: #D1D1D1;
51
color:#000000;
52
}
53

  
54
.shadetabs li a.selected{ /*selected main tab style */
55
border-bottom-color:#EBEBEB;
56
}
57

  
58
.shadetabs li a.selected:hover{ /*selected main tab style */
59
text-decoration: none;
60
}
61

  
62
.tabcontent{
63
display:none;
64
}
65

  
66
@media print {
67
.tabcontent {
68
display:block !important;
69
}
70
}
71

  
72
/* ######### CSS for Inverted Modern Bricks II Tabs. Remove if not using ######### */
73

  
74
.modernbricksmenu2{
75
padding: 0;
76
width: 362px;
77
border-top: 5px solid #D25A0B; /*Brown color theme*/
78
background: transparent;
79
voice-family: "\"}\"";
80
voice-family: inherit;
81
}
82

  
83
.modernbricksmenu2 ul{
84
margin:0;
85
margin-left: 10px; /*margin between first menu item and left browser edge*/
86
padding: 0;
87
list-style: none;
88
}
89

  
90
.modernbricksmenu2 li{
91
display: inline;
92
margin: 0 2px 0 0;
93
padding: 0;
94
text-transform:uppercase;
95
}
96

  
97
.modernbricksmenu2 a{
98
float: left;
99
display: block;
100
font: bold 11px Arial;
101
color: white;
102
text-decoration: none;
103
margin: 0 1px 0 0; /*Margin between each menu item*/
104
padding: 5px 10px;
105
background-color: black; /*Brown color theme*/
106
border-top: 1px solid white;
107
}
108

  
109
.modernbricksmenu2 a:hover{
110
background-color: #D25A0B; /*Brown color theme*/
111
color: white;
112
}
113

  
114
.modernbricksmenu2 a.selected{ /*currently selected tab*/
115
background-color: #D25A0B; /*Brown color theme*/
116
color: white;
117
border-color: #D25A0B; /*Brown color theme*/
118
}
119

  
120
.tabcontent{
121
display:none;
122
}
123

  
124
@media print {
125
.tabcontent {
126
display:block !important;
127
}
128
}
129

  
130
/* ######### CSS for Indented CSS Tabs. Remove if not using ######### */
131

  
132

  
133
.indentmenu{
134
font: bold 13px Arial;
135
width: 100%; /*leave this value as is in most cases*/
136
}
137

  
138
.indentmenu ul{
139
margin: 0;
140
padding: 0;
141
float: left;
142
/* width: 80%; width of menu*/
143
border-top: 1px solid navy; /*navy border*/
144
background: black url(../image/indentbg.gif) center center repeat-x;
145
}
146

  
147
.indentmenu ul li{
148
display: inline;
149
}
150

  
151
.indentmenu ul li a{
152
float: left;
153
color: white; /*text color*/
154
padding: 5px 11px;
155
text-decoration: none;
156
border-right: 1px solid navy; /*navy divider between menu items*/
157
}
158

  
159
.indentmenu ul li a:visited{
160
color: white;
161
}
162

  
163
.indentmenu ul li a.selected{
164
color: white !important;
165
padding-top: 6px; /*shift text down 1px*/
166
padding-bottom: 4px;
167
background: black url(../image/indentbg2.gif) center center repeat-x;
168
}
169

  
170

  
171
.tabcontentstyle{ /*style of tab content oontainer*/
172
/* border: 1px solid #D2691E; */
173
width: 95%;
174
margin-bottom: 1em;
175
padding: 10px;
176
-moz-border-radius:0 0 0.4em 0.4em; /* Firefox */
177
-webkit-border-radius:0 0 0.4em 0.4em; /* Safari, Chrome */
178
-khtml-border-radius:0 0 0.4em 0.4em; /* Konqueror */
179
border-radius:0 0 0.4em 0.4em; /* CSS3 */
180
behavior:url(border-radius.htc);
181
border: thin solid #A1A1A1;
182

  
183
}
184

  
185
.tabcontent{
186
display:none;
187
}
188

  
189
@media print {
190
.tabcontent {
191
display:block !important;
192
}
193
}
css/lx-office-erp/jquery-ui.custom.css
1
.tabwidget {
2
  background: none;
3
  position: relative;
4
  padding: .2em;
5
  zoom: 1;
6
  -webkit-border-radius: 0;
7
  border-radius: 0;
8
  border: 1px solid #000000;
9
  color: #000000;
10
  font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif;
11
  font-size: 1.1em;
12
}
13

  
14
.tabwidget ul {
15
  margin: 0;
16
  padding: .2em .2em 0;
17
  outline: 0;
18
  line-height: 1.3;
19
  text-decoration: none;
20
  font-size: 100%;
21
  font-weight: bold;
22
  list-style: none;
23
  display: block;
24
  background: url("../../image/fade.png");
25
  border: 0;
26
  color: #000000;
27
  margin: 0;
28
  padding: .2em .2em 0;
29
}
30

  
31
.tabwidget ul::after {
32
  content: ".";
33
  display: block;
34
  height: 0;
35
  clear: both;
36
  visibility: hidden;
37
}
38

  
39
.tabwidget ul li {
40
  list-style: none;
41
  float: left;
42
  position: relative;
43
  top: 1px;
44
  margin: 0 .2em 1px 0;
45
  border-bottom: 0 !important;
46
  border-top-right-radius: 0;
47
  padding: 0;
48
  white-space: nowrap;
49
  border: 1px solid #cccccc;
50
  background: #f6f6f6 url(ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x;
51
  font-weight: bold;
52
  color: #000000;
53
}
54

  
55
.tabwidget ul li a { float: left; padding: .5em 1em; text-decoration: none; }
56
.tabwidget ul li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
57
.tabwidget ul li.ui-tabs-selected a, .tabwidget.ui-tabs-nav li.ui-state-disabled a, .tabwidget.ui-tabs-nav li.ui-state-processing a { cursor: text; }
58
.tabwidget ul li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; }
59

  
60
.tabwidget div {
61
  display: none;
62
}
63

  
64
.tabwidget.ui-state-active {
65
}
66

  
67
.tabwidget .ui-widget-header {
68
  background: url("../../image/fade.png");
69
  border: 0;
70
  color: #000000;
71
}
72

  
73

  
74
.tabwidget .ui-state-active a, .tabwidget .ui-state-active a:link, .tabwidget .ui-state-active a:visited {
75
  color: #000000;
76
}
77

  
78
.tabwidget .ui-state-active, .tabwidget.ui-widget-content .ui-state-active, .tabwidget .ui-widget-header .ui-state-active {
79
  color: #000000;
80
}
81

  
82
.tabwidget .ui-state-default a, .tabwidget .ui-state-default a:link {
83
  color: #999999;
84
}
85

  
86
.tabwidget .ui-state-active a, .tabwidget .ui-state-active a:link {
87
  color: #000000;
88
  text-decoration: underline;
89
}
90

  
91
.tabwidget .ui-state-hover a, .tabwidget .ui-state-hover a:hover {
92
  color: #000000;
93
  text-decoration: underline;
94
}
css/lx-office-erp/tabcontent.css
1
/* ######### CSS for Shade Tabs. Remove if not using ######### */
2

  
3
.shadetabs{
4
padding: 3px 0;
5
margin-left: 0;
6
margin-top: 1px;
7
margin-bottom: 0;
8
font: bold 12px Verdana, sans-serif;
9
list-style-type: none;
10
text-align: left; /*set to left, center, or right to align the menu as desired*/
11
}
12

  
13
.shadetabs li{
14
display: inline;
15
margin: 0;
16
}
17

  
18
.shadetabs li a{
19
text-decoration: none;
20
position: relative;
21
z-index: 1;
22
padding: 3px 7px;
23
margin-right: 3px;
24
border: 1px solid #778;
25
color: #2d2b2b;
26
background: white url(../../image/shade.gif) top left repeat-x;
27
}
28

  
29
.shadetabs li a:visited{
30
color: #2d2b2b;
31
}
32

  
33
.shadetabs li a:hover{
34
text-decoration: underline;
35
color: #2d2b2b;
36
}
37

  
38
.shadetabs li a.selected{ /*selected main tab style */
39
position: relative;
40
top: 1px;
41
}
42

  
43
.shadetabs li a.selected{ /*selected main tab style */
44
background-image: url(../../image/shadeactive.gif);
45
border-bottom-color: white;
46
}
47

  
48
.shadetabs li a.selected:hover{ /*selected main tab style */
49
text-decoration: none;
50
}
51

  
52
.tabcontent{
53
display:none;
54
}
55

  
56
@media print {
57
.tabcontent {
58
display:block !important;
59
}
60
}
61

  
62
.tabcontent{
63
display:none;
64
}
65

  
66
@media print {
67
.tabcontent {
68
display:block !important;
69
}
70
}
71

  
72
.tabcontentstyle{ /*style of tab content oontainer*/
73
border: 1px solid gray;
74
width: 95%;
75
margin-bottom: 1em;
76
padding: 10px;
77
}
78

  
79
.tabcontent{
80
display:none;
81
}
82

  
83
@media print {
84
.tabcontent {
85
display:block !important;
86
}
87
}
js/common.js
61 61
  var forbidden = test_val.match(/[^\s\d\(\)\-\+\*\/\.]/g);
62 62
  if (forbidden && forbidden.length > 0 ){
63 63
    return show_alert_and_focus(input_name, wrongNumberFormat);
64
  } 
64
  }
65 65

  
66
  try{ 
66
  try{
67 67
    eval(test_val);
68 68
  }catch(err){
69 69
    return show_alert_and_focus(input_name, wrongNumberFormat);
70
  } 
70
  }
71 71

  
72 72
}
73 73

  
......
161 161
}
162 162

  
163 163
$(document).ready(function () {
164
  // initialize all jQuery UI tab elements:
165
  $(".tabwidget").each(function(idx, element) { $(element).tabs(); });
166

  
164 167
  $('input').focus(function(){
165 168
    if (focussable(this)) window.focused_element = this;
166 169
  });
js/tabcontent.js
1
//** Tab Content script v2.0- ? Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
2
//** Updated Oct 7th, 07 to version 2.0. Contains numerous improvements:
3
//   -Added Auto Mode: Script auto rotates the tabs based on an interval, until a tab is explicitly selected
4
//   -Ability to expand/contract arbitrary DIVs on the page as the tabbed content is expanded/ contracted
5
//   -Ability to dynamically select a tab either based on its position within its peers, or its ID attribute (give the target tab one 1st)
6
//   -Ability to set where the CSS classname "selected" get assigned- either to the target tab's link ("A"), or its parent container
7
//** Updated Feb 18th, 08 to version 2.1: Adds a "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically
8
//** Updated April 8th, 08 to version 2.2: Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0) 
9

  
10
////NO NEED TO EDIT BELOW////////////////////////
11

  
12
function ddtabcontent(tabinterfaceid){
13
	this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container
14
	this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container
15
	this.enabletabpersistence=true
16
	this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container
17
	this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array
18
	this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values)
19
	this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values)
20
	this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link")
21
}
22

  
23
ddtabcontent.getCookie=function(Name){ 
24
	var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
25
	if (document.cookie.match(re)) //if cookie found
26
		return document.cookie.match(re)[0].split("=")[1] //return its value
27
	return ""
28
}
29

  
30
ddtabcontent.setCookie=function(name, value){
31
	document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/)
32
}
33

  
34
ddtabcontent.prototype={
35

  
36
	expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers
37
		this.cancelautorun() //stop auto cycling of tabs (if running)
38
		var tabref=""
39
		try{
40
			if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr
41
				tabref=document.getElementById(tabid_or_position)
42
			else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr
43
				tabref=this.tabs[tabid_or_position]
44
		}
45
		catch(err){alert("Invalid Tab ID or position entered!")}
46
		if (tabref!="") //if a valid tab is found based on function parameter
47
			this.expandtab(tabref) //expand this tab
48
	},
49

  
50
	cycleit:function(dir, autorun){ //PUBLIC function to move foward or backwards through each hot tab (tabinstance.cycleit('foward/back') )
51
		if (dir=="next"){
52
			var currentTabIndex=(this.currentTabIndex<this.hottabspositions.length-1)? this.currentTabIndex+1 : 0
53
		}
54
		else if (dir=="prev"){
55
			var currentTabIndex=(this.currentTabIndex>0)? this.currentTabIndex-1 : this.hottabspositions.length-1
56
		}
57
		if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function
58
			this.cancelautorun() //stop auto cycling of tabs (if running)
59
		this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]])
60
	},
61

  
62
	setpersist:function(bool){ //PUBLIC function to toggle persistence feature
63
			this.enabletabpersistence=bool
64
	},
65

  
66
	setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link")
67
		this.selectedClassTarget=objstr || "link"
68
	},
69

  
70
	getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to
71
		return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref
72
	},
73

  
74
	urlparamselect:function(tabinterfaceid){
75
		var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL
76
		return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index
77
	},
78

  
79
	expandtab:function(tabref){
80
		var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand
81
		//Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through
82
		var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : ""
83
		this.expandsubcontent(subcontentid)
84
		this.expandrevcontent(associatedrevids)
85
		for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected"
86
			this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : ""
87
		}
88
		if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers
89
			ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition)
90
		this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array
91
	},
92

  
93
	expandsubcontent:function(subcontentid){
94
		for (var i=0; i<this.subcontentids.length; i++){
95
			var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop)
96
			subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value
97
		}
98
	},
99

  
100
	expandrevcontent:function(associatedrevids){
101
		var allrevids=this.revcontentids
102
		for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface
103
			//if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it
104
			document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none"
105
		}
106
	},
107

  
108
	setcurrenttabindex:function(tabposition){ //store current position of tab (within hottabspositions[] array)
109
		for (var i=0; i<this.hottabspositions.length; i++){
110
			if (tabposition==this.hottabspositions[i]){
111
				this.currentTabIndex=i
112
				break
113
			}
114
		}
115
	},
116

  
117
	autorun:function(){ //function to auto cycle through and select tabs based on a set interval
118
		this.cycleit('next', true)
119
	},
120

  
121
	cancelautorun:function(){
122
		if (typeof this.autoruntimer!="undefined")
123
			clearInterval(this.autoruntimer)
124
	},
125

  
126
	init:function(automodeperiod){
127
		var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled)
128
		var selectedtab=-1 //Currently selected tab index (-1 meaning none)
129
		var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid) //returns null or index from: tabcontent.htm?tabinterfaceid=index
130
		this.automodeperiod=automodeperiod || 0
131
		for (var i=0; i<this.tabs.length; i++){
132
			this.tabs[i].tabposition=i //remember position of tab relative to its peers
133
			if (this.tabs[i].getAttribute("rel")){
134
				var tabinstance=this
135
				this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers
136
				this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value)
137
				this.tabs[i].onclick=function(){
138
					tabinstance.expandtab(this)
139
					tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
140
					return false
141
				}
142
				if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element
143
					this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/))
144
				}
145
				if (selectedtabfromurl==i || this.enabletabpersistence && selectedtab==-1 && parseInt(persistedtab)==i || !this.enabletabpersistence && selectedtab==-1 && this.getselectedClassTarget(this.tabs[i]).className=="selected"){
146
					selectedtab=i //Selected tab index, if found
147
				}
148
			}
149
		} //END for loop
150
		if (selectedtab!=-1) //if a valid default selected tab index is found
151
			this.expandtab(this.tabs[selectedtab]) //expand selected tab (either from URL parameter, persistent feature, or class="selected" class)
152
		else //if no valid default selected index found
153
			this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr
154
		if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){
155
			this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod)
156
		}
157
	} //END int() function
158

  
159
} //END Prototype assignment
templates/webpages/am/config.html
1 1
[%- USE T8 %]
2 2
[%- USE LxERP %]
3 3
[%- USE HTML %][%- USE L %]
4
 <p>
5
  <div class="listtop">[% title %]</div>
6
 </p>
4
 <div class="listtop">[% title %]</div>
7 5

  
8 6
 <form method="post" action="am.pl" name="Form">
9

  
10
  <ul id="maintab" class="shadetabs">
11
   <li class="selected"><a href="#" rel="page_personal_settings">[% 'Personal settings' | $T8 %]</a></li>
12
   <li><a href="#" rel="page_display_options">[% 'Display options' | $T8 %]</a></li>
13
   <li><a href="#" rel="page_print_options">[% 'Print options' | $T8 %]</a></li>
14
   <li><a href="#" rel="page_todo_list_options">[% 'TODO list options' | $T8 %]</a></li>
15
  </ul>
16

  
17 7
  <input type="hidden" name="type" value="preferences">
18 8

  
19
  <div class="tabcontentstyle">
9
  <div class="tabwidget">
10
   <ul>
11
    <li><a href="#page_personal_settings">[% 'Personal settings' | $T8 %]</a></li>
12
    <li><a href="#page_display_options">[% 'Display options' | $T8 %]</a></li>
13
    <li><a href="#page_print_options">[% 'Print options' | $T8 %]</a></li>
14
    <li><a href="#page_todo_list_options">[% 'TODO list options' | $T8 %]</a></li>
15
   </ul>
20 16

  
21
   <div id="page_personal_settings" class="tabcontent">
17
   <div id="page_personal_settings">
22 18

  
23 19
    <table>
24 20
     <tr>
......
77 73
      </tr>
78 74

  
79 75
    </table>
80

  
81
    <br style="clear: left" />
82 76
   </div>
83 77

  
84
   <div id="page_display_options" class="tabcontent">
78
   <div id="page_display_options">
85 79

  
86 80
    <table>
87 81
     <tr>
......
147 141
      </td>
148 142
     </tr>
149 143
    </table>
150

  
151
    <br style="clear: left" />
152 144
   </div>
153 145

  
154
   <div id="page_print_options" class="tabcontent">
146
   <div id="page_print_options">
155 147

  
156 148
    <table>
157 149
     <input name="printer" type="hidden" value="[% HTML.escape(myconfig_printer) %]">
......
182 174
      <td><input name="copies" size="10" value="[% HTML.escape(myconfig_copies) %]"></td>
183 175
     </tr>
184 176
    </table>
185

  
186
    <br style="clear: left" />
187 177
   </div>
188 178

  
189
   <div id="page_todo_list_options" class="tabcontent">
179
   <div id="page_todo_list_options">
190 180

  
191 181
    <table>
192 182
     <tr>
......
229 219
     </tr>
230 220
     [%- END %]
231 221
    </table>
232

  
233
    <br style="clear: left" />
234 222
   </div>
235 223
  </div>
236 224

  
237 225
  <p><input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]"></p>
238 226
 </form>
239

  
240
 <script type="text/javascript">
241
  <!--
242
      var maintab = new ddtabcontent("maintab");
243
      maintab.setpersist(true);
244
      maintab.setselectedClassTarget("link"); //"link" or "linkparent"
245
      maintab.init();
246
    -->
247
 </script>
templates/webpages/ct/_contact.html
151 151
    [% IF cp_id %]
152 152
      <input type="button" id="delete_contact" onclick="submitInputButton(this);" name="action" value="[% 'Delete Contact' | $T8 %]">
153 153
    [% END %]
154

  
155
    <br style="clear: left" />
templates/webpages/ct/_shipto.html
62 62

  
63 63
[%- IF shipto_id %]
64 64
    <input type="submit" id="delete_shipto" name="action" value="[% 'Delete Shipto' | $T8 %]">
65
    <br style="clear: left" />
66 65
[%- END %]
templates/webpages/ct/form_footer.html
57 57
        button.form.submit();
58 58
      }
59 59

  
60
      var maintab = new ddtabcontent("maintab");
61
      maintab.setpersist(true);
62
      maintab.setselectedClassTarget("link"); //"link" or "linkparent"
63
      maintab.init();
64

  
65 60
      function check_taxzone_and_ustid() {
66 61
        if (($('#taxzone_id').attr('value') == '1') && ($('#ustid').attr('value') == '')) {
67 62
          alert('[% LxERP.t8('Please enter the sales tax identification number.') %]');
templates/webpages/ct/form_header.html
8 8

  
9 9
 <form method="post" name="ct" action="ct.pl" >
10 10

  
11
  <ul id="maintab" class="shadetabs">
12
   <li class="selected"><a href="#" rel="billing">[% 'Billing Address' | $T8 %]</a></li>
13
   <li><a href="#" rel="shipto">[% 'Shipping Address' | $T8 %]</a></li>
14
   <li><a href="#" rel="contacts">[% 'Contacts' | $T8 %]</a></li>
11
  <div class="tabwidget">
12
   <ul>
13
    <li><a href="#billing">[% 'Billing Address' | $T8 %]</a></li>
14
    <li><a href="#shipto">[% 'Shipping Address' | $T8 %]</a></li>
15
    <li><a href="#contacts">[% 'Contacts' | $T8 %]</a></li>
15 16
[%- IF id %]
16
   <li><a href="#" rel="deliveries">[% 'Supplies' | $T8 %]</a></li>
17
    <li><a href="#deliveries">[% 'Supplies' | $T8 %]</a></li>
17 18
[%- END %]
18
   <li><a href="#" rel="vcnotes">[% 'Notes' | $T8 %]</a></li>
19
   [%- IF CUSTOM_VARIABLES.CT.size %]
20
   <li><a href="#" rel="custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
21
   [%- END %]
22
  </ul>
23

  
24
  <div class="tabcontentstyle">
19
    <li><a href="#vcnotes">[% 'Notes' | $T8 %]</a></li>
20
[%- IF CUSTOM_VARIABLES.CT.size %]
21
    <li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
22
[%- END %]
23
   </ul>
25 24

  
26
   <div id="billing" class="tabcontent">
25
   <div id="billing">
27 26

  
28 27
    <table width="100%">
29 28
     <tr height="5"></tr>
......
295 294
      <td><textarea name="notes" rows="3" cols="60" wrap="soft">[% HTML.escape(notes) %]</textarea></td>
296 295
     </tr>
297 296
    </table>
298

  
299
    <br style="clear: left" />
300 297
   </div>
301 298

  
302
   <div id="shipto" class="tabcontent">
299
   <div id="shipto">
303 300
    [% INCLUDE 'ct/_shipto.html' %]
304 301
   </div>
305 302

  
306
   <div id="contacts" class="tabcontent">
303
   <div id="contacts">
307 304
    [% INCLUDE 'ct/_contact.html' %]
308 305
   </div>
309 306

  
310
   <div id="deliveries" class="tabcontent">
307
   <div id="deliveries">
311 308
    <table>
312 309
     <tr>
313 310
      <th align="right">[% 'Shipping Address' | $T8 %]</th>
......
341 338
      </td>
342 339
     </tr>
343 340
    </table>
344

  
345
    <br style="clear: left" />
346 341
   </div>
347 342

  
348
   <div id="vcnotes" class="tabcontent">
343
   <div id="vcnotes">
349 344

  
350 345
    [%- IF NOTES && NOTES.size %]
351 346
    <p>
......
414 409
      </tr>
415 410
     </table>
416 411
    </p>
417

  
418
    <br style="clear: left" />
419 412
   </div>
420 413

  
421 414
   [%- IF CUSTOM_VARIABLES.CT.size %]
422
   <div id="custom_variables" class="tabcontent">
415
   <div id="custom_variables">
423 416

  
424 417
    <p>
425 418
     <table>
......
431 424
      [%- END %]
432 425
     </table>
433 426
    </p>
434

  
435
    <br style="clear: left" />
436 427
   </div>
437 428
   [%- END %]
438 429

  
templates/webpages/ic/form_footer.html
24 24
    <td><hr size="3" noshade></td>
25 25
  </tr>
26 26
 </table>
27

  
28
 <br style="clear: left" />
29 27
</div>
30 28

  
31 29
[%- IF id %]
32
<div id="sales_price_information" class="tabcontent">
30
<div id="sales_price_information">
33 31
  [% PROCESS ic/sales_price_information.html id=id %]
34 32
</div>
35 33
[%- END %]
36 34

  
37 35
[%- IF CUSTOM_VARIABLES.size %]
38
<div id="custom_variables" class="tabcontent">
36
<div id="custom_variables">
39 37

  
40 38
 <p>[% 'Unchecked custom variables will not appear in orders and invoices.' | $T8 %]</p>
41 39

  
......
50 48
   [%- END %]
51 49
  </table>
52 50
 </p>
53

  
54
 <br style="clear: left" />
55 51
</div>
56 52
[%- END %]
57 53

  
......
86 82
</form>
87 83

  
88 84
<script type="text/javascript" src="js/wz_tooltip.js"></script>
89
<script type="text/javascript">
90
<!--
91
    var maintab = new ddtabcontent("maintab");
92
    maintab.setpersist(true);
93
    maintab.setselectedClassTarget("link"); //"link" or "linkparent"
94
    maintab.init();
95
  -->
96
</script>
97

  
templates/webpages/ic/form_header.html
24 24
  <input name="original_partnumber" type="hidden" value="[% HTML.escape(original_partnumber) %]">
25 25
  <input name="currow" type="hidden" value="[% HTML.escape(currow) %]">
26 26

  
27
  <ul id="maintab" class="shadetabs">
28
   <li class="selected"><a href="#" rel="master_data">[% 'Basic Data' | $T8 %]</a></li>
29
   [%- IF id %]
30
   <li><a href="#" rel="sales_price_information">[% 'Price information' | $T8 %]</a></li>
31
   [%- END %]
32
   [%- IF CUSTOM_VARIABLES.size %]
33
   <li><a href="#" rel="custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
34
   [%- END %]
35
  </ul>
27
  <div class="tabwidget">
28
   <ul>
29
    <li><a href="#master_data">[% 'Basic Data' | $T8 %]</a></li>
30
    [%- IF id %]
31
    <li><a href="#sales_price_information">[% 'Price information' | $T8 %]</a></li>
32
    [%- END %]
33
    [%- IF CUSTOM_VARIABLES.size %]
34
    <li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
35
    [%- END %]
36
   </ul>
36 37

  
37
  <div class="tabcontentstyle">
38
  <div id="master_data" class="tabcontent">
38
  <div id="master_data">
39 39

  
40 40
   <table width="100%">
41 41
    <tr>
templates/webpages/project/form.html
10 10
  [% L.hidden_tag("callback", callback) %]
11 11
  [% L.hidden_tag("id", SELF.project.id) %]
12 12

  
13
  <ul id="maintab" class="shadetabs">
14
   <li class="selected"><a href="#" rel="basic_data">[% 'Basic Data' | $T8 %]</a></li>
15
   [%- IF CUSTOM_VARIABLES.size %]
16
   <li><a href="#" rel="custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
17
   [%- END %]
18
   [%- IF SELF.project.id %]
19
   <li><a href="#" rel="linked_records">[% 'Linked Records' | $T8 %]</a></li>
20
   [%- END %]
21
  </ul>
22

  
23
  <div class="tabcontentstyle">
24

  
25
   <div id="basic_data" class="tabcontent">
13
  <div class="tabwidget">
14
   <ul>
15
    <li><a href="#basic_data">[% 'Basic Data' | $T8 %]</a></li>
16
    [%- IF CUSTOM_VARIABLES.size %]
17
    <li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
18
    [%- END %]
19
    [%- IF SELF.project.id %]
20
    <li><a href="#linked_records">[% 'Linked Records' | $T8 %]</a></li>
21
    [%- END %]
22
   </ul>
23

  
24
   <div id="basic_data">
26 25

  
27 26
    <table>
28 27
     <tr>
......
64 63
     </tr>
65 64
     [%- END %]
66 65
    </table>
67

  
68
    <br style="clear: left" />
69 66
   </div>
70 67

  
71 68
   [%- IF CUSTOM_VARIABLES.size %]
72
   <div id="custom_variables" class="tabcontent">
69
   <div id="custom_variables">
73 70

  
74 71
    <p>
75 72
     <table>
......
81 78
      [%- END %]
82 79
     </table>
83 80
    </p>
84

  
85
    <br style="clear: left" />
86 81
   </div>
87 82
   [%- END %]
88 83

  
89 84
   [%- IF SELF.project.id %]
90
   <div id="linked_records" class="tabcontent">
91

  
85
   <div id="linked_records">
92 86
    [% P.grouped_record_list(SELF.linked_records) %]
93

  
94
    <br style="clear: left" />
95 87
   </div>
96 88
   [%- END %]
97 89

  
......
108 100
   <a href="[% IF callback %][% callback %][% ELSE %][% SELF.url_for(action => 'search') %][% END %]">[%- LxERP.t8('Abort') %]</a>
109 101
  </p>
110 102
 </form>
111

  
112
 <script type="text/javascript">
113
  <!--
114
      var maintab = new ddtabcontent("maintab");
115
      maintab.setpersist(true);
116
      maintab.setselectedClassTarget("link"); //"link" or "linkparent"
117
      maintab.init();
118
    -->
119
 </script>

Auch abrufbar als: Unified diff