diff options
5 files changed, 107 insertions, 52 deletions
diff --git a/applications/luci-app-opkg/luasrc/view/opkg.htm b/applications/luci-app-opkg/luasrc/view/opkg.htm index 29fe3961a..e610ebad3 100644 --- a/applications/luci-app-opkg/luasrc/view/opkg.htm +++ b/applications/luci-app-opkg/luasrc/view/opkg.htm @@ -226,7 +226,7 @@ truncateVersion(pkg.version || '-'), truncateVersion(avail.version || '-')); - btn = E('div', { + btn = E('button', { 'class': 'btn cbi-button-positive', 'data-package': name, 'click': handleInstall @@ -234,7 +234,7 @@ } else if (currentDisplayMode === 'installed') { ver = truncateVersion(pkg.version || '-'); - btn = E('div', { + btn = E('button', { 'class': 'btn cbi-button-negative', 'data-package': name, 'click': handleRemove @@ -244,19 +244,19 @@ ver = truncateVersion(pkg.version || '-'); if (!packages.installed.pkgs[name]) - btn = E('div', { + btn = E('button', { 'class': 'btn cbi-button-action', 'data-package': name, 'click': handleInstall }, _('Install…')); else if (packages.installed.pkgs[name].version != pkg.version) - btn = E('div', { + btn = E('button', { 'class': 'btn cbi-button-positive', 'data-package': name, 'click': handleInstall }, _('Upgrade…')); else - btn = E('div', { + btn = E('button', { 'class': 'btn cbi-button-neutral', 'disabled': 'disabled' }, _('Installed')); @@ -660,12 +660,12 @@ desc || '', errs || inst || '', E('div', { 'class': 'right' }, [ - E('div', { + E('button', { 'class': 'btn', 'click': hideModal }, _('Cancel')), ' ', - E('div', { + E('button', { 'data-command': 'install', 'data-package': name, 'class': 'btn cbi-button-action', @@ -678,7 +678,7 @@ function handleManualInstall(ev) { var name_or_url = document.querySelector('input[name="install"]').value, - install = E('div', { + install = E('button', { 'class': 'btn cbi-button-action', 'data-command': 'install', 'data-package': name_or_url, @@ -705,7 +705,7 @@ showModal(_('Manually install package'), [ warning, E('div', { 'class': 'right' }, [ - E('div', { + E('button', { 'click': hideModal, 'class': 'btn cbi-button-neutral' }, _('Cancel')), @@ -734,12 +734,12 @@ }); body.push(E('div', { 'class': 'right' }, [ - E('div', { + E('button', { 'class': 'btn cbi-button-neutral', 'click': hideModal }, _('Cancel')), ' ', - E('div', { + E('button', { 'class': 'btn cbi-button-positive', 'click': function(ev) { var data = {}; @@ -795,12 +795,12 @@ _('Automatically remove unused dependencies') ]), E('div', { 'style': 'flex-grow:1', 'class': 'right' }, [ - E('div', { + E('button', { 'class': 'btn', 'click': hideModal }, _('Cancel')), ' ', - E('div', { + E('button', { 'data-command': 'remove', 'data-package': name, 'class': 'btn cbi-button-negative', @@ -842,7 +842,7 @@ dlg.appendChild(E('p', _('The <em>opkg %h</em> command failed with code <code>%d</code>.').format(cmd, (res.code & 0xff) || -1))); dlg.appendChild(E('div', { 'class': 'right' }, - E('div', { + E('button', { 'class': 'btn', 'click': function() { hideModal(); @@ -914,20 +914,20 @@ <div> <label><%:Filter%>:</label> <input type="text" name="filter" placeholder="<%:Type to filter…%>" /><!-- - --><div class="btn cbi-button" onclick="handleReset(event)"><%:Clear%></div> + --><button class="btn cbi-button" onclick="handleReset(event)"><%:Clear%></button> </div> <div> <label><%:Download and install package%>:</label> <input type="text" name="install" placeholder="<%:Package name or URL…%>" onkeydown="if (event.keyCode === 13) handleManualInstall(event)" /><!-- - --><div class="btn cbi-button cbi-button-action" onclick="handleManualInstall(event)"><%:OK%></div> + --><button class="btn cbi-button cbi-button-action" onclick="handleManualInstall(event)"><%:OK%></button> </div> <div> <label><%:Actions%>:</label> - <div class="btn cbi-button-positive" data-command="update" onclick="handleOpkg(event)"><%:Update lists…%></div> + <button class="btn cbi-button-positive" data-command="update" onclick="handleOpkg(event)"><%:Update lists…%></button>   - <div class="btn cbi-button-neutral" onclick="handleConfig(event)"><%:Configure opkg…%></div> + <button class="btn cbi-button-neutral" onclick="handleConfig(event)"><%:Configure opkg…%></button> </div> </div> @@ -939,9 +939,9 @@ <div class="controls" style="display:none"> <div id="pager" class="center"> - <div class="btn cbi-button-neutral prev">«</div> + <button class="btn cbi-button-neutral prev" aria-label="<%:Previous page%>">«</button> <div class="text">dummy</div> - <div class="btn cbi-button-neutral next">»</div> + <button class="btn cbi-button-neutral next" aria-label="<%:Next page%>">»</button> </div> </div> diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 294b2d748..1607b9af6 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -15,38 +15,71 @@ var cbi_d = []; var cbi_t = []; var cbi_strings = { path: {}, label: {} }; +function s8(bytes, off) { + var n = bytes[off]; + return (n > 0x7F) ? (n - 256) >>> 0 : n; +} + +function u16(bytes, off) { + return ((bytes[off + 1] << 8) + bytes[off]) >>> 0; +} + function sfh(s) { if (s === null || s.length === 0) return null; - var hash = (s.length >>> 0), - len = (s.length >>> 2), + var bytes = []; + + for (var i = 0; i < s.length; i++) { + var ch = s.charCodeAt(i); + + if (ch <= 0x7F) + bytes.push(ch); + else if (ch <= 0x7FF) + bytes.push(((ch >>> 6) & 0x1F) | 0xC0, + ( ch & 0x3F) | 0x80); + else if (ch <= 0xFFFF) + bytes.push(((ch >>> 12) & 0x0F) | 0xE0, + ((ch >>> 6) & 0x3F) | 0x80, + ( ch & 0x3F) | 0x80); + else if (code <= 0x10FFFF) + bytes.push(((ch >>> 18) & 0x07) | 0xF0, + ((ch >>> 12) & 0x3F) | 0x80, + ((ch >> 6) & 0x3F) | 0x80, + ( ch & 0x3F) | 0x80); + } + + if (!bytes.length) + return null; + + var hash = (bytes.length >>> 0), + len = (bytes.length >>> 2), off = 0, tmp; while (len--) { - hash += ((s.charCodeAt(off + 1) << 8) + s.charCodeAt(off)) >>> 0; - tmp = ((((s.charCodeAt(off + 3) << 8) + s.charCodeAt(off + 2)) << 11) ^ hash) >>> 0; + hash += u16(bytes, off); + tmp = ((u16(bytes, off + 2) << 11) ^ hash) >>> 0; hash = ((hash << 16) ^ tmp) >>> 0; hash += hash >>> 11; off += 4; } - switch ((s.length & 3) >>> 0) { + switch ((bytes.length & 3) >>> 0) { case 3: - hash += ((s.charCodeAt(off + 1) << 8) + s.charCodeAt(off)) >>> 0; + hash += u16(bytes, off); hash = (hash ^ (hash << 16)) >>> 0; - hash = (hash ^ (s.charCodeAt(off + 2) << 18)) >>> 0; - hash += hash >> 11; + hash = (hash ^ (s8(bytes, off + 2) << 18)) >>> 0; + hash += hash >>> 11; break; case 2: - hash += ((s.charCodeAt(off + 1) << 8) + s.charCodeAt(off)) >>> 0; + hash += u16(bytes, off); hash = (hash ^ (hash << 11)) >>> 0; hash += hash >>> 17; break; case 1: - hash += s.charCodeAt(off); + hash += s8(bytes, off); hash = (hash ^ (hash << 10)) >>> 0; hash += hash >>> 1; break; diff --git a/modules/luci-base/src/template_lmo.c b/modules/luci-base/src/template_lmo.c index cd4c609a7..f7a118c9b 100644 --- a/modules/luci-base/src/template_lmo.c +++ b/modules/luci-base/src/template_lmo.c @@ -46,14 +46,14 @@ uint32_t sfh_hash(const char *data, int len) switch (rem) { case 3: hash += sfh_get16(data); hash ^= hash << 16; - hash ^= data[sizeof(uint16_t)] << 18; + hash ^= (signed char)data[sizeof(uint16_t)] << 18; hash += hash >> 11; break; case 2: hash += sfh_get16(data); hash ^= hash << 11; hash += hash >> 17; break; - case 1: hash += *data; + case 1: hash += (signed char)*data; hash ^= hash << 10; hash += hash >> 1; } diff --git a/themes/luci-theme-rosy/htdocs/luci-static/rosy/cascade.css b/themes/luci-theme-rosy/htdocs/luci-static/rosy/cascade.css index 0f835df4b..3df110195 100644 --- a/themes/luci-theme-rosy/htdocs/luci-static/rosy/cascade.css +++ b/themes/luci-theme-rosy/htdocs/luci-static/rosy/cascade.css @@ -285,7 +285,6 @@ h4 { .table { width: 100%; border-radius: 20px; - overflow: hidden; } .table > .tbody > .tr > .td, @@ -361,18 +360,28 @@ div > .table > .tbody > .tr:nth-of-type(2n) { .cbi-section .table .tr.table-titles { background-color: #eee; } - -.cbi-section .table .cbi-section-table-titles { - background-color: #e0e0e0; +.table .tr:first-child .td:first-child, +.table .tr:first-child::before, +.table .tr:first-child .th:first-child { + border-top-left-radius: 10px; } - -.table .tr.cbi-rowstyle-1:nth-child(n), -.table .tr:nth-child(n) { - background-color: #f9f9f9; +.table .tr:first-child .td:last-child, +.table .tr:first-child .th:last-child { + border-top-right-radius: 10px; +} +.table .tr:last-child .td:first-child, +.table .tr:last-child::before { + border-bottom-left-radius: 10px; +} +.table .tr:last-child .td:last-child { + border-bottom-right-radius: 10px; +} +.table .tr.placeholder:last-child { + background-color: transparent; } -.table .tr:nth-child(2n) { - background-color: #fff; +.cbi-section .table .cbi-section-table-titles { + background-color: #e0e0e0; } /* fix progress bar */ @@ -546,6 +555,7 @@ td > table > tbody > tr > td, } .container .cbi-map .cbi-tabmenu + div { + border-radius: 0; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; overflow: hidden; @@ -1362,7 +1372,6 @@ header > .container > .pull-right > * { } /* fix status processes */ - .node-status-processes > .main .table .tr .td:nth-child(3) { white-space: normal; } @@ -1480,7 +1489,7 @@ header > .container > .pull-right > * { margin-left: 0; } -.node-system-flashops .cbi-tabmenu { +.lang_zh-cnBackup .cbi-tabmenu { margin-bottom: 1rem; } @@ -1946,6 +1955,10 @@ footer { border-bottom-right-radius: 50px; } +.node-main-login input.cbi-input-text { + box-shadow: 0 0 0 1000px white inset; +} + /* Interface after login */ .logged-in { @@ -2531,7 +2544,3 @@ footer { min-width: 25rem; } } - -input.cbi-input-text { - box-shadow: 0 0 0 1000px white inset; -} diff --git a/themes/luci-theme-rosy/htdocs/luci-static/rosy/js/script.js b/themes/luci-theme-rosy/htdocs/luci-static/rosy/js/script.js index 11d3cd68a..8985834ef 100755 --- a/themes/luci-theme-rosy/htdocs/luci-static/rosy/js/script.js +++ b/themes/luci-theme-rosy/htdocs/luci-static/rosy/js/script.js @@ -264,10 +264,23 @@ }) - if( $(window).width() > 992 ){ - $('.logged-in .main-right').width( $(window).width() - $('.logged-in .main-left').width() - 50 ); - } - $('body.logged-in').css('min-height', $(window).height()); + $(function(){ + if( $(window).width() > 992 ){ + $('.logged-in .main-right').outerWidth( $(window).width() - $('.logged-in .main-left').width() - 50 ); + } + var a = window.getComputedStyle($(".cbi-section .table .tr:first-child")[0], ':before').getPropertyValue('content'); + var b = window.getComputedStyle($('.cbi-section .table .tr:last-child')[0], ':before').getPropertyValue('content'); + console.log(typeof a); + + if( a != 'none' || b != 'none' ){ + $('.cbi-section .table .tr:first-child .td:first-child').css('border-top-left-radius', '0'); + $('.cbi-section .table .tr:last-child .td:first-child').css('border-bottom-left-radius', '0'); + $('.cbi-section .table .tr:first-child .th:first-child').css('border-top-left-radius', '0'); + console.log($('.cbi-section .table .tr:last-child .td:first-child')); + + } + }); + })(jQuery); |