diff --git a/app/components/sidebar-component.html b/app/components/sidebar-component.html index c8acdc34..681d0c75 100644 --- a/app/components/sidebar-component.html +++ b/app/components/sidebar-component.html @@ -1,4 +1,4 @@ diff --git a/app/components/static-about-component.html b/app/components/static-about-component.html index d9ddacf1..a85f28c2 100644 --- a/app/components/static-about-component.html +++ b/app/components/static-about-component.html @@ -7,14 +7,14 @@

Welcome to Calisphere: your gateway to California’s remarkable digital collections. Calisphere provides free access to unique and historically important artifacts for research, teaching, and curious exploration. Discover over one million photographs, documents, letters, artwork, diaries, oral histories, films, advertisements, musical recordings, and more.

-

The collections on Calisphere have been digitized and contributed by all ten campuses of the University of California and other important libraries, archives, and museums throughout the state.

+

The collections on Calisphere have been digitized and contributed by all ten campuses of the University of California and other important libraries, archives, and museums throughout the state.

Using Calisphere

-

For more information about how to use Calisphere and the materials you find here, please consult the help page and terms of use. Special information about using Calisphere in the classroom can be found on our For Educators page.

+

For more information about how to use Calisphere and the materials you find here, please consult the help page and terms of use. Special information about using Calisphere in the classroom can be found on our For Educators page.

Add your collections

-

Calisphere aggregates digital collections from libraries, archives, museums, historical societies, and other cultural heritage organizations in California. If you represent such an organization and are interested in contributing digital content to Calisphere, click here to learn more.

+

Calisphere aggregates digital collections from libraries, archives, museums, historical societies, and other cultural heritage organizations in California. If you represent such an organization and are interested in contributing digital content to Calisphere, click here to learn more.

Subscribe to our newsletter

@@ -22,16 +22,16 @@

Subscribe to our newsletter

Free posters!

-

We offer free posters for students, teachers, and librarians. Visit the poster order page for more details.

+

We offer free posters for students, teachers, and librarians. Visit the poster order page for more details.

Spread the word

-

Love Calisphere? Help us spread the word! Check out our outreach tips and tools for sharing Calisphere with others.

+

Love Calisphere? Help us spread the word! Check out our outreach tips and tools for sharing Calisphere with others.

Our organization

Calisphere is a project of the University of California Libraries, developed and maintained by the California Digital Library.

-

Information about Calisphere's technical framework can be found on our help page.

+

Information about Calisphere's technical framework can be found on our help page.

diff --git a/app/components/static-outreach-component.html b/app/components/static-outreach-component.html index 300a396e..4c957b45 100644 --- a/app/components/static-outreach-component.html +++ b/app/components/static-outreach-component.html @@ -64,7 +64,7 @@

Small banner

Let’s work together

-

We welcome opportunities to introduce Calisphere to diverse audiences. We are happy to supply language for articles and blog posts, and can be available for virtual and in-person presentations (subject to travel and staff resource considerations). Please contact us with your outreach ideas.

+

We welcome opportunities to introduce Calisphere to diverse audiences. We are happy to supply language for articles and blog posts, and can be available for virtual and in-person presentations (subject to travel and staff resource considerations). Please contact us with your outreach ideas.

