Есть 3 списка такого плана:"[191717, 191718]","EH3105928,ISCAR 3105081","3,1"
def f(*data):
return tuple(', '.join(map(str.strip, t)) for t in zip(
*[s.lstrip('[').rstrip(']').split(',') for s in data]))
print(f("[191717, 191718]", "EH3105928,ISCAR 3105081", "3,1"))
server {
listen 80;
server_name domain.ru;
location / {
proxy_pass http://111.111.111.111:80;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_redirect off;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 10m;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 443;
ssl on;
server_name domain.ru;
ssl_certificate /etc/nginx/ssl/domain.ru.crt;
ssl_certificate_key /etc/nginx/ssl/domain.ru.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "RC4:HIGH:!aNULL:!MD5:!kEDH";
location / {
proxy_pass https://111.111.111:443;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_redirect off;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 10m;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
function onlyOne({ value, dataset: { group } }) {
document.querySelectorAll(`[data-group="${group}"]`).forEach(n => {
n.checked = n.checked && n.value === value;
});
}
function onlyOne(checkbox) {
for (const n of document.getElementsByName(checkbox.name)) {
n.checked = n === checkbox ? n.checked : false;
}
}
function onlyOne(checkbox) {
checkbox
.closest('.group')
.querySelectorAll('input[type="checkbox"]')
.forEach(n => n.checked = n.checked && n === checkbox);
}
const counts = opis.reduce((p,c) => { p[c] = p[c] ? p[c]+1 : 1; return p;}, {});
const result = [];
for (let k in counts) if (counts[k] === 1) result.push(k);
<div id="container">
<input type="checkbox" name="price-input" value="10" onClick="calculate(this);" />10<br />
<input type="checkbox" name="price-input" value="20" onClick="calculate(this);" />20 <br />
<input type="checkbox" name="price-input" value="30" onClick="calculate(this);" />30 <br />
<input type="checkbox" name="price-input" value="40" onClick="calculate(this);" />40 <br />
</div>
Sum : <span id="sum">0</span>
var total = 0;
function calculate(item) {
if(item.checked){
total+= parseInt(item.value);
} else {
total-= parseInt(item.value);
}
document.getElementById('sum').innerHTML = total;
}
document.getElementById()
на находит элемента с данным id – ведь вы тут же пытаетесь изменить свойство checked
. checked
;try .. catch
function setCheck(arr, prefix) {
arr.forEach( item => {
const el = document.getElementById(prefix + item);
if (el && el.hasOwnProperty("checked")) el.checked = true;
});
}
setCheck (resKolichestvoSpalen, "kolichestvo-spalen-value-");
setCheck (resKolichestvoEtazhey, "kolichestvo-etazhey-value-");
/*
Plugin Name: Colum Remover
Plugin URI: https://toster.ru/q/573685
Description: Плагин, убирающий колонку
Version: 1.0
Author: Александр Соболев
Author URI: http://vk.com/san_jorich
License: GPL2
*/
/* Copyright 2018 SOBOLEV_ALEKSANDER (email : samigrai@mail.ru) */
function cr_js_includer() {
wp_register_script('cr_js', plugins_url('js.js', __FILE__));
wp_enqueue_script('cr_js');
//wp_localize_script( 'cr_js', 'ajaxurl', admin_url( 'admin-ajax.php' ) );
}
add_action( 'admin_enqueue_scripts', 'cr_js_includer' );
//Код файла js.js распологающийся в корневой папке плагина
jQuery(document).ready(function(){
if (window.location.href.indexOf("/edit.php?post_type=/*slug типа записи*/") > -1){jQuery.remove('#id блока\столбца');}
}