|
2510 | 2510 | }
|
2511 | 2511 |
|
2512 | 2512 | var banner = currentNode.banner;
|
2513 |
| - if ('undefined' != typeof(banner) && banner.length && -1 == banner.indexOf('//')) banner = $('link#parent').attr('href') + banner; |
| 2513 | + if ('undefined' != typeof(banner) && banner.length && -1 == banner.indexOf('//')) { |
| 2514 | + banner = $('link#parent').attr('href') + banner; |
| 2515 | + } else if ('undefined' == typeof(banner) || !banner) { |
| 2516 | + banner = ''; |
| 2517 | + }; |
2514 | 2518 | $('[property="art:url"]').hide();
|
2515 | 2519 | if ('.mp4'==banner.substr(banner.length-4, 4)) { // The controller looks for ".mp4" so do the same here ~cd
|
2516 | 2520 | element.addClass('has_video').prepend('<div class="video_wrapper"><video autoplay muted loop playsinline preload="none"><source src="'+banner+'" type="video/mp4"></video></div>');
|
|
2603 | 2607 |
|
2604 | 2608 | case 'image_header':
|
2605 | 2609 | var banner = currentNode.banner;
|
2606 |
| - if ('undefined' != typeof(banner) && banner.length && -1 == banner.indexOf('//')) banner = $('link#parent').attr('href') + banner; |
| 2610 | + if ('undefined' != typeof(banner) && banner.length && -1 == banner.indexOf('//')) { |
| 2611 | + banner = $('link#parent').attr('href') + banner; |
| 2612 | + } else if ('undefined' == typeof(banner) || !banner) { |
| 2613 | + banner = ''; |
| 2614 | + }; |
2607 | 2615 | $('.page').css('padding-top', '5rem');
|
2608 | 2616 | $('article > header').before('<div class="image_header"><div class="title_card"></div></div>');
|
2609 | 2617 | if ('.mp4'==banner.substr(banner.length-4, 4)) { // The controller looks for ".mp4" so do the same here ~cd
|
|
2928 | 2936 | var title = pathContents[i].current.title;
|
2929 | 2937 | var slug = pathContents[i].slug;
|
2930 | 2938 | var key = (pathContents[i].data['http://scalar.usc.edu/2012/01/scalar-ns#banner']) ? pathContents[i].data['http://scalar.usc.edu/2012/01/scalar-ns#banner'][0].value : '';
|
2931 |
| - if (-1==key.indexOf('://')) key = base_url+key; |
| 2939 | + if ('undefined'==typeof(key)) { |
| 2940 | + key = ''; |
| 2941 | + } else if (-1==key.indexOf('://')) { |
| 2942 | + key = base_url+key; |
| 2943 | + } |
2932 | 2944 | var description = (pathContents[i].current.description) ? pathContents[i].current.description : ' ';
|
2933 | 2945 | var $description = $('<div>'+description+'</div>');
|
2934 | 2946 | if ($description.find('br').length) { // If there is more than one paragraph (<br /><br />) only show the first paragraph
|
|
0 commit comments