ExtSearch/views/smarty/blocks/layout/d3_extsearch_js.tpl

123 lines
5.7 KiB
Smarty
Raw Normal View History

2024-02-09 18:44:23 +01:00
[{$smarty.block.parent}]
[{d3modcfgcheck modid="d3_extsearch"}][{/d3modcfgcheck}]
[{if $mod_d3_extsearch && false == $oModCfg_d3_extsearch->isThemeIdMappedTo('mobile')}]
[{if $blUseSuggestSearch}]
[{strip}]
[{block name="d3_extsearch_js__suggest"}]
[{block name="d3_extsearch_js__suggest_jsfile"}]
[{oxscript include=$oViewConf->getModuleUrl('d3_extsearch', 'out/src/js/wave/d3extsearch.min.js')}]
[{/block}]
[{block name="d3_extsearch_js__suggest_jssuggestcall"}]
[{assign var="sCharSet" value="charset"|oxmultilangassign}]
[{capture name="d3script"}][{strip}]
document.addEventListener("DOMContentLoaded", () => {
try {
var suggestSearch = new d3ExtsearchSuggest({
sWaitMessage: '[{$sD3QSWaitMessage|strip|oxescape:"htmlall":$sCharSet}]',
sParentThemeId: '[{$oModCfg_d3_extsearch->getReferenceThemeId()}]',
sRequestUrl: '[{$oViewConf->getSelfLink()|oxaddparams:"cl=d3_extsearch_response"|cat:"&=shp="|cat:$oViewConf->getActiveShopId()|cat:"&"}]',
iMinCharCount: 3
});
} catch (e) {
[{* don't use console.error because of undefined break in PhantomJS while generating critical css *}]
console.error(e.message);
}
});
[{/strip}][{/capture}]
[{oxscript add=$smarty.capture.d3script}]
[{/block}]
[{if !$blD3EmptySearch}]
[{assign var="sSBDefault" value="D3_EXTSEARCH_FIELD_NOTICE"|oxmultilangassign}]
[{oxscript add="var sD3SearchBoxDefault = '"|cat:$sSBDefault|cat:"';"}]
[{else}]
[{oxscript add="var sD3SearchBoxDefault = '';"}]
[{/if}]
[{/block}]
[{/strip}]
[{/if}]
[{if $blD3ShowIAS}]
[{strip}]
[{block name="d3_extsearch_js__ias"}]
[{block name="d3_extsearch_js__ias_jsfile"}]
[{oxscript include=$oViewConf->getModuleUrl('d3_extsearch', 'out/src/js/wave/d3extsearch_ias.min.js')}]
[{/block}]
[{block name="d3_extsearch_js__suggest_jsiascall"}]
[{assign var="sCharSet" value="charset"|oxmultilangassign}]
[{capture name="d3script"}][{strip}]
document.addEventListener("DOMContentLoaded", () => {
try {
new d3ExtsearchIAS();
} catch (e) {
[{* don't use console.error because of undefined break in PhantomJS while generating critical css *}]
console.error(e.message);
}
});
[{/strip}][{/capture}]
[{oxscript add=$smarty.capture.d3script}]
[{/block}]
<div id="IAS_box" class="IAS_box IAS_box_[{$oModCfg_d3_extsearch->getParentThemeId()}]">
<div class="headline">
<div class="closebtn" id="IAS_closebtn">X</div>
<label for="IAS_input">[{oxmultilang ident="D3_EXTSEARCH_IAS_SEARCH"}]</label>
</div>
<form action="[{$oViewConf->getBaseDir()}]index.php" method="get" onSubmit="d3_extsearch_popup.popup.load();">
<div>
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="search">
<input id="IAS_input" type="text" size="30" value="" name="searchparam">
<span class="btn">
<input type="submit" class="btn" value="[{oxmultilang ident="D3_EXTSEARCH_IAS_STARTSEARCH"}]">
</span>
</div>
</form>
</div>
[{/block}]
[{/strip}]
[{/if}]
[{if $blD3ShowSearchPopup}]
[{block name="d3_extsearch_js__popup"}]
<div id="d3extsearch_message" class="d3extsearch_popup">
<strong style="text-align: center;">[{oxmultilang ident="D3_EXTSEARCH_SEARCHINPROGRESS"}]</strong>
</div>
<script type="text/javascript">
let d3_extsearch_popup = {
// Popups
popup: {
load : function(){
let id = 'd3extsearch_message';
let pcl = 'd3extsearch_popup load on';
let mcl = 'on';
let _mk = document.getElementById('d3extsearch_mask');
let _el = document.getElementById(id);
if(_mk && _el) {
_mk.className = mcl;
_el.className = pcl;
}
}
}
};
</script>
<div id="d3extsearch_mask"></div>
[{/block}]
[{else}]
[{block name="d3_extsearch_js__nopopup"}]
<script type="text/javascript">
let d3_extsearch_popup = {
popup: {
load : function(){ }
}
};
</script>
[{/block}]
[{/if}]
[{/if}]