Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
338 changes: 177 additions & 161 deletions composer.json

Large diffs are not rendered by default.

Empty file removed composer.lock
Empty file.
20 changes: 20 additions & 0 deletions modules/custom/openy_field_faq/openy_field_faq.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/**
* @file
* Contains openy_field_faq.module.
*/

/**
* Implements hook_theme().
*/
function openy_field_faq_theme() {
return [
'openy_faq_item' => [
'variables' => [
'question' => '',
'answer' => '',
],
],
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,9 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
'#format' => 'full_html',
];
$elements[$delta] = [
'question' => [
'#type' => 'html_tag',
'#tag' => 'div',
'#attributes' => [
'class' => [
'field-question',
],
],
'#value' => $item->question,
],
'answer' => [
'#type' => 'html_tag',
'#tag' => 'div',
'#attributes' => [
'class' => [
'field-answer',
],
],
'#value' => render($answer),
],
'#prefix' => '<div class="paragraph--type--faq-item">',
'#suffix' => '</div>',
'#theme' => 'openy_faq_item',
'#question' => $item->question,
'#answer' => render($answer),
];
}

Expand Down
22 changes: 22 additions & 0 deletions modules/custom/openy_field_faq/templates/openy-faq-item.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{#
/**
* @file
* Default theme implementation for a FAQ item.
*
* Available variables:
* - question: The text that will be used as a header FAQ item.
* - answer: The text that will be used as a body FAQ item.
*
* @see template_preprocess_openy_faq_item()
*
* @ingroup themeable
*/
#}
<div class="paragraph--type--faq-item hide">
<div class="field-question">
{{- question -}}
</div>
<div class="field-answer">
{{- answer -}}
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -14,71 +14,71 @@ source:
-
id: 1
name: White
color: 'FFFFFF'
color: '#FFFFFF'
-
id: 2
name: Black
color: '000000'
color: '#000000'
-
id: 3
name: Sky blue
color: BFE1F3
color: '#BFE1F3'
-
id: 4
name: Light blue
color: '00AEEF'
color: '#00AEEF'
-
id: 5
name: Blue
color: '0089D0'
color: '#0089D0'
-
id: 6
name: Dark blue
color: '0060AF'
color: '#0060AF'
-
id: 7
name: Pink
color: 'C6168D'
color: '#C6168D'
-
id: 8
name: Dark magenta
color: '92278F'
color: '#92278F'
-
id: 9
name: Purple
color: '5C2E91'
color: '#5C2E91'
-
id: 10
name: Red
color: 'ED1C24'
color: '#ED1C24'
-
id: 11
name: Orange
color: 'F15922'
color: '#F15922'
-
id: 12
name: Yellow
color: 'FCAF17'
color: '#FCAF17'
-
id: 13
name: Green
color: '20BDBE'
color: '#20BDBE'
-
id: 14
name: Dark green
color: '006B6B'
color: '#006B6B'
-
id: 15
name: Light green
color: '01A490'
color: '#01A490'
-
id: 16
name: Brown
color: '231F20'
color: '#231F20'
-
id: 17
name: Grey
color: '4f4f4f'
color: '#4f4f4f'
ids:
id:
type: integer
Expand All @@ -88,7 +88,7 @@ process:
source: language
default_value: en
name: name
field_color: color
field_color/color: color
vid:
plugin: default_value
default_value: color
Expand Down
1 change: 0 additions & 1 deletion modules/openy_features/openy_node/openy_node.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- entity_reference_revisions
- field
- image
- jquery_colorpicker
- metatag
- node
- views
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies:
- drupal:text
- entity_browser:entity_browser
- focal_point:focal_point
- jquery_colorpicker:jquery_colorpicker
- link_attributes:link_attributes
- openy_focal_point:openy_focal_point
- openy_media_image:openy_media_image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

// Question click event.
$( '.field-question', wrapper ).on( 'click', function() {
var answer = $( '.field-answer', wrapper );
$( '.field-answer', wrapper ).toggle(200);

if ( answer.is( ':hidden') ) {
answer.slideDown( 200 );
if (wrapper.hasClass('hide')) {
wrapper.removeClass('hide').addClass('show');
}
else {
answer.slideUp( 200 );
wrapper.removeClass('show').addClass('hide');
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ dependencies:
- drupal:field
- focal_point:focal_point
- drupal:image
- jquery_colorpicker:jquery_colorpicker
- drupal:media
- openy_focal_point:openy_focal_point
- openy_media_image:openy_media_image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ content:
third_party_settings: { }
region: content
field_color:
settings: { }
weight: 31
settings:
color: FFFFFF
third_party_settings: { }
type: jquery_colorpicker
region: content
Expand All @@ -49,4 +48,11 @@ content:
settings: { }
third_party_settings: { }
region: content
status:
type: boolean_checkbox
settings:
display_label: true
weight: 100
region: content
third_party_settings: { }
hidden: { }
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ dependencies:
- field.field.taxonomy_term.color.field_color
- taxonomy.vocabulary.color
module:
- jquery_colorpicker
- colorapi
id: taxonomy_term.color.color
targetEntityType: taxonomy_term
bundle: color
mode: color
content:
field_color:
settings:
show_hash: true
display_name: false
weight: 0
label: hidden
settings: { }
third_party_settings: { }
type: jquery_colorpicker_raw_hex_display
type: colorapi_raw_hex_display
region: content
hidden:
description: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ dependencies:
- field.field.taxonomy_term.color.field_color
- taxonomy.vocabulary.color
module:
- jquery_colorpicker
- colorapi
id: taxonomy_term.color.default
targetEntityType: taxonomy_term
bundle: color
mode: default
content:
field_color:
settings:
show_hash: true
display_name: false
weight: 0
label: hidden
settings: { }
third_party_settings: { }
type: jquery_colorpicker_raw_hex_display
type: colorapi_raw_hex_display
region: content
hidden:
description: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- field.storage.taxonomy_term.field_color
- taxonomy.vocabulary.color
module:
- jquery_colorpicker
- colorapi
id: taxonomy_term.color.field_color
field_name: field_color
entity_type: taxonomy_term
Expand All @@ -16,7 +16,8 @@ required: true
translatable: true
default_value:
-
value: { }
name: ''
color: '#FFFFFF'
default_value_callback: ''
settings: { }
field_type: jquery_colorpicker
field_type: colorapi_color_field
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ langcode: en
status: true
dependencies:
module:
- jquery_colorpicker
- colorapi
- taxonomy
id: taxonomy_term.field_color
field_name: field_color
entity_type: taxonomy_term
type: jquery_colorpicker
type: colorapi_color_field
settings: { }
module: jquery_colorpicker
module: colorapi
locked: false
cardinality: 1
translatable: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ dependencies:
- rabbit_hole:rabbit_hole
- drupal:taxonomy
- drupal:text
- colorapi:colorapi
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ function openy_txnm_color_update_8004() {
}
}
}

/**
* Enable Colorapi, as it required for jquery_colorpicker:^2.
*/
function openy_txnm_color_update_8005() {
\Drupal::service('module_installer')->install(['colorapi']);
}
22 changes: 22 additions & 0 deletions modules/openy_features/openy_taxonomy/openy_taxonomy.install
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@
* Open Y Taxonomy install file.
*/

/**
* Implement hook_install().
*/
function openy_taxonomy_install() {
$config = \Drupal::configFactory()->loadMultiple(['views.view.taxonomy_term']);
if (array_key_exists('views.view.taxonomy_term', $config)) {
$config_updater = \Drupal::service('openy_upgrade_tool.param_updater');
$config = drupal_get_path('module', 'openy_taxonomy');
$config .= '/config/override/views.view.taxonomy_term.yml';
$config_updater->update($config, 'views.view.taxonomy_term', 'display');
}
else {
$config_dir = drupal_get_path('module', 'openy_taxonomy') . '/config/override/';
// Import new configuration
$config_importer = \Drupal::service('openy_upgrade_tool.importer');
$config_importer->setDirectory($config_dir);
$config_importer->importConfigs([
'views.view.taxonomy_term',
]);
}
}

/**
* Update pager settings in taxonomy term view.
*/
Expand Down
8 changes: 8 additions & 0 deletions patches/colorapi/enable_colorapi_field.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
diff --git a/config/install/colorapi.settings.yml b/config/install/colorapi.settings.yml
index 8d49460..b77a6be 100644
--- a/config/install/colorapi.settings.yml
+++ b/config/install/colorapi.settings.yml
@@ -1,2 +1,2 @@
-enable_color_field: false
+enable_color_field: true
enable_color_entity: false
16 changes: 16 additions & 0 deletions patches/jquery_colorpicker/library_path_update.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/jquery_colorpicker.libraries.yml b/jquery_colorpicker.libraries.yml
index 1c4477f..9dd4de8 100644
--- a/jquery_colorpicker.libraries.yml
+++ b/jquery_colorpicker.libraries.yml
@@ -2,9 +2,9 @@ library:
version: 1.0.1
css:
theme:
- vendor://jaypan/jquery-colorpicker/css/colorpicker.css: {}
+ /libraries/jquery_colorpicker/css/colorpicker.css: {}
js:
- vendor://jaypan/jquery-colorpicker/js/colorpicker.js: {}
+ /libraries/jquery_colorpicker/js/colorpicker.js: {}
dependencies:
- core/jquery

Loading