Project

General

Profile

Bug #11539 » 11539v2.patch

Tolleiv Nietsch, 2011-01-16 10:43

View differences:

Resources/Public/JavaScript/preview.js (working copy)
***************************************************************/
Ext.onReady(function() {
var iconClsChecked = 't3-icon t3-icon-status t3-icon-status-status t3-icon-status-checked';
var iconClsEmpty = 't3-icon t3-icon-empty t3-icon-empty-empty t3-icon-empty';
var viewport = new Ext.Viewport({
layout: 'border',
items: [{
......
plugins : [{
ptype : 'Ext.ux.plugins.TabStripContainer',
id: 'controls',
width: 400,
items: [{
xtype: 'button',
id: 'sizeSliderButtonLive',
cls: 'sliderButton',
text: TYPO3.LLL.Workspaces.livePreview,
width: 100,
listeners: {
click: {
fn: function () {
Ext.getCmp('sizeSlider').setValue(0);
}
}
}
},
{
xtype: 'slider',
id: 'sizeSlider',
margins: '0 10 0 10',
maxValue: 100,
minValue: 0,
value: 100,
flex: 1,
listeners: {
change: {
fn: function resizeFromValue(slider, newValue, thumb) {
var height = Ext.getCmp('wsPanel').getHeight();
Ext.getCmp('liveContainer').setHeight(height * (100 - newValue) / 100);
Ext.getCmp('visualPanel').setHeight(height);
}
}
}
},
{
xtype: 'button',
id: 'sizeSliderButtonWorkspace',
cls: 'sliderButton',
text: TYPO3.LLL.Workspaces.workspacePreview,
width: 100,
listeners: {
click: {
fn: function () {
Ext.getCmp('sizeSlider').setValue(100);
}
}
}
}]
width: 600,
items: [
{
xtype: 'panel',
id: 'slider',
width: 460,
layout: 'hbox',
items: [
{
xtype: 'button',
id: 'sizeSliderButtonLive',
cls: 'sliderButton',
text: TYPO3.LLL.Workspaces.livePreview,
width: 100,
listeners: {
click: {
fn: function () {
Ext.getCmp('sizeSlider').setValue(0);
}
}
}
},
{
xtype: 'slider',
id: 'sizeSlider',
margins: '0 10 0 10',
maxValue: 100,
minValue: 0,
value: 100,
width: 200,
flex: 1,
listeners: {
change: {
fn: function resizeFromValue(slider, newValue, thumb) {
var height = Ext.getCmp('wsPanel').getHeight();
Ext.getCmp('liveContainer').setHeight(height * (100 - newValue) / 100);
Ext.getCmp('visualPanel').setHeight(height);
}
}
}
},
{
xtype: 'button',
id: 'sizeSliderButtonWorkspace',
cls: 'sliderButton',
text: TYPO3.LLL.Workspaces.workspacePreview,
width: 100,
listeners: {
click: {
fn: function () {
Ext.getCmp('sizeSlider').setValue(100);
}
}
}
}
]
},
{
xtype: 'toolbar',
id: 'visual-mode-toolbar',
items: [
'->',{
iconCls: 'x-btn-icon t3-icon t3-icon-actions t3-icon-actions-system t3-icon-system-options-view',
id: 'visual-mode-options',
menu: {
id: 'visual-mode-selector',
items: [{
text: 'Slider',
id: 'visual-mode-selector-slider',
iconCls: iconClsChecked,
handler: function(){
Ext.getCmp('visualPanel-hbox').hide();
Ext.getCmp('visualPanel-vbox').hide();
Ext.getCmp('visualPanel').show();
Ext.getCmp('slider').show();
Ext.select('#visual-mode-selector ul li a img.t3-icon-status-checked').removeClass(iconClsChecked.split(" "))
Ext.getCmp('visual-mode-selector-slider').setIconClass(iconClsChecked);
Ext.getCmp('visual-mode-selector-hbox').setIconClass(iconClsEmpty);
Ext.getCmp('visual-mode-selector-vbox').setIconClass(iconClsEmpty);
}
},{
text: 'Vertical',
id: 'visual-mode-selector-vbox',
iconCls: iconClsEmpty,
handler: function() {
Ext.getCmp('visualPanel-hbox').hide();
Ext.getCmp('visualPanel-vbox').show();
Ext.getCmp('visualPanel').hide();
Ext.getCmp('slider').hide();
Ext.select('#visual-mode-selector ul li a img.t3-icon-status-checked').removeClass(iconClsChecked.split(" "))
Ext.getCmp('visual-mode-selector-slider').setIconClass(iconClsEmpty);
Ext.getCmp('visual-mode-selector-vbox').setIconClass(iconClsChecked)
Ext.getCmp('visual-mode-selector-hbox').setIconClass(iconClsEmpty);
}
},{
text: 'Horizontal',
id: 'visual-mode-selector-hbox',
iconCls: iconClsEmpty,
handler: function(){
Ext.getCmp('visualPanel-hbox').show();
Ext.getCmp('visualPanel-vbox').hide();
Ext.getCmp('visualPanel').hide();
Ext.getCmp('slider').hide();
Ext.select('#visual-mode-selector ul li a img.t3-icon-status-checked').removeClass(iconClsChecked.split(" "))
Ext.getCmp('visual-mode-selector-slider').setIconClass(iconClsEmpty);
Ext.getCmp('visual-mode-selector-vbox').setIconClass(iconClsEmpty);
Ext.getCmp('visual-mode-selector-hbox').setIconClass(iconClsChecked);
}
}]
}
}]
}]
}],
items: [{
title: TYPO3.LLL.Workspaces.visualPreview,
id: 'wsVisual',
layout: 'fit',
anchor: '100% 100%',
items: [{
layout: 'fit',
layout: 'absolute',
anchor: '100% 100%',
x: 0, y:0,
anchor: '100% 100%',
autoScroll: true,
items: [{
layout: 'absolute',
anchor: '100% 100%',
id: 'visualPanel',
hidden: false,
items: [{
x: 0, y:0,
anchor: '100% 100%',
......
autoScroll: false
}]
}]
},{
layout: 'hbox',
hidden: true,
x: 0, y:0,
anchor: '100% 100%',
layoutConfig: {
align : 'stretch',
pack : 'start'
},
id: 'visualPanel-hbox',
items: [{
xtype: 'iframePanel',
x: 0, y:0,
id: 'wsPanel-hbox',
doMask: false,
src: wsUrl,
autoScroll: false,
flex: 1
},{
xtype: 'iframePanel',
x: 0, y:0,
id: 'livePanel-hbox',
doMask: false,
src: liveUrl,
autoScroll: false,
flex: 1
}]
},{
layout: 'vbox',
hidden: true,
x: 0, y:0,
anchor: '100% 100%',
layoutConfig: {
align : 'stretch',
pack : 'start'
},
id: 'visualPanel-vbox',
items: [{
xtype: 'iframePanel',
x: 0, y:0,
id: 'wsPanel-vbox',
doMask: false,
src: wsUrl,
autoScroll: false,
flex: 1
},{
xtype: 'iframePanel',
x: 0, y:0,
id: 'livePanel-vbox',
doMask: false,
src: liveUrl,
autoScroll: false,
flex: 1
}]
}]
}]
},{
Resources/Public/StyleSheet/preview.css (working copy)
* Slider
*/
#controls {
padding-top: 10px;
padding-top: 5px;
}
#slider {
padding-top: 5px;
}
/* remove default ExtJS border */
.x-panel-body {
......
text-align: left;
}
#visual-mode-selector {
list-style: none;
background-color: #f9f9f9;
border: 1px solid #abb2bc;
border-top: none;
}
#visual-mode-selector td {
text-align: left;
}
#visual-mode-selector td button {
font-size: 11px;
line-height: 12px;
text-decoration: none;
}
#visual-mode-options {
display: block;
height: 20px;
margin: 5px 0 0 0;
}
#visual-mode-options.x-btn-menu-active {
background-color: #f9f9f9;
border: 1px solid #abb2bc;
border-bottom: none;
}
#visual-mode-options .x-btn-arrow {
padding-right: 2px;
}
#visual-mode-options .x-btn-text {
font-size: 11px;
}
#visual-mode-options.x-btn-menu-active .x-btn-text {
color: black;
}
#visual-mode-toolbar {
border:none;
}
/**
* Preview panel
*/
(4-4/9)