Plug new vector icons / styles into inspector iframe.

Change-Id: Ibd5227de6b74c51f31093e64a4404d5830e84a4e
This commit is contained in:
Rob Moen 2012-09-05 17:15:20 -07:00
parent 1df15237fb
commit 3331b16b3f
3 changed files with 55 additions and 3 deletions

View file

@ -0,0 +1,19 @@
.ve-ui-inspector-clearButton {
/* @embed */
background-image: url(images/icons/clear.png);
}
.ve-ui-linkInspector-location {
/* @embed */
background-image: url(images/icons/down.png);
}
.ve-ui-inspector-closeButton {
/* @embed */
background-image: url(images/icons/close.png);
}
.ve-ui-inspector-acceptButton {
/* @embed */
background-image: url(images/icons/accept.png);
}

View file

@ -0,0 +1,19 @@
.ve-ui-inspector-clearButton {
/* @embed */
background-image: url(images/icons/clear.svg);
}
.ve-ui-linkInspector-location {
/* @embed */
background-image: url(images/icons/down.svg);
}
.ve-ui-inspector-closeButton {
/* @embed */
background-image: url(images/icons/close.svg);
}
.ve-ui-inspector-acceptButton {
/* @embed */
background-image: url(images/icons/accept.svg);
}

View file

@ -54,7 +54,8 @@ ve.ui.Context = function ( surfaceView, $overlay ) {
/* Methods */
ve.ui.Context.prototype.setupInspectorSpace = function () {
var $styleLink;
var $styleLink,
$iconLink;
// Inspector container
this.$inspectors = $( '<div class="ve-ui-context-inspectors"></div>' );
@ -87,9 +88,22 @@ ve.ui.Context.prototype.setupInspectorSpace = function () {
'media': 'screen',
'href': ve.init.platform.getModulesUrl() + '/ve/ui/styles/ve.ui.Inspector.css'
} );
// Create vector or raster icon style element.
$iconLink =
$( '<link>', this.inspectorDoc )
.attr( {
'rel': 'stylesheet',
'type': 'text/css',
'media': 'screen',
'href': ve.init.platform.getModulesUrl() +
( window.devicePixelRatio > 1 ? '/ve/ui/styles/ve.ui.Icons-vector.css' :
'/ve/ui/styles/ve.ui.Icons-raster.css' )
} );
// Append style element to head.
$( this.inspectorDoc ).find( 'head' ).append( $styleLink );
// Append style elements to head.
$( this.inspectorDoc ).find( 'head' )
.append( $styleLink )
.append( $iconLink );
// Set iframe body styles.
$( 'body', this.inspectorDoc ).css( {