Commit f5c971aa authored by Jeff Sturek's avatar Jeff Sturek
Browse files

Support DCF 3.0+ and 2.0

parent d0b082a5
......@@ -15,18 +15,31 @@
<?php echo $maincontent ?>
</main>
<script>
require(['/wdn/templates_5.3/js/compressed/dcf-utility.js', '/wdn/templates_5.3/js/compressed/dcf-tabs.js'], function() {
require([
'/wdn/templates_5.3/js/compressed/dcf-utility.js',
'/wdn/templates_5.3/js/compressed/dcf-tabs.js'
], function(DCFUtilityModule, DCFTabsModule) {
try {
DCFUtility.flagSupportsWebP();
DCFUtility.flagSupportsJavaScript();
// Try DCF ^3.0 format first, then 2.0 format
if (DCFUtilityModule) {
DCFUtilityModule.DCFUtility.flagSupportsWebP();
DCFUtilityModule.DCFUtility.flagSupportsJavaScript();
} else {
DCFUtility.flagSupportsWebP();
DCFUtility.flagSupportsJavaScript();
}
} catch(e) {
// do nothing;
}
var tabs = document.querySelectorAll('.dcf-tabs');
var unlTabs = new DCFTabs(tabs);
// Try DCF ^3.0 format first, then 2.0 format
if (DCFTabsModule) {
var unlTabs = new DCFTabsModule.DCFTabs(tabs);
} else {
var unlTabs = new DCFTabs(tabs);
}
unlTabs.initialize();
});
</script>
</body>
</html>
......@@ -16,17 +16,30 @@
</main>
</body>
<script>
require(['https://unlcms.unl.edu/wdn/templates_5.3/js/compressed/dcf-utility.js',
'https://unlcms.unl.edu/wdn/templates_5.3/js/compressed/dcf-tabs.js'], function() {
require([
'https://unlcms.unl.edu/wdn/templates_5.3/js/compressed/dcf-utility.js',
'https://unlcms.unl.edu/wdn/templates_5.3/js/compressed/dcf-tabs.js'
], function(DCFUtilityModule, DCFTabsModule) {
try {
DCFUtility.flagSupportsWebP();
DCFUtility.flagSupportsJavaScript();
// Try DCF ^3.0 format first, then 2.0 format
if (DCFUtilityModule) {
DCFUtilityModule.DCFUtility.flagSupportsWebP();
DCFUtilityModule.DCFUtility.flagSupportsJavaScript();
} else {
DCFUtility.flagSupportsWebP();
DCFUtility.flagSupportsJavaScript();
}
} catch(e) {
// do nothing;
}
var tabs = document.querySelectorAll('.dcf-tabs');
var unlTabs = new DCFTabs(tabs);
// Try DCF ^3.0 format first, then 2.0 format
if (DCFTabsModule) {
var unlTabs = new DCFTabsModule.DCFTabs(tabs);
} else {
var unlTabs = new DCFTabs(tabs);
}
unlTabs.initialize();
});
</script>
......
......@@ -52,9 +52,27 @@
<?php if (!$isEmbed): ?></div><?php endif ?>
<script>
window.addEventListener('inlineJSReady', function() {
require(['dcf-utility', 'dcf-tabs', 'css!../js-css/tabs'], function() {
require(['dcf-utility', 'dcf-tabs', 'css!../js-css/tabs'], function(DCFUtilityModule, DCFTabsModule) {
try {
// Try DCF ^3.0 format first, then 2.0 format
if (DCFUtilityModule) {
DCFUtilityModule.DCFUtility.flagSupportsWebP();
DCFUtilityModule.DCFUtility.flagSupportsJavaScript();
} else {
DCFUtility.flagSupportsWebP();
DCFUtility.flagSupportsJavaScript();
}
} catch(e) {
// do nothing;
}
var tabs = document.querySelectorAll('.dcf-tabs');
var unlTabs = new DCFTabs(tabs);
// Try DCF ^3.0 format first, then 2.0 format
if (DCFTabsModule) {
var unlTabs = new DCFTabsModule.DCFTabs(tabs);
} else {
var unlTabs = new DCFTabs(tabs);
}
unlTabs.initialize();
});
});
......
......@@ -2,17 +2,18 @@
<h3 class="dcf-txt-md dcf-bold dcf-uppercase dcf-lh-3 unl-ls-2 unl-cream" id="dcf-footer-group-1-heading">About UNL Search</h3>
<p>This application is a product of the <a href="https://dxg.unl.edu/">Digital Experience Group at Nebraska</a>. DXG is a partnership of <a href="https://ucomm.unl.edu/">University Communication</a> and <a href="https://its.unl.edu/">Information Technology Services</a>.</p>
<?php
// TODO: Verify file will continue to exist and correct
echo file_get_contents('http://www.unl.edu/ucomm/sharedcode/footerContactInfo.html');
?>
</nav>
<?php
$relatedLinks = file_get_contents('http://www.unl.edu/sharedcode/relatedLinks.html');
preg_match_all('|<li>(.*)<\/li>|', $relatedLinks, $matches);
if (is_array($matches[0]) && count($matches[0]) > 0):
?>
<nav id="dcf-footer-group-2" role="navigation" aria-labelledby="dcf-footer-group-2-heading">
<h3 class="dcf-txt-md dcf-bold dcf-uppercase dcf-lh-3 unl-ls-2 unl-cream" id="dcf-footer-group-2-heading">Related Links</h3>
<ul class="dcf-list-bare dcf-mb-0">
<?php
//TODO: Verify file will continue to exist and if correct list of links
$relatedLinks = file_get_contents('http://www.unl.edu/sharedcode/relatedLinks.html');
preg_match_all('|<li>(.*)<\/li>|', $relatedLinks, $matches);
if (is_array($matches[0])) {
foreach($matches[0] as $link) {
echo $link, PHP_EOL;
......@@ -21,3 +22,4 @@
?>
</ul>
</nav>
<?php endif; ?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment