Ticket #594 (assigned enhancement)

Opened 2 years ago

Last modified 1 week ago

Requirements: Dynamically add javascript with an Ajax-Request

Reported by: ischommer Assigned to: sminnee (accepted)
Type: enhancement Priority: critical
Milestone: 2.3.0 Component: Sapphire Framework
Version: Severity: high effort / impact
Keywords: Cc:
Due date: Hours:

Description

Adding JS through Requirements is currently limited to non-ajax-requests, as they are included in <script>-tags. This leads to lots of unneccessary includes for custom scenarious (conf. CMSMain->init()).

Implementation-Links: http://ajaxpatterns.org/On-Demand_Javascript http://www.rittau.org/blog/20061118-00 http://simonwillison.net/2004/May/26/addLoadEvent/ http://www.codeproject.com/useritems/js_IncludingEngine_Part_1.asp

Attachments

Change History

Changed 1 year ago by ischommer

  • priority changed from medium to minor
  • custom_estimated_hours set to 16
  • severity changed from medium effort / impact to high effort / impact

Changed 1 year ago by sminnee

  • owner changed from hsmith to sminnee
  • harvest_task set to (Unknown)
  • invoice_sent set to 0
  • component changed from CMS - General to Sapphire Framework
  • priority changed from minor to medium

Changed 1 year ago by sminnee

  • milestone deleted

Changed 1 year ago by sminnee

  • owner changed from sminnee to ischommer
  • priority changed from medium to critical
  • milestone set to 2.2.1

It would be great to get this as part of 2.2.1 - it would solve a lot of long-term issues that we have overloading of javascripts in the CMS, and could therefore be used to speed up the CMS.

Changed 1 year ago by lperera

Seems this piece of code is a good solution for dynamically loading javascript :

http://www.exit12.org/archives/12

Changed 10 months ago by sminnee

This is crucial to improving the performance of the CMS - it's important that we achieve this in 2.2.2.

Changed 9 months ago by ischommer

this request conflicts with the agenda for 2.2.2 of being a "stability release" - this can potentially cause a lot of weird javascript-behaviour as its not a very common technique. in addition, lots of our ajax-return-values have to be transformed from HTML to evaluated JS, again opening a window for errors - i suggest moving this to 2.3

Changed 9 months ago by sminnee

  • milestone changed from 2.2.2 feature-lock to 2.3

Having discussed this with you, I think you're right.

Changed 9 months ago by mpeel

Being able to unload Javascript would be good as well.

For example, the YoutubeGallery? and BlipTVGallery modules both have 'Videos' tabs - if they both load Javascript they could easily conflict with each other.

Not sure if this is necessary for this ticket, but could bear thinking about for the future at least.

Changed 1 week ago by sminnee

  • owner changed from ischommer to sminnee

This is something that I'm working on.

Changed 1 week ago by sminnee

  • status changed from new to assigned
Note: See TracTickets for help on using tickets.