$('.filter_block.price_filter .price_filter_inputs input[name=price_start]').keyup(function() {
var from = $(this).val();
console.log(from);
});
Сделайте выборку дочерних ресурсов (например, с помощью pdoResources), а в вывод уже положите ваш
if($filter) {
$where = $modx->toJSON(array($filter));
} else {
$where = ' вот тут ';
}
0.0000451: pdoTools loaded
0.0000129: xPDO query object created
0.0002530: Included list of tvs: format, color, zavod, priceSHT, marka, show_cat, mini_image, sort
0.0000970: leftJoined modTemplateVarResource as TVformat
0.0000739: leftJoined modTemplateVarResource as TVcolor
0.0000710: leftJoined modTemplateVarResource as TVzavod
0.0000720: leftJoined modTemplateVarResource as TVpricesht
0.0000799: leftJoined modTemplateVarResource as TVmarka
0.0000720: leftJoined modTemplateVarResource as TVshow_cat
0.0000720: leftJoined modTemplateVarResource as TVmini_image
0.0000720: leftJoined modTemplateVarResource as TVsort
0.0000470: Added selection of modResource: `id`, `pagetitle`, `introtext`, `content`
0.0000041: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.format`
0.0000021: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.color`
0.0000021: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.zavod`
0.0000019: Added selection of modTemplateVarResource: IFNULL(`value`, '0') AS `tv.priceSHT`
0.0000031: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.marka`
0.0000031: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.show_cat`
0.0000019: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.mini_image`
0.0000019: Added selection of modTemplateVarResource: IFNULL(`value`, '999') AS `tv.sort`
0.0000050: Replaced TV conditions
0.0000110: Replaced TV conditions
0.0003150: Processed additional conditions
0.0005062: Added where condition: 0(`TVformat`.`value`=Одинарный), modResource.parent:IN(195,239,271,280,297,8,194,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,272,273,274,275,276,277,278,279,295,296,281,282,283,284,285,286,287,288,289,290,291,292,293,294,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321), modResource.published=1, modResource.deleted=0
0.0000041: Replaced TV conditions
0.0000448: Sorted by modResource.pagetitle, asc
0.0001812: SQL prepared "SELECT `modResource`.`id`, `modResource`.`pagetitle`, `modResource`.`introtext`, `modResource`.`content`, IFNULL(`TVformat`.`value`, '') AS `tv.format`, IFNULL(`TVcolor`.`value`, '') AS `tv.color`, IFNULL(`TVzavod`.`value`, '') AS `tv.zavod`, IFNULL(`TVpricesht`.`value`, '0') AS `tv.priceSHT`, IFNULL(`TVmarka`.`value`, '') AS `tv.marka`, IFNULL(`TVshow_cat`.`value`, '') AS `tv.show_cat`, IFNULL(`TVmini_image`.`value`, '') AS `tv.mini_image`, IFNULL(`TVsort`.`value`, '999') AS `tv.sort` FROM `bsm_site_content` AS `modResource` LEFT JOIN `bsm_site_tmplvar_contentvalues` `TVformat` ON `TVformat`.`contentid` = `modResource`.`id` AND `TVformat`.`tmplvarid` = 7 LEFT JOIN `bsm_site_tmplvar_contentvalues` `TVcolor` ON `TVcolor`.`contentid` = `modResource`.`id` AND `TVcolor`.`tmplvarid` = 8 LEFT JOIN `bsm_site_tmplvar_contentvalues` `TVzavod` ON `TVzavod`.`contentid` = `modResource`.`id` AND `TVzavod`.`tmplvarid` = 9 LEFT JOIN `bsm_site_tmplvar_contentvalues` `TVpricesht` ON `TVpricesht`.`contentid` = `modResource`.`id` AND `TVpricesht`.`tmplvarid` = 11 LEFT JOIN `bsm_site_tmplvar_contentvalues` `TVmarka` ON `TVmarka`.`contentid` = `modResource`.`id` AND `TVmarka`.`tmplvarid` = 13 LEFT JOIN `bsm_site_tmplvar_contentvalues` `TVshow_cat` ON `TVshow_cat`.`contentid` = `modResource`.`id` AND `TVshow_cat`.`tmplvarid` = 15 LEFT JOIN `bsm_site_tmplvar_contentvalues` `TVmini_image` ON `TVmini_image`.`contentid` = `modResource`.`id` AND `TVmini_image`.`tmplvarid` = 17 LEFT JOIN `bsm_site_tmplvar_contentvalues` `TVsort` ON `TVsort`.`contentid` = `modResource`.`id` AND `TVsort`.`tmplvarid` = 37 WHERE ( `TVformat`.`value`=Одинарный AND `modResource`.`parent` IN (195,239,271,280,297,8,194,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,272,273,274,275,276,277,278,279,295,296,281,282,283,284,285,286,287,288,289,290,291,292,293,294,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321) AND `modResource`.`published` = 1 AND `modResource`.`deleted` = 0 ) ORDER BY modResource.pagetitle asc "
0.0003979: Could not process query, error #1054: Unknown column 'Одинарный' in 'where clause'
0.0021970: Total time
2 097 152: Memory usage
<?php
//Filter Fields Settings
$filter = array();
//Radio, Select & Text Fields Type
if($_GET['show_cat']) {
$filter[] = 'show_cat='.$_GET['show_cat'];
}
if($_GET['color']) {
$filter[] = 'color='.$_GET['color'];
}
if($_GET['format']) {
$filter[] = 'format='.$_GET['format'];
}
if($_GET['zavod']) {
$filter[] = 'zavod='.$_GET['zavod'];
}
//End Settings
//Sort
if($_GET['sortby']) {
$sortby = $_GET['sortby'];
} else {
$sortby = 'pagetitle';
}
if($_GET['sortdir']) {
$sortdir = $_GET['sortdir'];
} else {
$sortdir = 'asc';
}
//End Sort
//Offset
$offset = 0;
if($_GET['offset']){
$offset = $_GET['offset'];
}
if($filter) {
$where = $modx->toJSON(array($filter));
} else {
$where = '';
}
$params_count = array(
'parents' => $parents,
'limit' => 0,
'tpl' => '@INLINE ,',
'select' => 'id',
'includeTVs' => $fields,
'showHidden' => '1',
'where' => $where
);
$count = $modx->runSnippet('pdoResources',$params_count);
$count = count(explode(',',$count))-1;
$modx->setPlaceholder('count',$count);
$params = array(
'parents' => $parents,
'limit' => $limit,
'offset' => $offset,
'tpl' => $tpl,
'select' => 'id,pagetitle,introtext,content',
'includeTVs' => $fields,
'showHidden' => '1',
'sortby' => $sortby,
'sortdir' => $sortdir,
'where' => $where,
'showLog' => '1'
);
return $modx->runSnippet('pdoResources',$params);
$(function() {
//MODx pdoResources Ajax Filter
//Filter Settings
var fadeSpeed = 200, // Fade Animation Speed
ajaxContainerSelector = '.bricks_items', // CSS Selector of Ajax Container
ajaxItemSelector = '.brick_item', // CSS Selector of Ajax Item
ajaxFormSelector = '.ajax-form'; // CSS Selector of Ajax Filter Form
$('' + ajaxFormSelector + '').submit(function() {
return false;
});
function ajaxMainFunction() {
$.ajax({
data: $(ajaxFormSelector).serialize()
}).done(function(response) {
var $response = $(response);
$(ajaxContainerSelector).fadeOut(fadeSpeed);
setTimeout(function() {
$(ajaxContainerSelector).html($response.find(ajaxContainerSelector).html()).fadeIn(fadeSpeed);
}, fadeSpeed);
});
}
$(''+ajaxFormSelector+' input').change(function() {
ajaxMainFunction();
})
});
0.0003979: Could not process query, error #1054: Unknown column 'Одинарный' in 'where clause'
var paths = document.querySelectorAll('svg path').length;
var over = "document.getElementById('trans1').beginElement();";
for(var i = 1; i != paths; i++){
var x = i+1;
over = over + "document.getElementById('trans"+x+"').beginElement();";
}
var svg = document.querySelector('svg');
var svg_w = svg.getAttribute('width');
var svg_h = svg.getAttribute('height');
svg.setAttribute("onmouseover",over);
var rect = document.createElementNS("http://www.w3.org/2000/svg","rect");
rect.setAttribute('width',svg_w);
rect.setAttribute('height',svg_h);
rect.setAttribute('opacity',0);
rect.setAttribute('fill','#000');
svg.appendChild(rect);
[].forEach.call(document.querySelectorAll('svg path'), function(el,i) {
var path = Math.round(el.getTotalLength()),
timer = 960;
i++;
el.setAttribute('stroke-dasharray', path);
el.setAttribute('stroke-dashoffset', path);
var ani = document.createElementNS("http://www.w3.org/2000/svg","animate");
ani.setAttribute('id','trans'+i);
ani.setAttribute('attributeName','stroke-dashoffset');
ani.setAttribute('values','0; '+path+'; 0');
ani.setAttribute('begin','0ms');
ani.setAttribute('dur',timer+'ms');
ani.setAttribute('repeatCount','1');
ani.setAttribute('fill','freeze');
ani.setAttribute('calcMode','linear');
ani.setAttribute('restart','whenNotActive');
el.appendChild(ani);
});
const leadingZero = n => ('0000' + n).substr(-4);
for (let imageIndex = 0; imageIndex < 30400; imageIndex++) {
image = parseInt(image.replace(/\D+/g,"")); // переводим строку в число, чтобы отобросить лишние нули
image = image.toString(); // переводим число в строку, чтобы посчитать количество оставшихся символов.
var len = image.length; // считаем количество символов
if (len == 1) {image = '000'+image;}
if (len == 2) {image = '00'+image;}
if (len == 3) {image = '0'+image;}
if (imageIndex % 301 == 0) {
coordX = 0 + 600 * (imageIndex / 301);
coordY = 30300 - 300 * (imageIndex / 301);
}
data.push({
src: image + '.jpg',
x: coordX,
y: coordY
});
coordX += 200;
coordY += 100;
maxX = Math.max(maxX, coordX);
maxY = Math.max(maxY, coordY);
image = parseInt(image.replace(/\D+/g,"")); // переводим строку в число, чтобы можно было прибавить единицу
image = image+1; // +1
image = image.toString(); // переводим число в строку, чтобы подготовить к следующему циклу
}
Заметил, когда писал код удаления скрытых частей. Изначально индексом выступали просто имена картинок xxxx.jpg/ Но оказалось, что картинка с одним и тем же именем по вашей формуле может иметь разные координаты (т.е. располагается в двух местах).
images.forEach(image => {
let key = makeKey(image);
if (!imgs[key]) {
const img = document.createElement('img');
loader.show();
img.classList.add('tile');
img.style.left = image.x + 'px';
img.style.top = image.y + 'px';
img.onload = () => loader.hide();
img.src = imagesPath + imagePrefix + image.src;
// устанавливаем правильный z-index для каждой картинки
var zindex = img.src.substring(35);
zindex = parseInt(zindex.replace(/\D+/g,""));
img.style.zIndex = zindex;
imgs[key] = img;
tiles.appendChild(img);
statCounter++;
}
});