diff --git a/app/library-footer.html b/app/library-footer.html index ae37d1ef..1fd9beb6 100644 --- a/app/library-footer.html +++ b/app/library-footer.html @@ -21,7 +21,6 @@ - diff --git a/app/scripts/ComplexCarouselView.js b/app/scripts/ComplexCarouselView.js index 3a738f6b..d9558f22 100644 --- a/app/scripts/ComplexCarouselView.js +++ b/app/scripts/ComplexCarouselView.js @@ -35,17 +35,12 @@ var ComplexCarouselView = Backbone.View.extend({ if ( e.which > 1 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey ) { return; } e.preventDefault(); - $.pjax({ - type: 'GET', - url: $(e.currentTarget).attr('href'), - container: '#js-itemContainer', - traditional: true, - scrollTo: 440 - }); + // pjax replacement - previously did a scrollTo 440px after this + document.location = $(e.currentTarget).attr('href') }, // `click` triggered on `.js-component-link` - // retrieve a particular component by adding order parameter to pjax call + // retrieve a particular component by adding order parameter getComponent: function(e) { // Middle click, cmd click, and ctrl click should open // links in a new tab as normal. @@ -54,14 +49,9 @@ var ComplexCarouselView = Backbone.View.extend({ var data_params = {order: $(e.currentTarget).data('item_id')}; e.preventDefault(); - $.pjax({ - type: 'GET', - url: $(e.currentTarget).attr('href').split('?')[0], - container: '#js-itemContainer', - data: data_params, - traditional: true, - scrollTo: 440 - }); + // pjax replacement - previously did a scrollTo 440px after this + document.location = $(e.currentTarget).attr('href').split('?')[0] + + '?' + $.param(data_params, true); }, // `afterChange` triggered on `.carousel-complex__item-container` @@ -137,19 +127,7 @@ var ComplexCarouselView = Backbone.View.extend({ } }, - // PJAX Event Handlers - // ---------------------- - - // on `pjax:end`, initialize the carousel if it hasn't already been initialized - pjax_end: function(that) { - return function() { - if ($('.carousel-complex').is(':hidden')) { - that.initialize(); - } - }; - }, - - // called by `setupComponents()` on `$(document).ready()` and `pjax:end` + // called by `setupComponents()` on `$(document).ready()` initialize: function() { this.initCarousel(); // once the images have loaded, change slidesToShow and slidesToScroll to @@ -159,15 +137,9 @@ var ComplexCarouselView = Backbone.View.extend({ that.changeWidth(); }; }(this))); - - // bind pjax event handlers and save as this.bound_pjax_end so as to remove - // later with `destroy()` - this.bound_pjax_end = this.pjax_end(this); - $(document).on('pjax:end', '#js-pageContent', this.bound_pjax_end); }, destroy: function() { - $(document).off('pjax:end', '#js-pageContent', this.bound_pjax_end); this.undelegateEvents(); } }); diff --git a/app/scripts/Controller.js b/app/scripts/Controller.js index e818b6cc..61d33abb 100644 --- a/app/scripts/Controller.js +++ b/app/scripts/Controller.js @@ -8,8 +8,7 @@ // `setupComponents()` acts as a controller to create/destroy JS components // based on which selectors are available/no longer available in the DOM. -// `setupComponents()` is called on `$(document).ready()` and also on `pjax:end`. -// https://github.com/defunkt/jquery-pjax#events +// `setupComponents()` is called on `$(document).ready()` var setupComponents = function(globalSearchForm, qm) { // **CALISPHERE COMPONENTS** @@ -21,8 +20,7 @@ var setupComponents = function(globalSearchForm, qm) { // Calisphere components all have constructors (called using the new // keyword here) as well as a `destroy` function. Additionally, each has - // pjax event handlers (bound in that component's initializer, and unbound - // in `destroy`), as well as various user-action handlers - click, submit, etc. + // various user-action handlers - click, submit, etc. if ($('#js-facet').length) { globalSearchForm.facetForm = globalSearchForm.facetForm || new FacetFormView({model: qm, popstate: globalSearchForm.popstate}); diff --git a/app/scripts/ExhibitPageView.js b/app/scripts/ExhibitPageView.js index 1fcf80a4..7cf955d2 100644 --- a/app/scripts/ExhibitPageView.js +++ b/app/scripts/ExhibitPageView.js @@ -26,22 +26,14 @@ var ExhibitPageView = Backbone.View.extend({ // links in a new tab as normal. if ( e.which > 1 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey ) { return; } e.preventDefault(); - $.pjax({ - push: true, - scrollTo: false, - url: $(e.currentTarget).attr('href'), - container: '#js-exhibit-item__container' - }); + // pjax replacement + document.location = $(e.currentTarget).attr('href'); }, // events: {'hidden.bs.modal #js-exhibit-item': 'exhibitView'} exhibitView: function() { if ($('#js-exhibit-item__container').children().length > 0) { - $.pjax({ - push: true, - scrollTo: false, - url: $('#js-exhibit-item .close').data('url'), - container: '#js-exhibit-item__container' - }); + // pjax replacement + document.location = $('#js-exhibit-item .close').data('url') } }, // events: {'click .js-blockquote': 'showExhibitOverview'} @@ -107,59 +99,11 @@ var ExhibitPageView = Backbone.View.extend({ }); }, - // if an exhibit item is displayed *and* the event target /isn't/ the item container - // we're leaving the exhibit space and need to remove the modal backdrop before we go - // ('go to item page', 'contributing institution' and 'collection' links) - pjax_beforeReplace: function(e) { - if (e.target !== $('#js-exhibit-item__container')[0] && $('#js-exhibit-item').is(':visible')) { - $('.modal-backdrop').remove(); - $('body').removeClass('modal-open'); - } - }, - - // this specifies to use the pjax-exhibit-item.html template in the response - pjax_beforeSend: function(e, xhr) { - xhr.setRequestHeader('X-Exhibit-Item', 'true'); - }, - - // this pjax_end_pageContent is called when the event is triggered for div#js-pageContent - // so this includes theme pages, lesson plans, exhibit pages, etc. not just item display - pjax_end: function(that) { - return function(xhr) { - // if the part getting replaced is js-exhibit-item__container, do modal stuff - if (xhr.target.id === 'js-exhibit-item__container') { - if ($('#js-exhibit-item__container').children().length && !$('#js-exhibit-item').is(':visible')) { - $('#js-exhibit-item').modal(); - } else if (!$('#js-exhibit-item__container').children().length) { - $('#js-exhibit-item').modal('hide'); - } - } - - // if the part getting replaced is the page content (theme pages, lesson plans, exhibit pages, etc.) - // init carousels and truncate exhibit overview - if (xhr.target.id === 'js-pageContent') { - that.initCarousel(); - $('.js-exhibit__overview').dotdotdot({callback: function(isTruncated) { - if (isTruncated) { - $('#js-exhibit__overview').text('Read full exhibition overview'); - } else { - $('.js-exhibit__overview').css('height', 'auto'); - } - }}); - } - }; - }, - initialize: function() { if ($('#js-exhibit-item__container').children().length) { $('#js-exhibit-item').modal(); } - this.bound_pjax_end = this.pjax_end(this); - $(document).on('pjax:beforeSend', '#js-exhibit-item__container', this.pjax_beforeSend); - $(document).on('pjax:beforeReplace', '#js-pageContent', this.pjax_beforeReplace); - $(document).on('pjax:end', '#js-pageContent', this.bound_pjax_end); - this.initCarousel(); $('.js-exhibit__overview').dotdotdot({callback: function(isTruncated) { if (isTruncated) { @@ -171,9 +115,6 @@ var ExhibitPageView = Backbone.View.extend({ }, destroy: function() { - $(document).off('pjax:beforeSend', '#js-exhibit-item__container', this.pjax_beforeSend); - $(document).off('pjax:beforeReplace', '#js-pageContent', this.pjax_beforeReplace); - $(document).off('pjax:end', '#js-pageContent', this.bound_pjax_end); this.undelegateEvents(); } }); diff --git a/app/scripts/FacetFormView.js b/app/scripts/FacetFormView.js index b7a985e3..2450c8fc 100644 --- a/app/scripts/FacetFormView.js +++ b/app/scripts/FacetFormView.js @@ -149,10 +149,10 @@ var FacetFormView = Backbone.View.extend({ } e.preventDefault(); - $.pjax({ - url: $(e.currentTarget).attr('href'), - container: '#js-pageContent' - }); + // TODO: w/ pjax replacement, persist query manager state + // add this.model.toJSON() to local storage? + // add this.model.toJSON() to the url w/ $.param(this.model.toJSON(), true);? + document.location = $(e.currentTarget).attr('href') } }, @@ -253,12 +253,9 @@ var FacetFormView = Backbone.View.extend({ // **PJAX CALL TO PERFORM THE SEARCH** facetSearch: function() { - $.pjax({ - url: $('#js-facet').attr('action'), - container: '#js-pageContent', - data: this.model.toJSON(), - traditional: true - }); + // pjax replacement + document.location = $('#js-facet').attr('action') + '?' + + $.param(this.model.toJSON(), true); }, // **RELATED COLLECTIONS** @@ -357,51 +354,7 @@ var FacetFormView = Backbone.View.extend({ } }, - // PJAX EVENT HANDLERS - // ----------------------- - - // called on `pjax:end`, only when a `FacetFormView` already exists - // so the user has already visited a search results page - pjax_end: function(that) { - return function() { - // since this is still called on pjax:end when navigating away from - // the facet form to something else, we need to check for our - // `#js-facet` selector - if ($('#js-facet').length) { - if (that.popstate === 'back' || that.popstate === 'forward') { - // when a user navigates 'back' to a form, the form is still set - // in the state the user left the form in, which doesn't reflect - // the results shown in search results, so we reset the form - // to reflect the state the DOM left the form in, last we got a - // roundtrip from the server. - _.each($('form'), function(form) { - form.reset(); - }); - - // get the query from the DOM, and silently set the model so as - // to avoid calling `render` - (no need to redraw the page; the - // page has already been drawn) - var queryObj; - queryObj = that.model.getQueryFromDOM('js-facet'); - that.model.set(queryObj, {silent: true}); - that.popstate = null; - } - - // we do need to redraw the tooltips and the select/deselect all - // buttons to reflect the current query state, though - that.toggleSelectDeselectAll(); - that.toggleTooltips(); - } - }; - }, - - pjax_popstate: function(that) { - return function(e) { - that.popstate = e.direction; - }; - }, - - // called via `setupComponents()` on `document.ready()` and `pjax:end` + // called via `setupComponents()` on `document.ready()` initialize: function(opts) { // sets `this.render` to listen to whenever `this.model` (qm) fires a `change` event this.listenTo(this.model, 'change', this.render); @@ -411,22 +364,9 @@ var FacetFormView = Backbone.View.extend({ // retrieve query from DOM, // toggle tooltips and select/deselect all links this.popstate = opts.popstate ? opts.popstate : null; - this.pjax_end(this)(); - - // bind pjax handlers to `this` - // we need to save the bound handler to `this.bound_pjax_end` so we can - // later remove these handlers by the same name in `destroy` - this.bound_pjax_end = this.pjax_end(this); - this.bound_pjax_popstate = this.pjax_popstate(this); - $(document).on('pjax:end', '#js-pageContent', this.bound_pjax_end); - $(document).on('pjax:popstate', '#js-pageContent', this.bound_pjax_popstate); }, destroy: function() { - // remove bound pjax event handlers - $(document).off('pjax:end', '#js-pageContent', this.bound_pjax_end); - $(document).off('pjax:popstate', '#js-pageContent', this.bound_pjax_popstate); - // stop calling `this.render` whenever `this.model` (qm) fires a `change` event this.stopListening(); // undelegate all user event handlers specified in `this.events` diff --git a/app/scripts/GlobalSearchFormView.js b/app/scripts/GlobalSearchFormView.js index 954d883e..052bb1da 100644 --- a/app/scripts/GlobalSearchFormView.js +++ b/app/scripts/GlobalSearchFormView.js @@ -101,7 +101,6 @@ var GlobalSearchFormView = Backbone.View.extend({ initialize: function() { this.listenTo(this.model, 'change:q', this.render); - $(document).on('pjax:beforeReplace', '#js-pageContent', this.pjax_beforeReplace); var headerWidth = window.matchMedia('(min-width: 650px)'); this.watchHeaderWidth(this)(headerWidth); @@ -123,18 +122,14 @@ var GlobalSearchFormView = Backbone.View.extend({ this.model.clear({silent: true}); this.model.set({q: q}, {silent: true}); //perform the search! - $.pjax({ - url: $('#js-searchForm').attr('action'), - container: '#js-pageContent', - data: this.model.toJSON() - }); + // pjax replacement + document.location = $('#js-searchForm').attr('action') + + '?' + $.param(this.model.toJSON(), true); } else { this.model.clear({silent: true}); - $.pjax({ - url: $('#js-searchForm').attr('action'), - container: '#js-pageContent', - data: {'q': ''} - }); + // pjax replacement + document.location = $('#js-searchForm').attr('action') + + '?' + $.params({'q': ''}); } _.each($('#js-searchForm, #js-footerSearch'), (function(model) { @@ -149,15 +144,5 @@ var GlobalSearchFormView = Backbone.View.extend({ if (this.carousel !== undefined) { this.carousel.changeWidth(window_width); } if (this.complexCarousel !== undefined) { this.complexCarousel.changeWidth(window_width); } }, - - pjax_beforeReplace: function() { - if($('#js-mosaicContainer').length > 0 && $('#js-collectionPagination').children().length) { - $('#js-mosaicContainer').infiniteScroll('destroy'); - } - - }, - pjax_end: function() { - this.closeMenu(); - } }); diff --git a/app/scripts/ItemView.js b/app/scripts/ItemView.js index 93f37365..2e22ccc6 100644 --- a/app/scripts/ItemView.js +++ b/app/scripts/ItemView.js @@ -88,15 +88,13 @@ var ItemView = Backbone.View.extend({ if ( e.which > 1 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey ) { return; } // Unset carousel/item specific information + // TODO: w/ pjax replacement, persist query manager state this.model.unsetItemInfo(); e.preventDefault(); - $.pjax({ - url: $(e.currentTarget).children('a').attr('href').split('?')[0], - container: '#js-pageContent', - data: this.model.toJSON(), - traditional: true - }); + // TODO: w/ pjax replacement, persist query manager state + document.location = $(e.currentTarget).children('a').attr('href').split('?')[0] + + '?' + $.param(this.model.toJSON(), true); }, carouselAfterChange: function(e, slick) { @@ -283,15 +281,15 @@ var ItemView = Backbone.View.extend({ } e.preventDefault(); - $.pjax({ - url: $(e.currentTarget).attr('href'), - container: '#js-itemContainer' - }); + // TODO: w/ pjax replacement, persist query manager state + // store this.model.toJSON() in local storage? + // in + document.location = $(e.currentTarget).attr('href'); } }, // `click` triggered on `.js-rc-page` - // also called in initialize and pjax_end with e=undefined + // also called in initialize with e=undefined paginateRelatedCollections: function(e) { var data_params = this.model.toJSON(); // don't need carousel specific item data for the related collections @@ -330,7 +328,7 @@ var ItemView = Backbone.View.extend({ }, // ultimately this will like get called from a 'click' triggered on paging exhibits - // as well as the initialize() and pjax_end() functions where it's called now + // as well as the initialize() functions where it's called now // for now most exhibit items really only exist in one exhibit - not so many that // we need pagination paginateRelatedExhibitions: function() { @@ -373,12 +371,9 @@ var ItemView = Backbone.View.extend({ if($(e.currentTarget).data('relation') !== undefined) { e.preventDefault(); this.model.set({ relation_ss: [$(e.currentTarget).data('relation')] }); - $.pjax({ - url: $(e.currentTarget).attr('href').split('?')[0], - container: '#js-pageContent', - data: this.model.toJSON(), - traditional: true - }); + // TODO: w/ pjax replacement, persist query manager state + document.location = $(e.currentTarget).attr('href').split('?')[0] + + '?' + $.param(this.model.toJSON(), true); } else { if (typeof _paq !== 'undefined') { _paq.push(['trackEvent', @@ -525,71 +520,7 @@ var ItemView = Backbone.View.extend({ // PJAX EVENT HANDLERS // --------------------- - // called on `pjax:beforeSend` - // Navigating between item pages is one of the rare cases where instead of - // replacing the contents of #js-pageContent with the results of a pjax call, - // we replace the contents of #js-itemContainer. When a user clicks from an - // item page to another item page, this event handler appends a special header - // to tell the server to use a different template - // (`/calisphere/templates/calisphere/pjaxTemplates/pjax-item.html`) - // for the response - pjax_beforeSend: function(e, xhr) { - xhr.setRequestHeader('X-From-Item-Page', 'true'); - }, - - // called on `pjax:end` - pjax_end: function(that) { - return function() { - // reset the query manager's item-specific info to the previous item. - if (that.popstate === 'back' || that.popstate === 'forward') { - var queryObj; - if ($('#js-carouselForm').length) { - queryObj = that.model.getItemInfoFromDOM(); - that.model.set(queryObj, {silet: true}); - } - - if ($('#disqus_thread').length) { - if ($('#disqus_thread').html().length > 0) { - that.resetDisqus(); - } - } - that.popstate = null; - } - - // when navigating between items, the carousel is *not* a part of the #js-itemContainer - // document fragment returned, so here we manually change which item in the carousel - // gets the 'selected' CSS treatment - var lastItem = $('.carousel__item--selected'); - if (lastItem.children('a').data('item_id') !== that.model.get('itemId')) { - lastItem.find('.carousel__image--selected').toggleClass('carousel__image'); - lastItem.find('.carousel__image--selected').toggleClass('carousel__image--selected'); - lastItem.toggleClass('carousel__item'); - lastItem.toggleClass('carousel__item--selected'); - - var linkItem = $('.js-item-link[data-item_id="' + that.model.get('itemId') + '"]'); - linkItem.find('.carousel__image').toggleClass('carousel__image--selected'); - linkItem.find('.carousel__image').toggleClass('carousel__image'); - linkItem.parent().toggleClass('carousel__item--selected'); - linkItem.parent().toggleClass('carousel__item'); - } - - // when navigating between items, the related collections is *not* a part of - // the #js-itemContainer document document fragment returned, so here we manually - // retrieve new related collections - that.paginateRelatedCollections(undefined); - that.paginateRelatedExhibitions(); - - that.initMediaPlayer(); - }; - }, - - pjax_popstate: function(that) { - return function(e) { - that.popstate = e.direction; - }; - }, - - // called via `setupComponents()` on document.ready() and pjax:end + // called via `setupComponents()` on document.ready() initialize: function() { // gets the query from the DOM, if present if ($('#js-carouselForm').length) { @@ -609,23 +540,9 @@ var ItemView = Backbone.View.extend({ this.resetDisqus(); } } - - // bind pjax handlers to `this` - // we need to save the bound handler to `this.bound_pjax_end` so we can later - // remove these handlers by name in `destroy` - this.bound_pjax_end = this.pjax_end(this); - this.bound_pjax_popstate = this.pjax_popstate(this); - $(document).on('pjax:beforeSend', '#js-itemContainer', this.pjax_beforeSend); - $(document).on('pjax:end', '#js-itemContainer', this.bound_pjax_end); - $(document).on('pjax:popstate', '#js-pageContent', this.bound_pjax_popstate); }, destroy: function() { - // remove pjax event handlers - $(document).off('pjax:beforeSend', '#js-itemContainer', this.pjax_beforeSend); - $(document).off('pjax:end', '#js-itemContainer', this.bound_pjax_end); - $(document).off('pjax:popstate', '#js-pageContent', this.bound_pjax_popstate); - // undelegate all user event handlers specified in `this.events` this.undelegateEvents(); diff --git a/app/scripts/calisphere.js b/app/scripts/calisphere.js index a6ef0ce9..d8abce63 100644 --- a/app/scripts/calisphere.js +++ b/app/scripts/calisphere.js @@ -29,9 +29,6 @@ if(typeof console === 'undefined') { console = { log: function() { } }; } -// PJAX explained more a bit later, for now this is just a timeout -$(document).on('pjax:timeout', function() { return false; }); - var qm, globalSearchForm; function timeoutGACallback(callback, opt_timeout) { @@ -75,7 +72,7 @@ function get_inst_ga_dimensions() { $(document).ready(function() { // *********************************** - on_ready_pjax_end_handler(); + on_ready_handler(); // **Google Event Tracking** @@ -187,18 +184,9 @@ $(document).ready(function() { // **Initial Setup for all Calisphere pages except the homepage** - // The homepage doesn't have pjax-y links, or JS components to initialize + // The homepage doesn't have JS components to initialize if (!$('.home').length) { - // **PJAX** - - // We use pjax (pushState+ajax) to replace the inner HTML of given DOM - // nodes (typically `#js-pageContent`), and update the address bar accordingly. - // https://github.com/defunkt/jquery-pjax - $.pjax.defaults.timeout = 5000; - // make all links with attribute `data-pjax=js-PageContent` pjax-y - $(document).pjax('a[data-pjax=js-pageContent]', '#js-pageContent'); - // **Initial Component Setup** //Create query manager and global search form component @@ -208,51 +196,6 @@ $(document).ready(function() { //`setupComponents()` acts as a controller to create/destroy JS components //based on which selectors are available/no longer available in the DOM. setupComponents(globalSearchForm, qm); - - // **Global PJAX Event Handlers** - - // https://github.com/defunkt/jquery-pjax#events - - //**Pjax Success** - $(document).on('pjax:success', function(e, data, x, xhr, z) { - var start_marker = z.context.find('meta[property=og\\:type]'); - var variable_markup = start_marker.nextUntil($('meta[name=twitter\\:creator]')); - var old_start = $('head').find('meta[property=og\\:type]'); - old_start.nextUntil($('meta[name=twitter\\:creator]')).remove(); - $.each($(variable_markup).get().reverse(), function(i, v) { - $(v).insertAfter(old_start); - }); - }); - - //**Pjax End** - $(document).on('pjax:end', '#js-pageContent', function() { - // Closes global search and nav menus in mobile - globalSearchForm.pjax_end(); - - // if we've gotten to a page without search context, clear the query manager - if(!$('#js-facet').length && !$('#js-objectViewport').length) { - qm.clear({silent: true}); - } - - //Create/destroy components based on which selectors are available in the DOM, - //which components exist already, and which selectors are no longer in the DOM - setupComponents(globalSearchForm, qm); - globalSearchForm.popstate = null; - }); - - //**Loading notifications** - /* globals NProgress: false */ - $(document).on('pjax:send', function() { - NProgress.start(); - }); - - $(document).on('pjax:complete', function() { - NProgress.done(); - }); - - $(document).on('pjax:popstate', function(e) { - globalSearchForm.popstate = e.direction; - }); } }); @@ -277,31 +220,31 @@ var cluster_search = function(col_id, facet_field) { }); }; -var on_ready_pjax_end_handler = function() { +var on_ready_handler = function() { // send google analytics on pjax pages /* globals ga: false, _paq: false */ /* jshint latedef: false */ - if (typeof _paq !== 'undefined') { - _paq.push(['setCustomUrl', window.location.href]); - _paq.push(['setDocumentTitle', document.title]); - _paq.push(['trackPageView', document.title, get_cali_ga_dimensions()]); - _paq.push(['enableLinkTracking']); - } - if (typeof ga !== 'undefined') { - var dimensions = get_cali_ga_dimensions(); - ga('caliga.set', 'location', window.location.href); - ga('caliga.send', 'pageview', dimensions); - - var inst_ga_code = $('[data-ga-code]').data('ga-code'); - if (inst_ga_code) { - var inst_tracker_name = inst_ga_code.replace(/-/g,'x'); - ga('create', inst_ga_code, 'auto', {'name': inst_tracker_name}); - ga(inst_tracker_name + '.set', 'anonymizeIp', true); - ga(inst_tracker_name + '.set', 'location', window.location.href); - var inst_dimensions = get_inst_ga_dimensions(); - ga( inst_tracker_name + '.send', 'pageview', inst_dimensions); - } - } + // if (typeof _paq !== 'undefined') { + // _paq.push(['setCustomUrl', window.location.href]); + // _paq.push(['setDocumentTitle', document.title]); + // _paq.push(['trackPageView', document.title, get_cali_ga_dimensions()]); + // _paq.push(['enableLinkTracking']); + // } + // if (typeof ga !== 'undefined') { + // var dimensions = get_cali_ga_dimensions(); + // ga('caliga.set', 'location', window.location.href); + // ga('caliga.send', 'pageview', dimensions); + + // var inst_ga_code = $('[data-ga-code]').data('ga-code'); + // if (inst_ga_code) { + // var inst_tracker_name = inst_ga_code.replace(/-/g,'x'); + // ga('create', inst_ga_code, 'auto', {'name': inst_tracker_name}); + // ga(inst_tracker_name + '.set', 'anonymizeIp', true); + // ga(inst_tracker_name + '.set', 'location', window.location.href); + // var inst_dimensions = get_inst_ga_dimensions(); + // ga( inst_tracker_name + '.send', 'pageview', inst_dimensions); + // } + // } // **Collection Title Search** @@ -353,7 +296,6 @@ var on_ready_pjax_end_handler = function() { }); } }; -$(document).on('pjax:end', on_ready_pjax_end_handler); //************************************ diff --git a/calisphere/__init__.py b/calisphere/__init__.py index feff467b..10d40e56 100644 --- a/calisphere/__init__.py +++ b/calisphere/__init__.py @@ -23,4 +23,4 @@ def new_render(cls, context): URLNode.render = new_render -default_app_config = 'calisphere.apps.CalisphereAppConfig' + diff --git a/calisphere/templates/404.html b/calisphere/templates/404.html index 3ca6962e..d74d17eb 100644 --- a/calisphere/templates/404.html +++ b/calisphere/templates/404.html @@ -53,16 +53,16 @@ @@ -95,11 +95,11 @@

404: Not Found

If you think this is a problem with Calisphere, please - + contact us.
- Or return to the homepage. + Or return to the homepage.

@@ -139,42 +139,42 @@

404: Not Found