Index: Classes/Controller/PreviewController.php =================================================================== --- Classes/Controller/PreviewController.php (revision 3345) +++ Classes/Controller/PreviewController.php (working copy) @@ -72,6 +72,7 @@ * @return void */ public function indexAction() { + // @todo language doesn't always come throught the L parameter // @todo Evaluate how the intval() call can be used with Extbase validators/filters $language = intval(t3lib_div::_GP('L')); @@ -102,6 +103,13 @@ $this->view->assign('wsUrl', $wsBaseUrl . '&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=' . $GLOBALS['BE_USER']->workspace); $this->view->assign('wsSettingsUrl', $wsSettingsUrl); $this->view->assign('wsHelpUrl', $wsHelpUrl); + $this->view->assign('backendDomain', t3lib_div::getIndpEnv('TYPO3_HOST_ONLY')); + $GLOBALS['BE_USER']->setAndSaveSessionData('workspaces.backend_domain', t3lib_div::getIndpEnv('TYPO3_HOST_ONLY')); + $this->pageRenderer->addJsInlineCode("workspaces.preview.lll" , "TYPO3.LLL.Workspaces = { + visualPreview: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.visualPreview', true) . "', + listView: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.listView', true) . "', + helpView: '" . $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:preview.helpView', true) . "' + };\n"); } /** Index: Classes/Service/Fehooks.php =================================================================== --- Classes/Service/Fehooks.php (revision 0) +++ Classes/Service/Fehooks.php (revision 0) @@ -0,0 +1,55 @@ +fePreview != 2) { + return; + } + + echo $GLOBALS['TSFE']->cObj->cObjGetSingle( + 'FLUIDTEMPLATE', + array( + 'file' => 'EXT:workspaces/Resources/Private/Templates/Preview/Preview.html', + 'variables.' => array( + 'backendDomain' => 'TEXT', + 'backendDomain.' => array('value' => $GLOBALS['BE_USER']->getSessionData('workspaces.backend_domain')) + ) + ) + ); + } +} \ No newline at end of file Index: ext_localconf.php =================================================================== --- ext_localconf.php (revision 3345) +++ ext_localconf.php (working copy) @@ -18,4 +18,6 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['workspaces'] = 'EXT:workspaces/Classes/Service/Tcemain.php:tx_Workspaces_Service_Tcemain'; $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass']['workspaces'] = 'EXT:workspaces/Classes/Service/Tcemain.php:tx_Workspaces_Service_Befunc'; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['workspaces'] = 'EXT:workspaces/Classes/Service/Fehooks.php:tx_Workspaces_Service_Fehooks->hook_eofe'; + ?> \ No newline at end of file Index: Resources/Private/Language/locallang.xml =================================================================== --- Resources/Private/Language/locallang.xml (revision 3345) +++ Resources/Private/Language/locallang.xml (working copy) @@ -71,6 +71,9 @@ + + + \ No newline at end of file Index: Resources/Private/Layouts/popup.html =================================================================== --- Resources/Private/Layouts/popup.html (revision 3345) +++ Resources/Private/Layouts/popup.html (working copy) @@ -5,4 +5,13 @@ var wsUrl = '{wsUrl}'; var wsSettingsUrl = '{wsSettingsUrl}'; var wsHelpUrl = '{wsHelpUrl}'; + document.domain = '{backendDomain}'; + + function resize(height) { + // poor way to avoid that we require any scrollbars within the frames + var finalHeight = height * 1.1; + Ext.getCmp('visualPanel').setHeight(finalHeight); + Ext.getCmp('wsPanel').setHeight(finalHeight); + Ext.getCmp('livePanel').setHeight(finalHeight); + } Index: Resources/Private/Templates/Preview/Preview.html =================================================================== --- Resources/Private/Templates/Preview/Preview.html (revision 0) +++ Resources/Private/Templates/Preview/Preview.html (revision 0) @@ -0,0 +1,6 @@ + \ No newline at end of file Index: Resources/Public/JavaScript/preview.js =================================================================== --- Resources/Public/JavaScript/preview.js (revision 3345) +++ Resources/Public/JavaScript/preview.js (working copy) @@ -27,55 +27,97 @@ Ext.onReady(function() { var viewport = new Ext.Viewport({ layout: 'border', - items: [ - { + items: [{ xtype: 'tabpanel', region: 'center', // a center region is ALWAYS required for border layout id: 'preview', activeTab: 0, - items: [ - { - title: 'Workspace preview', - id: 'workspaceRegion', + items: [{ + title: TYPO3.LLL.Workspaces.visualPreview, + layout: 'fit', + items: [{ layout: 'fit', + x: 0, y:0, + anchor: '100% 100%', + autoScroll: true, items: [{ - xtype: 'iframePanel', - id: 'wsPanel', - doMask: false, - src: wsUrl + 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', + autoScroll: false, + items:[{ + xtype: 'iframePanel', + x: 0, y:0, + id: 'livePanel', + doMask: false, + src: liveUrl, + autoScroll: false + }] + }] }] - }, { - title: 'Live site', - id: 'liveRegion', - layout: 'fit', - items: [{ - xtype: 'iframePanel', - id: 'livePanel', - doMask: false, - src: liveUrl - }] - },{ - title: 'List view', - id: 'wsSettings', - layout: 'fit', - items: [{ - xtype: 'iframePanel', - id: 'settingsPanel', - doMask: false, - src: wsSettingsUrl - }] - },{ - title: 'Help', - id: 'wsHelp', - layout: 'fit', - items: [{ - xtype: 'iframePanel', - id: 'settingsPanel', - doMask: false, - src: wsHelpUrl - }] - } - ] + }] + },{ + title: TYPO3.LLL.Workspaces.listView, + id: 'wsSettings', + layout: 'fit', + items: [{ + xtype: 'iframePanel', + id: 'settingsPanel', + doMask: false, + src: wsSettingsUrl + }] + },{ + title: TYPO3.LLL.Workspaces.helpView, + id: 'wsHelp', + layout: 'fit', + items: [{ + xtype: 'iframePanel', + id: 'settingsPanel', + doMask: false, + src: wsHelpUrl + }] + }], + tbar:[{ + xtype: 'tbfill' + }, + '-', + { + xtype: 'slider', + id: 'sizeSlider', + style: 'margin: 0 5px;', + maxValue: 100, + minValue: 0, + value: 0, + width: 200, + listeners: { + change: { + fn: function resizeFromValue(slider, newValue, thumb) { + var height = Ext.getCmp('wsPanel').getHeight(); + Ext.getCmp('liveContainer').setHeight(height * newValue/100); + Ext.getCmp('visualPanel').setHeight(height); + } + } + } + }] }] }); }); \ No newline at end of file