reverted rev 3898 - which was accidental commit - sorry for that :(
authortolleiv <tolleiv@743128fe-103e-dd11-99c4-001b210b3e58>
Thu, 20 Jan 2011 14:14:49 +0000 (14:14 +0000)
committertolleiv <tolleiv@743128fe-103e-dd11-99c4-001b210b3e58>
Thu, 20 Jan 2011 14:14:49 +0000 (14:14 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/CoreProjects/workspaces/workspaces/trunk@3899 743128fe-103e-dd11-99c4-001b210b3e58

typo3/sysext/workspaces/Classes/Controller/PreviewController.php
typo3/sysext/workspaces/Resources/Private/Language/locallang.xml
typo3/sysext/workspaces/Resources/Private/Layouts/popup.html
typo3/sysext/workspaces/Resources/Private/Templates/Preview/Preview.html
typo3/sysext/workspaces/Resources/Public/JavaScript/preview.js
typo3/sysext/workspaces/Resources/Public/StyleSheet/preview.css
typo3/sysext/workspaces/ext_emconf.php

index 4901b12..335db1f 100644 (file)
@@ -108,7 +108,10 @@ class Tx_Workspaces_Controller_PreviewController extends Tx_Workspaces_Controlle
                        livePreview: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.livePreview', true) . "',
                        livePreviewDetail: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.livePreviewDetail', true) . "',
                        workspacePreview: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.workspacePreview', true) . "',
-                       workspacePreviewDetail: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.workspacePreviewDetail', true) . "'
+                       workspacePreviewDetail: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.workspacePreviewDetail', true) . "',
+                       modeSlider: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.modeSlider', true) . "',
+                       modeVbox: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.modeVbox', true) . "',
+                       modeHbox: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.modeHbox', true) . "'
                };\n");
        }
 
index 9675803..818b087 100644 (file)
@@ -77,6 +77,9 @@
                        <label index="preview.livePreviewDetail">Click this element to hide the workspace version and see the live version of the page.</label>
                        <label index="preview.workspacePreview">Workspace</label>
                        <label index="preview.workspacePreviewDetail">Click this element to hide the live version and see the workspace version of the page.</label>
+                       <label index="preview.modeSlider">Slider</label>
+                       <label index="preview.modeVbox">Vertical</label>
+                       <label index="preview.modeHbox">Horizontal</label>
                        <label index="label_doaction_publish">Publish</label>
                        <label index="label_doaction_swap">Swap</label>
                        <label index="label_doaction_discard">Discard</label>
index 3559e16..39a8d2f 100644 (file)
@@ -10,8 +10,6 @@
                        // poor way to avoid that we require any scrollbars within the frames
                var finalHeight = height * 1.1;
                Ext.getCmp('visualPanel').setHeight(finalHeight);
-               Ext.getCmp('liveContainer').setHeight((100-Ext.getCmp('sizeSlider').getValue()/100) * finalHeight);
-               Ext.getCmp('wsContainer').setHeight(finalHeight);
                Ext.getCmp('wsPanel').setHeight(finalHeight);
                Ext.getCmp('livePanel').setHeight(finalHeight);
        }
index 5bfeb22..42623f8 100644 (file)
@@ -1,45 +1,19 @@
 <script type="text/javascript">
+       document.domain =  '{backendDomain}';
 
                // @todo redirect to split module if this is opened standalone
 
-               // having this is very important, otherwise the parent.resize call will fail
-       document.domain = '{backendDomain}';
+               // make sure we're in the workspace preview module 
+       if (typeof parent.resize == 'function') {
+               parent.resize(
+                       Math.max(
+                               Math.max(document.body.scrollHeight, document.documentElement.scrollHeight),
+                               Math.max(document.body.offsetHeight, document.documentElement.offsetHeight),
+                               Math.max(document.body.clientHeight, document.documentElement.clientHeight)
+                       )
+               );
 
-       var asNumber = function(val) {
-               return isNaN(val) ? 0 : parseInt(val, 10);
-       };
-       var TYPO3 = {};
-       TYPO3.ready = function () {
-               // make sure we're in the workspace preview module
-               if (typeof parent.resize == 'function') {
-                               // try to find the height of the document
-                       var docHeight = Math.max(
-                               asNumber(window.innerHeight),
-                               asNumber(document.height),
-                               asNumber(document.body.scrollHeight),
-                               asNumber(document.body.offsetHeight),
-                               asNumber(document.body.clientHeight),
-                               asNumber(document.documentElement.scrollHeight),
-                               asNumber(document.documentElement.offsetHeight),
-                               asNumber(document.documentElement.clientHeight)
-                       );
-                       parent.resize(docHeight);
-                               // remove the ugly red box if we're in the ws-repview frames
-                       var element = document.getElementById('typo3-previewInfo');
-                       element.parentNode.removeChild(element);
-               }
-       };
-               // trigger this after content is loaded, inspired by jQuery
-       if (document.addEventListener && !/opera/.test(navigator.userAgent.toLowerCase())) {
-               document.addEventListener("DOMContentLoaded", TYPO3.ready, false);
-       } else {
-               (function() {
-                       if (document.readyState != "loaded" && document.readyState != "complete") {
-                               setTimeout(arguments.callee, 10);
-                       } else {
-                               TYPO3.ready();
-                       }
-               })();
+               var element = document.getElementById('typo3-previewInfo');
+               element.parentNode.removeChild(element);
        }
-
 </script>
index 5f71dd2..89a336b 100644 (file)
@@ -25,8 +25,6 @@
  ***************************************************************/
 
 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: [{
@@ -37,222 +35,96 @@ Ext.onReady(function() {
                        plugins : [{
                                ptype : 'Ext.ux.plugins.TabStripContainer',
                                id: 'controls',
-                               width: 600,
-                               items: [
-                                               {
-                                                       xtype: 'panel',
-                                                       id: 'slider',
-                                                       width: 460,
-                                                       layout: 'hbox',
-                                                       items: [
-                                                               {
-                                                                       xtype: 'button',
-                                                                       id: 'sizeSliderButtonLive',
-                                                                       cls: 'sliderButton',
-                                                                       text: TYPO3.LLL.Workspaces.livePreview,
-                                                                       tooltip: TYPO3.LLL.Workspaces.livePreviewDetail,
-                                                                       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,
-                                                                       tooltip: TYPO3.LLL.Workspaces.workspacePreviewDetail,
-                                                                       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: TYPO3.LLL.Workspaces.modeSlider,
-                                                                               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: TYPO3.LLL.Workspaces.modeVbox,
-                                                                               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: TYPO3.LLL.Workspaces.modeHbox,
-                                                                               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);
-                                                                               }
-                                                                       }]
-                                                               }
-                                                       }]
-                                               }]
+                               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);
+                                                       }
+                                               }
+                                       }
+                               }]
                        }],
                        items: [{
                                title: TYPO3.LLL.Workspaces.visualPreview,
                                id: 'wsVisual',
                                layout: 'fit',
-                               anchor: '100% 100%',
                                items: [{
-                                       layout: 'absolute',
-                                       anchor: '100% 100%',
+                                       layout: 'fit',
                                        x: 0, y:0,
+                                       anchor: '100% 100%',
+                                       autoScroll: true,
                                        items: [{
-                                                       layout: 'fit',
+                                               layout: 'absolute',
+                                               id: 'visualPanel',
+                                               items: [{
                                                        x: 0, y:0,
                                                        anchor: '100% 100%',
-                                                       autoScroll: true,
-                                                       items: [{
-                                                               layout: 'absolute',
-                                                               id: 'visualPanel',
-                                                               items: [{
-                                                                       x: 0, y:0,
-                                                                       anchor: '100% 100%',
-                                                                       id: 'wsContainer',
-                                                                       layout: 'absolute',
-                                                                       autoScroll: false,
-                                                                       items:[{
-                                                                               xtype: 'iframePanel',
-                                                                               x: 0, y:0,
-                                                                               id: 'wsPanel',
-                                                                               doMask: false,
-                                                                               src: wsUrl,
-                                                                               autoScroll: false
-                                                                       }]
-                                                               },{
-                                                                       x: 0, y:0,
-                                                                       anchor: '100% 0%',
-                                                                       id: 'liveContainer',
-                                                                       layout: 'absolute',
-                                                                       bodyStyle: 'height:0px;border-bottom: 2px solid red;',
-                                                                       autoScroll: false,
-                                                                       items:[{
-                                                                               xtype: 'iframePanel',
-                                                                               x: 0, y:0,
-                                                                               id: 'livePanel',
-                                                                               doMask: false,
-                                                                               src: liveUrl,
-                                                                               autoScroll: false
-                                                                       }]
-                                                               }]
-                                                       }]
-                                               },{
-                                                       layout: 'hbox',
-                                                       hidden: true,
-                                                       x: 0, y:0,
-                                                       anchor: '100% 100%',
-                                                       layoutConfig: {
-                                                               align : 'stretch',
-                                                               pack  : 'start'
-                                                       },
-                                                       id: 'visualPanel-hbox',
-                                                       items: [{
+                                                       id: 'wsContainer',
+                                                       layout: 'absolute',
+                                                       autoScroll: false,
+                                                       items:[{
                                                                xtype: 'iframePanel',
                                                                x: 0, y:0,
-                                                               id: 'wsPanel-hbox',
+                                                               id: 'wsPanel',
                                                                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
+                                                               autoScroll: false
                                                        }]
-                                       },{
-                                                       layout: 'vbox',
-                                                       hidden: true,
+                                               },{
                                                        x: 0, y:0,
-                                                       anchor: '100% 100%',
-                                                       layoutConfig: {
-                                                               align : 'stretch',
-                                                               pack  : 'start'
-                                                       },
-                                                       id: 'visualPanel-vbox',
-                                                       items: [{
+                                                       anchor: '100% 0%',
+                                                       id: 'liveContainer',
+                                                       layout: 'absolute',
+                                                       bodyStyle: 'height:0px;border-bottom: 2px solid red;',
+                                                       autoScroll: false,
+                                                       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',
+                                                               id: 'livePanel',
                                                                doMask: false,
                                                                src: liveUrl,
-                                                               autoScroll: false,
-                                                               flex: 1
+                                                               autoScroll: false
                                                        }]
+                                               }]
                                        }]
                                }]
                        },{
index 52b773d..e9fdb1a 100644 (file)
@@ -103,10 +103,7 @@ ul.x-tab-strip-top {
  * Slider
  */
 #controls {
-       padding-top: 5px;
-}
-#slider {
-       padding-top: 5px;
+       padding-top: 10px;
 }
 
 /* remove default ExtJS border */
@@ -146,48 +143,6 @@ ul.x-tab-strip-top {
        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
  */
index 2fb06af..e9e7c0c 100644 (file)
@@ -26,7 +26,7 @@ $EM_CONF[$_EXTKEY] = array(
        'uploadfolder' => 0,
        'createDirs' => '',
        'modify_tables' => '',
-       'clearCacheOnLoad' => 1,
+       'clearCacheOnLoad' => 0,
        'lockType' => '',
        'author_company' => '',
        'version' => '4.5.0beta4',