Skip to content
Merged
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
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
islandora-module-ci:
uses: digitalutsc/reusable_workflows/.github/workflows/islandora-module-ci.yml@main
with:
module_name: ableplayer_extend
install_chromedriver: false
2 changes: 1 addition & 1 deletion ableplayer_extend.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ ableplayer_extend.transcript_position:
dependencies:
- core/drupal
- core/jquery
- core/once
- core/once
16 changes: 9 additions & 7 deletions ableplayer_extend.module
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ function ableplayer_extend_help($route_name, RouteMatchInterface $route_match) {

/**
* Implements hook_field_formatter_third_party_settings_form().
* Provides additional two config options for Ableplayer
*
* Provides additional two config options for Ableplayer.
*/
function ableplayer_extend_field_formatter_third_party_settings_form($plugin, $field_definition, $view_mode, $form, $form_state) {

Expand Down Expand Up @@ -63,7 +64,8 @@ function ableplayer_extend_field_formatter_third_party_settings_form($plugin, $f

/**
* Implements hook_preprocess_field().
* Setups the javascript to enable Ableplayer related functions
*
* Setups the javascript to enable Ableplayer related functions.
*/
function ableplayer_extend_preprocess_field(&$variables) {

Expand All @@ -83,7 +85,7 @@ function ableplayer_extend_preprocess_field(&$variables) {
if (isset($field_display['third_party_settings']['ableplayer_extend'])) {
$display_ableplayer_transcript_audio = $field_display['third_party_settings']['ableplayer_extend']['display_ableplayer_transcript_audio'];
$show_timestamp_audio = $field_display['third_party_settings']['ableplayer_extend']['show_timestamp_audio'];

$variables['#attached']['drupalSettings']['display_ableplayer_transcript'] = $display_ableplayer_transcript_audio;
$variables['#attached']['drupalSettings']['show_timestamp'] = $show_timestamp_audio;
}
Expand All @@ -102,10 +104,10 @@ function ableplayer_extend_preprocess_field(&$variables) {

// Make the setting available in the field template.
if (isset($field_display['third_party_settings']['ableplayer_extend'])) {
$display_ableplayer_transcript_video = $field_display['third_party_settings']['ableplayer_extend']['display_ableplayer_transcript_video'];
$show_timestamp_video = $field_display['third_party_settings']['ableplayer_extend']['show_timestamp_video'];
$variables['#attached']['drupalSettings']['display_ableplayer_transcript'] = $display_ableplayer_transcript_video;
$variables['#attached']['drupalSettings']['show_timestamp'] = $show_timestamp_video;
$display_ableplayer_transcript_video = $field_display['third_party_settings']['ableplayer_extend']['display_ableplayer_transcript_video'];
$show_timestamp_video = $field_display['third_party_settings']['ableplayer_extend']['show_timestamp_video'];
$variables['#attached']['drupalSettings']['display_ableplayer_transcript'] = $display_ableplayer_transcript_video;
$variables['#attached']['drupalSettings']['show_timestamp'] = $show_timestamp_video;
}
$variables['#attached']['library'][] = 'ableplayer_extend/ableplayer_extend.transcript_position';
}
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"support": {
"issues": "https://github.com/digitalutsc/ableplayer_extend/issues",
"source": "https://github.com/digitalutsc/ableplayer_extend"
}
},
"require": {}
}

1 change: 0 additions & 1 deletion css/ableplayer_transcript.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
.able-status-bar {
height: 2em !important;
}

9 changes: 8 additions & 1 deletion src/Functional/LoadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@

use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
* Simple test to ensure that main page loads with module enabled.
*
* @group ableplayer_extend
*/
#[RunTestsInSeparateProcesses]
class LoadTest extends BrowserTestBase {

/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';

/**
* Modules to enable.
*
Expand Down Expand Up @@ -40,7 +47,7 @@ protected function setUp(): void {
*/
public function testLoad() {
$this->drupalGet(Url::fromRoute('<front>'));
$this->assertSession()->responseContains('200');
$this->assertSession()->statusCodeEquals(200);
}

}