Changeset 3690:b48aaf7c80a4 for admin
- Timestamp:
- 01/28/18 13:16:06 (8 years ago)
- Branch:
- default
- Location:
- admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/jquery/jquery.pageTabs.js
r3333 r3690 1 1 (function($) { 2 2 'use strict'; 3 3 4 5 6 7 8 9 10 11 4 $.pageTabs = function(start_tab, opts) { 5 var defaults = { 6 containerClass: 'part-tabs', 7 partPrefix: 'part-', 8 contentClass: 'multi-part', 9 activeClass: 'part-tabs-active', 10 idTabPrefix: 'part-tabs-' 11 }; 12 12 13 14 15 16 13 $.pageTabs.options = $.extend({}, defaults, opts); 14 var active_tab = start_tab || ''; 15 var hash = $.pageTabs.getLocationHash(); 16 var subhash = $.pageTabs.getLocationSubhash(); 17 17 18 19 window.scrollTo(0,0);20 21 22 active_tab = $('.'+$.pageTabs.options.contentClass+':eq(0)').attr('id');23 18 if (hash !== undefined && hash) { 19 window.scrollTo(0, 0); 20 active_tab = hash; 21 } else if (active_tab == '') { // open first part 22 active_tab = $('.' + $.pageTabs.options.contentClass + ':eq(0)').attr('id'); 23 } 24 24 25 25 createTabs(); 26 26 27 $('ul li', '.'+$.pageTabs.options.containerClass).click(function(e) {28 29 30 27 $('ul li', '.' + $.pageTabs.options.containerClass).click(function(e) { 28 if ($(this).hasClass($.pageTabs.options.activeClass)) { 29 return; 30 } 31 31 32 $(this).parent().find('li.'+$.pageTabs.options.activeClass).removeClass($.pageTabs.options.activeClass);33 34 $('.'+$.pageTabs.options.contentClass+'.active').removeClass('active').hide();32 $(this).parent().find('li.' + $.pageTabs.options.activeClass).removeClass($.pageTabs.options.activeClass); 33 $(this).addClass($.pageTabs.options.activeClass); 34 $('.' + $.pageTabs.options.contentClass + '.active').removeClass('active').hide(); 35 35 36 var part_to_activate = $('#'+$.pageTabs.options.partPrefix+getHash($(this).find('a').attr('href')));36 var part_to_activate = $('#' + $.pageTabs.options.partPrefix + getHash($(this).find('a').attr('href'))); 37 37 38 39 40 41 42 38 part_to_activate.addClass('active').show(); 39 if (!part_to_activate.hasClass('loaded')) { 40 part_to_activate.onetabload(); 41 part_to_activate.addClass('loaded'); 42 } 43 43 44 45 44 part_to_activate.tabload(); 45 }); 46 46 47 48 49 47 $(window).bind('hashchange onhashchange', function(e) { 48 $.pageTabs.clickTab($.pageTabs.getLocationHash()); 49 }); 50 50 51 51 $.pageTabs.clickTab(active_tab); 52 52 53 if (subhash !== undefined) { 54 // Tab displayed, now scroll to the sub-part if defined in original document.location (#tab.sub-part) 55 document.getElementById(subhash).scrollIntoView(); 56 } 53 if (subhash !== undefined) { 54 var elt = document.getElementById(subhash); 55 // Tab displayed, now scroll to the sub-part if defined in original document.location (#tab.sub-part) 56 elt.scrollIntoView() 57 // Give focus to the sub-part if possible 58 $('#' + subhash).addClass('focus').focusout(function() { 59 $(this).removeClass('focus'); 60 }); 61 elt.focus(); 62 } 57 63 58 59 64 return this; 65 }; 60 66 61 var createTabs = function createTabs() { 62 var lis = [], li_class = ''; 67 var createTabs = function createTabs() { 68 var lis = [], 69 li_class = ''; 63 70 64 $('.'+$.pageTabs.options.contentClass).each(function() {65 66 lis.push('<li id="'+$.pageTabs.options.idTabPrefix+$(this).attr('id')+'">' 67 +'<a href="#'+$(this).attr('id')+'">'+$(this).attr('title')+'</a></li>');68 $(this).attr('id', $.pageTabs.options.partPrefix + $(this).attr('id')).prop('title','');69 71 $('.' + $.pageTabs.options.contentClass).each(function() { 72 $(this).hide(); 73 lis.push('<li id="' + $.pageTabs.options.idTabPrefix + $(this).attr('id') + '">' + 74 '<a href="#' + $(this).attr('id') + '">' + $(this).attr('title') + '</a></li>'); 75 $(this).attr('id', $.pageTabs.options.partPrefix + $(this).attr('id')).prop('title', ''); 76 }); 70 77 71 $('<div class="'+$.pageTabs.options.containerClass+'"><ul>'+lis.join('')+'</ul></div>')72 .insertBefore($('.'+$.pageTabs.options.contentClass).get(0));73 78 $('<div class="' + $.pageTabs.options.containerClass + '"><ul>' + lis.join('') + '</ul></div>') 79 .insertBefore($('.' + $.pageTabs.options.contentClass).get(0)); 80 }; 74 81 75 76 82 var getHash = function getHash(href) { 83 var href = href || ''; 77 84 78 79 85 return href.replace(/.*#/, ''); 86 }; 80 87 81 82 if (tab=='') {83 tab = getHash($('ul li a', '.'+$.pageTabs.options.containerClass+':eq(0)').attr('href'));84 } else if ($('#'+$.pageTabs.options.idTabPrefix+tab, '.'+$.pageTabs.options.containerClass).length==0) {85 86 if ($('#'+tab).length==1) {87 var div_content = $('#'+tab).parents('.'+$.pageTabs.options.contentClass);88 if (div_content.length==1) {89 tab = div_content.attr('id').replace($.pageTabs.options.partPrefix,'');90 91 tab = getHash($('ul li a', '.'+$.pageTabs.options.containerClass+':eq(0)').attr('href'));92 93 94 tab = getHash($('ul li a', '.'+$.pageTabs.options.containerClass+':eq(0)').attr('href'));95 96 88 $.pageTabs.clickTab = function(tab) { 89 if (tab == '') { 90 tab = getHash($('ul li a', '.' + $.pageTabs.options.containerClass + ':eq(0)').attr('href')); 91 } else if ($('#' + $.pageTabs.options.idTabPrefix + tab, '.' + $.pageTabs.options.containerClass).length == 0) { 92 // try to find anchor in a .multi-part div 93 if ($('#' + tab).length == 1) { 94 var div_content = $('#' + tab).parents('.' + $.pageTabs.options.contentClass); 95 if (div_content.length == 1) { 96 tab = div_content.attr('id').replace($.pageTabs.options.partPrefix, ''); 97 } else { 98 tab = getHash($('ul li a', '.' + $.pageTabs.options.containerClass + ':eq(0)').attr('href')); 99 } 100 } else { 101 tab = getHash($('ul li a', '.' + $.pageTabs.options.containerClass + ':eq(0)').attr('href')); 102 } 103 } 97 104 98 $('ul li a', '.'+$.pageTabs.options.containerClass).filter(function() {99 return getHash($(this).attr('href'))==tab;100 101 105 $('ul li a', '.' + $.pageTabs.options.containerClass).filter(function() { 106 return getHash($(this).attr('href')) == tab; 107 }).parent().click(); 108 }; 102 109 103 104 105 106 107 108 109 110 111 112 110 $.pageTabs.getLocationHash = function() { 111 // Return the URL hash (without subhash — #hash[.subhash]) 112 var h = getHash(document.location.hash).split('.'); 113 return h[0]; 114 }; 115 $.pageTabs.getLocationSubhash = function() { 116 // Return the URL subhash if present (without hash — #hash[.subhash]) 117 var sh = getHash(document.location.hash).split('.'); 118 return sh[1]; 119 }; 113 120 })(jQuery); 114 121 115 122 jQuery.fn.tabload = function(f) { 116 this.each(function() { 117 if (f) { 118 chainHandler(this,'tabload',f) 119 } else { 120 var h = this.tabload; 121 if (h) { h.apply(this); } 122 } 123 }); 124 return this; 123 this.each(function() { 124 if (f) { 125 chainHandler(this, 'tabload', f) 126 } else { 127 var h = this.tabload; 128 if (h) { 129 h.apply(this); 130 } 131 } 132 }); 133 return this; 125 134 }; 126 135 127 136 jQuery.fn.onetabload = function(f) { 128 129 130 chainHandler(this,'onetabload',f);131 132 133 134 135 136 137 138 139 137 this.each(function() { 138 if (f) { 139 chainHandler(this, 'onetabload', f); 140 } else { 141 var h = this.onetabload; 142 if (h != null) { 143 h.apply(this); 144 this.onetabload = null; 145 } 146 } 147 }); 148 return this; 140 149 }; -
admin/style/default.css
r3685 r3690 984 984 text-decoration: none; } 985 985 986 input[type=text], 987 input[type=password], 988 input[type=submit], 989 input[type=button], 990 input[type=reset], 991 a.button, 992 button, 993 textarea, 994 select, 995 legend { 986 input[type=text], input[type=password], input[type=submit], input[type=button], input[type=reset], a.button, button, textarea, select, legend { 996 987 max-width: 100%; } 997 988 998 input[type=text], 999 input[type=password], 1000 input[type=submit], 1001 input[type=button], 1002 input[type=reset], 1003 a.button, 1004 button, 1005 textarea, 1006 legend { 989 input[type=text], input[type=password], input[type=submit], input[type=button], input[type=reset], a.button, button, textarea, legend { 1007 990 border-radius: 3px; } 1008 991 … … 1023 1006 background-color: #eee; } 1024 1007 1025 input[type=text], 1026 textarea { 1008 input[type=text], textarea { 1027 1009 font-family: inherit; 1028 1010 font-size: 100%; } … … 1036 1018 margin-bottom: 0.5em; } 1037 1019 1038 label .maximal, 1039 textarea.maximal, 1040 input.maximal, 1041 select.maximal { 1020 label .maximal, textarea.maximal, input.maximal, select.maximal { 1042 1021 width: 99%; } 1043 1022 1044 input.invalid, 1045 textarea.invalid, 1046 select.invalid, 1047 input:not([type=file]):invalid:not(:focus) { 1023 input.invalid, textarea.invalid, select.invalid, input:not([type=file]):invalid:not(:focus) { 1048 1024 color: #900; 1049 1025 box-shadow: 0 0 0 3px rgba(218, 62, 90, 0.3); } 1050 1026 1051 input.invalid, 1052 textarea.invalid, 1053 input:not([type=file]):invalid:not(:focus) { 1027 input.invalid, textarea.invalid, input:not([type=file]):invalid:not(:focus) { 1054 1028 border: 1px solid red; 1055 1029 background: #FFBABA; } 1056 1030 1057 input[type=text], 1058 input[type=password], 1059 textarea, 1060 select, 1061 input:not([type=file]):invalid, 1062 input:not([type=file]):invalid:placeholder-shown { 1031 input[type=text], input[type=password], textarea, select, input:not([type=file]):invalid, input:not([type=file]):invalid:placeholder-shown { 1063 1032 color: #000; 1064 1033 box-shadow: 1px 1px 2px #f3f3f3 inset; … … 1066 1035 vertical-align: top; } 1067 1036 1068 input[type=text], 1069 input[type=password], 1070 textarea, 1071 input:not([type=file]):invalid, 1072 input:not([type=file]):invalid:placeholder-shown { 1037 input[type=text], input[type=password], textarea, input:not([type=file]):invalid, input:not([type=file]):invalid:placeholder-shown { 1073 1038 background: #fcfcfc; 1074 1039 border-width: 1px; … … 1076 1041 border-color: #dfdfdf; } 1077 1042 1078 input:focus, 1079 textarea:focus { 1043 input:focus, textarea:focus { 1080 1044 border-color: #9bca1c; } 1081 1045 … … 1104 1068 background: transparent url(../images/check-on.png) no-repeat 0 50%; } 1105 1069 1106 input[type=text], 1107 input[type=password], 1108 textarea { 1070 input[type=text], input[type=password], textarea { 1109 1071 margin-right: .3em; } 1110 1072 1111 input[type=checkbox], 1112 input[type=radio], 1113 input[type=file] { 1073 input[type=checkbox], input[type=radio], input[type=file] { 1114 1074 border: none; 1115 1075 margin: 0 .33em 0 0; … … 1134 1094 font-weight: normal; } 1135 1095 1136 label, 1137 label span { 1096 label, label span { 1138 1097 display: block; } 1139 1098 1140 label.ib, 1141 input.ib { 1099 label.ib, input.ib { 1142 1100 display: inline-block; } 1143 1101 … … 1145 1103 display: inline; } 1146 1104 1147 label.classic input, 1148 label span input, 1149 label.classic select, 1150 label span select { 1105 label.classic input, label span input, label.classic select, label span select { 1151 1106 display: inline; } 1152 1107 … … 1163 1118 margin-top: 2em; } 1164 1119 1165 label.area, 1166 p.area { 1120 label.area, p.area { 1167 1121 width: inherit !important; } 1168 1122 … … 1174 1128 p.field.wide label { 1175 1129 width: 21em; } 1176 p.field input, 1177 p.field select { 1130 p.field input, p.field select { 1178 1131 display: inline-block; } 1179 1132 … … 1199 1152 50% { 1200 1153 background-color: #ffbaba; } 1154 100% { 1155 background-color: inherit; } } 1156 .focus { 1157 background-color: inherit; 1158 animation-name: kf-focus; 1159 animation-duration: 1s; } 1160 1161 @keyframes kf-focus { 1162 0% { 1163 background-color: inherit; } 1164 50% { 1165 background-color: #ccff00; } 1201 1166 100% { 1202 1167 background-color: inherit; } } -
admin/style/scss/partials/_forms.scss
r3685 r3690 1 input[type=text], 2 input[type=password], 3 input[type=submit], 4 input[type=button], 5 input[type=reset], 6 a.button, 7 button, 8 textarea, 9 select, 1 input[type=text], input[type=password], input[type=submit], input[type=button], input[type=reset], a.button, button, textarea, select, legend { 2 max-width: 100%; 3 } 4 input[type=text], input[type=password], input[type=submit], input[type=button], input[type=reset], a.button, button, textarea, legend { 5 border-radius: 3px; 6 } 7 form { 8 display: block; 9 margin: 0; 10 padding: 0; 11 } 12 fieldset { 13 display: block; 14 margin: 1em 0; 15 padding: 1em 0.5em; 16 border-width: 1px 0; 17 border-style: solid; 18 border-color: #ccc; 19 background: #f7f7f7; 20 &:focus-within { 21 background-color: #eee; 22 } 23 } 24 input[type=text], textarea { 25 font-family: $sans-serif-input; 26 font-size: 100%; 27 } 10 28 legend { 11 max-width: 100%; 12 } 13 14 input[type=text], 15 input[type=password], 16 input[type=submit], 17 input[type=button], 18 input[type=reset], 19 a.button, 20 button, 21 textarea, 22 legend { 23 border-radius: 3px; 24 } 25 26 form { 27 display: block; 28 margin: 0; 29 padding: 0; 30 } 31 32 fieldset { 33 display: block; 34 margin: 1em 0; 35 padding: 1em 0.5em; 36 border-width: 1px 0; 37 border-style: solid; 38 border-color: #ccc; 39 background: #f7f7f7; 40 &:focus-within { 41 background-color: #eee; 42 } 43 } 44 45 input[type=text], 29 padding: 0.2em 0.6em; 30 border-width: 1px; 31 border-style: solid; 32 border-color: #676e78; 33 background: #fff; 34 margin-bottom: 0.5em; 35 } 36 label .maximal, textarea.maximal, input.maximal, select.maximal { 37 width: 99%; 38 } 39 input.invalid, textarea.invalid, select.invalid, input:not([type=file]):invalid:not(:focus) { 40 color: #900; 41 box-shadow: 0 0 0 3px rgba(218, 62, 90, 0.3); 42 } 43 input.invalid, textarea.invalid, input:not([type=file]):invalid:not(:focus) { 44 border: 1px solid red; 45 background: #FFBABA; 46 } 47 input[type=text], input[type=password], textarea, select, input:not([type=file]):invalid, input:not([type=file]):invalid:placeholder-shown { 48 color: #000; 49 box-shadow: 1px 1px 2px #f3f3f3 inset; 50 padding: 3px; 51 vertical-align: top; 52 } 53 input[type=text], input[type=password], textarea, input:not([type=file]):invalid, input:not([type=file]):invalid:placeholder-shown { 54 background: #fcfcfc; 55 border-width: 1px; 56 border-style: solid; 57 border-color: #dfdfdf; 58 } 59 input:focus, textarea:focus { 60 border-color: #9bca1c; 61 } 46 62 textarea { 47 font-family: $sans-serif-input; 48 font-size: 100%; 49 } 50 51 legend { 52 padding: 0.2em 0.6em; 53 border-width: 1px; 54 border-style: solid; 55 border-color: #676e78; 56 background: #fff; 57 margin-bottom: 0.5em; 58 } 59 60 label .maximal, 61 textarea.maximal, 62 input.maximal, 63 select.maximal { 64 width: 99%; 65 } 66 67 input.invalid, 68 textarea.invalid, 69 select.invalid, 70 input:not([type=file]):invalid:not(:focus) { 71 color: #900; 72 box-shadow: 0 0 0 3px rgba(218, 62, 90, 0.3); 73 } 74 input.invalid, 75 textarea.invalid, 76 input:not([type=file]):invalid:not(:focus) { 77 border: 1px solid red; 78 background: #FFBABA; 79 } 80 81 input[type=text], 82 input[type=password], 83 textarea, 84 select, 85 input:not([type=file]):invalid, 86 input:not([type=file]):invalid:placeholder-shown { 87 color: #000; 88 box-shadow: 1px 1px 2px #f3f3f3 inset; 89 padding: 3px; 90 vertical-align: top; 91 } 92 input[type=text], 93 input[type=password], 94 textarea, 95 input:not([type=file]):invalid, 96 input:not([type=file]):invalid:placeholder-shown { 97 background: #fcfcfc; 98 border-width: 1px; 99 border-style: solid; 100 border-color: #dfdfdf; 101 } 102 103 input:focus, 104 textarea:focus { 105 border-color: #9bca1c; 106 } 107 108 textarea { 109 padding: 2px 0; 110 &.maximal { 111 resize: vertical; 112 } 113 .area & { 114 display: block; 115 width: 100%; 116 resize: vertical; 117 } 118 } 119 63 padding: 2px 0; 64 &.maximal { 65 resize: vertical; 66 } 67 .area & { 68 display: block; 69 width: 100%; 70 resize: vertical; 71 } 72 } 120 73 select { 121 122 123 } 124 @media not all and (min-resolution:.001dpcm) 125 { @supports (-webkit-appearance:none) {126 127 128 74 padding: 2px 0; 75 vertical-align: middle; 76 } 77 @media not all and (min-resolution:.001dpcm) { 78 @supports (-webkit-appearance: none) { 79 /* Safari 10.1+ only (https://browserstrangeness.bitbucket.io/css_hacks.html#webkit) */ 80 select { 81 font-size: initial; 129 82 } 130 }}131 83 } 84 } 132 85 select.l10n option { 133 padding-left: 16px; 134 } 135 86 padding-left: 16px; 87 } 136 88 option.avail10n { 137 background: transparent url(../images/check-on.png) no-repeat 0 50%; 138 } 139 140 input[type=text], 141 input[type=password], 142 textarea { 143 margin-right: .3em; 144 } 145 146 input[type=checkbox], 147 input[type=radio], 89 background: transparent url(../images/check-on.png) no-repeat 0 50%; 90 } 91 input[type=text], input[type=password], textarea { 92 margin-right: .3em; 93 } 94 input[type=checkbox], input[type=radio], input[type=file] { 95 border: none; 96 margin: 0 .33em 0 0; 97 padding: 0; 98 background: transparent; 99 } 100 input+input[type=checkbox] { 101 // Used for js expand/hide (lists, options, ...) 102 margin-left: .33em; 103 } 104 a input { 105 // Used for js expand/hide (lists, options, ...) 106 margin-right: .33em; 107 } 148 108 input[type=file] { 149 border: none; 150 margin: 0 .33em 0 0; 151 padding: 0; 152 background: transparent; 153 } 154 input + input[type=checkbox] { 155 // Used for js expand/hide (lists, options, ...) 156 margin-left: .33em; 157 } 158 a input { 159 // Used for js expand/hide (lists, options, ...) 160 margin-right: .33em; 161 } 162 163 input[type=file] { 164 margin-top: .3em; 165 margin-bottom: .3em; 166 } 167 109 margin-top: .3em; 110 margin-bottom: .3em; 111 } 168 112 optgroup { 169 font-weight: bold; 170 font-style: normal; 171 } 172 113 font-weight: bold; 114 font-style: normal; 115 } 173 116 option { 174 font-weight: normal; 175 } 176 177 label, 178 label span { 179 display: block; 180 } 181 182 label.ib, 183 input.ib { 184 display: inline-block; 185 } 186 117 font-weight: normal; 118 } 119 label, label span { 120 display: block; 121 } 122 label.ib, input.ib { 123 display: inline-block; 124 } 187 125 label.classic { 188 display: inline; 189 } 190 191 label.classic input, 192 label span input, 193 label.classic select, 194 label span select { 195 display: inline; 196 } 197 126 display: inline; 127 } 128 label.classic input, label span input, label.classic select, label span select { 129 display: inline; 130 } 198 131 label.required { 199 font-weight: bold; 200 } 201 132 font-weight: bold; 133 } 202 134 label.required abbr { 203 color: #900; 204 font-size: 1.3em; 205 } 206 135 color: #900; 136 font-size: 1.3em; 137 } 207 138 label.bold { 208 text-transform: uppercase; 209 font-weight: bold; 210 margin-top: 2em; 211 } 212 213 label.area, 214 p.area { 215 width: inherit !important; 216 } 217 139 text-transform: uppercase; 140 font-weight: bold; 141 margin-top: 2em; 142 } 143 label.area, p.area { 144 width: inherit !important; 145 } 218 146 p.field { 219 position: relative; 220 label { 221 display: inline-block; 222 width: 14em; 223 } 224 &.wide label { 225 width: 21em; 226 } 227 input, 228 select { 229 display: inline-block; 230 } 231 } 232 147 position: relative; 148 label { 149 display: inline-block; 150 width: 14em; 151 } 152 &.wide label { 153 width: 21em; 154 } 155 input, select { 156 display: inline-block; 157 } 158 } 233 159 .form-note, .form-stats { 234 font-style: italic; 235 font-weight: normal; 236 color: #676e78; 237 } 238 160 font-style: italic; 161 font-weight: normal; 162 color: #676e78; 163 } 239 164 p.form-note, p.form-stats { 240 margin-top: -.7em; 241 } 242 165 margin-top: -.7em; 166 } 243 167 span.form-note, span.form-stats { 244 text-transform: none; 245 } 246 168 text-transform: none; 169 } 247 170 .missing { 248 171 background-color: inherit; … … 261 184 } 262 185 } 263 186 .focus { 187 background-color: inherit; 188 animation-name: kf-focus; 189 animation-duration: 1s; 190 } 191 @keyframes kf-focus { 192 0% { 193 background-color: inherit; 194 } 195 50% { 196 background-color: #ccff00; 197 } 198 100% { 199 background-color: inherit; 200 } 201 } 264 202 // .more-info Additional information on fieldset, field, … (may be hide from user-prefs) 265 203 .more-info {} 266 267 204 .no-more-info { 268 269 } 205 display: none; 206 } -
admin/style/scss/partials/_utils.scss
r3685 r3690 8 8 } 9 9 10 11 10 /* _media_item.js */ 12 11
Note: See TracChangeset
for help on using the changeset viewer.