Bug 956935 - RFE: Allow customisation of site JavaScript
Summary: RFE: Allow customisation of site JavaScript
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 3.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 3.2
Assignee: Jeff Fearn 🐞
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-26 03:20 UTC by Katie Miller
Modified: 2015-02-08 21:35 UTC (History)
5 users (show)

Fixed In Version: 3.2.0
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-09 04:47:17 UTC
Embargoed:


Attachments (Terms of Use)

Description Katie Miller 2013-04-26 03:20:13 UTC
Description of problem:

It would be useful to have a way of customising the site JavaScript found in /usr/share/publican/sitetemplate/toc.js. This could be another site configuration option.

A use case for this is when a brand uses client-side chroming utilising require.js to manage the loading of JavaScripts. For everything to be managed by require.js, JavaScripts that use jQuery must be wrapped in a call to require.js. To do this, it needs to be possible to alter the site JavaScripts, such as toc.js.

Comment 8 Jeff Fearn 🐞 2013-07-08 01:02:13 UTC
This requires a few changes, let me know if this is acceptable.

The assumption is that you'd do this at the home page/site level and not the brand level.

1: Modify home page to allow site level java-script & templates to be shipped.
2: Add new toc_js attribute to site config.
3: rename toc.js to default.js
4: Modify update_site to make toc.js a sym-link to $toc_js || default.js

This wouldn't allow you to do every possible update but it should allow a lot more customization before you really need to start hacking things.

Comment 9 HSS Product Manager 2013-07-08 05:47:52 UTC
HSS-QE has reviewed and declined this request. QE for this bug will be handled by IED.

Comment 10 Katie Miller 2013-07-10 02:06:25 UTC
(In reply to Jeff Fearn from comment #8)
> This requires a few changes, let me know if this is acceptable.
> 
> The assumption is that you'd do this at the home page/site level and not the
> brand level.
> 
> 1: Modify home page to allow site level java-script & templates to be
> shipped.
> 2: Add new toc_js attribute to site config.
> 3: rename toc.js to default.js
> 4: Modify update_site to make toc.js a sym-link to $toc_js || default.js
> 
> This wouldn't allow you to do every possible update but it should allow a
> lot more customization before you really need to start hacking things.

This solution would facilitate the customisation that I require.

Comment 11 Jeff Fearn 🐞 2013-07-10 04:35:02 UTC
Since you can already ship java script in brands it makes sense to expand that to handle templates, and then add an extra site parameter for the relative path to the js file.

Much easier to do.

Comment 12 Jeff Fearn 🐞 2013-07-10 05:27:51 UTC
Added site param toc_js.

Allow brands to ship 'template' directory.

Updated Users_Guide/en-US/Websites_structure_manual.xml with new param.

To ssh://git.fedorahosted.org/git/publican.git
   b525469..e96d576  HEAD -> devel

Comment 13 Tim Hildred 2013-07-23 10:11:22 UTC
Hey Katie,

I wonder if you could suggest a way for me to verify this one as well?

Comment 14 Katie Miller 2013-07-24 22:38:10 UTC
Hi Tim,

I will have to QA this bug. Testing this involves changes to site config.

(In reply to Tim Hildred from comment #13)
> Hey Katie,
> 
> I wonder if you could suggest a way for me to verify this one as well?

Comment 15 Katie Miller 2013-07-25 21:53:22 UTC
Tested on Publican 3.1.5-0.fc18.t66.

Comment 16 Jeff Fearn 🐞 2013-08-09 04:47:17 UTC
The fix for this bug has been shipped in publican 3.2.0


Note You need to log in before you can comment on or make changes to this bug.