Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean out old codez #4

Merged
merged 2 commits into from
Feb 20, 2024
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
8 changes: 0 additions & 8 deletions oit.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ spacemonkey:
dependencies:
- core/jquery
- core/drupalSettings
details:
remote: https://github.com/javan/details-element-polyfill
version: 2.4.0
license:
name: MIT
gpl-compatible: false
js:
/libraries/details-element-polyfill/dist/details-element-polyfill.js: { minified: false }
gsap:
remote: https://github.com/greensock/GSAP
version: 3.4.0
Expand Down
40 changes: 0 additions & 40 deletions oit.module
Original file line number Diff line number Diff line change
Expand Up @@ -598,21 +598,6 @@ function oit_cron() {
$midnight = TRUE;
}
if ($midnight) {
$nodes = [10687, 13639];
foreach ($nodes as $nid) {
$node = \Drupal::entityTypeManager()->getStorage('node')->load($nid);
$node->setNewRevision(TRUE);
$node->setRevisionLogMessage('Cron update - no actual changes');
// D8 is smarter and won't actually update without a change, so we'll
// toggle the sticky checkbox to make this work.
if ($node->isSticky()) {
$node->setSticky(FALSE);
}
else {
$node->setSticky(TRUE);
}
$node->save();
}
// Add analytics to redirects.
\Drupal::service('oit.redirect.add.analytics');
}
Expand All @@ -624,31 +609,6 @@ function oit_cron() {
\Drupal::service('oit.smc');
}

/**
* Implements hook_preprocess_node().
*/
function oit_preprocess_node(&$variables) {
$node = $variables['node'];
$body = $node->get('body')->getValue();
$body = $body[0]['value'] ?? '';
// Check the node body and if the <details> element exists add the details
// polyfill to the page. Currently not supported by edge or ie, may remove in
// the future.
if (strpos($body, '</details>') !== FALSE) {
$variables['#attached']['library'][] = 'oit/details';
}
}

/**
* Implements hook_preprocess_block().
*/
function oit_preprocess_block(&$variables) {
// Disable caching on certain blocks.
if ($variables['base_plugin_id'] == 'page_overview') {
$variables['#cache']['max-age'] = 0;
}
}

/**
* Alter the off-canvas menu tree.
*
Expand Down
Loading