mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Use proper HTMLTemplateElement for all knockoutjs templates
This commit is contained in:
parent
efc2dd89e1
commit
29367a0ea7
5 changed files with 2 additions and 40 deletions
|
|
@ -207,14 +207,11 @@ class AbstractApp extends AbstractBoot {
|
||||||
ko.components.register('Date', require('Component/Date').default);
|
ko.components.register('Date', require('Component/Date').default);
|
||||||
|
|
||||||
ko.components.register('x-script', require('Component/Script').default);
|
ko.components.register('x-script', require('Component/Script').default);
|
||||||
// ko.components.register('svg-icon', require('Component/SvgIcon').default);
|
|
||||||
|
|
||||||
if (Settings.appSettingsGet('materialDesign') && !bMobileDevice) {
|
if (Settings.appSettingsGet('materialDesign') && !bMobileDevice) {
|
||||||
ko.components.register('Checkbox', require('Component/MaterialDesign/Checkbox').default);
|
ko.components.register('Checkbox', require('Component/MaterialDesign/Checkbox').default);
|
||||||
ko.components.register('CheckboxSimple', require('Component/Checkbox').default);
|
ko.components.register('CheckboxSimple', require('Component/Checkbox').default);
|
||||||
} else {
|
} else {
|
||||||
// ko.components.register('Checkbox', require('Component/Classic/Checkbox').default);
|
|
||||||
// ko.components.register('CheckboxSimple', require('Component/Classic/Checkbox').default);
|
|
||||||
ko.components.register('Checkbox', require('Component/Checkbox').default);
|
ko.components.register('Checkbox', require('Component/Checkbox').default);
|
||||||
ko.components.register('CheckboxSimple', require('Component/Checkbox').default);
|
ko.components.register('CheckboxSimple', require('Component/Checkbox').default);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
import { componentExportHelper } from 'Component/Abstract';
|
|
||||||
import { AbstractCheckbox } from 'Component/AbstractCheckbox';
|
|
||||||
|
|
||||||
class ClassicCheckboxComponent extends AbstractCheckbox {}
|
|
||||||
|
|
||||||
export default componentExportHelper(ClassicCheckboxComponent, 'ClassicCheckboxComponent');
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
let cachedUrl = null;
|
|
||||||
const getUrl = () => {
|
|
||||||
if (!cachedUrl) {
|
|
||||||
const version = jQuery('#rlAppVersion').attr('content') || '0.0.0';
|
|
||||||
cachedUrl = `rainloop/v/${version}/static/css/svg/icons.svg`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return cachedUrl;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
template: '<b></b>',
|
|
||||||
viewModel: {
|
|
||||||
createViewModel: ({ icon = 'null' }, componentInfo) => {
|
|
||||||
if (componentInfo && componentInfo.element) {
|
|
||||||
jQuery(componentInfo.element).replaceWith(
|
|
||||||
`<svg class="svg-icon svg-icon-${icon}"><use xlink:href="${getUrl()}#svg-icon-${icon}"></use></svg>`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
@ -1012,8 +1012,8 @@ class ServiceActions
|
||||||
foreach ($aTemplates as $sName => $sFile)
|
foreach ($aTemplates as $sName => $sFile)
|
||||||
{
|
{
|
||||||
$sName = \preg_replace('/[^a-zA-Z0-9]/', '', $sName);
|
$sName = \preg_replace('/[^a-zA-Z0-9]/', '', $sName);
|
||||||
$sHtml .= '<script id="'.$sName.'" type="text/html" data-cfasync="false">'.
|
$sHtml .= '<template id="'.$sName.'">'.
|
||||||
$this->oActions->ProcessTemplate($sName, \file_get_contents($sFile)).'</script>';
|
$this->oActions->ProcessTemplate($sName, \file_get_contents($sFile)).'</template>';
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($aTemplates);
|
unset($aTemplates);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
<label class="e-component e-checkbox inline" data-bind="css: { 'disabled': disable() || !enable() }">
|
|
||||||
<input type="checkbox" data-bind="checked: value, disable: disable() || !enable()" style="margin: 0 0 1px 0;" />
|
|
||||||
<!-- ko if: labeled -->
|
|
||||||
|
|
||||||
<span class="sub-label i18n" data-bind="attr: {'data-i18n': label}, css: {'i18n-animation': labelAnimated}"></span>
|
|
||||||
<!-- /ko -->
|
|
||||||
</label>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue