From 50ffdeb729036b736e3c4ec9d089428f34904498 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 4 Jul 2013 03:58:36 +0200 Subject: [PATCH] makeStaticLoader: Update output and re-sync This was broken after 92c38ea removed ve-mw files from the static loaders but didn't update makeStaticLoader.php so it was harder to keep the files in sync and a few minor issues on the documentation pages. Since the files are still mixed in the non-mw modules the only way to exclude them is to do what was manually done in 92c38ea: Filter out paths starting with "ve-mw/" from non-mw modules. Change-Id: Id58ee89ac18c63c01719dc11ec7a07ddeee3ea0b --- maintenance/makeStaticLoader.php | 21 +++++++++++++++------ modules/ve/test/index.php | 4 ++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/maintenance/makeStaticLoader.php b/maintenance/makeStaticLoader.php index 7054855102..c117ce68db 100644 --- a/maintenance/makeStaticLoader.php +++ b/maintenance/makeStaticLoader.php @@ -162,21 +162,30 @@ class MakeStaticLoader extends Maintenance { $headAdd = $bodyAdd = ''; if ( isset( $registry['styles'] ) && $target !== 'test' ){ - foreach ($registry['styles'] as $style) { + foreach ( $registry['styles'] as $path ) { + if ( strpos( $path, 've-mw/' ) === 0 ) { + continue; + } $headAdd .= $indent . Html::element( 'link', array( 'rel' => 'stylesheet', - 'href' => "$vePath/$style", + 'href' => "$vePath/$path", ) ) . "\n"; } } if ( isset( $registry['scripts'] ) ) { - foreach ($registry['scripts'] as $script) { - $bodyAdd .= $indent . Html::element( 'script', array( 'src' => "$vePath/$script" ) ) . "\n"; + foreach ( $registry['scripts'] as $path ) { + if ( strpos( $path, 've-mw/' ) === 0 ) { + continue; + } + $bodyAdd .= $indent . Html::element( 'script', array( 'src' => "$vePath/$path" ) ) . "\n"; } } if ( isset( $registry['debugScripts'] ) ) { - foreach ($registry['debugScripts'] as $script) { - $bodyAdd .= $indent . Html::element( 'script', array( 'src' => "$vePath/$script" ) ) . "\n"; + foreach ( $registry['debugScripts'] as $path ) { + if ( strpos( $path, 've-mw/' ) === 0 ) { + continue; + } + $bodyAdd .= $indent . Html::element( 'script', array( 'src' => "$vePath/$path" ) ) . "\n"; } } if ( isset( $registry['headAdd'] ) ) { diff --git a/modules/ve/test/index.php b/modules/ve/test/index.php index 2c35588abf..9dbbaa2bb3 100644 --- a/modules/ve/test/index.php +++ b/modules/ve/test/index.php @@ -17,12 +17,12 @@ ) { document.write( '' + 'href="../../ve/ui/styles/ve.ui.Icons-vector.css">' ); } else { document.write( '' + 'href="../../ve/ui/styles/ve.ui.Icons-raster.css">' ); }