You are here: Foswiki>Tasks Web>Item13791 (23 Nov 2015, GeorgeClark)Edit Attach

Item13791: Backport CSS classes in script/link/style elements in zones for 1.1.x.

pencil
Priority: Enhancement
Current State: Closed
Released In: 1.1.10
Target Release: patch
Applies To: Engine
Component:
Branches: Release01x01
Reported By: MichaelDaum
Waiting For:
Last Change By: GeorgeClark
... Required for AngularSkin and RenderPlugin to properly inject css and js as required by TML snippets loaded async'ly

diff --git a/lib/Foswiki.pm b/lib/Foswiki.pm
index 17e2e22..c1d17ba 100644
--- a/lib/Foswiki.pm
+++ b/lib/Foswiki.pm
@@ -3457,6 +3457,11 @@ sub addToZone {
         $thisZone->{$id} = $zoneID;
     }

+    # add class to script and link data
+    $data =~ s/<script\s+((?![^>]*class=))/<script class='\$zone \$id' $1/g;
+    $data =~ s/<link\s+((?![^>]class=))/<link class='\$zone \$id' $1/g;
+    $data =~ s/<style\s+((?![^>]*class=))/<style class='\$zone \$id' $1/g;
+
     # override previous properties
     $zoneID->{zone}            = $zone;
     $zoneID->{requires}        = \@requires;

-- MichaelDaum - 05 Oct 2015

 

ItemTemplate edit

Summary Backport CSS classes in script/link/style elements in zones for 1.1.x.
ReportedBy MichaelDaum
Codebase 1.1.9
SVN Range
AppliesTo Engine
Component
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins distro:391ebb103270 distro:6f5207a03658
TargetRelease patch
ReleasedIn 1.1.10
CheckinsOnBranches Release01x01
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins distro:391ebb103270 distro:6f5207a03658
Topic revision: r4 - 23 Nov 2015, GeorgeClark - This page was cached on 19 May 2017 - 00:29.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License