Skip to content

Commit

Permalink
Merge pull request #4 from UCBoulder/issue-3
Browse files Browse the repository at this point in the history
Clean out old codez
  • Loading branch information
protitude authored Feb 20, 2024
2 parents eab3975 + 1cc6311 commit b5d04ff
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
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

0 comments on commit b5d04ff

Please sign in to comment.