Changeset 7085
- Timestamp:
- 04/11/2018 05:20:21 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js
r7083 r7085 1412 1412 window.applyCommentsOrder = window.applyCommentsOrder || function() {} 1413 1413 1414 // Add Params to s.w.org scripts and stylesheets when loaded dynamically. 1415 var cache_buster = jQuery('script[src^="https://s.w.org"][src*="v="]').attr('src'); 1416 if ( cache_buster ) { 1417 cache_buster = cache_buster.match(/v=([0-9]+)$/)[1]; 1418 } 1419 var maybe_add_cache_buster = function( href ) { 1420 if ( cache_buster && href.match( /https:\/\/s.w.org/i ) && href.match( /[.](css|js)$/ ) ) { 1421 href += '?v=' + cache_buster; 1422 } 1423 return href; 1424 } 1425 var oldLoadScript = $.loadScript; 1426 $.loadScript = function(href, type, charset) { 1427 return oldLoadScript( maybe_add_cache_buster( href ), type, charset ); 1428 } 1429 var oldLoadStylesheet = $.loadStyleSheet; 1430 $.loadStyleSheet = function( href ) { 1431 return oldLoadStylesheet( maybe_add_cache_buster( href ) ); 1432 } 1433 1414 1434 // From Trac 1.2.2 trac.js: 1415 1435 $.loadScript = $.loadScript || function() {}
Note: See TracChangeset
for help on using the changeset viewer.