/** Datei: plugins/rest/assets.OLD/js/arunox/_OLD/components/paragraph.js **/ /** * rest/arunox/generators/components/paragraph.js * * Some Javascript codes without further description * * @author Sparky * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ ARUNOX.Hooks.register( 'generator.components/paragraph->create.OLD', function( [ type, name, hook, config, data ] ) { type = 'htmltag'; name = 'p'; hook = `${type}.${name}`; ARUNOX.Theme.bindHooks( type, name, hook ); return [ type, name, hook, config, data ]; }, 0 ); ARUNOX.Registry.htmlTag.register( 'p', class RestTemplateDefault extends ARUNOX.Theme.Component { static htmlTag = 'p'; static hooks = { config( config, type, name, data, storage ) { config.textNode ??= config.text || null; return config; }, }; create( config, data ) { const className = 'paragraph'; const block = config.block ? `${className} ${config.block}__${className}` : className; this.element.classList.add( ...block.split(' ') ); if( config.icon ) this.elements.icon = this.render( 'components/icon', { name: config.icon, block: config.block } ); if( config.color ) this.apply( 'colorize', config.color, { target: 'icon' }, this.elements.icon ); } }); /** Datei: plugins/rest/assets.OLD/js/arunox/_OLD/components/breadcrumbs.js **/ /** * rest/arunox/generators/components/breadcrumbs.js * * Some Javascript codes without further description * * @author Sparky * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ ARUNOX.Registry.generator.register( 'components/breadcrumbs', class RestTemplateDefault extends ARUNOX.Theme.Component { static htmlTag = 'h1'; create( config, data ) { const wrapper = document.querySelector('#breadcrumbs'); if( !wrapper) return; if( location.pathname != config.path.cachekey || config.path.cachekey != config.path.history ) { window.history.pushState({}, "", config.path.history ); } const home = wrapper.querySelector( '.breadcrumbs__item--home'); const items = wrapper.querySelectorAll( ':not(.breadcrumbs__item--home) '); if( !wrapper ) return; wrapper.classList.add( 'breadcrumbs' ); items.forEach( element => element.remove() ); const segments = router.getBreadcrumbSegments( config.path.history ); for( const [ index, segment ] of segments.entries() ) { if( ( home && index === 0 ) || ( index <= segments.length - 1 ) ) { generator.generate( 'components/breadcrumbs/separator', {}, {}, wrapper ); } generator.generate( 'components/link', { name : 'item', block : 'breadcrumbs', path : index === segments.length - 1 ? false : segment.path, label : segment.label, active : index === segments.length - 1, }, {}, wrapper ); } } }); ARUNOX.Registry.generator.register( 'components/breadcrumbs/separator', class RestTemplateDefault extends ARUNOX.Theme.Component { static htmlTag = 'h1'; create( config, data ) { const separator = document.createElement('div'); separator.classList.add('breadcrumbs__separator'); container.append( separator ); } }); /** Datei: plugins/rest/assets.OLD/js/arunox/_OLD/components/headline.js **/ /** * rest/arunox/generators/components/headline.js * * Some Javascript codes without further description * * @author Sparky * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ ARUNOX.Registry.generator.register( 'components/headline', class extends ARUNOX.Theme.Component { static htmlTag = 'h1'; create( config, data ) { this.append( document.createTextNode( data || config.title ) ) } }); /** Datei: plugins/rest/assets.OLD/js/arunox/_OLD/components/icon.js **/ /** * rest/arunox/generators/components/icon.js * * Some Javascript codes without further description * * @author Sparky * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ ARUNOX.Registry.generator.register( 'components/icon', class RestTemplateDefault extends ARUNOX.Theme.Component { static htmlTag = 'i'; create( config, data ) { const className = 'icon'; const block = config.block ? `${className} ${config.block}__${className}` : className; this.element.classList.add( ...config.name.split(' ') ); this.element.classList.add( ...block.split(' ') ); // if( config.color ) this.classList.add(`text--${config.color}`); if( config.color ) this.apply( 'colorize', config.color, { target: 'text' }); this.parent.element?.classList.add( 'has--icon' ); } }); /** Datei: plugins/rest/assets.OLD/js/arunox/_OLD/components/link.js **/ /** * rest/arunox/generators/components/link.js * * Some Javascript codes without further description * * @author Sparky * @copyright 2025 ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ ARUNOX.Registry.generator.register( 'components/link', class RestTemplateDefault extends ARUNOX.Theme.Component { static htmlTag = 'a'; create( config, data ) { const link = this.element; const label = document.createElement("span"); const name = config.name || 'link'; const block = config.block ? `${config.block}__${name}` : name; // Standardklasse setzen oder `block` nutzen (z. B. "menu") link.classList.add( block ); link.elements = {}; if( config.title ) link.title = config.title; if( config.active ) link.classList.add( `${block}--active` ); if( !config.path ) link.classList.add( `${block}--inactive` ); if( config.icon ) link.elements.icon = this.render("components/icon", { name: config.icon, block: config.block } ); if( config.label ) { label.innerHTML = config.label; label.classList.add( `${block}__label` ); link.append( label ); } if( config.path && config.path != '#' ) { link.addEventListener("click", (event) => { event.preventDefault(); ARUNOX.Router.handle( config.path, {}, {}, 'rest' ); }); } } });