From 02b6f0da140988aff16a3c6e7b34abdddacf410d Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Sat, 8 Jun 2013 16:16:07 -0400 Subject: [PATCH] Bug 10405: add IDs for custom regions This patch adds unique IDs for: opaccredits opacheader OPACMobileUserCSS OpacNavBottom OpacUserCSS opacuserjs This is most useful for previewing changes you make in the OPAC preferences using the following javascript in your IntranetUserJS: function showPreview(url) { $('#preview-loading').show(); document.getElementById('opac-preview').src = url; $('#opac-preview').load(function () { $('#opac-preview').show(); $('#region-opaccredits', $('#opac-preview').contents()).html($('#pref_opaccredits').val()); $('#region-opacheader', $('#opac-preview').contents()).html($('#pref_opacheader').val()); $('#opacmainuserblock', $('#opac-preview').contents()).html($('#pref_OpacMainUserBlock').val()); $('#opacmainuserblockmobile', $('#opac-preview').contents()).html($('#pref_OpacMainUserBlockMobile').val()); $('#region-opacnav', $('#opac-preview').contents()).html($('#pref_OpacNav').val()); $('#region-opacnavbottom', $('#opac-preview').contents()).html($('#pref_OpacNavBottom').val()); $('#opacrightsidebar', $('#opac-preview').contents()).html($('#pref_OpacNavRight').val()); $('#noresultsfound', $('#opac-preview').contents()).html($('#pref_OPACNoResultsFound').val()); $('#opacresultssidebar', $('#opac-preview').contents()).html($('#pref_OPACResultsSidebar').val()); $('#region-opacusercss', $('#opac-preview').contents()).replaceWith(''); $('#region-opacuserjs', $('#opac-preview').contents()).replaceWith(''); $('#preview-loading').hide(); }); } $(document).ready(function () { if ($('#pref_OpacNav').size() > 0) { $('#doc3').after(''); $('#preview-main').click(function () { showPreview('/cgi-bin/koha/opac/opac-main.pl'); }); $('#preview-results').click(function () { showPreview('/cgi-bin/koha/opac/opac-search.pl?idx=&q=pqf%3D%40attr+1%3D_ALLRECORDS+%40attr+2%3D103+%22%22&branch_group_limit='); }); $('#preview-details').click(function () { showPreview('/cgi-bin/koha/opac/opac-detail.pl?biblionumber=1'); }); $('#preview-hide').click(function () { $('#opac-preview').hide(); $('#preview-loading').hide(); }); } }); --- .../opac-tmpl/prog/en/includes/doc-head-close.inc | 12 ++++++++---- koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 8 +++----- .../opac-tmpl/prog/en/includes/navigation.inc | 5 ++++- .../opac-tmpl/prog/en/includes/opac-bottom.inc | 8 +++----- .../opac-tmpl/prog/en/includes/opac-facets.inc | 3 --- koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt | 6 +++--- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc index 147b82c..1ccf24e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc @@ -23,11 +23,11 @@ [% IF persona %] [% END %] -[% IF ( OPACMobileUserCSS ) %][% END %] + [% IF ( bidi ) %] [% END %] -[% IF ( OPACUserCSS ) %][% END %] + @@ -94,8 +94,12 @@ [% IF ( SyndeticsCoverImages ) %]$(window).load(function() { verify_images(); });[% END %] - [% IF ( opacuserjs ) %][% opacuserjs %][% END %] - //]]> + //]]> + + + diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc index 651e669..c4dedea 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc @@ -14,9 +14,9 @@ [% END %] - [% IF ( opacheader ) %] - [% opacheader %] - [% END %] +
+ [% opacheader %] +
[% END %]

[% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc b/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc index 9cd2c12..c3c25e6 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/navigation.inc @@ -1,6 +1,9 @@ +
[% OpacNav %] +
[% IF IsPatronPage %] [% INCLUDE usermenu.inc %] [% END %] +
[% OpacNavBottom %] - +
diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc index 7020673..ec17f80 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc @@ -1,8 +1,6 @@ -[% IF ( opaccredits ) %] -
- [% opaccredits %] -
-[% END %] +
+ [% opaccredits %] +
[% IF ( opaclanguagesdisplay || OpacKohaUrl ) %] diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc index fbb7c55..f575da9 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc @@ -27,10 +27,7 @@ [% END %] -[% IF ( OPACResultsSidebar ) %]
-[% OPACResultsSidebar %]
[% END %] [% END %] -[% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt index 3844fc5..604c4be 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt @@ -36,8 +36,8 @@

Quote of the Day

[% daily_quote.text %] ~ [% daily_quote.source %]
[% END %] - [% IF ( OpacMainUserBlock ) %]
[% OpacMainUserBlock %]
[% END %] - [% IF ( OpacMainUserBlockMobile ) %]
[% OpacMainUserBlockMobile %]
[% END %] +
[% OpacMainUserBlock %]
+
[% OpacMainUserBlockMobile %]
@@ -68,7 +68,7 @@ [% END %] [% END %] [% END %] - [% IF ( OpacNavRight ) %]
[% OpacNavRight %]
[% END %] +
[% OpacNavRight %]
[% END %] -- 1.7.9.5