aboutsummaryrefslogtreecommitdiff
path: root/webgui/data
diff options
context:
space:
mode:
Diffstat (limited to 'webgui/data')
-rw-r--r--webgui/data/index.html4
-rw-r--r--webgui/data/style.css22
-rw-r--r--webgui/data/tabs.js27
3 files changed, 36 insertions, 17 deletions
diff --git a/webgui/data/index.html b/webgui/data/index.html
index e4a6c63..b677387 100644
--- a/webgui/data/index.html
+++ b/webgui/data/index.html
@@ -15,14 +15,14 @@
15 Need javascript to function. 15 Need javascript to function.
16 </p> 16 </p>
17 <div class="tabs"> 17 <div class="tabs">
18 <ul class="tab-links"> 18 <ul class="tabLinks" id="tabLinks">
19 <li class="active"><a href="#editor">Editor</a></li> 19 <li class="active"><a href="#editor">Editor</a></li>
20 <li><a href="#drafts">Drafts</a></li> 20 <li><a href="#drafts">Drafts</a></li>
21 <li><a href="#printers">Printers & Jobs</a></li> 21 <li><a href="#printers">Printers & Jobs</a></li>
22 <li id="errors-tab" style="display:none;"><a href="#errors">Errors</a></li> 22 <li id="errors-tab" style="display:none;"><a href="#errors">Errors</a></li>
23 </ul> 23 </ul>
24 24
25 <div class="tab-content"> 25 <div class="tabContent" id="tabContent">
26 <div class="tab active" id="editor"> 26 <div class="tab active" id="editor">
27 <!-- <label id="titleLabel" for="editorTitle">Title</label> --> 27 <!-- <label id="titleLabel" for="editorTitle">Title</label> -->
28 <input id="saveDraft" type="checkbox" checked="checked" /><label for="saveDraft">Save as Draft</label> 28 <input id="saveDraft" type="checkbox" checked="checked" /><label for="saveDraft">Save as Draft</label>
diff --git a/webgui/data/style.css b/webgui/data/style.css
index fd40d92..d496e2a 100644
--- a/webgui/data/style.css
+++ b/webgui/data/style.css
@@ -98,6 +98,16 @@ tr.focused td {
98 background-color:#f0f0f0; 98 background-color:#f0f0f0;
99} 99}
100 100
101.close {
102 float:right;
103 text-decoration:underline;
104 color:#4c4c4c;
105}
106
107.close:hover {
108 text-decoration:none;
109}
110
101/*----- Tabs -----*/ 111/*----- Tabs -----*/
102.tabs { 112.tabs {
103 display:block; 113 display:block;
@@ -109,7 +119,7 @@ tr.focused td {
109} 119}
110 120
111/*----- Tab Links -----*/ 121/*----- Tab Links -----*/
112.tab-links { 122.tabLinks {
113 display:block; 123 display:block;
114 height:2.2em; 124 height:2.2em;
115 margin:0; 125 margin:0;
@@ -118,19 +128,19 @@ tr.focused td {
118} 128}
119 129
120/* Clearfix */ 130/* Clearfix */
121.tab-links:after { 131.tabLinks:after {
122 display:block; 132 display:block;
123 clear:both; 133 clear:both;
124 content:''; 134 content:'';
125} 135}
126 136
127.tab-links li { 137.tabLinks li {
128 margin:0px 0.5em; 138 margin:0px 0.5em;
129 float:left; 139 float:left;
130 list-style:none; 140 list-style:none;
131} 141}
132 142
133.tab-links a { 143.tabLinks a {
134 padding:0.5em 1em; 144 padding:0.5em 1em;
135 display:inline-block; 145 display:inline-block;
136 border-radius:3px 3px 0px 0px; 146 border-radius:3px 3px 0px 0px;
@@ -141,7 +151,7 @@ tr.focused td {
141 transition:all linear 0.15s; 151 transition:all linear 0.15s;
142} 152}
143 153
144.tab-links a:hover { 154.tabLinks a:hover {
145 text-decoration:none; 155 text-decoration:none;
146} 156}
147 157
@@ -156,7 +166,7 @@ li.active a, li.active a:hover {
156} 166}
157 167
158/*----- Content of Tabs -----*/ 168/*----- Content of Tabs -----*/
159.tab-content { 169.tabContent {
160 padding:0.5em; 170 padding:0.5em;
161 border:1px solid #ddd; 171 border:1px solid #ddd;
162 border-radius:3px; 172 border-radius:3px;
diff --git a/webgui/data/tabs.js b/webgui/data/tabs.js
index 1d178d9..0cdb8e5 100644
--- a/webgui/data/tabs.js
+++ b/webgui/data/tabs.js
@@ -1,13 +1,22 @@
1jQuery(document).ready(function() { 1jQuery(document).ready(function() {
2 jQuery('.tabs .tab-links a').on('click', function(e) { 2 jQuery('.tabs .tabLinks a').on('click', switchTab);
3 var currentAttrValue = jQuery(this).attr('href'); 3
4 var observer = new window.MutationObserver(function(mutations, observer) {
5 jQuery('.tabs .tabLinks a').on('click', switchTab);
6 });
7 jQuery('.tabLinks').each( function () {
8 observer.observe(this, { childList: true, subtree: true });
9 });
10});
11
12function switchTab(e) {
13 var currentAttrValue = jQuery(this).attr('href');
4 14
5 // Show/Hide Tabs 15 // Show/Hide Tabs
6 jQuery('.tabs ' + currentAttrValue).show().siblings().hide(); 16 jQuery('.tabs ' + currentAttrValue).show().siblings().hide();
7 17
8 // Change/remove current tab to active 18 // Change/remove current tab to active
9 jQuery(this).parent('li').addClass('active').siblings().removeClass('active'); 19 jQuery(this).parent('li').addClass('active').siblings().removeClass('active');
10 20
11 e.preventDefault(); 21 e.preventDefault();
12 }); 22}
13});