diff --git a/module/VuDL/src/VuDL/Connection/Fedora.php b/module/VuDL/src/VuDL/Connection/Fedora.php index 118b45c371b434958184974e2134f6a687c87b45..15a383ba455d88b287070cfceff16bb825d9359d 100644 --- a/module/VuDL/src/VuDL/Connection/Fedora.php +++ b/module/VuDL/src/VuDL/Connection/Fedora.php @@ -408,7 +408,9 @@ class Fedora extends AbstractBase $record['id'], 'MASTER-MD' ); - $ret += $this->getSizeAndTypeInfo($record['techinfo']); + $info = $this->getSizeAndTypeInfo($record['techinfo']); + $ret['size'] = $info['size']; + $ret['type'] = $info['type']; } if ($renderer != null) { $ret['div'] = $renderer diff --git a/module/VuDL/src/VuDL/Controller/VudlController.php b/module/VuDL/src/VuDL/Controller/VudlController.php index 0f7bb48c0edb62def2014ba4ef4f82fcb72b103d..49f06b571d1850b96ad31511bced50a83a17ecbc 100644 --- a/module/VuDL/src/VuDL/Controller/VudlController.php +++ b/module/VuDL/src/VuDL/Controller/VudlController.php @@ -85,7 +85,7 @@ class VudlController extends AbstractVuDL protected function getPage($parent, $child) { // GET LISTS - $lists = $this->getConnector()->getOrderedMembers($parent); + $lists = array_reverse($this->getConnector()->getOrderedMembers($parent)); // GET LIST ITEMS foreach ($lists as $list=>$list_data) { $items = $this->getConnector()->getOrderedMembers($list_data); @@ -117,6 +117,19 @@ class VudlController extends AbstractVuDL return $generator->getOutline($root, $start, $pageLength); } + /** + * Get the technical metadata for a record from POST + * + * @return array + */ + protected function getTechInfo() + { + return $this->getConnector()->getTechInfo( + $this->params()->fromPost(), + $this->getViewRenderer() + ); + } + /** * Ajax function for the VuDL view * Return JSON encoding of pages @@ -186,9 +199,6 @@ class VudlController extends AbstractVuDL { $renderer = $this->getViewRenderer(); $data = $this->params()->fromPost(); - if ($data == null) { - $data = $this->params()->fromPost(); - } if ($data == null) { $id = $this->params()->fromQuery('id'); $list = array(); @@ -200,7 +210,6 @@ class VudlController extends AbstractVuDL $data = array_flip($list[1]); $data['id'] = $id; } - $data['techinfo'] = $this->getConnector()->getTechInfo($data, $renderer); $data['keys'] = array_keys($data); try { $view = $renderer->render( @@ -273,7 +282,6 @@ class VudlController extends AbstractVuDL // Get ids for all files $outline = $this->getOutline( $root, - $this->params()->fromQuery('cache'), max(0, $view->initPage-($this->getConnector()->getPageLength()/2)) ); diff --git a/module/VuDL/src/VuDL/OutlineGenerator.php b/module/VuDL/src/VuDL/OutlineGenerator.php index d83806c3fcb9395413b800b80a8442d0c4116090..8cf28dd0c8d8507a2aa17bac0c7623558746ca94 100644 --- a/module/VuDL/src/VuDL/OutlineGenerator.php +++ b/module/VuDL/src/VuDL/OutlineGenerator.php @@ -67,13 +67,6 @@ class OutlineGenerator */ protected $cache; - /** - * Do we skip the cache for this outline? - * - * @var boolean - */ - protected $skipCache; - /** * Queues * @@ -124,9 +117,7 @@ class OutlineGenerator */ protected function getCache($key, $moddate = null) { - if (!$this->skipCache && $this->cache - && $cache_item = $this->cache->getItem($key) - ) { + if ($this->cache && $cache_item = $this->cache->getItem($key)) { if ($moddate == null || (isset($cache_item['moddate']) && date_create($cache_item['moddate']) >= date_create($moddate)) ) { @@ -294,15 +285,13 @@ class OutlineGenerator * Generate an array of all child pages and their information/images * * @param string $root record id to search under - * @param string $cache 'cache' get parameter for skipping the cache * @param string $start page/doc to start with for the return * @param int $pageLength page length (leave null to use default) * * @return associative array of the lists with their members */ - public function getOutline($root, $cache = null, $start = 0, $pageLength = null) + public function getOutline($root, $start = 0, $pageLength = null) { - $this->skipCache = $cache == 'no'; $this->loadLists($root); $this->loadPagesAndDocs($start, $pageLength); $this->injectUrls(); diff --git a/themes/bootstrap/css/vudl.css b/themes/bootstrap/css/vudl.css index b328afebd5df88e1db988b65c134b148d1f22620..1f204f93549496f9cfc4bedd23b0cb8c0aaa9901 100644 --- a/themes/bootstrap/css/vudl.css +++ b/themes/bootstrap/css/vudl.css @@ -1,15 +1,10 @@ -.inspector_container #side-nav { - margin:auto 0; -} -.inspector_container #view { - margin:auto 0 auto 1%; -} -.inspector_container .grid-view { - margin-left:1%; -} -.item-list { - height:600px; -} +.inspector_container #side-nav { margin:auto 0 } +.inspector_container #view { margin:auto 0 auto 1% } +.inspector_container .grid-view { margin-left:1% } +.item-list { height:600px } +.nav>li.opener>a { display:none } +#view.wide { width:100% } + .page_grid .audio { background:url('../images/small/mp3.png'); box-shadow:none; @@ -26,7 +21,15 @@ } .page_grid .doc, .page_grid .msword { - background:url('../images/small/doc.png'); + background:url('../images/small/msword.jpg'); + box-shadow:none; + margin:auto; + width:116px; + height:85px; +} +.page_grid .xls, +.page_grid .msexcel { + background:url('../images/small/msexcel.jpg'); box-shadow:none; margin:auto; width:116px; diff --git a/themes/bootstrap/images/vudl/default.png b/themes/bootstrap/images/vudl/default.png new file mode 100644 index 0000000000000000000000000000000000000000..1776b6b4eaacdeb4ad9c57bf475c705b37185c70 Binary files /dev/null and b/themes/bootstrap/images/vudl/default.png differ diff --git a/themes/bootstrap/images/vudl/msexcel.png b/themes/bootstrap/images/vudl/msexcel.png new file mode 100644 index 0000000000000000000000000000000000000000..772539caadaa4608d134709f613887194df3412e Binary files /dev/null and b/themes/bootstrap/images/vudl/msexcel.png differ diff --git a/themes/bootstrap/images/vudl/msword.png b/themes/bootstrap/images/vudl/msword.png index 447826c011b97641ad5c51f6828eb61addc9de8c..3b207687c927b426a35672add18989ca30efa2a4 100644 Binary files a/themes/bootstrap/images/vudl/msword.png and b/themes/bootstrap/images/vudl/msword.png differ diff --git a/themes/bootstrap/js/common.js b/themes/bootstrap/js/common.js index 596a496ecf19172b212fb6f9f83d1ff418b7b073..436d54ba9b347ecd7b6ad85de97a87961c317f0d 100644 --- a/themes/bootstrap/js/common.js +++ b/themes/bootstrap/js/common.js @@ -116,7 +116,13 @@ $(document).ready(function() { } } }); - }, 600); // Delay request submission + }, 500); // Delay request submission + }, + updater : function(item) { // Submit on update + console.log(this.$element[0].form.submit); + this.$element[0].value = item; + this.$element[0].form.submit(); + return item; } }); @@ -184,4 +190,29 @@ $(document).ready(function() { Lightbox.addFormCallback('emailSearch', function(x) { Lightbox.confirm(vufindString['bulk_email_success']); }); -}); \ No newline at end of file +}); + +/* --- BOOTSTRAP LIBRARY TWEAKS --- */ +// Prevent typeahead highlighting +$.fn.typeahead.Constructor.prototype.render = function(items) { + var that = this + + items = $(items).map(function (i, item) { + i = $(that.options.item).attr('data-value', item) + i.find('a').html(that.highlighter(item)) + return i[0] + }) + + this.$menu.html(items) + return this +}; +// Enter without highlight does not delete the query +$.fn.typeahead.Constructor.prototype.select = function () { + var val = this.$menu.find('.active') + if(val.length > 0) val = val.attr('data-value') + else val = this.$element.val() + this.$element + .val(this.updater(val)) + .change() + return this.hide() +} \ No newline at end of file diff --git a/themes/bootstrap/js/vudl/grid.js b/themes/bootstrap/js/vudl/grid.js index db91fdc72c8632ffb078fdd86a9d3a2c35362d7a..7c88850176b7ab33f743257f8b35aac1a09b0273 100644 --- a/themes/bootstrap/js/vudl/grid.js +++ b/themes/bootstrap/js/vudl/grid.js @@ -3,7 +3,6 @@ */ var loading_pages = true; function ajaxLoadPages(response) { -//console.log(response); if(!loading_pages) return; // If we got any pages (length is set in the controller) if(response.data !== false && response.data.length > 0) { @@ -11,22 +10,19 @@ function ajaxLoadPages(response) { var trueStart = response.data.start < 0 ? 0 : response.data.start; for(var i=0;i<response.data.length;i++) { var page = response.data.outline[response.data.start]; - if(page == undefined) { - //console.log('done'); - loading_pages = false; - continue; - } + if(page == undefined) continue; $('.page-grid#item'+response.data.start) .attr('href','../Item/'+page.id) .attr('title',page.id) .attr('id', 'item'+response.data.start) .html('<div class="imgc"><img src="'+page.thumbnail+'"/></div>'+page.label) - .removeClass('loading'); + .removeClass('loading') + .removeClass('onscreen'); response.data.start++; } // Call the next round of page loading if(loading_pages) { - console.log(trueStart,response.data.start-1); + //console.log(trueStart,response.data.start-1); var target = Math.min(counts[0], Math.floor($('#list0').scrollTop()/159)); $.ajax({ url:'../VuDL/ajax?method=pageAjax&record='+documentID+'&start='+response.data.start+'&end='+(response.data.start+response.data.length), diff --git a/themes/bootstrap/js/vudl/record.js b/themes/bootstrap/js/vudl/record.js index 017a876f84a854812ade451eb12e2056ed592610..64a1cbc5217d227a2ae4508da240416ce577f07a 100644 --- a/themes/bootstrap/js/vudl/record.js +++ b/themes/bootstrap/js/vudl/record.js @@ -2,9 +2,15 @@ var currentType = 'imaginary'; var currTab = 'medium-tab'; var updateFunction; +var lastID = false; function ajaxGetView(pageObject) { + console.log(pageObject); pageObject['counts'] = counts; - if(currentType != pageObject['filetype']) { + if (currTab == 'master-tab' && lastID == pageObject['id']) { + // Trigger file download + //alert('download'); + $('#file-download').submit(); + } else if (currentType != pageObject['filetype']) { $.ajax({ type: 'POST', url : '../VuDL/ajax?method=viewLoad', @@ -12,6 +18,14 @@ function ajaxGetView(pageObject) { success: function(e) { $('#view').html(e.data); currentType = pageObject['filetype']; + var tab = $('#'+currTab, e.data); + if(tab.length > 0) { + tab.click(); + } else { + currTab = $('.nav-tabs li a:eq(0)')[0].id; + } + // Accordion size + resizeAccordions(); }, error: function(d,e){ console.log(d.responseText); @@ -23,14 +37,19 @@ function ajaxGetView(pageObject) { updateFunction(pageObject); $('#'+currTab).click(); } - updateTechInfo(pageObject['id']); + updateTechInfo(pageObject); + lastID = pageObject['id']; } -function updateTechInfo(id) { +function updateTechInfo(record) { $.ajax({dataType:'json', - url:'../VuDL/ajax?method=getTechInfo&id='+id, + type:'post', + url:path+'/VuDL/ajax?method=getTechInfo', + data:record, success:function(d){ $('#techinfo').html(d.data.div); + $('#file-download').attr('action', path+'/files/'+record.id+'/MASTER?download=true'); $('#download-button small').html(d.data.type+' ~ '+d.data.size); + $('#allFiles').addClass('in'); }, error:function(d,e){ console.log(d.responseText); @@ -44,11 +63,15 @@ var loadWait = false; // AJAX load all records flagged as on screen function findVisible() { var chunk = true,min = -1,max; - $('.page-link').each(function(index, value) { - if(chunk && $(value).hasClass('onscreen')) { - max = parseInt($(value).attr('title')); + // Flag pages on screen + $('.page-link').each(function(index, item) { + if($(item).offset().top > $('#collapse1').position().top-100 + && $(item).offset().top < $('#collapse1').position().top+$('#collapse1').height()+300 + && $(item).hasClass('loading')) { + $(item).removeClass('muted'); + $(item).removeClass('loading'); + max = parseInt($(item).attr('title')); if(min < 0) min = max; - $(value).removeClass('onscreen'); } else { if(min > -1) chunk = false; } @@ -63,30 +86,29 @@ function findVisible() { function ajaxLoadPages(min, max) { //console.log('ajax', min, max, counts); $.ajax({ - url:'../VuDL/ajax?method=pageAjax&record='+documentID+'&start='+min+'&end='+max, + url:path+'/VuDL/ajax?method=pageAjax&record='+documentID+'&start='+min+'&end='+max, dataType:'json', success : function(response) { loadWait = false; - //console.log('return'); // For each page for(var i=0;i<response.data.length;i++) { var page = response.data.outline[response.data.start]; if(page == undefined) continue; + var img = $('<img src="'+page.thumbnail+'"/>'); $('.page-link#item'+response.data.start) .attr('onClick','ajaxGetView('+JSON.stringify(page).replace(/"/g, "'")+', this)') .attr('title',page.id) .attr('alt',page.label) .attr('id', 'item'+response.data.start) - .html('<img class="img-polaroid" src="'+page.thumbnail+'"/><br/>'+page.label) + .html('<br/>'+page.label) + .prepend(img) .addClass('pointer') .removeClass('loading') - .removeClass('onscreen'); + .removeClass('onscreen') + .removeClass('muted'); response.data.start++; } - if($('.onscreen').length > 0) { - //console.log('go again'); - findVisible(); - } + findVisible(); }, error : function(d,e){ console.log(d.responseText); @@ -94,7 +116,7 @@ function ajaxLoadPages(min, max) { } }); } - +// Pages function prevPage() { $('.page-link.alert-info').prev('.page-link').click(); scrollToSelected(); @@ -104,34 +126,57 @@ function nextPage() { scrollToSelected(); } function scrollToSelected() { - $('#list0').scrollTop($('#list0').scrollTop()+$('#list0 .alert-info').offset().top-320); + $('#collapse1').scrollTop($('#collapse1').scrollTop()+$('#collapse1 .alert-info').position().top-10); } - +// Accordion size +function resizeAccordions(offset) { + var height = $(window).innerHeight()-40; + $('.tab-content').css('min-height',height-$('.tab-content').position().top-46); + var accordionHeight = height-160-($('#side-nav .accordion-heading').length-2)*30; + // All accordions + $('#side-nav .accordion-body').css({ + 'max-height':accordionHeight, + 'overflow-y':'auto' + }); + // Set height in the open accordion + $('#side-nav .accordion-body.in').css({ + 'height':accordionHeight + }); + $('.zoomy-container').css('height',height-$('.zoomy-container').parent().position().top+2); +} +// Toggle side menu +function toggleSideNav() { + $('#side-nav').toggle(); + var opener = $('#view .nav-tabs li.opener a'); + if(opener.is(":visible")) { + opener.hide(); + } else { + opener.css('display','inherit'); + } + $('#view').toggleClass('wide'); + $('#zoom').zoomyResize(); +} +// Ready? Let's go $(document).ready(function() { $('.page-link').click(function() { $('.page-link.alert-info').removeClass('alert-info'); $(this).addClass('alert-info'); }); - // Scroll Event - $('.item-list').scroll(function() { - // Flag pages on screen - $('.page-link').removeClass('onscreen').each(function(index, value) { - if($(value).offset().top > 0 - && $(value).offset().top < $('#list0').height()+300 - && $(value).hasClass('loading')) { - $(value).addClass('onscreen').removeClass('muted'); - } + // Load clicked items + $('.loading').click(function() { + scrollToSelected(); + findVisible(); }); + // Scroll Event + $('.item-list').parent().scroll(function() { if(loadWait) return; loadWait = true; findVisible(); }); - // Accordion size - $('.item-list').css({ - 'height':Math.max(200, $('#view').height()-$('#side-nav').position()-2), - 'overflow-y':'auto' - }) - // Initial events + setTimeout(findVisible, 1000); ajaxGetView(initPage); - scrollToSelected(); -}); \ No newline at end of file +}); +// Initial alignment +$( window ).load( scrollToSelected ); +// Accordion size +$( window ).resize( resizeAccordions ); \ No newline at end of file diff --git a/themes/bootstrap/js/zoomy/zoomy.js b/themes/bootstrap/js/zoomy/zoomy.js index 8e1542a5a56960ce54e8ea3c6a2f4cba11b5029d..f13682967c678dfd60fb5593d6beba8704564094 100644 --- a/themes/bootstrap/js/zoomy/zoomy.js +++ b/themes/bootstrap/js/zoomy/zoomy.js @@ -126,6 +126,18 @@ state.minimap.attr('src', src); } }, + resize: function() { + // Update container size + state.container.width = $('.zoomy-container').width(); + state.container.height = $('.zoomy-container').height(); + state.container.left = $('.zoomy-container').offset().left; + state.container.top = $('.zoomy-container').offset().top; + state.container.centerx = $('.zoomy-container').width()/2; + state.container.centery = $('.zoomy-container').height()/2; + // Do it + core.zoom({init:state.page.zoom,setZoom:true},0); + //console.log(state.bounds.width()); + }, rotateLeft: function() { //drawCross(centerX+(centerY-mouseY)-boxHeight,centerY+(mouseX-centerX)); core.rotate(state.page.theta + 90); @@ -167,13 +179,13 @@ state.map.elem.css({ 'width' :state.map.height, 'height':state.map.width, 'right' :(state.map.size+state.map.margin-state.map.height)/2, - 'bottom':(state.map.size+state.map.margin-state.map.width)/2-21 + 'bottom':(state.map.size+state.map.margin-state.map.width)/2 }); } else { state.map.elem.css({ 'width' :state.map.width, 'height':state.map.height, 'right' :(state.map.size+state.map.margin-state.map.width)/2, - 'bottom':(state.map.size+state.map.margin-state.map.height)/2-21 + 'bottom':(state.map.size+state.map.margin-state.map.height)/2 }); } var moffset = state.page.sideways && $.browser != "msie" @@ -304,9 +316,9 @@ toggleUI: function() { $('.zoomy-container .ui').toggle(); if($('.zoomy-container .ui').is(':hidden')) { - $('.zoomy-container #toggle').html('<i class="icon-resize-full icon-rotate-90"></i>'); + $('.zoomy-container #toggle').html('<span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-resize-full icon-rotate-90"></i></span>'); } else { - $('.zoomy-container #toggle').html('<i class="icon-resize-small icon-rotate-90"></i>'); + $('.zoomy-container #toggle').html('<span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-resize-small icon-rotate-90"></i></span>'); } } }; @@ -315,19 +327,19 @@ $('.zoomy-container .turn-left').unbind('click').bind('click', core.rotateLeft); $('.zoomy-container .turn-right').unbind('click').bind('click', core.rotateRight); - $('.zoomy-container .zoom-in').unbind('click').bind('click', function(){core.zoom({fake:1},1)}); - $('.zoomy-container .zoom-out').unbind('click').bind('click', function(){core.zoom({fake:1},-1)}); + $('.zoomy-container .zoom-in').unbind('click').bind('click', function(){core.zoom({fake:1},-1)}); + $('.zoomy-container .zoom-out').unbind('click').bind('click', function(){core.zoom({fake:1},1)}); $('.zoomy-container .zoom .level').unbind('keyup').bind('keyup', function(){core.zoom({setZoom:this.value/100},0)}); $('.zoomy-container #toggle').unbind('click').bind('click', function(){core.toggleUI()}); - return {'src':src,'load':core.load}; + return {'src':src,'load':core.load,'resize':core.resize}; }; $.fn.zoomy = function(src, thumb) { var elem = this, instance = elem.data('zoomy'); if(!instance) { // init - $(this).html('<div class="bounds"></div><div class="page"><img src=""></div><div class="map ui"><img src="" class="mini_map"><div class="scope"></div></div><div class="loading-bar"><div class="progress progress-striped active" style="width:40%;margin:auto;border:1px solid #FFF"><div class="bar" style="width:100%;">Loading...</div></div></div><div class="control"><a class="turn-right ui"><span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-rotate-left"></i></span></i></a><a class="turn-left ui"><span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-rotate-right"></i></span></a><a id="toggle"><i class="icon-resize-small icon-rotate-90"></i></a></div><div class="zoom ui"><a class="zoom-out"><span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-plus"></i></span></a><input class="level">%<a class="zoom-in"><span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-minus"></i></span></a></div>'); + $(this).html('<div class="bounds"></div><div class="page"><img src=""></div><div class="map ui"><img src="" class="mini_map"><div class="scope"></div></div><div class="loading-bar"><div class="progress progress-striped active" style="width:40%;margin:auto;border:1px solid #FFF"><div class="bar" style="width:100%;">Loading...</div></div></div><div class="control"><a class="turn-right ui"><span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-rotate-left"></i></span></i></a><a class="turn-left ui"><span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-rotate-right"></i></span></a><a id="toggle"><span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-resize-small icon-rotate-90"></i></span></a></div><div class="zoom ui"><a class="zoom-out"><span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-plus"></i></span></a><input class="level">%<a class="zoom-in"><span class="icon-stack"><i class="icon-sign-blank icon-muted icon-stack-base"></i><i class="icon-minus"></i></span></a></div>'); $(this).addClass('zoomy-container'); instance = new Zoomy(src, thumb); elem.data('zoomy', instance); @@ -340,4 +352,11 @@ } return this; } + + $.fn.zoomyResize = function() { + var instance = this.data('zoomy'); + //console.log(instance); + instance['resize'](); + + } })(jQuery); diff --git a/themes/bootstrap/templates/breadcrumbs/default.phtml b/themes/bootstrap/templates/breadcrumbs/default.phtml index beef0a381fb573348ca0e00f63335e4588544f88..0f31bec29db8dfb33b46940b5f930b94fc3a908b 100644 --- a/themes/bootstrap/templates/breadcrumbs/default.phtml +++ b/themes/bootstrap/templates/breadcrumbs/default.phtml @@ -5,8 +5,8 @@ <li><a href="<?=$this->url('collection', array('id'=>$id)) ?>"><?=$parent ?></a> <span class="divider">></span></li> <? endforeach; ?> <? if(isset($this->layout()->end)): ?> - <li title="<?=$this->title ?>"><?=$this->truncate($this->title, 100) ?> <span class="divider">></span></li> + <li title="<?=$this->layout()->title ?>"><?=$this->truncate($this->layout()->title, 100) ?> <span class="divider">></span></li> <li class="active"><?=$this->layout()->end ?></li> <? else: ?> - <li class="active" title="<?=$this->title ?>"><?=$this->title ?></li> + <li class="active" title="<?=$this->layout()->title ?>"><?=$this->truncate($this->layout()->title, 100) ?></li> <? endif; ?> \ No newline at end of file diff --git a/themes/bootstrap/templates/breadcrumbs/multi.phtml b/themes/bootstrap/templates/breadcrumbs/multi.phtml index eaf8ddced91048b595b4d2c4af56638d25933036..9819107c852a0fdbeb9edc8c26e054f94a4278da 100644 --- a/themes/bootstrap/templates/breadcrumbs/multi.phtml +++ b/themes/bootstrap/templates/breadcrumbs/multi.phtml @@ -1,9 +1,9 @@ <li><a href="<?=$this->url('home') ?>">Home</a> <span class="divider">></span></li> <li><a href="<?=$this->url('vudl-default-collection') ?>">Collections</a> <span class="divider">></span></li> <li class="dropdown"> - <a class="dropdown-toggle pointer">In <?=count($this->parents) ?> Collections</a> + <a class="dropdown-toggle pointer">In <?=count($this->layout()->breadcrumbs) ?> Collections</a> <ul class="dropdown-menu" role="menu"> - <? foreach ($this->parents as $trail): ?> + <? foreach ($this->layout()->breadcrumbs as $trail): ?> <ul class="inline" style="margin:0 .5em;white-space:nowrap"> <? foreach (array_reverse($trail) as $id=>$title): ?> <li><span class="muted">></span> <a href="<?=$this->url('vudl-record', array('id'=>$id))?>"><?=$title ?></a></li> @@ -14,9 +14,9 @@ <span class="divider">></span> </li> <? if(isset($this->layout()->end)): ?> - <li title="<?=$this->title ?>"><?=$this->truncate($this->title, 100) ?> <span class="divider">></span></li> + <li title="<?=$this->layout()->title ?>"><?=$this->truncate($this->layout()->title, 100) ?> <span class="divider">></span></li> <li class="active"><?=$this->layout()->end ?></li> <? else: ?> - <li class="active" title="<?=$this->title ?>"><?=$this->title ?></li> + <li class="active" title="<?=$this->layout()->title ?>"><?=$this->truncate($this->layout()->title, 100) ?></li> <? endif; ?> <script>$('.dropdown-toggle').dropdown()</script> diff --git a/themes/bootstrap/templates/search/searchbox.phtml b/themes/bootstrap/templates/search/searchbox.phtml index a3ecfdb79eb03b04fd6b8266be896f2d444707b0..e2bed076f31b1ed6cac13a67df63137d4bfd9af3 100644 --- a/themes/bootstrap/templates/search/searchbox.phtml +++ b/themes/bootstrap/templates/search/searchbox.phtml @@ -47,7 +47,7 @@ <? elseif ($handlerCount == 1): ?> <input type="hidden" name="type" value="<?=$this->escapeHtml($handlers[0]['value'])?>" /> <? endif; ?> - <button type="submit" name="submit" class="btn" value="<?=$this->transEsc("Find")?>"><i class="icon-search"></i> <?=$this->transEsc("Find")?></button> + <button type="submit" class="btn"><i class="icon-search"></i> <?=$this->transEsc("Find")?></button> <? if ($advSearch): ?> <a href="<?=$this->url($advSearch)?>" class="btn btn-link"><?=$this->transEsc("Advanced")?></a> <? endif; ?> diff --git a/themes/bootstrap/templates/vudl/details.phtml b/themes/bootstrap/templates/vudl/details.phtml index 77cf0ba8fc3534c9ad6e6855a5e8da5cbb4c4e4c..bf72a8be084429aa54bef955ca1d45c55de06555 100644 --- a/themes/bootstrap/templates/vudl/details.phtml +++ b/themes/bootstrap/templates/vudl/details.phtml @@ -1,6 +1,6 @@ <?php $skip = array( - 'license', 'special_license', 'description', 'title', 'title_alt' + 'license', 'special_license', 'description', 'title' ); $no_link = array('title', 'description'); ?> @@ -11,7 +11,9 @@ </a> </div> <div id="collapse0" class="accordion-body collapse"> - <table class="table table-striped small details"> + <div class="accordion-inner"> + <table class="table small details"> + <tr><td><?=$this->transEsc('Full Title') ?></td><td><?=$this->details['title']['value'] ?></td></tr> <? foreach ($this->details as $attr=>$val): // Skip items not placed in this table if(in_array($attr, $skip)) continue; ?> @@ -63,6 +65,7 @@ <? endif; ?> <? endif; ?> </table> + </div> <div class="pad text-center small"> <? if(isset($this->details['license'])): ?> <div class="block text-center"> @@ -81,9 +84,10 @@ </div> <br/><br/> <? endif; ?> - <a href="<?=$this->url('vudl-record', array('id'=>$this->id))?>"><i class="icon-link"></i> Permanent Link</a> + <a href="<?=$this->url('record', array('id'=>$this->id))?>"><i class="icon-link"></i> <?=$this->transEsc('More Details') ?></a><br/> + <a href="<?=$this->url('vudl-record', array('id'=>$this->id))?>"><i class="icon-save"></i> <?=$this->transEsc('Permanent Link') ?></a><br/> <br/><br/> - <? if(isset($this->details['description'])): ?><p class="text-left"><?=html_entity_decode($this->details['description']['value']) ?></p><? endif ?> + <? if(isset($this->details['description'])): ?><p class="text-left"><?=html_entity_decode($this->details['description']['value'], ENT_COMPAT|ENT_HTML401, 'UTF-8') ?></p><? endif ?> </div> </div> </div> \ No newline at end of file diff --git a/themes/bootstrap/templates/vudl/grid.phtml b/themes/bootstrap/templates/vudl/grid.phtml index b1324357ca7ad49005a5195d78504a8c0b048393..2763bb35d36c532929b2326cfd0ee1561f0d479c 100644 --- a/themes/bootstrap/templates/vudl/grid.phtml +++ b/themes/bootstrap/templates/vudl/grid.phtml @@ -48,7 +48,7 @@ <? endfor; ?> <!-- LOADED ITEMS --> <? foreach($list as $i=>$item): ?> - <a href="<?=$this->url('vudl-record', array('id'=>$item['id'])) ?>" class="span3 pull-left well text-center page-grid pointer" title="<?=$item['id'] ?>" id="item<?=$j?>"> + <a href="<?=$this->url('vudl-record', array('id'=>$item['id'])) ?>" class="span3 pull-left well text-center page-grid pointer" title="<?=$item['id'] ?>" id="item<?=$index?>"> <? if(isset($item['thumbnail'])): ?> <img class="img-polaroid" src="<?=$item['thumbnail'] ?>" alt="<?=$item['label'] ?>"/> <? else: ?> diff --git a/themes/bootstrap/templates/vudl/home.phtml b/themes/bootstrap/templates/vudl/home.phtml index 5374d3acdf2f8df101724f46dad30ed14c2fae98..d76a743584c57964d9a6c24e5e93ab178029cea8 100644 --- a/themes/bootstrap/templates/vudl/home.phtml +++ b/themes/bootstrap/templates/vudl/home.phtml @@ -1,6 +1,6 @@ <? // Set page title. - $this->headTitle($this->translate($this->title) .' - '. $this->translate('Search Home')); + $this->headTitle($this->translate($this->translate($this->title))); // Set default value if necessary: if (!isset($this->searchClassId)) { diff --git a/themes/bootstrap/templates/vudl/master-tab.phtml b/themes/bootstrap/templates/vudl/master-tab.phtml index a964aff56a44ad56360f005c74b6e82d950b0eec..5496c549326d7fe2afb3be213c8aa50ced437f32 100644 --- a/themes/bootstrap/templates/vudl/master-tab.phtml +++ b/themes/bootstrap/templates/vudl/master-tab.phtml @@ -1,10 +1,14 @@ <? if(isset($this->master)): ?> - <a id="download-button" class="btn btn-large btn-primary" href="<?=$this->url('files', array('id'=>$this->id, 'type'=>'MASTER')) ?>?download=true" style="width:300px;margin-top:12px"> - <i class="icon-download-alt icon-2x pull-left"></i> Download Master File<br> - <small><?=$this->mimetype ?><?if(isset($this->techinfo['size'])):?> ~ <?=$this->techinfo['size'] ?><? endif ?></small> - </a> + <form method="get" id="file-download" action="<?=$this->url('files', array('id'=>$this->id, 'type'=>'MASTER')) ?>?download=true"> + <button id="download-button" class="btn btn-large btn-primary" style="width:300px;margin-top:12px"> + <i class="icon-download-alt icon-2x pull-left"></i> <?=$this->transEsc('Download File') ?><br> + <small><?=$this->techinfo['type'] ?><?if(isset($this->techinfo['size'])):?> ~ <?=$this->techinfo['size'] ?><? endif ?></small> + </button> + </form> <? else: ?> - <p class="big">Original Image File Not Available.</p> + <br/><br/> + <p>Original Image File Not Available.</p> + <p>See below for all available downloads.</p> <? endif; ?> -<br/><br/> +<br/> <div class="accordion" id="techinfo"><?=$this->techinfo['div'] ?></div> \ No newline at end of file diff --git a/themes/bootstrap/templates/vudl/record.phtml b/themes/bootstrap/templates/vudl/record.phtml index d9b4aa3a3cec334ca6f36d662fecb06cac044c42..0ede159ec3d3c7081b34e3fc1d7d731145086525 100644 --- a/themes/bootstrap/templates/vudl/record.phtml +++ b/themes/bootstrap/templates/vudl/record.phtml @@ -43,12 +43,14 @@ function json_php_encode($op, $quotes = false) { if($quotes) { - return str_replace('"', "'", str_replace(''', "\'", str_replace('\/', '/', json_encode($op)))); + return str_replace('"', "'", str_replace("'", "\\'", str_replace('\/', '/', json_encode($op)))); } else { return str_replace('\/', '/', json_encode($op)); } } ?> + <? var_dump($this->initList) ?> + <? var_dump($this->initPage) ?> <script> google.load("swfobject", "2.2"); var documentID = '<?=$this->id ?>'; @@ -79,21 +81,28 @@ <? else: ?> <input type="hidden" name="trail" value="<?=current(array_keys($this->parents[0]))?>"/> <? endif; ?> - <a href="<?=$this->url('vudl-grid', array('id'=>$this->id)) ?>" class="btn grid-btn"><i class="icon-th"></i></a> <button class="btn" type="submit" name="next_x" value="1" title="<?=$this->transEsc('Next Item in Collection')?>"><?=$this->transEsc('Next Item')?> →</button> </form> <div class="inspector_container row-fluid"> <div id="side-nav" class="accordion span3"> + <div class="accordion-group closer"> + <div class="accordion-heading"> + <a class="accordion-toggle" onClick="toggleSideNav()"> + <i class="icon-caret-left"></i> + <i class="icon-caret-left"></i> + <i class="icon-caret-left"></i> + </a> + </div> + </div> <?=$this->context($this)->renderInContext('vudl/details.phtml', array())?> - <? $i=0; ?> <? foreach($this->outline['lists'] as $key=>$list): ?> <div class="accordion-group"> <div class="accordion-heading"> - <a class="accordion-toggle" data-toggle="collapse" data-parent="#side-nav" href="#collapse<?=($i+1)?>"> + <a class="accordion-toggle" data-toggle="collapse" data-parent="#side-nav" href="#collapse<?=$key+1 ?>"> <?=$this->outline['names'][$key] ?> </a> </div> - <div id="collapse<?=($i+1)?>" class="accordion-body collapse<? if($i==0): ?> in<? endif; ?>"> + <div id="collapse<?=$key+1 ?>" class="accordion-body collapse<? if($key==$this->initList): ?> in<? endif; ?>"> <div class="accordion-inner item-list" id="list<?=$key ?>"> <!-- PRE LOADING PLACEHOLDERS --> <? for($i=0;$i<current(array_keys($list))-1;$i++): ?> @@ -101,12 +110,14 @@ <? endfor; ?> <!-- LOADED ITEMS --> <? foreach($list as $j=>$item): ?> - <a title="<?=$item['id'] ?>" onClick="ajaxGetView(<?=json_php_encode($item, true) ?>, this)" class="well well-small block text-center page-link pointer<?=$key == 0 && $j == $this->initPage ?' alert-info':''?>" id="item<?=$j?>"> + <a title="<?=$item['id'] ?>" onClick="ajaxGetView(<?=json_php_encode($item, true) ?>, this)" class="well well-small block text-center page-link pointer<?=$key == $this->initList && $j == $this->initPage ?' alert-info':''?>" id="item<?=$j?>"> <? if(isset($item['thumbnail'])): ?> <img src="<?=$item['thumbnail'] ?>" alt="<?=$item['label'] ?>"/><br/> <? else: ?> - <? $imgSrc = $item['filetype'] == 'download' ? $item['fulltype'] : $item['filetype']; ?> - <img src="<?=$this->imageLink('vudl/'.$imgSrc.'.png') ?>" alt="<?=$imgSrc ?>"/><br/> + <? $imgType = $item['filetype'] == 'download' ? $item['fulltype'] : $item['filetype']; + $imgSrc = $this->imageLink('vudl/'.$imgType.'.png'); + if(empty($imgSrc)) $imgSrc = $this->imageLink('vudl/'.$imgType.'.jpg'); ?> + <img src="<?=$imgSrc ?>" alt="<?=$imgType ?>" style="max-width:100px"/><br/> <? endif; ?> <?=$item['label'] ?> </a> diff --git a/themes/bootstrap/templates/vudl/techinfo.phtml b/themes/bootstrap/templates/vudl/techinfo.phtml index 104699cf7eecacf8012672592aea146f8a16bd0f..2e4ea6c158677d3ce1b98ca95236f70b4ad92c6c 100644 --- a/themes/bootstrap/templates/vudl/techinfo.phtml +++ b/themes/bootstrap/templates/vudl/techinfo.phtml @@ -8,8 +8,14 @@ <div id="allFiles" class="accordion-body collapse"> <div class="accordion-inner"> <? foreach ($this->record as $key=>$link): ?> - <? if (is_array($this->record[$key]) || strpos($key, '-') !== false - || $link == $this->record['id']|| $key == 'techinfo') continue; ?> + <? $mtKey = array_search(strToUpper($key), $this->record['datastreams']); ?> + <? if ( + is_array($this->record[$key]) + || strpos($this->record['mimetypes'][$mtKey], 'text') !== false + || strpos($this->record['mimetypes'][$mtKey], 'xml') !== false + || strpos($key, '-') !== false + || $key == 'techinfo' + ) continue; ?> <a class="btn btn-block" href="<?=$this->url( 'files', array( @@ -19,7 +25,6 @@ )?>?download=true"> <?=strToUpper($this->transEsc($key)) ?> <? if (isset($this->record['mimetypes'])): ?> - <? $mtKey = array_search(strToUpper($key), $this->record['datastreams']); ?> <span class="pull-right small"><?=$this->record['mimetypes'][$mtKey] ?></span> <? endif; ?> </a> diff --git a/themes/bootstrap/templates/vudl/views/audio.phtml b/themes/bootstrap/templates/vudl/views/audio.phtml index 75f929f62893786375a989d6f0c4449392e0870a..677c52e6753ddcac3a3bfd359ac8d9bc51b4af3b 100644 --- a/themes/bootstrap/templates/vudl/views/audio.phtml +++ b/themes/bootstrap/templates/vudl/views/audio.phtml @@ -39,7 +39,14 @@ </div> <? endif; ?> <ul class="nav nav-tabs"> - <li class="active"><a>Original</a></li> + <li class="opener"> + <a onClick="toggleSideNav()"> + <i class="icon-caret-right"></i> + <i class="icon-caret-right"></i> + <i class="icon-caret-right"></i> + </a> + </li> + <li class="active"><a>Player and Downloads</a></li> <? if($this->counts[0] > 1): ?> <div class="btn-group pull-right hidden-phone"> <a href="javascript:prevPage()" class="btn btn-small">Prev Page</a> diff --git a/themes/bootstrap/templates/vudl/views/download.phtml b/themes/bootstrap/templates/vudl/views/download.phtml index 3c8ca9af5de39867a099dbdf1db26b84101bf763..e93a2d18f7a870a8a8dcb8881599de0210db0407 100644 --- a/themes/bootstrap/templates/vudl/views/download.phtml +++ b/themes/bootstrap/templates/vudl/views/download.phtml @@ -5,20 +5,29 @@ }; </script> <? if($this->counts[0] > 1): ?> - <div class="row-fluid btn-group visible-phone text-center"> - <a href="javascript:prevPage()" class="btn">Prev Page</a> - <a href="javascript:nextPage()" class="btn">Next Page</a> - <br/><br/> - </div> + <div class="row-fluid btn-group visible-phone text-center"> + <a href="javascript:prevPage()" class="btn">Prev Page</a> + <a href="<?=$this->url('vudl-grid', array('id'=>$this->id)) ?>" class="btn grid-btn"><i class="icon-th"></i></a> + <a href="javascript:nextPage()" class="btn">Next Page</a> + <br/><br/> + </div> <? endif; ?> <ul class="nav nav-tabs"> - <li class="active"><a href="#master" id="master-tab">Original</a></li> - <? if($this->counts[0] > 1): ?> - <div class="btn-group pull-right hidden-phone"> - <a href="javascript:prevPage()" class="btn btn-small">Prev Page</a> - <a href="javascript:nextPage()" class="btn btn-small">Next Page</a> - </div> - <? endif; ?> + <li class="opener"> + <a onClick="toggleSideNav()"> + <i class="icon-caret-right"></i> + <i class="icon-caret-right"></i> + <i class="icon-caret-right"></i> + </a> + </li> + <li class="active"><a href="#master" id="master-tab">Downloads</a></li> + <? if($this->counts[0] > 1): ?> + <div class="btn-group pull-right hidden-phone"> + <a href="javascript:prevPage()" class="btn btn-small">Prev Page</a> + <a href="<?=$this->url('vudl-grid', array('id'=>$this->id)) ?>" class="btn grid-btn"><i class="icon-th"></i></a> + <a href="javascript:nextPage()" class="btn btn-small">Next Page</a> + </div> + <? endif; ?> </ul> <div class="tab-container text-center tab-content"> <?=$this->context($this)->renderInContext('vudl/master-tab.phtml', array())?> diff --git a/themes/bootstrap/templates/vudl/views/page.phtml b/themes/bootstrap/templates/vudl/views/page.phtml index 47ed47030313be0d5578f6e8f7acd001b1619282..5e8fa4b3b98e05cefacc464bf46815233535a398 100644 --- a/themes/bootstrap/templates/vudl/views/page.phtml +++ b/themes/bootstrap/templates/vudl/views/page.phtml @@ -35,7 +35,7 @@ } $(document).ready(function() { - $('#view .nav-tabs li a').click(function (e) { + $('#view .nav-tabs li:not(.opener) a').click(function (e) { e.preventDefault(); $(this).tab('show'); currTab = $(this).attr('id'); @@ -51,24 +51,32 @@ 'mimetype' :'<?=$this->mimetype ?>' }; updateFunction(pageData, 'medium-tab'); - updateTechInfo(pageData['id']) }); </script> <? if($this->counts[0] > 1): ?> <div class="row-fluid btn-group visible-phone text-center"> <a href="javascript:prevPage()" class="btn">Prev Page</a> + <a href="<?=$this->url('vudl-grid', array('id'=>$this->id)) ?>" class="btn grid-btn"><i class="icon-th"></i></a> <a href="javascript:nextPage()" class="btn">Next Page</a> <br/><br/> </div> <? endif; ?> <ul class="nav nav-tabs"> + <li class="opener"> + <a onClick="toggleSideNav()"> + <i class="icon-caret-right"></i> + <i class="icon-caret-right"></i> + <i class="icon-caret-right"></i> + </a> + </li> <li><a href="#image" id="medium-tab" onClick="showPreview('medium', this)">Medium</a></li> <li class="hidden-phone"><a href="#image" id="large-tab" onClick="showPreview('large', this)">Large</a></li> <li><a href="#zoom" id="zoom-tab" onClick="showZoom(this)">Zoom</a></li> - <li><a href="#master" id="master-tab">Original</a></li> + <li><a href="#master" id="master-tab">Downloads</a></li> <? if($this->counts[0] > 1): ?> <div class="btn-group pull-right hidden-phone"> <a href="javascript:prevPage()" class="btn btn-small">Prev Page</a> + <a href="<?=$this->url('vudl-grid', array('id'=>$this->id)) ?>" class="btn btn-small grid-btn"><i class="icon-th"></i></a> <a href="javascript:nextPage()" class="btn btn-small">Next Page</a> </div> <? endif; ?> diff --git a/themes/bootstrap/templates/vudl/views/video.phtml b/themes/bootstrap/templates/vudl/views/video.phtml index 344c1683b942f5966e49851079fd0ec6cb2fb149..50c283013ceacb6607db944be3dc6988c77240e4 100644 --- a/themes/bootstrap/templates/vudl/views/video.phtml +++ b/themes/bootstrap/templates/vudl/views/video.phtml @@ -119,15 +119,24 @@ <? if($this->counts[0] > 1): ?> <div class="row-fluid btn-group visible-phone text-center"> <a href="javascript:prevPage()" class="btn">Prev Page</a> + <a href="<?=$this->url('vudl-grid', array('id'=>$this->id)) ?>" class="btn grid-btn"><i class="icon-th"></i></a> <a href="javascript:nextPage()" class="btn">Next Page</a> <br/><br/> </div> <? endif; ?> <ul class="nav nav-tabs"> - <li class="active"><a>Original</a></li> + <li class="opener"> + <a onClick="toggleSideNav()"> + <i class="icon-caret-right"></i> + <i class="icon-caret-right"></i> + <i class="icon-caret-right"></i> + </a> + </li> + <li class="active"><a>Downloads</a></li> <? if($this->counts[0] > 1): ?> <div class="btn-group pull-right hidden-phone"> <a href="javascript:prevPage()" class="btn btn-small">Prev Page</a> + <a href="<?=$this->url('vudl-grid', array('id'=>$this->id)) ?>" class="btn grid-btn"><i class="icon-th"></i></a> <a href="javascript:nextPage()" class="btn btn-small">Next Page</a> </div> <? endif; ?> diff --git a/themes/bootstrap/theme.config.php b/themes/bootstrap/theme.config.php index b4d6fdfde0d8e82658b6a85a184ffa55e305ff29..3ecae90a741b0f10f03da962172d35bacb93c138 100644 --- a/themes/bootstrap/theme.config.php +++ b/themes/bootstrap/theme.config.php @@ -12,7 +12,7 @@ return array( ), 'js' => array( 'core/jquery.min.js', - 'core/bootstrap.js', + 'core/bootstrap.min.js', 'common.js', 'lightbox.js', 'rc4.js'