Changeset 4007:d08f9c5e38db
- Timestamp:
- 07/11/19 15:15:52 (6 years ago)
- Branch:
- default
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_blogs.js
r3880 r4007 8 8 $('#form-blogs td input[type=checkbox]').enableShiftClick(); 9 9 dotclear.condSubmit('#form-blogs td input[type=checkbox]', '#form-blogs #do-action'); 10 dotclear.responsiveCellHeaders(document.querySelector('#form-blogs table'), '#form-blogs table', 1); 10 11 $('#form-blogs').submit(function() { 11 12 const action = $(this).find('select[name="action"]').val(); -
admin/js/_comments.js
r3880 r4007 54 54 dotclear.commentsActionsHelper(); 55 55 dotclear.condSubmit('#form-comments td input[type=checkbox]', '#form-comments #do-action'); 56 dotclear.responsiveCellHeaders(document.querySelector('#form-comments table'), '#form-comments table', 1); 56 57 $('form input[type=submit][name=delete_all_spam]').click(function() { 57 58 return window.confirm(dotclear.msg.confirm_spam_delete); -
admin/js/_posts_list.js
r3880 r4007 55 55 dotclear.condSubmit('#form-entries td input[type=checkbox]', '#form-entries #do-action'); 56 56 dotclear.postsActionsHelper(); 57 dotclear.responsiveCellHeaders(document.querySelector('#form-entries table'), '#form-entries table', 1); 57 58 }); -
admin/js/_users.js
r3880 r4007 7 7 }); 8 8 dotclear.condSubmit('#form-users input[type="checkbox"]', '#form-users #do-action'); 9 dotclear.responsiveCellHeaders(document.querySelector('#form-users table'), '#form-users table', 1); 9 10 $('#form-users').submit(function() { 10 11 const action = $(this).find('select[name="action"]').val(); -
admin/js/common.js
r3930 r4007 460 460 window.open($(this).attr('href')); 461 461 }); 462 }, 463 464 /** 465 * Add headers on each cells (responsive tables) 466 * 467 * @param DOM elt table The table 468 * @param string selector The selector 469 * @param number [offset=0] The offset = number of firsts columns to ignore 470 * @param boolean [thead=false] True if titles are in thead rather than in the first tr of the body 471 */ 472 responsiveCellHeaders: function(table, selector, offset = 0, thead = false) { 473 try { 474 let THarray = []; 475 const ths = table.getElementsByTagName("th"); 476 for (let i = 0; i < ths.length; i++) { 477 for (let colspan = ths[i].colSpan; colspan > 0; colspan--) { 478 THarray.push(ths[i].innerText.replace('►', '')); 479 } 480 } 481 let styleElm = document.createElement("style"); 482 let styleSheet; 483 document.head.appendChild(styleElm); 484 styleSheet = styleElm.sheet; 485 for (let i = offset; i < THarray.length; i++) { 486 styleSheet.insertRule( 487 selector + " td:nth-child(" + (i + 1) + ')::before {content:"' + THarray[i] + ' ";}', 488 styleSheet.cssRules.length 489 ); 490 } 491 table.className += (table.className !== '' ? ' ' : '') + 'rch' + (thead ? ' rch-thead' : ''); 492 } catch (e) { 493 console.log("responsiveCellHeaders(): " + e); 494 } 462 495 }, 463 496 -
admin/style/default-dark.css
r3969 r4007 1954 1954 padding-right: 34px; } 1955 1955 1956 th img, 1957 tr.line img { 1956 th img, tr.line img { 1958 1957 vertical-align: middle; } 1959 th img.expand, 1960 tr.line img.expand { 1958 th img.expand, tr.line img.expand { 1961 1959 margin-right: 6px; 1962 1960 margin-bottom: -2px; } … … 1964 1962 tr.line p { 1965 1963 margin: 0; } 1966 tr.line input, 1967 tr.line select { 1964 tr.line input, tr.line select { 1968 1965 vertical-align: middle; 1969 1966 box-shadow: none; } … … 1980 1977 border: none; } 1981 1978 1982 .noborder td, 1983 td.noborder, 1984 .noborder th, 1985 th.noborder { 1979 .noborder td, td.noborder, .noborder th, th.noborder { 1986 1980 border-width: 0 0 1px 0; 1987 1981 border-color: #dbdcdd; … … 1995 1989 min-width: 50%; } 1996 1990 1997 table.settings, 1998 table.prefs { 1991 table.settings, table.prefs { 1999 1992 margin-bottom: 3em; } 2000 table.settings th:first-child, 2001 table.prefs th:first-child { 1993 table.settings th:first-child, table.prefs th:first-child { 2002 1994 width: 20%; } 2003 table.settings th + th, 2004 table.prefs th + th { 1995 table.settings th + th, table.prefs th + th { 2005 1996 width: 30%; } 2006 table.settings th + th + th, 2007 table.prefs th + th + th { 1997 table.settings th + th + th, table.prefs th + th + th { 2008 1998 width: 10%; } 2009 table.settings th:last-child, 2010 table.prefs th:last-child { 1999 table.settings th:last-child, table.prefs th:last-child { 2011 2000 width: 40%; } 2012 2001 … … 2025 2014 padding-left: 15px; } 2026 2015 2016 /* Responsive Cell Header */ 2017 .rch td::before { 2018 display: none; } 2019 2020 @media screen and (max-width: 44em), print and (max-width: 5in) { 2021 table.rch { 2022 display: block; } 2023 table.rch caption, table.rch tbody, table.rch tr, table.rch td { 2024 display: block; } 2025 table.rch th, table.rch tr:first-of-type { 2026 display: none; } 2027 table.rch td:first-of-type { 2028 border-top: 1px solid #ecedee; 2029 color: #c9cbcf; 2030 background: #595b5d; } 2031 table.rch td::before { 2032 display: inline; 2033 font-weight: bold; } 2034 table.rch td { 2035 display: grid; 2036 grid-template-columns: 10em auto; 2037 grid-gap: 1em 0.5em; 2038 text-align: left; 2039 border: none; } 2040 table.rch .maximal { 2041 max-width: inherit; } 2042 table.rch .nowrap { 2043 white-space: inherit; } 2044 table.rch td.expand { 2045 grid-template-columns: auto !important; 2046 color: #dcdee0; 2047 background-color: #272b30; 2048 border-top: 1px dashed #ecedee; } 2049 2050 table.rch-thead thead { 2051 display: none; } 2052 table.rch-thead tr:first-of-type { 2053 display: block; } } 2027 2054 a.form-control { 2028 2055 display: none; -
admin/style/default.css
r3969 r4007 1954 1954 padding-right: 34px; } 1955 1955 1956 th img, 1957 tr.line img { 1956 th img, tr.line img { 1958 1957 vertical-align: middle; } 1959 th img.expand, 1960 tr.line img.expand { 1958 th img.expand, tr.line img.expand { 1961 1959 margin-right: 6px; 1962 1960 margin-bottom: -2px; } … … 1964 1962 tr.line p { 1965 1963 margin: 0; } 1966 tr.line input, 1967 tr.line select { 1964 tr.line input, tr.line select { 1968 1965 vertical-align: middle; 1969 1966 box-shadow: none; } … … 1980 1977 border: none; } 1981 1978 1982 .noborder td, 1983 td.noborder, 1984 .noborder th, 1985 th.noborder { 1979 .noborder td, td.noborder, .noborder th, th.noborder { 1986 1980 border-width: 0 0 1px 0; 1987 1981 border-color: #dbdbdb; … … 1995 1989 min-width: 50%; } 1996 1990 1997 table.settings, 1998 table.prefs { 1991 table.settings, table.prefs { 1999 1992 margin-bottom: 3em; } 2000 table.settings th:first-child, 2001 table.prefs th:first-child { 1993 table.settings th:first-child, table.prefs th:first-child { 2002 1994 width: 20%; } 2003 table.settings th + th, 2004 table.prefs th + th { 1995 table.settings th + th, table.prefs th + th { 2005 1996 width: 30%; } 2006 table.settings th + th + th, 2007 table.prefs th + th + th { 1997 table.settings th + th + th, table.prefs th + th + th { 2008 1998 width: 10%; } 2009 table.settings th:last-child, 2010 table.prefs th:last-child { 1999 table.settings th:last-child, table.prefs th:last-child { 2011 2000 width: 40%; } 2012 2001 … … 2025 2014 padding-left: 15px; } 2026 2015 2016 /* Responsive Cell Header */ 2017 .rch td::before { 2018 display: none; } 2019 2020 @media screen and (max-width: 44em), print and (max-width: 5in) { 2021 table.rch { 2022 display: block; } 2023 table.rch caption, table.rch tbody, table.rch tr, table.rch td { 2024 display: block; } 2025 table.rch th, table.rch tr:first-of-type { 2026 display: none; } 2027 table.rch td:first-of-type { 2028 border-top: 1px solid #ececec; 2029 color: #c9c9c9; 2030 background: #595959; } 2031 table.rch td::before { 2032 display: inline; 2033 font-weight: bold; } 2034 table.rch td { 2035 display: grid; 2036 grid-template-columns: 10em auto; 2037 grid-gap: 1em 0.5em; 2038 text-align: left; 2039 border: none; } 2040 table.rch .maximal { 2041 max-width: inherit; } 2042 table.rch .nowrap { 2043 white-space: inherit; } 2044 table.rch td.expand { 2045 grid-template-columns: auto !important; 2046 color: #323232; 2047 background-color: #fff; 2048 border-top: 1px dashed #ececec; } 2049 2050 table.rch-thead thead { 2051 display: none; } 2052 table.rch-thead tr:first-of-type { 2053 display: block; } } 2027 2054 a.form-control { 2028 2055 display: none; -
admin/style/scss/partials/_tables.scss
r3779 r4007 1 1 table { 2 .maximal { 3 overflow: hidden; 4 text-overflow: ellipsis; 5 max-width: 1px; 6 } 7 .maximal, 8 &.maximal { 9 width: 100%; 10 } 11 .minimal { 12 width: 1px; 13 } 14 .nowrap { 15 white-space: nowrap; 16 vertical-align: top; 17 } 18 .count { 19 text-align: right; 20 padding-right: 1.5em; 21 } 2 .maximal { 3 overflow: hidden; 4 text-overflow: ellipsis; 5 max-width: 1px; 6 } 7 .maximal, &.maximal { 8 width: 100%; 9 } 10 .minimal { 11 width: 1px; 12 } 13 .nowrap { 14 white-space: nowrap; 15 vertical-align: top; 16 } 17 .count { 18 text-align: right; 19 padding-right: 1.5em; 20 } 22 21 } 23 24 22 th.first input { 25 23 padding-right: 34px; 26 24 } 27 28 th, 25 th, tr.line { 26 img { 27 vertical-align: middle; 28 &.expand { 29 margin-right: 6px; 30 margin-bottom: -2px; 31 } 32 } 33 } 29 34 tr.line { 30 img { 31 vertical-align: middle; 32 &.expand { 33 margin-right: 6px; 34 margin-bottom: -2px; 35 } 36 } 35 p { 36 margin: 0; 37 } 38 input, select { 39 vertical-align: middle; 40 box-shadow: none; 41 } 42 select { 43 width: 6em; 44 } 45 input[type=text] { 46 // background: $line-input-background; 47 } 48 &:hover { 49 background: $line-background-over; 50 } 51 &:focus-within { 52 background-color: $line-focus-background; 53 } 37 54 } 38 39 tr.line { 40 p { 41 margin: 0; 42 } 43 input, 44 select { 45 vertical-align: middle; 46 box-shadow: none; 47 } 48 select { 49 width: 6em; 50 } 51 input[type=text] { 52 // background: $line-input-background; 53 } 54 &:hover { 55 background: $line-background-over; 56 } 57 &:focus-within { 58 background-color: $line-focus-background; 59 } 55 td.status { 56 vertical-align: middle; 57 a { 58 border: none; 59 } 60 60 } 61 62 td.status { 63 vertical-align: middle; 64 a { 65 border: none; 66 } 61 .noborder td, td.noborder, .noborder th, th.noborder { 62 border-width: 0 0 1px 0; 63 border-color: $cell-noborder-color; 64 line-height: 2em; 65 padding-bottom: 0; 67 66 } 68 69 .noborder td, 70 td.noborder, 71 .noborder th, 72 th.noborder { 73 border-width: 0 0 1px 0; 74 border-color: $cell-noborder-color; 75 line-height: 2em; 76 padding-bottom: 0; 67 .noborder p { 68 margin-bottom: 0; 77 69 } 78 79 .noborder p { 80 margin-bottom: 0; 70 table.posts-list { 71 min-width: 50%; 81 72 } 82 83 table.posts-list { 84 min-width: 50%; 73 table.settings, table.prefs { 74 margin-bottom: 3em; 75 th:first-child { 76 width: 20%; 77 } 78 th+th { 79 width: 30%; 80 +th { 81 width: 10%; 82 } 83 } 84 th:last-child { 85 width: 40%; 86 } 85 87 } 86 87 table.settings,88 table.prefs {89 margin-bottom: 3em;90 th:first-child {91 width: 20%;92 }93 th + th {94 width: 30%;95 + th {96 width: 10%;97 }98 }99 th:last-child {100 width: 40%;101 }102 }103 104 105 88 /* js */ 106 89 107 90 td.expand { 108 109 110 111 91 padding: 1em; 92 td { 93 border-bottom: none; 94 } 112 95 } 96 .handle { 97 padding: 0; 98 } 99 .handler { 100 cursor: move; 101 background: transparent url(drag.png) no-repeat 0 50%; 102 padding-left: 15px; 103 } 104 /* Responsive Cell Header */ 113 105 114 . handle {115 padding: 0;106 .rch td::before { 107 display: none; 116 108 } 117 118 .handler { 119 cursor: move; 120 background: transparent url(drag.png) no-repeat 0 50%; 121 padding-left: 15px; 109 @media screen and (max-width: $s-screen), print and (max-width: 5in) { 110 table.rch { 111 display: block; 112 caption, tbody, tr, td { 113 display: block; 114 } 115 th, tr:first-of-type { 116 display: none; 117 } 118 td:first-of-type { 119 border-top: 1px solid $gray-lighter; 120 color: $gray-light; 121 background: $gray-darker; 122 } 123 td::before { 124 display: inline; 125 font-weight: bold; 126 } 127 td { 128 display: grid; 129 grid-template-columns: 10em auto; 130 grid-gap: 1em 0.5em; 131 text-align: left; 132 border: none; 133 } 134 .maximal { 135 max-width: inherit; 136 } 137 .nowrap { 138 white-space: inherit; 139 } 140 td.expand { 141 grid-template-columns: auto !important; 142 color: $body-color; 143 background-color: $body-background; 144 border-top: 1px dashed $gray-lighter; 145 } 146 } 147 table.rch-thead { 148 thead { 149 display: none; 150 } 151 tr:first-of-type { 152 display: block; 153 } 154 } 122 155 } -
plugins/aboutConfig/js/index.js
r3709 r4007 1 /*global $ */1 /*global $, dotclear */ 2 2 'use strict'; 3 3 … … 11 11 window.location = $('#ls_nav option:selected').val(); 12 12 }); 13 dotclear.responsiveCellHeaders(document.querySelector('table.settings'), 'table.settings', 0, true); 14 $('table.settings').addClass('rch rch-thead'); 13 15 }); -
plugins/antispam/js/antispam.js
r3987 r4007 31 31 return window.confirm(dotclear.msg.confirm_spam_delete); 32 32 }); 33 dotclear.responsiveCellHeaders(document.querySelector('#filters-list-form table'), '#filters-list-form table', 1, true); 33 34 }); -
plugins/pages/js/list.js
r3995 r4007 56 56 $('#pageslist td input[type=checkbox]').enableShiftClick(); 57 57 dotclear.condSubmit('#pageslist td input[type=checkbox]', '#form-entries #do-action'); 58 dotclear.responsiveCellHeaders(document.querySelector('#form-entries table'), '#form-entries table', 3, true); 58 59 59 60 $('#pageslist tr.line td:not(.expander)').mousedown(function() { -
plugins/simpleMenu/js/simplemenu.js
r3880 r4007 26 26 $('#menuitemslist tr td.handle').addClass('handler'); 27 27 dotclear.condSubmit('#menuitems tr td input[name^=items_selected]', '#menuitems #remove-action'); 28 dotclear.responsiveCellHeaders(document.querySelector('#menuitems table'), '#menuitems table', 2); 28 29 }); -
plugins/userPref/js/index.js
r3709 r4007 1 /*global $ */1 /*global $, dotclear */ 2 2 'use strict'; 3 3 … … 13 13 window.location = $('#lp_nav option:selected').val(); 14 14 }); 15 dotclear.responsiveCellHeaders(document.querySelector('table.prefs'), 'table.prefs', 0, true); 16 $('table.prefs').addClass('rch rch-thead'); 15 17 });
Note: See TracChangeset
for help on using the changeset viewer.