[TASK] Move js files to EXT: backend 44/20644/3
authorFelix Kopp <felix-source@phorax.com>
Wed, 8 May 2013 16:32:26 +0000 (18:32 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 18 May 2013 17:20:10 +0000 (19:20 +0200)
The global js/ directory should be resolved. Moves several files
to EXT: backend that are only used in EXT: backend classes.

Change-Id: I79c80f60699750a5aff46ac554cb8d92c8a37236
Resolves: #48063
Releases: 6.2
Reviewed-on: https://review.typo3.org/20644
Reviewed-by: Thomas Maroschik
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
27 files changed:
typo3/js/backend.js [deleted file]
typo3/js/backendsearch.js [deleted file]
typo3/js/clearcachemenu.js [deleted file]
typo3/js/common.js [deleted file]
typo3/js/iecompatibility.js [deleted file]
typo3/js/livesearch.js [deleted file]
typo3/js/modulemenu.js [deleted file]
typo3/js/pagetreefiltermenu.js [deleted file]
typo3/js/shortcutmenu.js [deleted file]
typo3/js/tabmenu.js [deleted file]
typo3/js/toolbarmanager.js [deleted file]
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Controller/PageTreeNavigationController.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Toolbar/ClearCacheToolbarItem.php
typo3/sysext/backend/Classes/Toolbar/LiveSearchToolbarItem.php
typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php
typo3/sysext/backend/Resources/Public/JavaScript/backend.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/clearcachemenu.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/common.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/iecompatibility.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/livesearch.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/modulemenu.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/pagetreefiltermenu.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/shortcutmenu.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/tabmenu.js [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/toolbarmanager.js [new file with mode: 0644]

diff --git a/typo3/js/backend.js b/typo3/js/backend.js
deleted file mode 100644 (file)
index 96ea324..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2007-2011 Ingo Renner <ingo@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * general backend javascript functions
- */
-
-Ext.ns('TYPO3.configuration');
-
-/**
- * jump the backend to a module
- */
-function jump(url, modName, mainModName, pageId) {
-       if (isNaN(pageId)) {
-               pageId = -2;
-       }
-               // clear information about which entry in nav. tree that might have been highlighted.
-       top.fsMod.navFrameHighlightedID = [];
-       top.fsMod.recentIds['web'] = pageId;
-
-       if (top.TYPO3.Backend.NavigationContainer.PageTree) {
-               top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree();
-       }
-
-       top.nextLoadModuleUrl = url;
-       top.TYPO3.ModuleMenu.App.showModule(modName);
-
-}
-
-/**
- * shortcut manager to delegate the action of creating shortcuts to the new
- * backend.php shortcut menu or the old shortcut frame depending on what is available
- */
-var ShortcutManager = {
-
-       /**
-        * central entry point to create a shortcut, delegates the call to correct endpoint
-        */
-       createShortcut: function(confirmQuestion, backPath, moduleName, url) {
-               if(confirm(confirmQuestion)) {
-                       if (typeof TYPO3BackendShortcutMenu !== undefined) {
-                                       // backend.php
-                               TYPO3BackendShortcutMenu.createShortcut('', moduleName, url);
-                       }
-               }
-       }
-}
-
-
-/**
- * Function similar to PHPs  rawurlencode();
- */
-function rawurlencode(str) {
-       var output = escape(str);
-       output = str_replace("*","%2A", output);
-       output = str_replace("+","%2B", output);
-       output = str_replace("/","%2F", output);
-       output = str_replace("@","%40", output);
-       return output;
-}
-
-/**
- * Function to similar to PHPs  rawurlencode() which removes TYPO3_SITE_URL;
- */
-function rawurlencodeAndRemoveSiteUrl(str)     {       //
-       var siteUrl = TYPO3.configuration.siteUrl;
-       return rawurlencode(str_replace(siteUrl, "", str));
-}
-
-/**
- * String-replace function
- */
-function str_replace(match,replace,string)     {       //
-       var input = ""+string;
-       var matchStr = ""+match;
-       if (!matchStr)  {return string;}
-       var output = "";
-       var pointer=0;
-       var pos = input.indexOf(matchStr);
-       while (pos !== -1) {
-               output+=""+input.substr(pointer, pos-pointer)+replace;
-               pointer=pos+matchStr.length;
-               pos = input.indexOf(match,pos+1);
-       }
-       output+=""+input.substr(pointer);
-       return output;
-}
-
-
-
-/**
- * Launcing information window for records/files (fileref as "table" argument)
- */
-function launchView(table,uid,bP)      {       //
-       var backPath= bP ? bP : "";
-       var thePreviewWindow="";
-       thePreviewWindow = window.open(TS.PATH_typo3+"show_item.php?table="+encodeURIComponent(table)+"&uid="+encodeURIComponent(uid),"ShowItem"+TS.uniqueID,"width=550,height=600,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
-       if (thePreviewWindow && thePreviewWindow.focus) {
-               thePreviewWindow.focus();
-       }
-}
-
-/**
- * Opens plain window with url
- */
-function openUrlInWindow(url,windowName)       {       //
-       regularWindow = window.open(
-               url,
-               windowName,
-               "status=1,menubar=1,resizable=1,location=1,directories=0,scrollbars=1,toolbar=1");
-       regularWindow.focus();
-       return false;
-}
-
-/**
- * Loads a page id for editing in the page edit module:
- */
-function loadEditId(id,addGetVars)     {       //
-       top.fsMod.recentIds.web = id;
-       top.fsMod.navFrameHighlightedID.web = "pages" + id + "_0";              // For highlighting
-
-       if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
-               top.content.nav_frame.refresh_nav();
-       }
-       if (TYPO3.configuration.pageModule) {
-               top.goToModule(TYPO3.configuration.pageModule, 0, addGetVars?addGetVars:"");
-       }
-}
-
-/**
- * Returns incoming URL (to a module) unless nextLoadModuleUrl is set. If that is the case nextLoadModuleUrl is returned (and cleared)
- * Used by the shortcut frame to set a "intermediate URL"
- */
-var nextLoadModuleUrl="";
-function getModuleUrl(inUrl)   {       //
-       var nMU;
-       if (top.nextLoadModuleUrl) {
-               nMU=top.nextLoadModuleUrl;
-               top.nextLoadModuleUrl="";
-               return nMU;
-       } else {
-               return inUrl;
-       }
-}
-
-/**
- * Print properties of an object
- */
-function debugObj(obj,name)    {       //
-       var acc;
-       for (var i in obj) {
-               if (obj[i]) {
-                       acc+=i+":  "+obj[i]+"\n";
-               }
-       }
-       alert("Object: "+name+"\n\n"+acc);
-}
-
-
-
-       // Used by Frameset Modules
-var condensedMode = TYPO3.configuration.condensedMode;
-var currentSubScript = "";
-var currentSubNavScript = "";
-
-       // Used for tab-panels:
-var DTM_currentTabs = [];
-
-       // status of WS FE preview
-var WorkspaceFrontendPreviewEnabled = TYPO3.configuration.workspaceFrontendPreviewEnabled;
diff --git a/typo3/js/backendsearch.js b/typo3/js/backendsearch.js
deleted file mode 100644 (file)
index aef8331..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2007-2011 Ingo Renner <ingo@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * class to handle the backend search
- */
-var BackendSearch = Class.create({
-
-       /**
-        * registers for resize event listener and executes on DOM ready
-        */
-       initialize: function() {
-               Ext.onReady(function() {
-                       Event.observe(
-                               window, 'resize',
-                               function() { TYPO3BackendToolbarManager.positionMenu('backend-search-menu'); }
-                       );
-                       TYPO3BackendToolbarManager.positionMenu('backend-search-menu');
-                       this.toolbarItemIcon = $$('#backend-search-menu .toolbar-item span.t3-icon')[0];
-
-                       $('search-query').observe('keypress', function(event) {
-                               var keyCode;
-
-                               if (!event) {
-                                       var event = window.event;
-                               }
-
-                               if (event.keyCode) {
-                                       keyCode = event.keyCode;
-                               } else if (event.which) {
-                                       keyCode = event.which;
-                               }
-
-                               if (keyCode === Event.KEY_RETURN) {
-                                       TYPO3BackendSearchMenu.invokeSearch();
-                               }
-                       });
-
-                       $$('#backend-search-menu .toolbar-item')[0].observe('click', this.toggleMenu)
-               }.bindAsEventListener(this));
-       },
-
-
-       /**
-        * toggles the visibility of the menu and places it under the toolbar icon
-        */
-       toggleMenu: function(event) {
-               var toolbarItem = $$('#backend-search-menu > a')[0];
-               var menu        = $$('#backend-search-menu .toolbar-item-menu')[0];
-               toolbarItem.blur();
-
-               if (!toolbarItem.hasClassName('toolbar-item-active')) {
-                       toolbarItem.addClassName('toolbar-item-active');
-                       Effect.Appear(menu, {duration: 0.2});
-                       TYPO3BackendToolbarManager.hideOthers(toolbarItem);
-
-                       setTimeout(function() {
-                               $('search-query').activate();
-                       }, 200);
-               } else {
-                       toolbarItem.removeClassName('toolbar-item-active');
-                       Effect.Fade(menu, {duration: 0.1});
-
-                       setTimeout(function() {
-                               $('search-query').clear();
-                       }, 100);
-               }
-
-               if (event) {
-                       Event.stop(event);
-               }
-       },
-
-       /**
-        * calls the actual clear cache URL using an asynchronious HTTP request
-        */
-       invokeSearch: function() {
-               new Ajax.Request('alt_shortcut.php?ajax=1&editPage=' + top.rawurlencodeAndRemoveSiteUrl($F('search-query')), {
-                       method: 'get',
-                       requestHeaders: {Accept: 'application/json'},
-                       onSuccess: function(transport) {
-                               var jsonResponse = transport.responseText.evalJSON(true);
-
-                               switch(jsonResponse.type) {
-                                       case 'page':
-                                               top.loadEditId(jsonResponse.editRecord);
-                                               break;
-                                       case 'alternative':
-                                               this.jump(
-                                                       unescape('alt_doc.php?returnUrl=dummy.php&edit[' + jsonResponse.alternativeTable + '][' + jsonResponse.alternativeUid + ']=edit'),
-                                                       'web_list',
-                                                       'web'
-                                               );
-                                               break;
-                                       case 'search':
-                                               this.jump(
-                                                       unescape(TYPO3.configuration.listModulePath + 'db_list.php?id=' + jsonResponse.firstMountPoint + '&search_field=' + jsonResponse.searchFor + '&search_levels=' + (jsonResponse.firstMountPoint > 0 ? '4' : '-1')),
-                                                       'web_list',
-                                                       'web'
-                                               );
-                                               break;
-                               }
-                       }.bind(this)
-               });
-
-               $('search-query').clear();
-               this.toggleMenu();
-       },
-
-       /**
-        * jumps to a given URL in the content iframe, taken from alt_shortcut.php
-        *
-        * @param       string          the URL to jump to
-        * @param       string          module name
-        * @param       string          main module name
-        */
-       jump: function(url, modName, mainModName) {
-                       // Clear information about which entry in nav. tree that might have been highlighted.
-               top.fsMod.navFrameHighlightedID = new Array();
-               if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
-                       top.content.nav_frame.refresh_nav();
-               }
-
-               top.nextLoadModuleUrl = url;
-               top.goToModule(modName);
-       }
-
-});
-
-var TYPO3BackendSearchMenu = new BackendSearch();
diff --git a/typo3/js/clearcachemenu.js b/typo3/js/clearcachemenu.js
deleted file mode 100644 (file)
index 5b12d4d..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2007-2011 Ingo Renner <ingo@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * class to handle the clear cache menu
- */
-var ClearCacheMenu = Class.create({
-
-       /**
-        * registers for resize event listener and executes on DOM ready
-        */
-       initialize: function() {
-
-               Ext.onReady(function() {
-                       var self = this;
-                       Event.observe(
-                               window, 'resize',
-                               function() { TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu'); }
-                       );
-                       TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu');
-                       this.toolbarItemIcon = $$('#clear-cache-actions-menu .toolbar-item span.t3-icon')[0];
-
-                       Event.observe('clear-cache-actions-menu', 'click', this.toggleMenu);
-
-                               // observe all clicks on clear cache actions in the menu
-                       $$('#clear-cache-actions-menu li a').each(function(element) {
-                               $(element).onclick = function(event) {
-                                       event = event || window.event;
-                                       self.clearCache.call(self, event);
-                                       return false;
-                               };
-                       });
-               }, this);
-       },
-
-       /**
-        * toggles the visibility of the menu and places it under the toolbar icon
-        */
-       toggleMenu: function(event) {
-               var toolbarItem = $$('#clear-cache-actions-menu > a')[0];
-               var menu        = $$('#clear-cache-actions-menu .toolbar-item-menu')[0];
-               toolbarItem.blur();
-
-               if (!toolbarItem.hasClassName('toolbar-item-active')) {
-                       toolbarItem.addClassName('toolbar-item-active');
-                       Effect.Appear(menu, {duration: 0.2});
-                       TYPO3BackendToolbarManager.hideOthers(toolbarItem);
-               } else {
-                       toolbarItem.removeClassName('toolbar-item-active');
-                       Effect.Fade(menu, {duration: 0.1});
-               }
-
-               if (event) {
-                       Event.stop(event);
-               }
-       },
-
-       /**
-        * calls the actual clear cache URL using an asynchronious HTTP request
-        *
-        * @param       Event   prototype event object
-        */
-       clearCache: function(event) {
-               var toolbarItemIcon = $$('#clear-cache-actions-menu .toolbar-item span.t3-icon')[0];
-               var url             = '';
-               var clickedElement  = Event.element(event);
-
-                       // activate the spinner
-               var parent = Element.up(toolbarItemIcon);
-               var spinner = new Element('span').addClassName('spinner');
-               var oldIcon = toolbarItemIcon.replace(spinner);
-
-               if (clickedElement.tagName === 'SPAN') {
-                       link =  clickedElement.up('a');
-               } else {
-                       link =  clickedElement;
-               }
-
-               if (link.href) {
-                       var call = new Ajax.Request(link.href, {
-                               'method': 'get',
-                               'onComplete': function(result) {
-                                       spinner.replace(oldIcon);
-                               }.bind(this)
-                       });
-               }
-
-               this.toggleMenu(event);
-       }
-});
-
-var TYPO3BackendClearCacheMenu = new ClearCacheMenu();
diff --git a/typo3/js/common.js b/typo3/js/common.js
deleted file mode 100644 (file)
index 428a91a..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/***************************************************************
-*
-*  javascript functions regarding the TYPO3 wrapper
-*  for the javascript library "prototype".
-*
-*  Copyright notice
-*
-*  (c) 2008-2011 Benjamin Mack <benni@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 backend provided by
-*  Kasper Skaarhoj <kasper@typo3.com> together with TYPO3
-*
-*  Released under GNU/GPL (see license file in /typo3/)
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-*
-*  This copyright notice MUST APPEAR in all copies of this script
-*
-***************************************************************/
-
-// Please make sure that prototype.js is loaded before loading this
-// file in your script, the responder is only added if prototype was loaded
-
-if (Prototype) {
-       // adding generic a responder to use when a AJAX request is done
-       Ajax.Responders.register({
-               onCreate: function(request, transport) {
-
-                       // if the TYPO3 AJAX backend is used,
-                       // the onSuccess & onComplete callbacks are hooked
-                       if (request.url.indexOf("ajax.php") === -1) {
-                               return;
-                       }
-
-                       var origSuccess = request.options.onSuccess, origComplete = request.options.onComplete;
-
-                       // hooking "onSuccess"
-                       if (origSuccess) {
-                               request.options.onSuccess = function(xhr, json) {
-                                       if (!json) {
-                                               T3AJAX.showError(xhr);
-                                       } else {
-                                               origSuccess(xhr, json);
-                                       }
-                               }
-                       }
-
-                       // hooking "onComplete", using T3Error handler if available
-                       if (origComplete) {
-                               request.options.onComplete = function(xhr, json) {
-                                       if (!json && request.options.onT3Error) {
-                                               request.options.onT3Error(xhr, json);
-                                       } else if (!json) {
-                                               T3AJAX.showError(xhr);
-                                       } else {
-                                               origComplete(xhr, json);
-                                       }
-                               };
-                       }
-               }
-       });
-}
-
-var T3AJAX = {};
-T3AJAX.showError = function(xhr, json) {
-       if (typeof xhr.responseText !== undefined && xhr.responseText) {
-               if (typeof Ext.MessageBox !== undefined) {
-                       Ext.MessageBox.alert('TYPO3', xhr.responseText);
-               }
-               else {
-                       alert(xhr.responseText);
-               }
-       }
-};
-
-// common storage and global object, could later hold more information about the current user etc.
-var TYPO3 = TYPO3 || {};
-TYPO3 = Ext.apply(TYPO3, {
-       // store instances that only should be running once
-       _instances: {},
-       getInstance: function(className) {
-               return TYPO3._instances[className] || false;
-       },
-       addInstance: function(className, instance) {
-               TYPO3._instances[className] = instance;
-               return instance;
-       },
-
-       helpers: {
-               // creates an array by splitting a string into parts, taking a delimiter
-               split: function(str, delim) {
-                       var res = [];
-                       while (str.indexOf(delim) > 0) {
-                               res.push(str.substr(0, str.indexOf(delim)));
-                               str = str.substr(str.indexOf(delim) + delim.length);
-                       }
-                       return res;
-               }
-       }
-});
diff --git a/typo3/js/iecompatibility.js b/typo3/js/iecompatibility.js
deleted file mode 100644 (file)
index 5a32c09..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2008-2011 Jeff Segars <jeff@webempoweredchurch.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-
-Element.addMethods({
-       pngHack: function(element) {
-               element = $(element);
-               var transparentGifPath = 'clear.gif';
-
-                       // If there is valid element, it is an image and the image file ends with png:
-               if (Object.isElement(element) && element.tagName === 'IMG' && element.src.endsWith('.png')) {
-                       var alphaImgSrc = element.src;
-                       var sizingMethod = 'scale';
-                       element.src = transparentGifPath;
-               }
-
-               if (alphaImgSrc) {
-                       element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="#{alphaImgSrc}",sizingMethod="#{sizingMethod}")'.interpolate(
-                       {
-                               alphaImgSrc: alphaImgSrc,
-                               sizingMethod: sizingMethod
-                       });
-               }
-
-               return element;
-       }
-});
-
-var IECompatibility = Class.create({
-
-       /**
-        * initializes the compatibility class
-        */
-       initialize: function() {
-               Event.observe(document, 'dom:loaded', function() {
-                       $$('input[type="checkbox"]').invoke('addClassName', 'checkbox');
-               }.bind(this));
-
-               Event.observe(window, 'load', function() {
-                       if (Prototype.Browser.IE) {
-                               var version = parseFloat(navigator.appVersion.split(';')[1].strip().split(' ')[1]);
-                               if (version === 6) {
-                                       $$('img').each(function(img) {
-                                               img.pngHack();
-                                       });
-                                       $$('#typo3-menu li ul li').each(function(li) {
-                                               li.setStyle({height: '21px'});
-                                       });
-                               }
-                       }
-               });
-       }
-});
-
-if (Prototype.Browser.IE) {
-       var TYPO3IECompatibilty = new IECompatibility();
-}
diff --git a/typo3/js/livesearch.js b/typo3/js/livesearch.js
deleted file mode 100644 (file)
index 6d54bf7..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2009-2010 Michael Klapper <michael.klapper@aoemedia.de>
- *  (c) 2010-2011 Jeff Segars <jeff@webempoweredchurch.org>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-Ext.namespace('TYPO3');
-
-TYPO3.BackendLiveSearch = Ext.extend(Ext.form.ComboBox, {
-       autoSelect: false,
-       ctCls: 'live-search-results',
-       dataProvider: null,
-       searchResultsPid : 0,
-       displayField: 'title',
-       emptyText: null,
-       enableKeyEvents: true,
-       helpTitle: null,
-       hideTrigger: true,
-       itemSelector: 'div.search-item-title',
-       listAlign : 'tr-br',
-       listClass: 'live-search-list',
-       listEmptyText: null,
-       listWidth: 315,
-       listHovered: false,
-       loadingText: null,
-       minChars: 1,
-       resizable: false,
-       title: null,
-       width: 205,
-       triggerClass : 'x-form-clear-trigger',
-       triggerConfig: '<span tag="a" class="t3-icon t3-icon-actions t3-icon-actions-input t3-icon-input-clear t3-tceforms-input-clearer">&nbsp;</span>',
-       onTriggerClick: function() {
-               // Empty the form field, give it focus, and collapse the results
-               this.reset(this);
-               this.focus();
-               this.collapse();
-       },
-       tpl: new Ext.XTemplate(
-               '<table border="0" cellspacing="0">',
-                       '<tpl for=".">',
-                               '<tr class="search-item">',
-                                       '<td class="search-item-type" width="105" align="right">{recordTitle}</td>',
-                                       '<td class="search-item-content" width="195">',
-                                               '<div class="search-item-title">{iconHTML} {title}</div>',
-                                       '</td>',
-                               '</tr>',
-                       '</tpl>',
-               '</table>'
-       ),
-
-       dataReader : new Ext.data.JsonReader({
-               idProperty : 'type',
-               root : 'searchItems',
-               fields : [
-                       {name: 'recordTitle'},
-                       {name: 'pageId'},
-                       {name: 'id'},
-                       {name: 'iconHTML'},
-                       {name: 'title'},
-                       {name: 'editLink'}
-               ]
-       }),
-       listeners: {
-               select : {
-                       scope: this,
-                       fn: function (combo, record, index) {
-                               jump(record.data.editLink, 'web_list', 'web', record.data.pageId);
-                       }
-               },
-               focus : {
-                       fn: function() {
-                               if (this.getValue() == this.emptyText) {
-                                       this.reset(this);
-                               }
-                       }
-               },
-               specialkey : function (field, e) {
-                       if (e.getKey() == e.RETURN || e.getKey() == e.ENTER) {
-                               if (this.dataReader.jsonData.pageJump != '') {
-                                       jump(this.dataReader.jsonData.pageJump, 'web_list', 'web');
-                               } else {
-                                       TYPO3.ModuleMenu.App.showModule('web_list', this.getSearchResultsUrl(this.getValue()));
-                               }
-                       }
-               },
-               keyup : function() {
-                       if ((this.getValue() == this.emptyText) || (this.getValue() == '')) {
-                               this.setHideTrigger(true);
-                       } else {
-                               this.setHideTrigger(false);
-                       }
-               }
-       },
-
-       /**
-        * Initializes the component.
-        */
-       initComponent: function() {
-               this.store = new Ext.data.DirectStore({
-                       directFn: this.dataProvider.find,
-                       reader: this.dataReader
-               });
-               TYPO3.BackendLiveSearch.superclass.initComponent.apply(this, arguments);
-       },
-
-       restrictHeight : function(){
-               this.innerList.dom.style.height = '';
-               var inner = this.innerList.dom;
-               var pad = this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight + 30; // @todo Remove hardcoded 30
-               var h = Math.max(inner.clientHeight, inner.offsetHeight, inner.scrollHeight);
-               var ha = this.getPosition()[1]-Ext.getBody().getScroll().top;
-               var hb = Ext.lib.Dom.getViewHeight()-ha-this.getSize().height;
-               var space = Math.max(ha, hb, this.minHeight || 0)-pad-2;
-               /** BUG FIX **/
-               if (this.shadow === true) { space-=this.list.shadow.offset; }
-
-               h = Math.min(h, space, this.maxHeight);
-
-               /**
-                * @internal The calcated height of "h" in the line before seems not working as expected.
-                *                       If i define a min height, the box shold at least use this height also if only one entry is in there
-                */
-               //h = this.maxHeight;
-
-               this.innerList.setHeight(h);
-               this.list.beginUpdate();
-               this.list.setHeight(h+pad);
-               this.list.alignTo(this.el, this.listAlign);
-               this.list.endUpdate();
-       },
-
-       initList : function () {
-               TYPO3.BackendLiveSearch.superclass.initList.apply(this, arguments);
-               var cls = 'x-combo-list';
-
-                       // Track whether the hovering over the results list or not, to aid in detecting iframe clicks.
-               this.mon(this.list, 'mouseover', function() {this.listHovered = true;}, this);
-               this.mon(this.list, 'mouseout', function() {this.listHovered = false; }, this);
-
-               /**
-                * Create bottom Toolbar to the result layer
-                */
-               this.footer = this.list.createChild({cls:cls+'-ft'});
-
-               this.pageTb = new Ext.Toolbar({
-                       renderTo:this.footer,
-                       height: 30,
-                       items: [{
-                               xtype: 'tbfill',
-                               autoWidth : true
-                       },{
-                               xtype: 'button',
-                               text: TYPO3.LLL.liveSearch.showAllResults,
-                               arrowAlign : 'right',
-                               shadow: false,
-                               icon : '../typo3/sysext/t3skin/icons/module_web_list.gif',
-                               listeners : {
-                                       scope : this,
-                                       click : function () {
-                                                       // go to db_list.php and search for given search value
-                                                       // @todo the current selected page ID from the page tree is required, also we need the
-                                                       // values of $GLOBALS['BE_USER']->returnWebmounts() to search only during the allowed pages
-                                               TYPO3.ModuleMenu.App.showModule('web_list', this.getSearchResultsUrl(this.getValue()));
-                                               this.collapse();
-                                       }
-                               }
-                       }]
-               });
-               this.assetHeight += this.footer.getHeight();
-       },
-
-       initQuery : function(){
-               TYPO3.BackendLiveSearch.superclass.initQuery.apply(this, arguments);
-               this.removeHelp();
-       },
-       initHelp : function () {
-               if(!this.helpList){
-                       var cls = 'search-list-help';
-
-                       this.helpList = new Ext.Layer({
-                               parentEl: this.getListParent(),
-                               shadow: this.shadow,
-                               cls: [cls, this.listClass].join(' '),
-                               constrain:false
-                       });
-
-                               // Track whether the hovering over the help list or not, to aid in detecting iframe clicks.
-                       this.mon(this.helpList, 'mouseover', function() {this.listHovered = true;}, this);
-                       this.mon(this.helpList, 'mouseout', function() {this.listHovered = false; }, this);
-
-                       var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth);
-                       this.helpList.setSize(lw);
-                       this.helpList.swallowEvent('mousewheel');
-                       if(this.syncFont !== false){
-                               this.helpList.setStyle('font-size', this.el.getStyle('font-size'));
-                       }
-
-                       this.innerHelpList = this.helpList.createChild({cls:cls+'-inner'});
-                       this.mon(this.innerHelpList, 'mouseover', this.onViewOver, this);
-                       this.mon(this.innerHelpList, 'mousemove', this.onViewMove, this);
-                       this.innerHelpList.setWidth(lw - this.helpList.getFrameWidth('lr'));
-
-                       if(!this.helpTpl){
-                               this.helpTpl = '<tpl for="."><div class="'+cls+'-item">{' + this.displayField + '}</div></tpl>';
-                        }
-
-                       /**
-                       * The {@link Ext.DataView DataView} used to display the ComboBox's options.
-                       * @type Ext.DataView
-                       */
-                       this.helpView = new Ext.DataView({
-                               applyTo: this.innerHelpList,
-                               tpl: this.helpTpl,
-                               singleSelect: true,
-                               selectedClass: this.selectedClass,
-                               itemSelector: this.itemSelector || '.' + cls + '-item',
-                               emptyText: this.listEmptyText
-                       });
-
-                       this.helpList.createChild({
-                               cls: cls + '-content',
-                               // @todo Can we grab this content via ExtDirect?
-                               html: '<strong>' + this.helpTitle + '</strong><p>' + TYPO3.LLL.liveSearch.helpDescription + '<br /> ' + TYPO3.LLL.liveSearch.helpDescriptionPages + '</p>'
-                       });
-
-                       this.helpList.alignTo(this.wrap, this.listAlign);
-                       this.helpList.show();
-               }
-       },
-
-       removeHelp : function() {
-               if (this.helpList) {
-                       this.helpList.destroy();
-                       delete this.helpList;
-               }
-       },
-
-       onFocus : function() {
-               TYPO3.BackendLiveSearch.superclass.onFocus.apply(this, arguments);
-               TYPO3BackendToolbarManager.hideAll();
-
-               // If search is blank, show the help on focus. Otherwise, show last results
-               if (this.getValue() == '') {
-                       this.initHelp();
-               } else {
-                       this.expand();
-               }
-       },
-
-       /**
-        * Fired when search results are clicked. We do not want the search result
-        * appear so we always set doFocus = false
-        */
-       onViewClick : function(doFocus){
-               doFocus = false;
-               TYPO3.BackendLiveSearch.superclass.onViewClick.apply(this, arguments);
-       },
-
-       postBlur : function() {
-               TYPO3.BackendLiveSearch.superclass.postBlur.apply(this, arguments);
-               this.removeHelp();
-       },
-
-       getTriggerWidth : function() {
-               // Trigger is inset, so width used in calculations is 0
-               return 0;
-       },
-
-       reset : function() {
-           this.originalValue = this.emptyText;
-               this.setHideTrigger(true);
-               TYPO3.BackendLiveSearch.superclass.reset.apply(this, arguments);
-       },
-
-       getSearchResultsUrl : function(searchTerm) {
-               return 'id=' + this.searchResultsPid + '&search_levels=4&search_field=' + searchTerm;
-       },
-
-       handleBlur : function(e) {
-
-               if (!this.listHovered) {
-                       this.hasFocus = false;
-                       if (this.getValue() == '') {
-                               this.reset();
-                       }
-                       this.postBlur();
-               }
-
-       }
-});
-
-var TYPO3LiveSearch;
-
-Ext.onReady(function() {
-       TYPO3LiveSearch = new TYPO3.BackendLiveSearch({
-               dataProvider: TYPO3.LiveSearchActions.ExtDirect,
-               title: TYPO3.LLL.liveSearch.title,
-               helpTitle: TYPO3.LLL.liveSearch.helpTitle,
-               emptyText: TYPO3.LLL.liveSearch.emptyText,
-               loadingText: TYPO3.LLL.liveSearch.loadingText,
-               listEmptyText: TYPO3.LLL.liveSearch.listEmptyText,
-               searchResultsPid: TYPO3.configuration.firstWebmountPid
-       });
-
-       TYPO3LiveSearch.applyToMarkup(Ext.get('live-search-box'));
-
-               // Add a blur event listener outside the ExtJS widget to handle clicks in iframes also.
-       Ext.get('live-search-box').on('blur', TYPO3LiveSearch.handleBlur, TYPO3LiveSearch);
-});
diff --git a/typo3/js/modulemenu.js b/typo3/js/modulemenu.js
deleted file mode 100644 (file)
index f0c28fb..0000000
+++ /dev/null
@@ -1,398 +0,0 @@
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2010-2011 Steffen Kamper <steffen@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-
-/**
- * Class to render the module menu and handle the BE navigation
- *
- * @author     Steffen Kamper
- */
-
-
-Ext.ns('TYPO3', 'ModuleMenu');
-
-TYPO3.ModuleMenu = {};
-
-TYPO3.ModuleMenu.Store = new Ext.data.JsonStore({
-       storeId: 'ModuleMenuStore',
-       root: 'root',
-       fields: [
-               {name: 'index', type: 'int', mapping: 'sub.index'},
-               {name: 'key', type: 'string'},
-               {name: 'label', type: 'string'},
-               {name: 'menuState', type: 'int'},
-               {name: 'subitems', type: 'int'},
-               'sub'
-       ],
-       url: 'ajax.php?ajaxID=ModuleMenu::getData',
-       baseParams: {
-               'action': 'getModules'
-       },
-       listeners: {
-               beforeload: function(store) {
-                       this.loaded = false;
-               },
-               load: function(store) {
-                       this.loaded = true;
-               }
-       },
-       // Custom indicator for loaded store:
-       loaded: false,
-       isLoaded: function() {
-               return this.loaded;
-       }
-
-});
-
-TYPO3.ModuleMenu.Template = new Ext.XTemplate(
-               '<div id="typo3-docheader">',
-               '       <div class="typo3-docheader-functions">',
-               '       </div>',
-               '</div>',
-               '<ul id="typo3-menu">',
-               '<tpl for=".">',
-               '       <li class="menuSection" id="{key}">',
-               '               <div class="modgroup {[this.getStateClass(values)]}">{label}</div>',
-               '       <ul {[this.getStateStyle(values)]}>',
-               '       <tpl for="sub">',
-               '       <li id="{name}" class="submodule mod-{name}">',
-               '               <a title="{description}" href="#" class="modlink">',
-               '                       <span class="submodule-icon">',
-               '                               <img width="16" height="16" alt="{label}" title="{label}" src="{icon}" />',
-               '                       </span>',
-               '                       <span>{label}</span>',
-               '               </a>',
-               '       </li>',
-               '       </tpl>',
-               '       </ul>',
-               '       </li>',
-               '</tpl>',
-               '</ul>',
-               {
-                       getStateClass: function(value) {
-                               return value.menuState ? 'collapsed' : 'expanded';
-                       },
-                       getStateStyle: function(value) {
-                               return value.menuState ? 'style="display:none"' : '';
-                       }
-               }
-);
-
-TYPO3.ModuleMenu.App = {
-       loadedModule: null,
-       loadedNavigationComponentId: '',
-       availableNavigationComponents: {},
-
-       init: function() {
-               TYPO3.ModuleMenu.Store.load({
-                       scope: this,
-                       callback: function(records, options) {
-                               this.renderMenu(records);
-                               if (top.startInModule) {
-                                       this.showModule(top.startInModule[0], top.startInModule[1]);
-                               } else {
-                                       this.loadFirstAvailableModule();
-                               }
-                       }
-               });
-       },
-
-       renderMenu: function(records) {
-               TYPO3.Backend.ModuleMenuContainer.removeAll();
-               TYPO3.Backend.ModuleMenuContainer.add({
-                       xtype: 'dataview',
-                       animCollapse: true,
-                       store: TYPO3.ModuleMenu.Store,
-                       tpl: TYPO3.ModuleMenu.Template,
-                       singleSelect: true,
-                       itemSelector: 'li.submodule',
-                       overClass: 'x-view-over',
-                       selectedClass: 'highlighted',
-                       autoHeight: true,
-                       itemId: 'modDataView',
-                       tbar: [{text: 'test'}],
-                       listeners: {
-                               click: function(view, index, node, event) {
-                                       var el = Ext.fly(node);
-                                       if (el.hasClass('submodule')) {
-                                               TYPO3.ModuleMenu.App.showModule(el.getAttribute('id'));
-                                       }
-                               },
-                               containerclick: function(view, event) {
-                                       var item = event.getTarget('li.menuSection', view.getEl());
-                                       if (item) {
-                                               var el = Ext.fly(item);
-                                               var id = el.getAttribute('id');
-                                               var section = el.first('div'), state;
-                                               if (section.hasClass('expanded')) {
-                                                       state = true;
-                                                       section.removeClass('expanded').addClass('collapsed');
-                                                       el.first('ul').slideOut('t', {
-                                                               easing: 'easeOut',
-                                                               duration: .2,
-                                                               remove: false,
-                                                               useDisplay: true
-                                                       });
-
-                                               } else {
-                                                       state = false;
-                                                       section.removeClass('collapsed').addClass('expanded');
-                                                       el.first('ul').slideIn('t', {
-                                                               easing: 'easeIn',
-                                                               duration: .2,
-                                                               remove: false,
-                                                               useDisplay: true
-                                                       });
-                                               }
-                                               // save menu state
-                                               Ext.Ajax.request({
-                                                       url: 'ajax.php?ajaxID=ModuleMenu::saveMenuState',
-                                                       params: {
-                                                               'menuid': 'modmenu_' + id,
-                                                               'state': state
-                                                       }
-                                               });
-                                       }
-                                       return false;
-                               },
-                               scope: this
-                       }
-               });
-               TYPO3.Backend.ModuleMenuContainer.doLayout();
-       },
-
-       getRecordFromIndex: function(index) {
-               var i, record;
-               for (i = 0; i < TYPO3.ModuleMenu.Store.getCount(); i++) {
-                       record = TYPO3.ModuleMenu.Store.getAt(i);
-                       if (index < record.data.subitems) {
-                               return record.data.sub[index];
-                       }
-                       index -= record.data.subitems;
-               }
-       },
-
-       getRecordFromName: function(name) {
-               var i, j, record;
-               for (i = 0; i < TYPO3.ModuleMenu.Store.getCount(); i++) {
-                       record = TYPO3.ModuleMenu.Store.getAt(i);
-                       for (j = 0; j < record.data.subitems; j++) {
-                               if (record.data.sub[j].name === name) {
-                                       return record.data.sub[j];
-                               }
-                       }
-               }
-       },
-
-       showModule: function(mod, params) {
-               params = params || '';
-               this.selectedModule = mod;
-
-               params = this.includeId(mod, params);
-               var record = this.getRecordFromName(mod);
-
-               if (record) {
-                       this.loadModuleComponents(record, params);
-               } else {
-                               //defined startup module is not present, use the first available instead
-                       this.loadFirstAvailableModule(params);
-               }
-       },
-
-       loadFirstAvailableModule: function(params) {
-               params = params || '';
-               if (TYPO3.ModuleMenu.Store.isLoaded() === false) {
-                       new Ext.util.DelayedTask(
-                               this.loadFirstAvailableModule,
-                               this,
-                               [params]
-                       ).delay(250);
-               } else if (TYPO3.ModuleMenu.Store.getCount() === 0) {
-                               // Store is empty, something went wrong
-                       TYPO3.Flashmessage.display(TYPO3.Severity.error, 'Module loader', 'No module found. If this is a temporary error, please reload the Backend!', 50000);
-               } else {
-                       mod = TYPO3.ModuleMenu.Store.getAt(0).data.sub[0];
-                       this.loadModuleComponents(mod, params);
-               }
-       },
-
-       loadModuleComponents: function(record, params) {
-               var mod = record.name;
-               if (record.navigationComponentId) {
-                               this.loadNavigationComponent(record.navigationComponentId);
-                               TYPO3.Backend.NavigationDummy.hide();
-                               TYPO3.Backend.NavigationIframe.getEl().parent().setStyle('overflow', 'auto');
-                       } else if (record.navframe || record.navigationFrameScript) {
-                               TYPO3.Backend.NavigationDummy.hide();
-                               TYPO3.Backend.NavigationContainer.show();
-                               this.loadNavigationComponent('typo3-navigationIframe');
-                               this.openInNavFrame(record.navigationFrameScript || record.navframe, record.navigationFrameScriptParam);
-                               TYPO3.Backend.NavigationIframe.getEl().parent().setStyle('overflow', 'hidden');
-                       } else {
-                               TYPO3.Backend.NavigationContainer.hide();
-                               TYPO3.Backend.NavigationDummy.show();
-                       }
-
-                       this.highlightModuleMenuItem(mod);
-                       this.loadedModule = mod;
-                       this.openInContentFrame(record.originalLink, params);
-
-                               // compatibility
-                       top.currentSubScript = record.originalLink;
-                       top.currentModuleLoaded = mod;
-
-                       TYPO3.Backend.doLayout();
-       },
-
-       includeId: function(mod, params) {
-                       //get id
-               var section = mod.split('_')[0];
-               if (top.fsMod.recentIds[section]) {
-                       params = 'id=' + top.fsMod.recentIds[section] + '&' + params;
-               }
-
-               return params;
-       },
-
-       loadNavigationComponent: function(navigationComponentId) {
-               if (navigationComponentId === this.loadedNavigationComponentId) {
-                       if (TYPO3.Backend.NavigationContainer.hidden) {
-                               TYPO3.Backend.NavigationContainer.show();
-                       }
-
-                       return;
-               }
-
-               if (this.loadedNavigationComponentId !== '') {
-                       Ext.getCmp(this.loadedNavigationComponentId).hide();
-               }
-
-               var component = Ext.getCmp(navigationComponentId);
-               if (typeof component !== 'object') {
-                       if (typeof this.availableNavigationComponents[navigationComponentId] !== 'function') {
-                               throw 'The navigation component "' + navigationComponentId + '" is not available ' +
-                                       'or has no valid callback function';
-                       }
-
-                       component = this.availableNavigationComponents[navigationComponentId]();
-                       TYPO3.Backend.NavigationContainer.add(component);
-               }
-
-               component.show()
-
-                       // backwards compatibility
-               top.nav = component;
-               
-               TYPO3.Backend.NavigationContainer.show();
-               this.loadedNavigationComponentId = navigationComponentId;
-       },
-
-       registerNavigationComponent: function(componentId, initCallback) {
-               this.availableNavigationComponents[componentId] = initCallback;
-       },
-
-       openInNavFrame: function(url, params) {
-               var navUrl = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '');
-               var currentUrl = this.relativeUrl(TYPO3.Backend.NavigationIframe.getUrl());
-               if (currentUrl !== navUrl) {
-                       TYPO3.Backend.NavigationIframe.setUrl(navUrl);
-               }
-       },
-
-       openInContentFrame: function(url, params) {
-               var urlToLoad;
-               if (top.nextLoadModuleUrl) {
-                       TYPO3.Backend.ContentContainer.setUrl(top.nextLoadModuleUrl);
-                       top.nextLoadModuleUrl = '';
-               } else {
-                       urlToLoad = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '')
-                       TYPO3.Backend.ContentContainer.setUrl(urlToLoad);
-                       return;
-               }
-       },
-
-       highlightModuleMenuItem: function(module, mainModule) {
-               TYPO3.Backend.ModuleMenuContainer.getComponent('modDataView').select(module, false, false);
-       },
-
-       relativeUrl: function(url) {
-               return url.replace(TYPO3.configuration.siteUrl + 'typo3/', '');
-       },
-
-       refreshMenu: function() {
-               TYPO3.ModuleMenu.Store.load({
-                       scope: this,
-                       callback: function(records, options) {
-                               this.renderMenu(records);
-                               if (this.loadedModule) {
-                                       this.highlightModuleMenuItem(this.loadedModule);
-                               }
-                       }
-               });
-       },
-
-       reloadFrames: function() {
-               TYPO3.Backend.NavigationIframe.refresh();
-               TYPO3.Backend.ContentContainer.refresh();
-       }
-
-};
-
-
-
-Ext.onReady(function() {
-       TYPO3.ModuleMenu.App.init();
-
-               // keep backward compatibility
-       top.list = TYPO3.Backend.ContentContainer;
-       top.list_frame = top.list.getIframe();
-       top.nav_frame = TYPO3.Backend.NavigationContainer.PageTree;
-
-       top.TYPO3ModuleMenu = TYPO3.ModuleMenu.App;
-       top.content = {
-               nav_frame: TYPO3.Backend.NavigationContainer.PageTree,
-               list_frame: TYPO3.Backend.ContentContainer.getIframe(),
-               location: TYPO3.Backend.ContentContainer.getIframe().location,
-               document: TYPO3.Backend.ContentContainer.getIframe()
-       }
-});
-
-
-/*******************************************************************************
-*
-* Backwards compatability handling down here
-*
-******************************************************************************/
-
-/**
-* Highlight module:
-*/
-var currentlyHighLightedId = '';
-var currentlyHighLighted_restoreValue = '';
-var currentlyHighLightedMain = '';
-function highlightModuleMenuItem(trId, mainModule) {
-       TYPO3.ModuleMenu.App.highlightModule(trId, mainModule);
-}
diff --git a/typo3/js/pagetreefiltermenu.js b/typo3/js/pagetreefiltermenu.js
deleted file mode 100644 (file)
index c7aadaa..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2010-2011 Jigal van Hemert <jigal@xs4all.nl>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-/**
- * class to handle the pagetree filter menu
- */
-var PagetreeFilterMenu = Class.create({
-
-       /**
-        * registers for resize event listener and executes on DOM ready
-        */
-       initialize: function() {
-               Ext.onReady(function() {
-                       Ext.get('tree-toolbar-filter-item').on('click', this.toggleMenu);
-               }, this);
-       },
-
-       /**
-        * toggles the visibility of the filter
-        */
-       toggleMenu: function(event) {
-               var toolbarItem = Ext.get('tree-toolbar-filter-item');
-               var treeFilterBox = Ext.get('treeFilterBox');
-               var treeFilterItem = Ext.get('treeFilter');
-               var treeFilterReset = Ext.get('treeFilterReset');
-
-               toolbarItem.blur();
-
-               if (toolbarItem.hasClass('active')) {
-                       treeFilterBox.fadeOut();
-                       TYPO3PageTreeFilter.resetSearchField();
-               } else {
-                       treeFilterBox.fadeIn();
-                       treeFilterItem.focus();
-               }
-
-               toolbarItem.toggleClass('active');
-
-       }
-});
-
-var TYPO3BackendFilterMenu = new PagetreeFilterMenu();
diff --git a/typo3/js/shortcutmenu.js b/typo3/js/shortcutmenu.js
deleted file mode 100644 (file)
index 9d2fd5e..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2007-2011 Ingo Renner <ingo@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-
-/**
- * class to handle the shortcut menu
- */
-var ShortcutMenu = Class.create({
-
-       /**
-        * registers for resize event listener and executes on DOM ready
-        */
-       initialize: function() {
-               Ext.onReady(function() {
-                       Event.observe(
-                               window, 'resize',
-                               function() { TYPO3BackendToolbarManager.positionMenu('shortcut-menu'); }
-                       );
-                       TYPO3BackendToolbarManager.positionMenu('shortcut-menu');
-                       
-                       this.toolbarItemIcon = $$('#shortcut-menu .toolbar-item span.t3-icon')[0];
-
-                       Event.observe($$('#shortcut-menu .toolbar-item')[0], 'click', this.toggleMenu);
-                       this.initControls();
-               }, this);
-       },
-
-       /**
-        * initializes the controls to follow, edit, and delete shortcuts
-        *
-        */
-       initControls: function() {
-
-               $$('.shortcut-label a').each(function(element) {
-                       var shortcutId = element.up('tr.shortcut').identify().slice(9);
-
-                               // map InPlaceEditor to edit icons
-                       var edit = new Ajax.InPlaceEditor('shortcut-label-' + shortcutId, 'ajax.php?ajaxID=ShortcutMenu::saveShortcut', {
-                               externalControl     : 'shortcut-edit-' + shortcutId,
-                               externalControlOnly : true,
-                               highlightcolor      : '#f9f9f9',
-                               highlightendcolor   : '#f9f9f9',
-                               onFormCustomization : this.addGroupSelect,
-                               onComplete          : this.reRenderMenu.bind(this),
-                               callback            : function(form, nameInputFieldValue) {
-                                       var params = form.serialize();
-                                       params += '&shortcutId=' + shortcutId;
-
-                                       return params;
-                               },
-                               textBetweenControls : ' ',
-                               cancelControl       : 'button',
-                               clickToEditText     : '',
-                               htmlResponse        : true
-                       });
-
-                               // follow/execute shortcuts
-                       element.observe('click', function(event) {
-                               this.toggleMenu();
-                       }.bind(this));
-
-               }.bind(this));
-
-                       // activate delete icon
-               $$('.shortcut-delete img').each(function(element) {
-                       element.observe('click', function(event) {
-                               if (confirm('Do you really want to remove this bookmark?')) {
-                                       var deleteControl = event.element();
-                                       var shortcutId = deleteControl.up('tr.shortcut').identify().slice(9);
-
-                                       var del = new Ajax.Request('ajax.php', {
-                                               parameters : 'ajaxID=ShortcutMenu::delete&shortcutId=' + shortcutId,
-                                               onComplete : this.reRenderMenu.bind(this)
-                                       });
-                               }
-                       }.bind(this));
-               }.bind(this));
-
-       },
-
-       /**
-        * toggles the visibility of the menu and places it under the toolbar icon
-        */
-       toggleMenu: function(event) {
-               var toolbarItem = $$('#shortcut-menu > a')[0];
-               var menu        = $$('#shortcut-menu .toolbar-item-menu')[0];
-               toolbarItem.blur();
-
-               if (!toolbarItem.hasClassName('toolbar-item-active')) {
-                       toolbarItem.addClassName('toolbar-item-active');
-                       Effect.Appear(menu, {duration: 0.2});
-                       TYPO3BackendToolbarManager.hideOthers(toolbarItem);
-               } else {
-                       toolbarItem.removeClassName('toolbar-item-active');
-                       Effect.Fade(menu, {duration: 0.1});
-               }
-       },
-
-       /**
-        * adds a select field for the groups
-        */
-       addGroupSelect: function(inPlaceEditor, inPlaceEditorForm) {
-               var selectField = $(document.createElement('select'));
-
-                       // determine the shortcut id
-               var shortcutId  = inPlaceEditorForm.identify().slice(9, -14);
-
-                       // now determine the shortcut's group id
-               var shortcut        = $('shortcut-' + shortcutId).up('tr.shortcut');
-               var firstInGroup    = null;
-               var shortcutGroupId = 0;
-
-               if (shortcut.hasClassName('first-row')) {
-                       firstInGroup = shortcut;
-               } else {
-                       firstInGroup = shortcut.previous('.first-row');
-               }
-
-               if (undefined !== firstInGroup) {
-                       shortcutGroupId = firstInGroup.previous().identify().slice(15);
-               }
-
-               selectField.name = 'shortcut-group';
-               selectField.id = 'shortcut-group-select-' + shortcutId;
-               selectField.size = 1;
-               selectField.setStyle({marginBottom: '5px'});
-
-                       // create options
-               var option;
-                       // first create an option for "no group"
-               option = document.createElement('option');
-               option.value = 0;
-               option.selected = (shortcutGroupId === 0 ? true : false);
-               option.appendChild(document.createTextNode('No Group'));
-               selectField.appendChild(option);
-
-                       // get the groups
-               var getGroups = new Ajax.Request('ajax.php', {
-                       method: 'get',
-                       parameters: 'ajaxID=ShortcutMenu::getGroups',
-                       asynchronous: false, // needs to be synchronous to build the options before adding the selectfield
-                       requestHeaders: {Accept: 'application/json'},
-                       onSuccess: function(transport, json) {
-                               var shortcutGroups = transport.responseText.evalJSON(true);
-
-                                       // explicitly make the object a Hash
-                               shortcutGroups = $H(json.shortcutGroups);
-                               shortcutGroups.each(function(group) {
-                                       option = document.createElement('option');
-                                       option.value = group.key
-                                       option.selected = (shortcutGroupId === group.key ? true : false);
-                                       option.appendChild(document.createTextNode(group.value));
-                                       selectField.appendChild(option);
-                               });
-
-                       }
-               });
-
-               inPlaceEditor._form.appendChild(document.createElement('br'));
-               inPlaceEditor._form.appendChild(selectField);
-               inPlaceEditor._form.appendChild(document.createElement('br'));
-       },
-
-       /**
-        * gets called when the update was succesfull, fetches the complete menu to
-        * honor changes in group assignments
-        */
-       reRenderMenu: function(transport, element, backPath) {
-               var container = $$('#shortcut-menu .toolbar-item-menu')[0];
-               if (!backPath) {
-                       var backPath = '';
-               }
-
-
-               container.setStyle({
-                       height: container.getHeight() + 'px'
-               });
-               container.update('LOADING');
-
-               var render = new Ajax.Updater(
-                       container,
-                       backPath + 'ajax.php',
-                       {
-                               parameters : 'ajaxID=ShortcutMenu::render',
-                               asynchronous : false
-                       }
-               );
-
-               container.setStyle({
-                       height: 'auto'
-               });
-
-               this.initControls();
-       },
-
-       /**
-        * makes a call to the backend class to create a new shortcut,
-        * when finished it reloads the menu
-        */
-       createShortcut: function(backPath, moduleName, url) {
-               var toolbarItemIcon = $$('#shortcut-menu .toolbar-item span.t3-icon')[0];
-
-               var parent = Element.up(toolbarItemIcon);
-               var spinner = new Element('span').addClassName('spinner');
-               var oldIcon = toolbarItemIcon.replace(spinner);
-
-                       // synchrous call to wait for it to complete and call the render
-                       // method with backpath _afterwards_
-               var call = new Ajax.Request(backPath + 'ajax.php', {
-                       parameters : 'ajaxID=ShortcutMenu::create&module=' + moduleName + '&url=' + url,
-                       asynchronous : false
-               });
-
-               this.reRenderMenu(null, null, backPath);
-               spinner.replace(oldIcon);
-       }
-
-});
-
-var TYPO3BackendShortcutMenu = new ShortcutMenu();
diff --git a/typo3/js/tabmenu.js b/typo3/js/tabmenu.js
deleted file mode 100644 (file)
index d036b49..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/***************************************************************
- *
- *  javascript functions regarding the "dyntabmenu"
- *  used throughout the TYPO3 backend
- *
- *  Copyright notice
- *
- *  (c) 2003-2011 Kasper Skaarhoj <kasperYYYY@typo3.com>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 t3lib/ library provided by
- *  Kasper Skaarhoj <kasper@typo3.com> together with TYPO3
- *
- *  Released under GNU/GPL (see license file in tslib/)
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- *  This copyright notice MUST APPEAR in all copies of this script
- *
- ***************************************************************/
-
-var DTM_array = DTM_array || [],
-       DTM_origClass = DTM_origClass || '';
-
-       // if tabs are used in a popup window the array might not exists
-if (!top.DTM_currentTabs) {
-       top.DTM_currentTabs = [];
-}
-
-function DTM_activate(idBase,index,doToogle) {
-               // Hiding all:
-       if (DTM_array[idBase]) {
-               for(var cnt = 0; cnt < DTM_array[idBase].length; cnt++) {
-                       if (DTM_array[idBase][cnt] !== idBase + '-' + index) {
-                               document.getElementById(DTM_array[idBase][cnt]+'-DIV').style.display = 'none';
-                               // Only Overriding when Tab not disabled
-                               if (document.getElementById(DTM_array[idBase][cnt]+'-MENU').attributes.getNamedItem('class').nodeValue !== 'disabled') {
-                                       document.getElementById(DTM_array[idBase][cnt]+'-MENU').attributes.getNamedItem('class').nodeValue = 'tab';
-                               }
-                       }
-               }
-       }
-
-               // Showing one:
-       if (document.getElementById(idBase+'-'+index+'-DIV')) {
-               if (doToogle && document.getElementById(idBase+'-'+index+'-DIV').style.display === 'block') {
-                       document.getElementById(idBase+'-'+index+'-DIV').style.display = 'none';
-                       if (DTM_origClass === '') {
-                               document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tab';
-                       } else {
-                               DTM_origClass = 'tab';
-                       }
-                       top.DTM_currentTabs[idBase] = -1;
-               } else {
-                       document.getElementById(idBase+'-'+index+'-DIV').style.display = 'block';
-                       if (DTM_origClass === '') {
-                               document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tabact';
-                       } else {
-                               DTM_origClass = 'tabact';
-                       }
-                       top.DTM_currentTabs[idBase] = index;
-               }
-       }
-       document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tabact';
-}
-function DTM_toggle(idBase,index,isInit) {
-               // Showing one:
-       if (document.getElementById(idBase+'-'+index+'-DIV')) {
-               if (document.getElementById(idBase+'-'+index+'-DIV').style.display === 'block') {
-                       document.getElementById(idBase+'-'+index+'-DIV').style.display = 'none';
-                       if (isInit) {
-                               document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tab';
-                       } else {
-                               DTM_origClass = 'tab';
-                       }
-                       top.DTM_currentTabs[idBase+'-'+index] = 0;
-               } else {
-                       document.getElementById(idBase+'-'+index+'-DIV').style.display = 'block';
-                       if (isInit) {
-                               document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tabact';
-                       } else {
-                               DTM_origClass = 'tabact';
-                       }
-                       top.DTM_currentTabs[idBase+'-'+index] = 1;
-               }
-       }
-}
-
-function DTM_mouseOver(obj) {
-               DTM_origClass = obj.attributes.getNamedItem('class').nodeValue;
-               obj.attributes.getNamedItem('class').nodeValue += '_over';
-}
-
-function DTM_mouseOut(obj) {
-               obj.attributes.getNamedItem('class').nodeValue = DTM_origClass;
-               DTM_origClass = '';
-}
-
diff --git a/typo3/js/toolbarmanager.js b/typo3/js/toolbarmanager.js
deleted file mode 100644 (file)
index 30fa507..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2007-2011 Ingo Renner <ingo@typo3.org>
-*  All rights reserved
-*
-*  This script is part of the TYPO3 project. The TYPO3 project is
-*  free software; you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  The GNU General Public License can be found at
-*  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license
-*  from the author is found in LICENSE.txt distributed with these scripts.
-*
-*
-*  This script is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY; without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*  GNU General Public License for more details.
-*
-*  This copyright notice MUST APPEAR in all copies of the script!
-***************************************************************/
-
-
-var ToolbarManager = Class.create({
-
-       /**
-        * hides all toolbar item menus except for the which was clicked
-        */
-       hideOthers: function(toolbarItem) {
-               var sibling = toolbarItem.next();
-
-                       // check whether it is a toolbar item with menu
-               if (sibling.hasClassName('toolbar-item-menu')) {
-                       this.hideAll();
-                               // show toolbarItem
-                       toolbarItem.addClassName('toolbar-item-active');
-               }
-       },
-
-       /**
-        * Hide all expanded toolbar menus
-        */
-       hideAll: function() {
-               $$('#typo3-toolbar a.toolbar-item + .toolbar-item-menu').invoke('hide');
-               $$('#typo3-toolbar a.toolbar-item').each(function(element) {
-                       element.removeClassName('toolbar-item-active');
-               });
-       },
-
-       /**
-        * refreshs positioning of all submenus
-        */
-       refreshAll: function() {
-       },
-
-       /**
-        * positions a toolbar item (has to have .toolbar-item-menu)
-        * @param elementId The parent element ofthe menu to be positioned
-        */
-       positionMenu: function(elementId) {
-       }
-
-});
-
-var TYPO3BackendToolbarManager = new ToolbarManager();
-
-
index d5645da..f867947 100644 (file)
@@ -99,18 +99,18 @@ class BackendController {
                // Add default BE javascript
                $this->js = '';
                $this->jsFiles = array(
-                       'common' => 'js/common.js',
+                       'common' => 'sysext/backend/Resources/Public/JavaScript/common.js',
                        'locallang' => $this->getLocalLangFileName(),
                        'modernizr' => 'contrib/modernizr/modernizr.min.js',
                        'md5' => 'md5.js',
-                       'toolbarmanager' => 'js/toolbarmanager.js',
-                       'modulemenu' => 'js/modulemenu.js',
-                       'iecompatibility' => 'js/iecompatibility.js',
+                       'toolbarmanager' => 'sysext/backend/Resources/Public/JavaScript/toolbarmanager.js',
+                       'modulemenu' => 'sysext/backend/Resources/Public/JavaScript/modulemenu.js',
+                       'iecompatibility' => 'sysext/backend/Resources/Public/JavaScript/iecompatibility.js',
                        'evalfield' => '../t3lib/jsfunc.evalfield.js',
                        'flashmessages' => '../t3lib/js/extjs/ux/flashmessages.js',
                        'tabclosemenu' => '../t3lib/js/extjs/ux/ext.ux.tabclosemenu.js',
                        'notifications' => '../t3lib/js/extjs/notifications.js',
-                       'backend' => 'js/backend.js',
+                       'backend' => 'sysext/backend/Resources/Public/JavaScript/backend.js',
                        'loginrefresh' => 'js/loginrefresh.js',
                        'debugPanel' => 'js/extjs/debugPanel.js',
                        'viewport' => 'js/extjs/viewport.js',
index 81355d5..ea6208f 100644 (file)
@@ -156,7 +156,7 @@ class PageTreeNavigationController {
                $this->doc->getPageRenderer()->loadScriptaculous('effects');
                $this->doc->getPageRenderer()->loadExtJS();
                if ($this->hasFilterBox) {
-                       $this->doc->getPageRenderer()->addJsFile('js/pagetreefiltermenu.js');
+                       $this->doc->getPageRenderer()->addJsFile('sysext/backend/Resources/Public/JavaScript/pagetreefiltermenu.js');
                }
                $this->doc->JScode .= $this->doc->wrapScriptTags(($this->currentSubScript ? 'top.currentSubScript=unescape("' . rawurlencode($this->currentSubScript) . '");' : '') . '
                // setting prefs for pagetree and drag & drop
index cd8272d..c211596 100644 (file)
@@ -1564,7 +1564,7 @@ class DocumentTemplate {
         */
        public function getDragDropCode($table) {
                $this->pageRenderer->loadPrototype();
-               $this->loadJavascriptLib('js/common.js');
+               $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/common.js');
                $this->loadJavascriptLib('js/tree.js');
                // Setting prefs for drag & drop
                $this->JScodeArray['dragdrop'] = '
@@ -1684,7 +1684,7 @@ class DocumentTemplate {
         */
        public function getDynTabMenu($menuItems, $identString, $toggle = 0, $foldout = FALSE, $noWrap = TRUE, $fullWidth = FALSE, $defaultTabIndex = 1, $dividers2tabs = 2) {
                // Load the static code, if not already done with the function below
-               $this->loadJavascriptLib('js/tabmenu.js');
+               $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/tabmenu.js');
                $content = '';
                if (is_array($menuItems)) {
                        // Init:
@@ -1848,7 +1848,7 @@ class DocumentTemplate {
        public function setModuleTemplate($filename) {
                // Load Prototype lib for IE event
                $this->pageRenderer->loadPrototype();
-               $this->loadJavascriptLib('js/iecompatibility.js');
+               $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/iecompatibility.js');
                $this->moduleTemplate = $this->getHtmlTemplate($filename);
        }
 
index 38aef2b..c94258b 100644 (file)
@@ -149,7 +149,7 @@ class ClearCacheToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHoo
         * @return void
         */
        protected function addJavascriptToBackend() {
-               $this->backendReference->addJavascriptFile('js/clearcachemenu.js');
+               $this->backendReference->addJavascriptFile('sysext/backend/Resources/Public/JavaScript/clearcachemenu.js');
        }
 
        /**
index 1c37601..80a3bcc 100644 (file)
@@ -89,7 +89,7 @@ class LiveSearchToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHoo
         */
        protected function addJavascriptToBackend() {
                $pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
-               $this->backendReference->addJavascriptFile('js/livesearch.js');
+               $this->backendReference->addJavascriptFile('sysext/backend/Resources/Public/JavaScript/livesearch.js');
        }
 
        /**
index b04a49e..de33f35 100644 (file)
@@ -204,7 +204,7 @@ class ShortcutToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookI
         * @return void
         */
        protected function addJavascriptToBackend() {
-               $this->backendReference->addJavascriptFile('js/shortcutmenu.js');
+               $this->backendReference->addJavascriptFile('sysext/backend/Resources/Public/JavaScript/shortcutmenu.js');
        }
 
        /**
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/backend.js b/typo3/sysext/backend/Resources/Public/JavaScript/backend.js
new file mode 100644 (file)
index 0000000..96ea324
--- /dev/null
@@ -0,0 +1,193 @@
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2007-2011 Ingo Renner <ingo@typo3.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * general backend javascript functions
+ */
+
+Ext.ns('TYPO3.configuration');
+
+/**
+ * jump the backend to a module
+ */
+function jump(url, modName, mainModName, pageId) {
+       if (isNaN(pageId)) {
+               pageId = -2;
+       }
+               // clear information about which entry in nav. tree that might have been highlighted.
+       top.fsMod.navFrameHighlightedID = [];
+       top.fsMod.recentIds['web'] = pageId;
+
+       if (top.TYPO3.Backend.NavigationContainer.PageTree) {
+               top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree();
+       }
+
+       top.nextLoadModuleUrl = url;
+       top.TYPO3.ModuleMenu.App.showModule(modName);
+
+}
+
+/**
+ * shortcut manager to delegate the action of creating shortcuts to the new
+ * backend.php shortcut menu or the old shortcut frame depending on what is available
+ */
+var ShortcutManager = {
+
+       /**
+        * central entry point to create a shortcut, delegates the call to correct endpoint
+        */
+       createShortcut: function(confirmQuestion, backPath, moduleName, url) {
+               if(confirm(confirmQuestion)) {
+                       if (typeof TYPO3BackendShortcutMenu !== undefined) {
+                                       // backend.php
+                               TYPO3BackendShortcutMenu.createShortcut('', moduleName, url);
+                       }
+               }
+       }
+}
+
+
+/**
+ * Function similar to PHPs  rawurlencode();
+ */
+function rawurlencode(str) {
+       var output = escape(str);
+       output = str_replace("*","%2A", output);
+       output = str_replace("+","%2B", output);
+       output = str_replace("/","%2F", output);
+       output = str_replace("@","%40", output);
+       return output;
+}
+
+/**
+ * Function to similar to PHPs  rawurlencode() which removes TYPO3_SITE_URL;
+ */
+function rawurlencodeAndRemoveSiteUrl(str)     {       //
+       var siteUrl = TYPO3.configuration.siteUrl;
+       return rawurlencode(str_replace(siteUrl, "", str));
+}
+
+/**
+ * String-replace function
+ */
+function str_replace(match,replace,string)     {       //
+       var input = ""+string;
+       var matchStr = ""+match;
+       if (!matchStr)  {return string;}
+       var output = "";
+       var pointer=0;
+       var pos = input.indexOf(matchStr);
+       while (pos !== -1) {
+               output+=""+input.substr(pointer, pos-pointer)+replace;
+               pointer=pos+matchStr.length;
+               pos = input.indexOf(match,pos+1);
+       }
+       output+=""+input.substr(pointer);
+       return output;
+}
+
+
+
+/**
+ * Launcing information window for records/files (fileref as "table" argument)
+ */
+function launchView(table,uid,bP)      {       //
+       var backPath= bP ? bP : "";
+       var thePreviewWindow="";
+       thePreviewWindow = window.open(TS.PATH_typo3+"show_item.php?table="+encodeURIComponent(table)+"&uid="+encodeURIComponent(uid),"ShowItem"+TS.uniqueID,"width=550,height=600,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
+       if (thePreviewWindow && thePreviewWindow.focus) {
+               thePreviewWindow.focus();
+       }
+}
+
+/**
+ * Opens plain window with url
+ */
+function openUrlInWindow(url,windowName)       {       //
+       regularWindow = window.open(
+               url,
+               windowName,
+               "status=1,menubar=1,resizable=1,location=1,directories=0,scrollbars=1,toolbar=1");
+       regularWindow.focus();
+       return false;
+}
+
+/**
+ * Loads a page id for editing in the page edit module:
+ */
+function loadEditId(id,addGetVars)     {       //
+       top.fsMod.recentIds.web = id;
+       top.fsMod.navFrameHighlightedID.web = "pages" + id + "_0";              // For highlighting
+
+       if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
+               top.content.nav_frame.refresh_nav();
+       }
+       if (TYPO3.configuration.pageModule) {
+               top.goToModule(TYPO3.configuration.pageModule, 0, addGetVars?addGetVars:"");
+       }
+}
+
+/**
+ * Returns incoming URL (to a module) unless nextLoadModuleUrl is set. If that is the case nextLoadModuleUrl is returned (and cleared)
+ * Used by the shortcut frame to set a "intermediate URL"
+ */
+var nextLoadModuleUrl="";
+function getModuleUrl(inUrl)   {       //
+       var nMU;
+       if (top.nextLoadModuleUrl) {
+               nMU=top.nextLoadModuleUrl;
+               top.nextLoadModuleUrl="";
+               return nMU;
+       } else {
+               return inUrl;
+       }
+}
+
+/**
+ * Print properties of an object
+ */
+function debugObj(obj,name)    {       //
+       var acc;
+       for (var i in obj) {
+               if (obj[i]) {
+                       acc+=i+":  "+obj[i]+"\n";
+               }
+       }
+       alert("Object: "+name+"\n\n"+acc);
+}
+
+
+
+       // Used by Frameset Modules
+var condensedMode = TYPO3.configuration.condensedMode;
+var currentSubScript = "";
+var currentSubNavScript = "";
+
+       // Used for tab-panels:
+var DTM_currentTabs = [];
+
+       // status of WS FE preview
+var WorkspaceFrontendPreviewEnabled = TYPO3.configuration.workspaceFrontendPreviewEnabled;
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/clearcachemenu.js b/typo3/sysext/backend/Resources/Public/JavaScript/clearcachemenu.js
new file mode 100644 (file)
index 0000000..5b12d4d
--- /dev/null
@@ -0,0 +1,115 @@
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2007-2011 Ingo Renner <ingo@typo3.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * class to handle the clear cache menu
+ */
+var ClearCacheMenu = Class.create({
+
+       /**
+        * registers for resize event listener and executes on DOM ready
+        */
+       initialize: function() {
+
+               Ext.onReady(function() {
+                       var self = this;
+                       Event.observe(
+                               window, 'resize',
+                               function() { TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu'); }
+                       );
+                       TYPO3BackendToolbarManager.positionMenu('clear-cache-actions-menu');
+                       this.toolbarItemIcon = $$('#clear-cache-actions-menu .toolbar-item span.t3-icon')[0];
+
+                       Event.observe('clear-cache-actions-menu', 'click', this.toggleMenu);
+
+                               // observe all clicks on clear cache actions in the menu
+                       $$('#clear-cache-actions-menu li a').each(function(element) {
+                               $(element).onclick = function(event) {
+                                       event = event || window.event;
+                                       self.clearCache.call(self, event);
+                                       return false;
+                               };
+                       });
+               }, this);
+       },
+
+       /**
+        * toggles the visibility of the menu and places it under the toolbar icon
+        */
+       toggleMenu: function(event) {
+               var toolbarItem = $$('#clear-cache-actions-menu > a')[0];
+               var menu        = $$('#clear-cache-actions-menu .toolbar-item-menu')[0];
+               toolbarItem.blur();
+
+               if (!toolbarItem.hasClassName('toolbar-item-active')) {
+                       toolbarItem.addClassName('toolbar-item-active');
+                       Effect.Appear(menu, {duration: 0.2});
+                       TYPO3BackendToolbarManager.hideOthers(toolbarItem);
+               } else {
+                       toolbarItem.removeClassName('toolbar-item-active');
+                       Effect.Fade(menu, {duration: 0.1});
+               }
+
+               if (event) {
+                       Event.stop(event);
+               }
+       },
+
+       /**
+        * calls the actual clear cache URL using an asynchronious HTTP request
+        *
+        * @param       Event   prototype event object
+        */
+       clearCache: function(event) {
+               var toolbarItemIcon = $$('#clear-cache-actions-menu .toolbar-item span.t3-icon')[0];
+               var url             = '';
+               var clickedElement  = Event.element(event);
+
+                       // activate the spinner
+               var parent = Element.up(toolbarItemIcon);
+               var spinner = new Element('span').addClassName('spinner');
+               var oldIcon = toolbarItemIcon.replace(spinner);
+
+               if (clickedElement.tagName === 'SPAN') {
+                       link =  clickedElement.up('a');
+               } else {
+                       link =  clickedElement;
+               }
+
+               if (link.href) {
+                       var call = new Ajax.Request(link.href, {
+                               'method': 'get',
+                               'onComplete': function(result) {
+                                       spinner.replace(oldIcon);
+                               }.bind(this)
+                       });
+               }
+
+               this.toggleMenu(event);
+       }
+});
+
+var TYPO3BackendClearCacheMenu = new ClearCacheMenu();
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/common.js b/typo3/sysext/backend/Resources/Public/JavaScript/common.js
new file mode 100644 (file)
index 0000000..428a91a
--- /dev/null
@@ -0,0 +1,103 @@
+/***************************************************************
+*
+*  javascript functions regarding the TYPO3 wrapper
+*  for the javascript library "prototype".
+*
+*  Copyright notice
+*
+*  (c) 2008-2011 Benjamin Mack <benni@typo3.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 backend provided by
+*  Kasper Skaarhoj <kasper@typo3.com> together with TYPO3
+*
+*  Released under GNU/GPL (see license file in /typo3/)
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*
+*  This copyright notice MUST APPEAR in all copies of this script
+*
+***************************************************************/
+
+// Please make sure that prototype.js is loaded before loading this
+// file in your script, the responder is only added if prototype was loaded
+
+if (Prototype) {
+       // adding generic a responder to use when a AJAX request is done
+       Ajax.Responders.register({
+               onCreate: function(request, transport) {
+
+                       // if the TYPO3 AJAX backend is used,
+                       // the onSuccess & onComplete callbacks are hooked
+                       if (request.url.indexOf("ajax.php") === -1) {
+                               return;
+                       }
+
+                       var origSuccess = request.options.onSuccess, origComplete = request.options.onComplete;
+
+                       // hooking "onSuccess"
+                       if (origSuccess) {
+                               request.options.onSuccess = function(xhr, json) {
+                                       if (!json) {
+                                               T3AJAX.showError(xhr);
+                                       } else {
+                                               origSuccess(xhr, json);
+                                       }
+                               }
+                       }
+
+                       // hooking "onComplete", using T3Error handler if available
+                       if (origComplete) {
+                               request.options.onComplete = function(xhr, json) {
+                                       if (!json && request.options.onT3Error) {
+                                               request.options.onT3Error(xhr, json);
+                                       } else if (!json) {
+                                               T3AJAX.showError(xhr);
+                                       } else {
+                                               origComplete(xhr, json);
+                                       }
+                               };
+                       }
+               }
+       });
+}
+
+var T3AJAX = {};
+T3AJAX.showError = function(xhr, json) {
+       if (typeof xhr.responseText !== undefined && xhr.responseText) {
+               if (typeof Ext.MessageBox !== undefined) {
+                       Ext.MessageBox.alert('TYPO3', xhr.responseText);
+               }
+               else {
+                       alert(xhr.responseText);
+               }
+       }
+};
+
+// common storage and global object, could later hold more information about the current user etc.
+var TYPO3 = TYPO3 || {};
+TYPO3 = Ext.apply(TYPO3, {
+       // store instances that only should be running once
+       _instances: {},
+       getInstance: function(className) {
+               return TYPO3._instances[className] || false;
+       },
+       addInstance: function(className, instance) {
+               TYPO3._instances[className] = instance;
+               return instance;
+       },
+
+       helpers: {
+               // creates an array by splitting a string into parts, taking a delimiter
+               split: function(str, delim) {
+                       var res = [];
+                       while (str.indexOf(delim) > 0) {
+                               res.push(str.substr(0, str.indexOf(delim)));
+                               str = str.substr(str.indexOf(delim) + delim.length);
+                       }
+                       return res;
+               }
+       }
+});
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/iecompatibility.js b/typo3/sysext/backend/Resources/Public/JavaScript/iecompatibility.js
new file mode 100644 (file)
index 0000000..5a32c09
--- /dev/null
@@ -0,0 +1,80 @@
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2008-2011 Jeff Segars <jeff@webempoweredchurch.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+
+Element.addMethods({
+       pngHack: function(element) {
+               element = $(element);
+               var transparentGifPath = 'clear.gif';
+
+                       // If there is valid element, it is an image and the image file ends with png:
+               if (Object.isElement(element) && element.tagName === 'IMG' && element.src.endsWith('.png')) {
+                       var alphaImgSrc = element.src;
+                       var sizingMethod = 'scale';
+                       element.src = transparentGifPath;
+               }
+
+               if (alphaImgSrc) {
+                       element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="#{alphaImgSrc}",sizingMethod="#{sizingMethod}")'.interpolate(
+                       {
+                               alphaImgSrc: alphaImgSrc,
+                               sizingMethod: sizingMethod
+                       });
+               }
+
+               return element;
+       }
+});
+
+var IECompatibility = Class.create({
+
+       /**
+        * initializes the compatibility class
+        */
+       initialize: function() {
+               Event.observe(document, 'dom:loaded', function() {
+                       $$('input[type="checkbox"]').invoke('addClassName', 'checkbox');
+               }.bind(this));
+
+               Event.observe(window, 'load', function() {
+                       if (Prototype.Browser.IE) {
+                               var version = parseFloat(navigator.appVersion.split(';')[1].strip().split(' ')[1]);
+                               if (version === 6) {
+                                       $$('img').each(function(img) {
+                                               img.pngHack();
+                                       });
+                                       $$('#typo3-menu li ul li').each(function(li) {
+                                               li.setStyle({height: '21px'});
+                                       });
+                               }
+                       }
+               });
+       }
+});
+
+if (Prototype.Browser.IE) {
+       var TYPO3IECompatibilty = new IECompatibility();
+}
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/livesearch.js b/typo3/sysext/backend/Resources/Public/JavaScript/livesearch.js
new file mode 100644 (file)
index 0000000..6d54bf7
--- /dev/null
@@ -0,0 +1,330 @@
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2009-2010 Michael Klapper <michael.klapper@aoemedia.de>
+ *  (c) 2010-2011 Jeff Segars <jeff@webempoweredchurch.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+Ext.namespace('TYPO3');
+
+TYPO3.BackendLiveSearch = Ext.extend(Ext.form.ComboBox, {
+       autoSelect: false,
+       ctCls: 'live-search-results',
+       dataProvider: null,
+       searchResultsPid : 0,
+       displayField: 'title',
+       emptyText: null,
+       enableKeyEvents: true,
+       helpTitle: null,
+       hideTrigger: true,
+       itemSelector: 'div.search-item-title',
+       listAlign : 'tr-br',
+       listClass: 'live-search-list',
+       listEmptyText: null,
+       listWidth: 315,
+       listHovered: false,
+       loadingText: null,
+       minChars: 1,
+       resizable: false,
+       title: null,
+       width: 205,
+       triggerClass : 'x-form-clear-trigger',
+       triggerConfig: '<span tag="a" class="t3-icon t3-icon-actions t3-icon-actions-input t3-icon-input-clear t3-tceforms-input-clearer">&nbsp;</span>',
+       onTriggerClick: function() {
+               // Empty the form field, give it focus, and collapse the results
+               this.reset(this);
+               this.focus();
+               this.collapse();
+       },
+       tpl: new Ext.XTemplate(
+               '<table border="0" cellspacing="0">',
+                       '<tpl for=".">',
+                               '<tr class="search-item">',
+                                       '<td class="search-item-type" width="105" align="right">{recordTitle}</td>',
+                                       '<td class="search-item-content" width="195">',
+                                               '<div class="search-item-title">{iconHTML} {title}</div>',
+                                       '</td>',
+                               '</tr>',
+                       '</tpl>',
+               '</table>'
+       ),
+
+       dataReader : new Ext.data.JsonReader({
+               idProperty : 'type',
+               root : 'searchItems',
+               fields : [
+                       {name: 'recordTitle'},
+                       {name: 'pageId'},
+                       {name: 'id'},
+                       {name: 'iconHTML'},
+                       {name: 'title'},
+                       {name: 'editLink'}
+               ]
+       }),
+       listeners: {
+               select : {
+                       scope: this,
+                       fn: function (combo, record, index) {
+                               jump(record.data.editLink, 'web_list', 'web', record.data.pageId);
+                       }
+               },
+               focus : {
+                       fn: function() {
+                               if (this.getValue() == this.emptyText) {
+                                       this.reset(this);
+                               }
+                       }
+               },
+               specialkey : function (field, e) {
+                       if (e.getKey() == e.RETURN || e.getKey() == e.ENTER) {
+                               if (this.dataReader.jsonData.pageJump != '') {
+                                       jump(this.dataReader.jsonData.pageJump, 'web_list', 'web');
+                               } else {
+                                       TYPO3.ModuleMenu.App.showModule('web_list', this.getSearchResultsUrl(this.getValue()));
+                               }
+                       }
+               },
+               keyup : function() {
+                       if ((this.getValue() == this.emptyText) || (this.getValue() == '')) {
+                               this.setHideTrigger(true);
+                       } else {
+                               this.setHideTrigger(false);
+                       }
+               }
+       },
+
+       /**
+        * Initializes the component.
+        */
+       initComponent: function() {
+               this.store = new Ext.data.DirectStore({
+                       directFn: this.dataProvider.find,
+                       reader: this.dataReader
+               });
+               TYPO3.BackendLiveSearch.superclass.initComponent.apply(this, arguments);
+       },
+
+       restrictHeight : function(){
+               this.innerList.dom.style.height = '';
+               var inner = this.innerList.dom;
+               var pad = this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight + 30; // @todo Remove hardcoded 30
+               var h = Math.max(inner.clientHeight, inner.offsetHeight, inner.scrollHeight);
+               var ha = this.getPosition()[1]-Ext.getBody().getScroll().top;
+               var hb = Ext.lib.Dom.getViewHeight()-ha-this.getSize().height;
+               var space = Math.max(ha, hb, this.minHeight || 0)-pad-2;
+               /** BUG FIX **/
+               if (this.shadow === true) { space-=this.list.shadow.offset; }
+
+               h = Math.min(h, space, this.maxHeight);
+
+               /**
+                * @internal The calcated height of "h" in the line before seems not working as expected.
+                *                       If i define a min height, the box shold at least use this height also if only one entry is in there
+                */
+               //h = this.maxHeight;
+
+               this.innerList.setHeight(h);
+               this.list.beginUpdate();
+               this.list.setHeight(h+pad);
+               this.list.alignTo(this.el, this.listAlign);
+               this.list.endUpdate();
+       },
+
+       initList : function () {
+               TYPO3.BackendLiveSearch.superclass.initList.apply(this, arguments);
+               var cls = 'x-combo-list';
+
+                       // Track whether the hovering over the results list or not, to aid in detecting iframe clicks.
+               this.mon(this.list, 'mouseover', function() {this.listHovered = true;}, this);
+               this.mon(this.list, 'mouseout', function() {this.listHovered = false; }, this);
+
+               /**
+                * Create bottom Toolbar to the result layer
+                */
+               this.footer = this.list.createChild({cls:cls+'-ft'});
+
+               this.pageTb = new Ext.Toolbar({
+                       renderTo:this.footer,
+                       height: 30,
+                       items: [{
+                               xtype: 'tbfill',
+                               autoWidth : true
+                       },{
+                               xtype: 'button',
+                               text: TYPO3.LLL.liveSearch.showAllResults,
+                               arrowAlign : 'right',
+                               shadow: false,
+                               icon : '../typo3/sysext/t3skin/icons/module_web_list.gif',
+                               listeners : {
+                                       scope : this,
+                                       click : function () {
+                                                       // go to db_list.php and search for given search value
+                                                       // @todo the current selected page ID from the page tree is required, also we need the
+                                                       // values of $GLOBALS['BE_USER']->returnWebmounts() to search only during the allowed pages
+                                               TYPO3.ModuleMenu.App.showModule('web_list', this.getSearchResultsUrl(this.getValue()));
+                                               this.collapse();
+                                       }
+                               }
+                       }]
+               });
+               this.assetHeight += this.footer.getHeight();
+       },
+
+       initQuery : function(){
+               TYPO3.BackendLiveSearch.superclass.initQuery.apply(this, arguments);
+               this.removeHelp();
+       },
+       initHelp : function () {
+               if(!this.helpList){
+                       var cls = 'search-list-help';
+
+                       this.helpList = new Ext.Layer({
+                               parentEl: this.getListParent(),
+                               shadow: this.shadow,
+                               cls: [cls, this.listClass].join(' '),
+                               constrain:false
+                       });
+
+                               // Track whether the hovering over the help list or not, to aid in detecting iframe clicks.
+                       this.mon(this.helpList, 'mouseover', function() {this.listHovered = true;}, this);
+                       this.mon(this.helpList, 'mouseout', function() {this.listHovered = false; }, this);
+
+                       var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth);
+                       this.helpList.setSize(lw);
+                       this.helpList.swallowEvent('mousewheel');
+                       if(this.syncFont !== false){
+                               this.helpList.setStyle('font-size', this.el.getStyle('font-size'));
+                       }
+
+                       this.innerHelpList = this.helpList.createChild({cls:cls+'-inner'});
+                       this.mon(this.innerHelpList, 'mouseover', this.onViewOver, this);
+                       this.mon(this.innerHelpList, 'mousemove', this.onViewMove, this);
+                       this.innerHelpList.setWidth(lw - this.helpList.getFrameWidth('lr'));
+
+                       if(!this.helpTpl){
+                               this.helpTpl = '<tpl for="."><div class="'+cls+'-item">{' + this.displayField + '}</div></tpl>';
+                        }
+
+                       /**
+                       * The {@link Ext.DataView DataView} used to display the ComboBox's options.
+                       * @type Ext.DataView
+                       */
+                       this.helpView = new Ext.DataView({
+                               applyTo: this.innerHelpList,
+                               tpl: this.helpTpl,
+                               singleSelect: true,
+                               selectedClass: this.selectedClass,
+                               itemSelector: this.itemSelector || '.' + cls + '-item',
+                               emptyText: this.listEmptyText
+                       });
+
+                       this.helpList.createChild({
+                               cls: cls + '-content',
+                               // @todo Can we grab this content via ExtDirect?
+                               html: '<strong>' + this.helpTitle + '</strong><p>' + TYPO3.LLL.liveSearch.helpDescription + '<br /> ' + TYPO3.LLL.liveSearch.helpDescriptionPages + '</p>'
+                       });
+
+                       this.helpList.alignTo(this.wrap, this.listAlign);
+                       this.helpList.show();
+               }
+       },
+
+       removeHelp : function() {
+               if (this.helpList) {
+                       this.helpList.destroy();
+                       delete this.helpList;
+               }
+       },
+
+       onFocus : function() {
+               TYPO3.BackendLiveSearch.superclass.onFocus.apply(this, arguments);
+               TYPO3BackendToolbarManager.hideAll();
+
+               // If search is blank, show the help on focus. Otherwise, show last results
+               if (this.getValue() == '') {
+                       this.initHelp();
+               } else {
+                       this.expand();
+               }
+       },
+
+       /**
+        * Fired when search results are clicked. We do not want the search result
+        * appear so we always set doFocus = false
+        */
+       onViewClick : function(doFocus){
+               doFocus = false;
+               TYPO3.BackendLiveSearch.superclass.onViewClick.apply(this, arguments);
+       },
+
+       postBlur : function() {
+               TYPO3.BackendLiveSearch.superclass.postBlur.apply(this, arguments);
+               this.removeHelp();
+       },
+
+       getTriggerWidth : function() {
+               // Trigger is inset, so width used in calculations is 0
+               return 0;
+       },
+
+       reset : function() {
+           this.originalValue = this.emptyText;
+               this.setHideTrigger(true);
+               TYPO3.BackendLiveSearch.superclass.reset.apply(this, arguments);
+       },
+
+       getSearchResultsUrl : function(searchTerm) {
+               return 'id=' + this.searchResultsPid + '&search_levels=4&search_field=' + searchTerm;
+       },
+
+       handleBlur : function(e) {
+
+               if (!this.listHovered) {
+                       this.hasFocus = false;
+                       if (this.getValue() == '') {
+                               this.reset();
+                       }
+                       this.postBlur();
+               }
+
+       }
+});
+
+var TYPO3LiveSearch;
+
+Ext.onReady(function() {
+       TYPO3LiveSearch = new TYPO3.BackendLiveSearch({
+               dataProvider: TYPO3.LiveSearchActions.ExtDirect,
+               title: TYPO3.LLL.liveSearch.title,
+               helpTitle: TYPO3.LLL.liveSearch.helpTitle,
+               emptyText: TYPO3.LLL.liveSearch.emptyText,
+               loadingText: TYPO3.LLL.liveSearch.loadingText,
+               listEmptyText: TYPO3.LLL.liveSearch.listEmptyText,
+               searchResultsPid: TYPO3.configuration.firstWebmountPid
+       });
+
+       TYPO3LiveSearch.applyToMarkup(Ext.get('live-search-box'));
+
+               // Add a blur event listener outside the ExtJS widget to handle clicks in iframes also.
+       Ext.get('live-search-box').on('blur', TYPO3LiveSearch.handleBlur, TYPO3LiveSearch);
+});
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/modulemenu.js b/typo3/sysext/backend/Resources/Public/JavaScript/modulemenu.js
new file mode 100644 (file)
index 0000000..f0c28fb
--- /dev/null
@@ -0,0 +1,398 @@
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010-2011 Steffen Kamper <steffen@typo3.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+
+/**
+ * Class to render the module menu and handle the BE navigation
+ *
+ * @author     Steffen Kamper
+ */
+
+
+Ext.ns('TYPO3', 'ModuleMenu');
+
+TYPO3.ModuleMenu = {};
+
+TYPO3.ModuleMenu.Store = new Ext.data.JsonStore({
+       storeId: 'ModuleMenuStore',
+       root: 'root',
+       fields: [
+               {name: 'index', type: 'int', mapping: 'sub.index'},
+               {name: 'key', type: 'string'},
+               {name: 'label', type: 'string'},
+               {name: 'menuState', type: 'int'},
+               {name: 'subitems', type: 'int'},
+               'sub'
+       ],
+       url: 'ajax.php?ajaxID=ModuleMenu::getData',
+       baseParams: {
+               'action': 'getModules'
+       },
+       listeners: {
+               beforeload: function(store) {
+                       this.loaded = false;
+               },
+               load: function(store) {
+                       this.loaded = true;
+               }
+       },
+       // Custom indicator for loaded store:
+       loaded: false,
+       isLoaded: function() {
+               return this.loaded;
+       }
+
+});
+
+TYPO3.ModuleMenu.Template = new Ext.XTemplate(
+               '<div id="typo3-docheader">',
+               '       <div class="typo3-docheader-functions">',
+               '       </div>',
+               '</div>',
+               '<ul id="typo3-menu">',
+               '<tpl for=".">',
+               '       <li class="menuSection" id="{key}">',
+               '               <div class="modgroup {[this.getStateClass(values)]}">{label}</div>',
+               '       <ul {[this.getStateStyle(values)]}>',
+               '       <tpl for="sub">',
+               '       <li id="{name}" class="submodule mod-{name}">',
+               '               <a title="{description}" href="#" class="modlink">',
+               '                       <span class="submodule-icon">',
+               '                               <img width="16" height="16" alt="{label}" title="{label}" src="{icon}" />',
+               '                       </span>',
+               '                       <span>{label}</span>',
+               '               </a>',
+               '       </li>',
+               '       </tpl>',
+               '       </ul>',
+               '       </li>',
+               '</tpl>',
+               '</ul>',
+               {
+                       getStateClass: function(value) {
+                               return value.menuState ? 'collapsed' : 'expanded';
+                       },
+                       getStateStyle: function(value) {
+                               return value.menuState ? 'style="display:none"' : '';
+                       }
+               }
+);
+
+TYPO3.ModuleMenu.App = {
+       loadedModule: null,
+       loadedNavigationComponentId: '',
+       availableNavigationComponents: {},
+
+       init: function() {
+               TYPO3.ModuleMenu.Store.load({
+                       scope: this,
+                       callback: function(records, options) {
+                               this.renderMenu(records);
+                               if (top.startInModule) {
+                                       this.showModule(top.startInModule[0], top.startInModule[1]);
+                               } else {
+                                       this.loadFirstAvailableModule();
+                               }
+                       }
+               });
+       },
+
+       renderMenu: function(records) {
+               TYPO3.Backend.ModuleMenuContainer.removeAll();
+               TYPO3.Backend.ModuleMenuContainer.add({
+                       xtype: 'dataview',
+                       animCollapse: true,
+                       store: TYPO3.ModuleMenu.Store,
+                       tpl: TYPO3.ModuleMenu.Template,
+                       singleSelect: true,
+                       itemSelector: 'li.submodule',
+                       overClass: 'x-view-over',
+                       selectedClass: 'highlighted',
+                       autoHeight: true,
+                       itemId: 'modDataView',
+                       tbar: [{text: 'test'}],
+                       listeners: {
+                               click: function(view, index, node, event) {
+                                       var el = Ext.fly(node);
+                                       if (el.hasClass('submodule')) {
+                                               TYPO3.ModuleMenu.App.showModule(el.getAttribute('id'));
+                                       }
+                               },
+                               containerclick: function(view, event) {
+                                       var item = event.getTarget('li.menuSection', view.getEl());
+                                       if (item) {
+                                               var el = Ext.fly(item);
+                                               var id = el.getAttribute('id');
+                                               var section = el.first('div'), state;
+                                               if (section.hasClass('expanded')) {
+                                                       state = true;
+                                                       section.removeClass('expanded').addClass('collapsed');
+                                                       el.first('ul').slideOut('t', {
+                                                               easing: 'easeOut',
+                                                               duration: .2,
+                                                               remove: false,
+                                                               useDisplay: true
+                                                       });
+
+                                               } else {
+                                                       state = false;
+                                                       section.removeClass('collapsed').addClass('expanded');
+                                                       el.first('ul').slideIn('t', {
+                                                               easing: 'easeIn',
+                                                               duration: .2,
+                                                               remove: false,
+                                                               useDisplay: true
+                                                       });
+                                               }
+                                               // save menu state
+                                               Ext.Ajax.request({
+                                                       url: 'ajax.php?ajaxID=ModuleMenu::saveMenuState',
+                                                       params: {
+                                                               'menuid': 'modmenu_' + id,
+                                                               'state': state
+                                                       }
+                                               });
+                                       }
+                                       return false;
+                               },
+                               scope: this
+                       }
+               });
+               TYPO3.Backend.ModuleMenuContainer.doLayout();
+       },
+
+       getRecordFromIndex: function(index) {
+               var i, record;
+               for (i = 0; i < TYPO3.ModuleMenu.Store.getCount(); i++) {
+                       record = TYPO3.ModuleMenu.Store.getAt(i);
+                       if (index < record.data.subitems) {
+                               return record.data.sub[index];
+                       }
+                       index -= record.data.subitems;
+               }
+       },
+
+       getRecordFromName: function(name) {
+               var i, j, record;
+               for (i = 0; i < TYPO3.ModuleMenu.Store.getCount(); i++) {
+                       record = TYPO3.ModuleMenu.Store.getAt(i);
+                       for (j = 0; j < record.data.subitems; j++) {
+                               if (record.data.sub[j].name === name) {
+                                       return record.data.sub[j];
+                               }
+                       }
+               }
+       },
+
+       showModule: function(mod, params) {
+               params = params || '';
+               this.selectedModule = mod;
+
+               params = this.includeId(mod, params);
+               var record = this.getRecordFromName(mod);
+
+               if (record) {
+                       this.loadModuleComponents(record, params);
+               } else {
+                               //defined startup module is not present, use the first available instead
+                       this.loadFirstAvailableModule(params);
+               }
+       },
+
+       loadFirstAvailableModule: function(params) {
+               params = params || '';
+               if (TYPO3.ModuleMenu.Store.isLoaded() === false) {
+                       new Ext.util.DelayedTask(
+                               this.loadFirstAvailableModule,
+                               this,
+                               [params]
+                       ).delay(250);
+               } else if (TYPO3.ModuleMenu.Store.getCount() === 0) {
+                               // Store is empty, something went wrong
+                       TYPO3.Flashmessage.display(TYPO3.Severity.error, 'Module loader', 'No module found. If this is a temporary error, please reload the Backend!', 50000);
+               } else {
+                       mod = TYPO3.ModuleMenu.Store.getAt(0).data.sub[0];
+                       this.loadModuleComponents(mod, params);
+               }
+       },
+
+       loadModuleComponents: function(record, params) {
+               var mod = record.name;
+               if (record.navigationComponentId) {
+                               this.loadNavigationComponent(record.navigationComponentId);
+                               TYPO3.Backend.NavigationDummy.hide();
+                               TYPO3.Backend.NavigationIframe.getEl().parent().setStyle('overflow', 'auto');
+                       } else if (record.navframe || record.navigationFrameScript) {
+                               TYPO3.Backend.NavigationDummy.hide();
+                               TYPO3.Backend.NavigationContainer.show();
+                               this.loadNavigationComponent('typo3-navigationIframe');
+                               this.openInNavFrame(record.navigationFrameScript || record.navframe, record.navigationFrameScriptParam);
+                               TYPO3.Backend.NavigationIframe.getEl().parent().setStyle('overflow', 'hidden');
+                       } else {
+                               TYPO3.Backend.NavigationContainer.hide();
+                               TYPO3.Backend.NavigationDummy.show();
+                       }
+
+                       this.highlightModuleMenuItem(mod);
+                       this.loadedModule = mod;
+                       this.openInContentFrame(record.originalLink, params);
+
+                               // compatibility
+                       top.currentSubScript = record.originalLink;
+                       top.currentModuleLoaded = mod;
+
+                       TYPO3.Backend.doLayout();
+       },
+
+       includeId: function(mod, params) {
+                       //get id
+               var section = mod.split('_')[0];
+               if (top.fsMod.recentIds[section]) {
+                       params = 'id=' + top.fsMod.recentIds[section] + '&' + params;
+               }
+
+               return params;
+       },
+
+       loadNavigationComponent: function(navigationComponentId) {
+               if (navigationComponentId === this.loadedNavigationComponentId) {
+                       if (TYPO3.Backend.NavigationContainer.hidden) {
+                               TYPO3.Backend.NavigationContainer.show();
+                       }
+
+                       return;
+               }
+
+               if (this.loadedNavigationComponentId !== '') {
+                       Ext.getCmp(this.loadedNavigationComponentId).hide();
+               }
+
+               var component = Ext.getCmp(navigationComponentId);
+               if (typeof component !== 'object') {
+                       if (typeof this.availableNavigationComponents[navigationComponentId] !== 'function') {
+                               throw 'The navigation component "' + navigationComponentId + '" is not available ' +
+                                       'or has no valid callback function';
+                       }
+
+                       component = this.availableNavigationComponents[navigationComponentId]();
+                       TYPO3.Backend.NavigationContainer.add(component);
+               }
+
+               component.show()
+
+                       // backwards compatibility
+               top.nav = component;
+               
+               TYPO3.Backend.NavigationContainer.show();
+               this.loadedNavigationComponentId = navigationComponentId;
+       },
+
+       registerNavigationComponent: function(componentId, initCallback) {
+               this.availableNavigationComponents[componentId] = initCallback;
+       },
+
+       openInNavFrame: function(url, params) {
+               var navUrl = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '');
+               var currentUrl = this.relativeUrl(TYPO3.Backend.NavigationIframe.getUrl());
+               if (currentUrl !== navUrl) {
+                       TYPO3.Backend.NavigationIframe.setUrl(navUrl);
+               }
+       },
+
+       openInContentFrame: function(url, params) {
+               var urlToLoad;
+               if (top.nextLoadModuleUrl) {
+                       TYPO3.Backend.ContentContainer.setUrl(top.nextLoadModuleUrl);
+                       top.nextLoadModuleUrl = '';
+               } else {
+                       urlToLoad = url + (params ? (url.indexOf('?') !== -1 ? '&' : '?') + params : '')
+                       TYPO3.Backend.ContentContainer.setUrl(urlToLoad);
+                       return;
+               }
+       },
+
+       highlightModuleMenuItem: function(module, mainModule) {
+               TYPO3.Backend.ModuleMenuContainer.getComponent('modDataView').select(module, false, false);
+       },
+
+       relativeUrl: function(url) {
+               return url.replace(TYPO3.configuration.siteUrl + 'typo3/', '');
+       },
+
+       refreshMenu: function() {
+               TYPO3.ModuleMenu.Store.load({
+                       scope: this,
+                       callback: function(records, options) {
+                               this.renderMenu(records);
+                               if (this.loadedModule) {
+                                       this.highlightModuleMenuItem(this.loadedModule);
+                               }
+                       }
+               });
+       },
+
+       reloadFrames: function() {
+               TYPO3.Backend.NavigationIframe.refresh();
+               TYPO3.Backend.ContentContainer.refresh();
+       }
+
+};
+
+
+
+Ext.onReady(function() {
+       TYPO3.ModuleMenu.App.init();
+
+               // keep backward compatibility
+       top.list = TYPO3.Backend.ContentContainer;
+       top.list_frame = top.list.getIframe();
+       top.nav_frame = TYPO3.Backend.NavigationContainer.PageTree;
+
+       top.TYPO3ModuleMenu = TYPO3.ModuleMenu.App;
+       top.content = {
+               nav_frame: TYPO3.Backend.NavigationContainer.PageTree,
+               list_frame: TYPO3.Backend.ContentContainer.getIframe(),
+               location: TYPO3.Backend.ContentContainer.getIframe().location,
+               document: TYPO3.Backend.ContentContainer.getIframe()
+       }
+});
+
+
+/*******************************************************************************
+*
+* Backwards compatability handling down here
+*
+******************************************************************************/
+
+/**
+* Highlight module:
+*/
+var currentlyHighLightedId = '';
+var currentlyHighLighted_restoreValue = '';
+var currentlyHighLightedMain = '';
+function highlightModuleMenuItem(trId, mainModule) {
+       TYPO3.ModuleMenu.App.highlightModule(trId, mainModule);
+}
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/pagetreefiltermenu.js b/typo3/sysext/backend/Resources/Public/JavaScript/pagetreefiltermenu.js
new file mode 100644 (file)
index 0000000..c7aadaa
--- /dev/null
@@ -0,0 +1,65 @@
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2010-2011 Jigal van Hemert <jigal@xs4all.nl>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * class to handle the pagetree filter menu
+ */
+var PagetreeFilterMenu = Class.create({
+
+       /**
+        * registers for resize event listener and executes on DOM ready
+        */
+       initialize: function() {
+               Ext.onReady(function() {
+                       Ext.get('tree-toolbar-filter-item').on('click', this.toggleMenu);
+               }, this);
+       },
+
+       /**
+        * toggles the visibility of the filter
+        */
+       toggleMenu: function(event) {
+               var toolbarItem = Ext.get('tree-toolbar-filter-item');
+               var treeFilterBox = Ext.get('treeFilterBox');
+               var treeFilterItem = Ext.get('treeFilter');
+               var treeFilterReset = Ext.get('treeFilterReset');
+
+               toolbarItem.blur();
+
+               if (toolbarItem.hasClass('active')) {
+                       treeFilterBox.fadeOut();
+                       TYPO3PageTreeFilter.resetSearchField();
+               } else {
+                       treeFilterBox.fadeIn();
+                       treeFilterItem.focus();
+               }
+
+               toolbarItem.toggleClass('active');
+
+       }
+});
+
+var TYPO3BackendFilterMenu = new PagetreeFilterMenu();
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/shortcutmenu.js b/typo3/sysext/backend/Resources/Public/JavaScript/shortcutmenu.js
new file mode 100644 (file)
index 0000000..9d2fd5e
--- /dev/null
@@ -0,0 +1,243 @@
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2007-2011 Ingo Renner <ingo@typo3.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+
+/**
+ * class to handle the shortcut menu
+ */
+var ShortcutMenu = Class.create({
+
+       /**
+        * registers for resize event listener and executes on DOM ready
+        */
+       initialize: function() {
+               Ext.onReady(function() {
+                       Event.observe(
+                               window, 'resize',
+                               function() { TYPO3BackendToolbarManager.positionMenu('shortcut-menu'); }
+                       );
+                       TYPO3BackendToolbarManager.positionMenu('shortcut-menu');
+                       
+                       this.toolbarItemIcon = $$('#shortcut-menu .toolbar-item span.t3-icon')[0];
+
+                       Event.observe($$('#shortcut-menu .toolbar-item')[0], 'click', this.toggleMenu);
+                       this.initControls();
+               }, this);
+       },
+
+       /**
+        * initializes the controls to follow, edit, and delete shortcuts
+        *
+        */
+       initControls: function() {
+
+               $$('.shortcut-label a').each(function(element) {
+                       var shortcutId = element.up('tr.shortcut').identify().slice(9);
+
+                               // map InPlaceEditor to edit icons
+                       var edit = new Ajax.InPlaceEditor('shortcut-label-' + shortcutId, 'ajax.php?ajaxID=ShortcutMenu::saveShortcut', {
+                               externalControl     : 'shortcut-edit-' + shortcutId,
+                               externalControlOnly : true,
+                               highlightcolor      : '#f9f9f9',
+                               highlightendcolor   : '#f9f9f9',
+                               onFormCustomization : this.addGroupSelect,
+                               onComplete          : this.reRenderMenu.bind(this),
+                               callback            : function(form, nameInputFieldValue) {
+                                       var params = form.serialize();
+                                       params += '&shortcutId=' + shortcutId;
+
+                                       return params;
+                               },
+                               textBetweenControls : ' ',
+                               cancelControl       : 'button',
+                               clickToEditText     : '',
+                               htmlResponse        : true
+                       });
+
+                               // follow/execute shortcuts
+                       element.observe('click', function(event) {
+                               this.toggleMenu();
+                       }.bind(this));
+
+               }.bind(this));
+
+                       // activate delete icon
+               $$('.shortcut-delete img').each(function(element) {
+                       element.observe('click', function(event) {
+                               if (confirm('Do you really want to remove this bookmark?')) {
+                                       var deleteControl = event.element();
+                                       var shortcutId = deleteControl.up('tr.shortcut').identify().slice(9);
+
+                                       var del = new Ajax.Request('ajax.php', {
+                                               parameters : 'ajaxID=ShortcutMenu::delete&shortcutId=' + shortcutId,
+                                               onComplete : this.reRenderMenu.bind(this)
+                                       });
+                               }
+                       }.bind(this));
+               }.bind(this));
+
+       },
+
+       /**
+        * toggles the visibility of the menu and places it under the toolbar icon
+        */
+       toggleMenu: function(event) {
+               var toolbarItem = $$('#shortcut-menu > a')[0];
+               var menu        = $$('#shortcut-menu .toolbar-item-menu')[0];
+               toolbarItem.blur();
+
+               if (!toolbarItem.hasClassName('toolbar-item-active')) {
+                       toolbarItem.addClassName('toolbar-item-active');
+                       Effect.Appear(menu, {duration: 0.2});
+                       TYPO3BackendToolbarManager.hideOthers(toolbarItem);
+               } else {
+                       toolbarItem.removeClassName('toolbar-item-active');
+                       Effect.Fade(menu, {duration: 0.1});
+               }
+       },
+
+       /**
+        * adds a select field for the groups
+        */
+       addGroupSelect: function(inPlaceEditor, inPlaceEditorForm) {
+               var selectField = $(document.createElement('select'));
+
+                       // determine the shortcut id
+               var shortcutId  = inPlaceEditorForm.identify().slice(9, -14);
+
+                       // now determine the shortcut's group id
+               var shortcut        = $('shortcut-' + shortcutId).up('tr.shortcut');
+               var firstInGroup    = null;
+               var shortcutGroupId = 0;
+
+               if (shortcut.hasClassName('first-row')) {
+                       firstInGroup = shortcut;
+               } else {
+                       firstInGroup = shortcut.previous('.first-row');
+               }
+
+               if (undefined !== firstInGroup) {
+                       shortcutGroupId = firstInGroup.previous().identify().slice(15);
+               }
+
+               selectField.name = 'shortcut-group';
+               selectField.id = 'shortcut-group-select-' + shortcutId;
+               selectField.size = 1;
+               selectField.setStyle({marginBottom: '5px'});
+
+                       // create options
+               var option;
+                       // first create an option for "no group"
+               option = document.createElement('option');
+               option.value = 0;
+               option.selected = (shortcutGroupId === 0 ? true : false);
+               option.appendChild(document.createTextNode('No Group'));
+               selectField.appendChild(option);
+
+                       // get the groups
+               var getGroups = new Ajax.Request('ajax.php', {
+                       method: 'get',
+                       parameters: 'ajaxID=ShortcutMenu::getGroups',
+                       asynchronous: false, // needs to be synchronous to build the options before adding the selectfield
+                       requestHeaders: {Accept: 'application/json'},
+                       onSuccess: function(transport, json) {
+                               var shortcutGroups = transport.responseText.evalJSON(true);
+
+                                       // explicitly make the object a Hash
+                               shortcutGroups = $H(json.shortcutGroups);
+                               shortcutGroups.each(function(group) {
+                                       option = document.createElement('option');
+                                       option.value = group.key
+                                       option.selected = (shortcutGroupId === group.key ? true : false);
+                                       option.appendChild(document.createTextNode(group.value));
+                                       selectField.appendChild(option);
+                               });
+
+                       }
+               });
+
+               inPlaceEditor._form.appendChild(document.createElement('br'));
+               inPlaceEditor._form.appendChild(selectField);
+               inPlaceEditor._form.appendChild(document.createElement('br'));
+       },
+
+       /**
+        * gets called when the update was succesfull, fetches the complete menu to
+        * honor changes in group assignments
+        */
+       reRenderMenu: function(transport, element, backPath) {
+               var container = $$('#shortcut-menu .toolbar-item-menu')[0];
+               if (!backPath) {
+                       var backPath = '';
+               }
+
+
+               container.setStyle({
+                       height: container.getHeight() + 'px'
+               });
+               container.update('LOADING');
+
+               var render = new Ajax.Updater(
+                       container,
+                       backPath + 'ajax.php',
+                       {
+                               parameters : 'ajaxID=ShortcutMenu::render',
+                               asynchronous : false
+                       }
+               );
+
+               container.setStyle({
+                       height: 'auto'
+               });
+
+               this.initControls();
+       },
+
+       /**
+        * makes a call to the backend class to create a new shortcut,
+        * when finished it reloads the menu
+        */
+       createShortcut: function(backPath, moduleName, url) {
+               var toolbarItemIcon = $$('#shortcut-menu .toolbar-item span.t3-icon')[0];
+
+               var parent = Element.up(toolbarItemIcon);
+               var spinner = new Element('span').addClassName('spinner');
+               var oldIcon = toolbarItemIcon.replace(spinner);
+
+                       // synchrous call to wait for it to complete and call the render
+                       // method with backpath _afterwards_
+               var call = new Ajax.Request(backPath + 'ajax.php', {
+                       parameters : 'ajaxID=ShortcutMenu::create&module=' + moduleName + '&url=' + url,
+                       asynchronous : false
+               });
+
+               this.reRenderMenu(null, null, backPath);
+               spinner.replace(oldIcon);
+       }
+
+});
+
+var TYPO3BackendShortcutMenu = new ShortcutMenu();
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/tabmenu.js b/typo3/sysext/backend/Resources/Public/JavaScript/tabmenu.js
new file mode 100644 (file)
index 0000000..d036b49
--- /dev/null
@@ -0,0 +1,100 @@
+/***************************************************************
+ *
+ *  javascript functions regarding the "dyntabmenu"
+ *  used throughout the TYPO3 backend
+ *
+ *  Copyright notice
+ *
+ *  (c) 2003-2011 Kasper Skaarhoj <kasperYYYY@typo3.com>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 t3lib/ library provided by
+ *  Kasper Skaarhoj <kasper@typo3.com> together with TYPO3
+ *
+ *  Released under GNU/GPL (see license file in tslib/)
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *  This copyright notice MUST APPEAR in all copies of this script
+ *
+ ***************************************************************/
+
+var DTM_array = DTM_array || [],
+       DTM_origClass = DTM_origClass || '';
+
+       // if tabs are used in a popup window the array might not exists
+if (!top.DTM_currentTabs) {
+       top.DTM_currentTabs = [];
+}
+
+function DTM_activate(idBase,index,doToogle) {
+               // Hiding all:
+       if (DTM_array[idBase]) {
+               for(var cnt = 0; cnt < DTM_array[idBase].length; cnt++) {
+                       if (DTM_array[idBase][cnt] !== idBase + '-' + index) {
+                               document.getElementById(DTM_array[idBase][cnt]+'-DIV').style.display = 'none';
+                               // Only Overriding when Tab not disabled
+                               if (document.getElementById(DTM_array[idBase][cnt]+'-MENU').attributes.getNamedItem('class').nodeValue !== 'disabled') {
+                                       document.getElementById(DTM_array[idBase][cnt]+'-MENU').attributes.getNamedItem('class').nodeValue = 'tab';
+                               }
+                       }
+               }
+       }
+
+               // Showing one:
+       if (document.getElementById(idBase+'-'+index+'-DIV')) {
+               if (doToogle && document.getElementById(idBase+'-'+index+'-DIV').style.display === 'block') {
+                       document.getElementById(idBase+'-'+index+'-DIV').style.display = 'none';
+                       if (DTM_origClass === '') {
+                               document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tab';
+                       } else {
+                               DTM_origClass = 'tab';
+                       }
+                       top.DTM_currentTabs[idBase] = -1;
+               } else {
+                       document.getElementById(idBase+'-'+index+'-DIV').style.display = 'block';
+                       if (DTM_origClass === '') {
+                               document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tabact';
+                       } else {
+                               DTM_origClass = 'tabact';
+                       }
+                       top.DTM_currentTabs[idBase] = index;
+               }
+       }
+       document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tabact';
+}
+function DTM_toggle(idBase,index,isInit) {
+               // Showing one:
+       if (document.getElementById(idBase+'-'+index+'-DIV')) {
+               if (document.getElementById(idBase+'-'+index+'-DIV').style.display === 'block') {
+                       document.getElementById(idBase+'-'+index+'-DIV').style.display = 'none';
+                       if (isInit) {
+                               document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tab';
+                       } else {
+                               DTM_origClass = 'tab';
+                       }
+                       top.DTM_currentTabs[idBase+'-'+index] = 0;
+               } else {
+                       document.getElementById(idBase+'-'+index+'-DIV').style.display = 'block';
+                       if (isInit) {
+                               document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tabact';
+                       } else {
+                               DTM_origClass = 'tabact';
+                       }
+                       top.DTM_currentTabs[idBase+'-'+index] = 1;
+               }
+       }
+}
+
+function DTM_mouseOver(obj) {
+               DTM_origClass = obj.attributes.getNamedItem('class').nodeValue;
+               obj.attributes.getNamedItem('class').nodeValue += '_over';
+}
+
+function DTM_mouseOut(obj) {
+               obj.attributes.getNamedItem('class').nodeValue = DTM_origClass;
+               DTM_origClass = '';
+}
+
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/toolbarmanager.js b/typo3/sysext/backend/Resources/Public/JavaScript/toolbarmanager.js
new file mode 100644 (file)
index 0000000..30fa507
--- /dev/null
@@ -0,0 +1,71 @@
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2007-2011 Ingo Renner <ingo@typo3.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+
+var ToolbarManager = Class.create({
+
+       /**
+        * hides all toolbar item menus except for the which was clicked
+        */
+       hideOthers: function(toolbarItem) {
+               var sibling = toolbarItem.next();
+
+                       // check whether it is a toolbar item with menu
+               if (sibling.hasClassName('toolbar-item-menu')) {
+                       this.hideAll();
+                               // show toolbarItem
+                       toolbarItem.addClassName('toolbar-item-active');
+               }
+       },
+
+       /**
+        * Hide all expanded toolbar menus
+        */
+       hideAll: function() {
+               $$('#typo3-toolbar a.toolbar-item + .toolbar-item-menu').invoke('hide');
+               $$('#typo3-toolbar a.toolbar-item').each(function(element) {
+                       element.removeClassName('toolbar-item-active');
+               });
+       },
+
+       /**
+        * refreshs positioning of all submenus
+        */
+       refreshAll: function() {
+       },
+
+       /**
+        * positions a toolbar item (has to have .toolbar-item-menu)
+        * @param elementId The parent element ofthe menu to be positioned
+        */
+       positionMenu: function(elementId) {
+       }
+
+});
+
+var TYPO3BackendToolbarManager = new ToolbarManager();
+
+