mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-25 13:53:48 +01:00
Change needbrowser
This commit is contained in:
parent
dfa4a16f35
commit
1dc1d9702f
@ -41,9 +41,31 @@ draft: false
|
|||||||
getAllSelect().each(function () {
|
getAllSelect().each(function () {
|
||||||
$("<li/>").text($('label[for="' + $(this).attr('id') + '"]').text()).appendTo(slist)
|
$("<li/>").text($('label[for="' + $(this).attr('id') + '"]').text()).appendTo(slist)
|
||||||
})
|
})
|
||||||
$('[data-needengine],[data-needplatform],[data-needbrowser]').each(function() {
|
$('[data-needbrowser],[data-neednotbrowser]').each(function() {
|
||||||
if($(this).data("needengine").some((e=>browser.isEngine(e))) && $(this).data("needplatform").some((e=>browser.isPlatform(e)))){
|
function test(key,value){
|
||||||
|
switch (key) {
|
||||||
|
case "Engine":
|
||||||
|
return value.some((v)=>browser.isEngine(v))
|
||||||
|
break;
|
||||||
|
case "Browser":
|
||||||
|
return value.some((v)=>browser.isBrowser(v))
|
||||||
|
case "Platform":
|
||||||
|
return value.some((v)=>browser.isPlatform(v))
|
||||||
|
case "OS":
|
||||||
|
return value.some((v)=>browser.isOS(v))
|
||||||
|
default:
|
||||||
|
return true
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const needdata=$(this).data("needbrowser")
|
||||||
|
const neednotdata=$(this).data("neednotbrowser")
|
||||||
|
const need = ((needdata==null) ? true : Object.entries(needdata).every(kv=>test(kv[0],kv[1])))
|
||||||
|
const neednot=((neednotdata==null) ? true : Object.entries(neednotdata).some(kv=>!test(kv[0],kv[1])))
|
||||||
|
if(need && neednot){
|
||||||
$(this).show()
|
$(this).show()
|
||||||
|
} else {
|
||||||
|
$(this).hide()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
var cbextl = $("#cb_exTypeList")
|
var cbextl = $("#cb_exTypeList")
|
||||||
@ -463,8 +485,8 @@ draft: false
|
|||||||
<li>Absorption</li>
|
<li>Absorption</li>
|
||||||
<li>Fluorescence</li>
|
<li>Fluorescence</li>
|
||||||
</ul>
|
</ul>
|
||||||
<li>Choose each parameter (of course you can select multiples values for each) you can use the the <button
|
<li>Choose each parameter (of course you can select multiples values for each) you can use the the <buttongit
|
||||||
disabled>Select all</button> button to select all items <span hidden data-needengine='["WebKit","Blink"]' data-needplatform='["desktop"]'>or use the <kbd>Ctrl</kbd>+ <kbd>A</kbd> shortcut key</span></li>
|
disabled>Select all</button> button to select all items <span hidden data-needbrowser='{"Engine":["WebKit","Blink"],"Platform":["desktop"]}'>or use the <kbd data-needbrowser='{"OS":["MacOS"]}'>CMD</kbd><kbd data-neednotbrowser='{"OS":["MacOS"]}'>Ctrl</kbd>+<kbd>A</kbd> shortcut key</span></li>
|
||||||
<ul id="SelectList"></ul>
|
<ul id="SelectList"></ul>
|
||||||
<li>Choose filters:</li>
|
<li>Choose filters:</li>
|
||||||
<ul>
|
<ul>
|
||||||
|
Loading…
Reference in New Issue
Block a user