From: soufiane Date: Wed, 31 May 2023 15:26:30 +0000 (+0200) Subject: wip #5812 @0:30 image large, sanitize url X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d49dfcf966b085cfd69db0349de5cf09a5f96646;p=sycomore-fondation.git wip #5812 @0:30 image large, sanitize url --- diff --git a/wp-content/mu-plugins/cube/Init.php b/wp-content/mu-plugins/cube/Init.php index 4613904..a0d9c66 100644 --- a/wp-content/mu-plugins/cube/Init.php +++ b/wp-content/mu-plugins/cube/Init.php @@ -17,7 +17,6 @@ class Setup { public function register() { add_action('elementor/elements/categories_registered', [$this, 'register_widgets_category']); - add_action( 'elementor/widgets/widgets_registered', [$this, 'register_widgets'] ); $this->customise_sections(); @@ -29,7 +28,6 @@ class Setup { $widgets_manager->register(new Widgets\FormattedText()); $widgets_manager->register(new Widgets\HighlightTitle()); $widgets_manager->register(new Widgets\AssociationSectionImage()); - $widgets_manager->register(new Widgets\AssocationList()); $widgets_manager->register(new Widgets\BannerTitle()); $widgets_manager->register(new Widgets\BlockOrganisation()); $widgets_manager->register(new Widgets\CarouselHome()); @@ -195,18 +193,6 @@ class Setup { '4xl' => '4XL (112px — 140px)', '5xl' => '5XL (128px — 160px)', - // Not all of these are needed for now, so removing them to lighten the UI - // '3xs-2xs' => '3XS ↔ 2XS (4px — 10px)', - // '2xs-xs' => '2XS ↔ XS (8px — 15px)', - // 'xs-s' => 'XS ↔ S (12px — 20px)', - // 's-m' => 'S ↔ M (16px — 30px)', - // 'm-l' => 'M ↔ L (24px — 40px)', - // 'l-xl' => 'L ↔ XL (32px — 60px)', - // 'xl-2xl' => 'XL ↔ 2XL (48px — 80px)', - // '2xl-3xl' => '2XL ↔ 3XL (64px — 120px)', - // '3xl-4xl' => '3XL ↔ 4XL (96px — 140px)', - // '4xl-5xl' => '4XL ↔ 5XL (112px — 160px)', - 's-l' => 'S ↔ L (16px — 40px)', 's-l-custom' => '(38px — 43px)', 'm-xl' => 'M ↔ XL (24px — 60px)', diff --git a/wp-content/mu-plugins/cube/Widgets/AssocationList.php b/wp-content/mu-plugins/cube/Widgets/AssocationList.php deleted file mode 100644 index d7c2663..0000000 --- a/wp-content/mu-plugins/cube/Widgets/AssocationList.php +++ /dev/null @@ -1,206 +0,0 @@ -start_controls_section( - 'content_section', - [ - 'label' => esc_html__( 'Content', 'cube' ), - 'tab' => Controls_Manager::TAB_CONTENT, - ] - ); - - /* Start repeater */ - - $repeater = new \Elementor\Repeater(); - - $repeater->add_control( - 'text', - [ - 'label' => esc_html__( 'Text', 'cube' ), - 'type' => Controls_Manager::TEXT, - 'placeholder' => esc_html__( 'List Item', 'cube' ), - 'default' => esc_html__( 'List Item', 'cube' ), - 'label_block' => true, - 'dynamic' => [ - 'active' => true, - ], - ] - ); - - $repeater->add_control( - 'link', - [ - 'label' => esc_html__( 'Link', 'cube' ), - 'type' => Controls_Manager::URL, - 'placeholder' => esc_html__( 'https://your-link.com', 'cube' ), - 'dynamic' => [ - 'active' => true, - ], - ] - ); - - /* End repeater */ - - $this->add_control( - 'list_items', - [ - 'label' => esc_html__( 'List Items', 'cube' ), - 'type' => Controls_Manager::REPEATER, - 'fields' => $repeater->get_controls(), /* Use our repeater */ - 'default' => [ - [ - 'text' => esc_html__( 'List Item #1', 'cube' ), - 'link' => '', - ], - [ - 'text' => esc_html__( 'List Item #2', 'cube' ), - 'link' => '', - ], - [ - 'text' => esc_html__( 'List Item #3', 'cube' ), - 'link' => '', - ], - ], - 'title_field' => '{{{ text }}}', - ] - ); - - $this->end_controls_section(); - - $this->start_controls_section( - 'marker_section', - [ - 'label' => esc_html__( 'List Marker', 'cube' ), - 'tab' => Controls_Manager::TAB_CONTENT, - ] - ); - - $this->add_control( - 'marker_type', - [ - 'label' => esc_html__( 'Marker Type', 'cube' ), - 'type' => Controls_Manager::CHOOSE, - 'options' => [ - 'ordered' => [ - 'title' => esc_html__( 'Ordered List', 'cube' ), - 'icon' => 'eicon-editor-list-ol', - ], - 'unordered' => [ - 'title' => esc_html__( 'Unordered List', 'cube' ), - 'icon' => 'eicon-editor-list-ul', - ], - 'other' => [ - 'title' => esc_html__( 'Custom List', 'cube' ), - 'icon' => 'eicon-edit', - ], - ], - 'default' => 'ordered', - 'toggle' => false, - ] - ); - - $this->end_controls_section(); - } - - protected function render() { - $items = $this->get_settings("list_items"); - $marker_type = $this->get_settings("marker_type"); - $html_tag = [ - 'ordered' => 'ol', - 'unordered' => 'ul', - 'other' => 'ul', - ]; - - $this->add_render_attribute( 'list', 'class', 'assoc-list' ); - - echo "
"; - echo "<{$html_tag[$marker_type]} {$this->get_render_attribute_string( 'list' )} >"; - foreach ( $items as $index => $item ) { - $repeater_setting_key = $this->get_repeater_setting_key( 'text', 'list_items', $index ); - $this->add_render_attribute( $repeater_setting_key, 'class', 'elementor-list-widget-text' ); - $this->add_inline_editing_attributes( $repeater_setting_key ); - ?> -
  • get_render_attribute_string( $repeater_setting_key ); ?>> - add_link_attributes( "link_{$index}", $item['link'] ); - $linked_title = sprintf( '%2$s', $this->get_render_attribute_string( "link_{$index}" ), $title ); - echo $linked_title; - } else { - echo $title; - } - ?> -
  • - - - "; - } - - /** - * Render list widget output in the editor. - * - * Written as a Backbone JavaScript template and used to generate the live preview. - * - * @since 1.0.0 - * @access protected - */ - protected function content_template() { - ?> - <# - html_tag = { - 'ordered': 'ol', - 'unordered': 'ul', - 'other': 'ul', - }; - view.addRenderAttribute( 'list', 'class', 'assoc-list' ); - #> -
    - <{{{ html_tag[ settings.marker_type ] }}} {{{ view.getRenderAttributeString( 'list' ) }}}> - <# _.each( settings.list_items, function( item, index ) { - var repeater_setting_key = view.getRepeaterSettingKey( 'text', 'list_items', index ); - view.addRenderAttribute( repeater_setting_key, 'class', 'elementor-list-widget-text' ); - view.addInlineEditingAttributes( repeater_setting_key ); - #> -
  • - <# var title = item.text; #> - <# if ( item.link ) { #> - <# view.addRenderAttribute( `link_${index}`, item.link ); #> - - {{{title}}} - - <# } else { #> - {{{title}}} - <# } #> -
  • - <# } ); #> - -
    - - +

    '.$item['title'].'

    '.$item['text'].' @@ -46,7 +46,7 @@ class StickyNav extends CarouselHome echo '

    '; echo '
    '; foreach ( $settings['slides'] as $item ) { - echo ''; + echo ''; } echo '
    '; echo ''; diff --git a/wp-content/themes/sycomore-fondation/resources/styles/widgets/blockText.sass b/wp-content/themes/sycomore-fondation/resources/styles/widgets/blockText.sass index 9175334..5ad37b3 100644 --- a/wp-content/themes/sycomore-fondation/resources/styles/widgets/blockText.sass +++ b/wp-content/themes/sycomore-fondation/resources/styles/widgets/blockText.sass @@ -111,14 +111,19 @@ font-family: "Proxima Nova", Sans-serif +screen-size(small-desktop) font-size: map-get($fontSizes, 'lg') + &.active + &:after + width: 100% + &:after content: "" - width: 100% + width: 0 height: 38.8% background-color: map-get($colors, 'red','transparent') position: absolute left: 0 bottom: 0 + transition: width 0.9s ease-in-out a color: map-get($colors, 'grey', 'dark') diff --git a/wp-content/themes/sycomore-fondation/resources/styles/widgets/stickyNav.sass b/wp-content/themes/sycomore-fondation/resources/styles/widgets/stickyNav.sass index 58090ca..34c8f9e 100644 --- a/wp-content/themes/sycomore-fondation/resources/styles/widgets/stickyNav.sass +++ b/wp-content/themes/sycomore-fondation/resources/styles/widgets/stickyNav.sass @@ -15,6 +15,7 @@ +screen-size(small-desktop) * color: #DDDDDD + h3 margin-bottom: var(--space-m-l) font-size: var(--step-7) diff --git a/wp-content/themes/sycomore-fondation/resources/views/widgets/carousel-home.blade.php b/wp-content/themes/sycomore-fondation/resources/views/widgets/carousel-home.blade.php index 549c7de..274b791 100644 --- a/wp-content/themes/sycomore-fondation/resources/views/widgets/carousel-home.blade.php +++ b/wp-content/themes/sycomore-fondation/resources/views/widgets/carousel-home.blade.php @@ -2,13 +2,14 @@ @foreach($slides as $key => $slide) @php $key += 1; + $largeImg = wp_get_attachment_image_url($slide['image']['id'],'large'); @endphp @@ -40,11 +41,14 @@