Fixed dependency on mw, now demo works again

Change-Id: I26599e065a521cf08a16f5a65e36960a692421e9
This commit is contained in:
Trevor Parscal 2012-06-11 12:11:07 -07:00
parent 21ff108c28
commit 17fff0d163
2 changed files with 10 additions and 4 deletions

View file

@ -169,6 +169,9 @@ include( '../../modules/sandbox/base.php' );
<!-- ui -->
<script src="../../modules/ve2/ui/ve.ui.js"></script>
<script>
ve.ui.stylesheetPath = '../../modules/ve2/ui/styles/';
</script>
<script src="../../modules/ve2/ui/ve.ui.Inspector.js"></script>
<script src="../../modules/ve2/ui/ve.ui.Tool.js"></script>
<script src="../../modules/ve2/ui/ve.ui.Toolbar.js"></script>

View file

@ -4,7 +4,8 @@
* All classes and functions will be attached to this object to keep the global namespace clean.
*/
ve.ui = {
// Path to UI assets for direct loading
'stylesheetPath': 'extensions/VisualEditor/modules/ve2/ui/styles/'
};
/*
@ -12,7 +13,9 @@ ve.ui = {
* Returns UI stylesheet path
*/
ve.ui.getStylesheetPath = function() {
// gets the path to a UI
// TODO: look for mw.util and rewrite
return mw.config.get( 'wgExtensionAssetsPath' ) + '/VisualEditor/modules/ve2/ui/styles/';
if ( 'mw' in window ) {
return mw.config.get( 'wgExtensionAssetsPath' ) + '/VisualEditor/modules/ve2/ui/styles/';
} else {
return ve.ui.stylesheetPath;
}
};