automatic convert <(image|description) expose_view="true" to <et2-*-expose

This commit is contained in:
ralf 2022-05-05 19:07:44 +02:00
parent 632c40fbb7
commit 7dc959c223
3 changed files with 33 additions and 31 deletions

View File

@ -87,6 +87,10 @@ function send_template()
) . '>' . $matches[2] . "</$tag>"; ) . '>' . $matches[2] . "</$tag>";
}, $str); }, $str);
// modify <(image|description) expose_view="true" --> <et2-*-expose
$str = preg_replace('/<(image|description)\s([^><]*)expose_view="true"\s([^><]*)\\/>/',
'<et2-$1-expose $2 $3></et2-$1-expose>', $str);
// ^^^^^^^^^^^^^^^^ above widgets get transformed independent of legacy="true" set in overlay ^^^^^^^^^^^^^^^^^^ // ^^^^^^^^^^^^^^^^ above widgets get transformed independent of legacy="true" set in overlay ^^^^^^^^^^^^^^^^^^
// eTemplate marked as legacy --> replace only some widgets (eg. requiring jQueryUI) with web-components // eTemplate marked as legacy --> replace only some widgets (eg. requiring jQueryUI) with web-components

View File

@ -96,7 +96,6 @@ export class Et2Image extends Et2Widget(SlotMixin(LitElement)) implements et2_ID
this.label = ""; this.label = "";
this.extra_link_target = "_self"; this.extra_link_target = "_self";
this.extra_link_popup = ""; this.extra_link_popup = "";
this.expose_view = false;
this._handleClick = this._handleClick.bind(this); this._handleClick = this._handleClick.bind(this);
} }

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd"> <!DOCTYPE overlay PUBLIC "-//EGroupware GmbH//eTemplate 2//EN" "http://www.egroupware.org/etemplate2.dtd">
<!-- $Id$ -->
<overlay> <overlay>
<template id="resources.show.rows" template="" lang="" group="0" version="1.9.003"> <template id="resources.show.rows" template="" lang="" group="0" version="1.9.003">
<grid width="100%"> <grid width="100%">
@ -39,19 +38,17 @@
<nextmatch-customfields id="customfields"/> <nextmatch-customfields id="customfields"/>
</row> </row>
<row class="$row_cont[class]"> <row class="$row_cont[class]">
<et2-image-expose id="${row}[picture_thumb]" label="$row_cont[name]" <image id="${row}[picture_thumb]" expose_view="true" href="$row_cont[picture_original]" src="$row_cont[picture_thumb]" class="thumbnailImage"/>
href="$row_cont[picture_original]" <vbox>
src="$row_cont[picture_thumb]"/> <description id="${row}[name]" no_lang="1"/>
<vbox> <description id="${row}[short_description]" no_lang="1"/>
<description id="${row}[name]" no_lang="1"/> </vbox>
<description id="${row}[short_description]" no_lang="1"/> <vbox align="left">
</vbox> <description align="left" id="${row}[useable]" no_lang="1"/>
<vbox align="left"> <description align="left" id="${row}[quantity]" no_lang="1"/>
<description align="left" id="${row}[useable]" no_lang="1"/> <description align="left" id="${row}[bookable]" no_lang="1"/>
<description align="left" id="${row}[quantity]" no_lang="1"/> </vbox>
<description align="left" id="${row}[bookable]" no_lang="1"/> <vbox>
</vbox>
<vbox>
<menulist> <menulist>
<menupopup type="select-cat" id="{$row}[cat_id]" no_lang="1" readonly="true"/> <menupopup type="select-cat" id="{$row}[cat_id]" no_lang="1" readonly="true"/>
</menulist> </menulist>
@ -110,20 +107,22 @@
</vbox> </vbox>
</box> </box>
<styles> <styles>
.image16 img { .thumbnailImage img {
max-width: 16px; width: 100%;
max-height: 16px; max-width: 65px;
} height: auto !important;
.action_popup[id] { max-height: 50px;
position: fixed; }
top: 200px; .action_popup[id] {
left: 450px; position: fixed;
width: 76ex; top: 200px;
z-index: 20000; left: 450px;
display: none; width: 76ex;
border-collapse:collapse; z-index: 20000;
border-spacing:0px display: none;
} border-collapse:collapse;
</styles> border-spacing:0px
}
</styles>
</template> </template>
</overlay> </overlay>