Bug #19985 » 10377_v2.diff
typo3/js/backend.js (working copy) | ||
---|---|---|
*/
|
||
function jump(url, modName, mainModName) {
|
||
// clear information about which entry in nav. tree that might have been highlighted.
|
||
top.fsMod.navFrameHighlightedID = new Array();
|
||
top.fsMod.navFrameHighlightedID = [];
|
||
if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
|
||
top.content.nav_frame.refresh_nav();
|
||
... | ... | |
* 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') {
|
||
if (confirm(confirmQuestion)) {
|
||
if (typeof TYPO3BackendShortcutMenu !== undefined) {
|
||
// backend.php
|
||
TYPO3BackendShortcutMenu.createShortcut('', moduleName, url);
|
||
}
|
||
if(top.shortcutFrame) {
|
||
if (top.shortcutFrame) {
|
||
// alt_main.php
|
||
var location = backPath + 'alt_shortcut.php?modName=' + moduleName + '&URL=' + url;
|
||
shortcutFrame.location.href = location;
|
||
... | ... | |
var output = "";
|
||
var pointer=0;
|
||
var pos = input.indexOf(matchStr);
|
||
while (pos!=-1) {
|
||
while (pos !== -1) {
|
||
output+=""+input.substr(pointer, pos-pointer)+replace;
|
||
pointer=pos+matchStr.length;
|
||
pos = input.indexOf(match,pos+1);
|
||
... | ... | |
* 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 = 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
|
||
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();
|
||
... | ... | |
*/
|
||
function debugObj(obj,name) { //
|
||
var acc;
|
||
for (i in obj) {
|
||
for (var i in obj) {
|
||
if (obj[i]) {
|
||
acc+=i+": "+obj[i]+"\n";
|
||
}
|
||
... | ... | |
var currentSubNavScript = "";
|
||
// Used for tab-panels:
|
||
var DTM_currentTabs = new Array();
|
||
var DTM_currentTabs = [];
|
||
// status of WS FE preview
|
||
var WorkspaceFrontendPreviewEnabled = TYPO3.configuration.workspaceFrontendPreviewEnabled;
|
typo3/js/backendsearch.js (working copy) | ||
---|---|---|
$('search-query').observe('keypress', function(event) {
|
||
var keyCode;
|
||
if(!event) {
|
||
if (!event) {
|
||
var event = window.event;
|
||
}
|
||
if(event.keyCode) {
|
||
if (event.keyCode) {
|
||
keyCode = event.keyCode;
|
||
} else if(event.which) {
|
||
} else if (event.which) {
|
||
keyCode = event.which;
|
||
}
|
||
if(keyCode == Event.KEY_RETURN) {
|
||
if (keyCode === Event.KEY_RETURN) {
|
||
TYPO3BackendSearchMenu.invokeSearch();
|
||
}
|
||
});
|
||
... | ... | |
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if(toolbarItem.down().hasClassName('no-separator')) {
|
||
if (toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
... | ... | |
var menu = $$('#backend-search-menu .toolbar-item-menu')[0];
|
||
toolbarItem.blur();
|
||
if(!toolbarItem.hasClassName('toolbar-item-active')) {
|
||
if (!toolbarItem.hasClassName('toolbar-item-active')) {
|
||
toolbarItem.addClassName('toolbar-item-active');
|
||
Effect.Appear(menu, {duration: 0.2});
|
||
TYPO3BackendToolbarManager.hideOthers(toolbarItem);
|
||
... | ... | |
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) {
|
||
if (top.content && top.content.nav_frame && top.content.nav_frame.refresh_nav) {
|
||
top.content.nav_frame.refresh_nav();
|
||
}
|
||
typo3/js/browse_links.js (working copy) | ||
---|---|---|
parent.close();
|
||
}
|
||
}
|
||
}
|
||
};
|
||
BrowseLinks.File = {
|
||
insertElement: function(index, close) {
|
||
var result = false;
|
||
if (typeof BrowseLinks.elements[index] != 'undefined') {
|
||
if (typeof BrowseLinks.elements[index] !== undefined) {
|
||
var element = BrowseLinks.elements[index];
|
||
result = insertElement(
|
||
'', element.md5, element.type,
|
||
element.fileName, element.filePath, element.fileExt,
|
||
element.fileIcon, '', close
|
||
);
|
||
element.fileIcon, '', close);
|
||
}
|
||
return result;
|
||
}
|
typo3/js/clearcachemenu.js (working copy) | ||
---|---|---|
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if(toolbarItem.down().hasClassName('no-separator')) {
|
||
if (toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
... | ... | |
var menu = $$('#clear-cache-actions-menu .toolbar-item-menu')[0];
|
||
toolbarItem.blur();
|
||
if(!toolbarItem.hasClassName('toolbar-item-active')) {
|
||
if (!toolbarItem.hasClassName('toolbar-item-active')) {
|
||
toolbarItem.addClassName('toolbar-item-active');
|
||
Effect.Appear(menu, {duration: 0.2});
|
||
TYPO3BackendToolbarManager.hideOthers(toolbarItem);
|
||
... | ... | |
// activate the spinner
|
||
toolbarItemIcon.src = 'gfx/spinner.gif';
|
||
if (clickedElement.tagName == 'IMG') {
|
||
if (clickedElement.tagName === 'IMG') {
|
||
url = clickedElement.up('a').href;
|
||
} else {
|
||
url = clickedElement.href;
|
||
}
|
||
if (url) {
|
||
new Ajax.Request(url, {
|
||
var call = new Ajax.Request(url, {
|
||
'method': 'get',
|
||
'onComplete': function() {
|
||
toolbarItemIcon.src = this.toolbarItemIcon;
|
typo3/js/clickmenu.js (working copy) | ||
---|---|---|
* @return nothing
|
||
*/
|
||
show: function(table, uid, listFr, enDisItems, backPath, addParams) {
|
||
var params = 'table=' + encodeURIComponent(table)
|
||
+ '&uid=' + uid
|
||
+ '&listFr=' + listFr
|
||
+ '&enDisItems=' + enDisItems
|
||
+ '&backPath=' + backPath
|
||
+ '&addParams=' + addParams;
|
||
var params = 'table=' + encodeURIComponent(table) +
|
||
'&uid=' + uid +
|
||
'&listFr=' + listFr +
|
||
'&enDisItems=' + enDisItems +
|
||
'&backPath=' + backPath +
|
||
'&addParams=' + addParams;
|
||
this.callURL(params);
|
||
},
|
||
... | ... | |
callURL: function(params) {
|
||
if (this.ajax && Ajax.getTransport()) { // run with AJAX
|
||
params += '&ajax=1';
|
||
new Ajax.Request(this.clickURL, {
|
||
var call = new Ajax.Request(this.clickURL, {
|
||
method: 'get',
|
||
parameters: params,
|
||
onComplete: function(xhr) {
|
||
var response = xhr.responseXML;
|
||
if (!response.getElementsByTagName('data')[0]) return;
|
||
if (!response.getElementsByTagName('data')[0]) {
|
||
return;
|
||
}
|
||
var menu = response.getElementsByTagName('data')[0].getElementsByTagName('clickmenu')[0];
|
||
var data = menu.getElementsByTagName('htmltable')[0].firstChild.data;
|
||
var level = menu.getElementsByTagName('cmlevel')[0].firstChild.data;
|
||
... | ... | |
* @param level the depth of the clickmenu
|
||
*/
|
||
populateData: function(data, level) {
|
||
if (!$('contentMenu0')) this.addClickmenuItem();
|
||
level = parseInt(level) || 0;
|
||
if (!$('contentMenu0')) {
|
||
this.addClickmenuItem();
|
||
}
|
||
level = parseInt(level, 10) || 0;
|
||
var obj = $('contentMenu' + level);
|
||
if (obj && (level == 0 || Element.visible('contentMenu' + (level-1)))) {
|
||
if (obj && (level === 0 || Element.visible('contentMenu' + (level-1)))) {
|
||
obj.innerHTML = data;
|
||
var x = this.mousePos.X;
|
||
var y = this.mousePos.Y;
|
||
... | ... | |
obj = $(obj);
|
||
if (obj && Element.visible(obj) && !Position.within(obj, this.mousePos.X, this.mousePos.Y)) {
|
||
this.hide(obj);
|
||
if (/MSIE5/.test(navigator.userAgent) && obj.id == 'contentMenu0') {
|
||
if (/MSIE5/.test(navigator.userAgent) && obj.id === 'contentMenu0') {
|
||
this._toggleSelectorBoxes('visible');
|
||
}
|
||
}
|
||
... | ... | |
* @result nothing
|
||
*/
|
||
_toggleSelectorBoxes: function(action) {
|
||
for (i = 0; i < document.forms.length; i++) {
|
||
for (j = 0; j < document.forms[i].elements.length; j++) {
|
||
for (var i = 0; i < document.forms.length; i++) {
|
||
for (var j = 0; j < document.forms[i].elements.length; j++) {
|
||
if (document.forms[i].elements[j].type == 'select-one') {
|
||
document.forms[i].elements[j].style.visibility = action;
|
||
}
|
||
... | ... | |
*/
|
||
addClickmenuItem: function() {
|
||
var code = '<div id="contentMenu0" style="display: block;"></div><div id="contentMenu1" style="display: block;"></div>';
|
||
new Insertion.Bottom(document.getElementsByTagName('body')[0], code);
|
||
var insert = new Insertion.Bottom(document.getElementsByTagName('body')[0], code);
|
||
}
|
||
}
|
||
... | ... | |
function showClickmenu_raw(url) {
|
||
var parts = url.split('?');
|
||
if (parts.length == 2) {
|
||
if (parts.length === 2) {
|
||
Clickmenu.clickURL = parts[0];
|
||
Clickmenu.callURL(parts[1]);
|
||
} else {
|
||
... | ... | |
return false;
|
||
}
|
||
function hideSpecific(level) {
|
||
if (level == 0 || level == 1) {
|
||
if (level === 0 || level === 1) {
|
||
Clickmenu.hide('contentMenu'+level);
|
||
}
|
||
}
|
typo3/js/common.js (working copy) | ||
---|---|---|
// if the TYPO3 AJAX backend is used,
|
||
// the onSuccess & onComplete callbacks are hooked
|
||
if (request.url.indexOf("ajax.php") == -1) {
|
||
if (request.url.indexOf("ajax.php") === -1) {
|
||
return;
|
||
}
|
||
... | ... | |
} else {
|
||
origComplete(xhr, json);
|
||
}
|
||
}
|
||
};
|
||
}
|
||
}
|
||
});
|
||
}
|
||
var T3AJAX = new Object();
|
||
var T3AJAX = {};
|
||
T3AJAX.showError = function(xhr, json) {
|
||
if (typeof xhr.responseText != 'undefined' && xhr.responseText) {
|
||
if (typeof Ext.MessageBox != 'undefined') {
|
||
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 = {
|
||
... | ... | |
helpers: {
|
||
// creates an array by splitting a string into parts, taking a delimiter
|
||
split: function(str, delim) {
|
||
var res = new Array();
|
||
var res = [];
|
||
while (str.indexOf(delim) > 0) {
|
||
res.push(str.substr(0, str.indexOf(delim)));
|
||
str = str.substr(str.indexOf(delim) + delim.length);
|
typo3/js/constantEditor.js (working copy) | ||
---|---|---|
var userDiv = $('userTS-'+paramName);
|
||
var checkBox = $('check[' + paramName + ']');
|
||
|
||
if(editIcon.hasClassName('editIcon')) {
|
||
if (editIcon.hasClassName('editIcon')) {
|
||
$(defaultDiv).hide();
|
||
$(userDiv).show().setStyle({backgroundColor: '#fdf8bd'});
|
||
$(checkBox).enable().setValue('checked');
|
||
}
|
||
|
||
if(editIcon.hasClassName('undoIcon')) {
|
||
if (editIcon.hasClassName('undoIcon')) {
|
||
$(userDiv).hide();
|
||
$(defaultDiv).show();
|
||
$(checkBox).setValue('').disable();
|
||
... | ... | |
$(colorBox).setStyle({backgroundColor: colorValue});
|
||
|
||
$(colorSelect).childElements().each(function(option) {
|
||
if(option.value == colorValue) {
|
||
if (option.value === colorValue) {
|
||
option.selected = true;
|
||
} else {
|
||
option.selected = false;
|
typo3/js/extjs/backendsizemanager.js (working copy) | ||
---|---|---|
var consoleHeight = debugConsole.isVisible() ? 0 : debugConsole.getHeight() + debugConsole.getHeight();
|
||
var styles = {
|
||
height: (viewportHeight - topHeight - consoleHeight) + 'px'
|
||
}
|
||
};
|
||
Ext.get('typo3-side-menu').setStyle(styles);
|
||
Ext.get('content').setStyle(styles);
|
||
}
|
||
};
|
||
Ext.EventManager.onWindowResize(resizeBackend);
|
||
Ext.onReady(function() {
|
typo3/js/extjs/viewportConfiguration.js (working copy) | ||
---|---|---|
activate: function(tab) {
|
||
var i, id = [], tabCount = tab.ownerCt.items.getCount();
|
||
// get tab id's
|
||
for (var i = 1; i < tabCount; i++) {
|
||
for (i = 1; i < tabCount; i++) {
|
||
id.push(tab.ownerCt.items.keys[i]);
|
||
}
|
||
// remove all tabs except first
|
||
for (var i = 0; i < id.length; i++) {
|
||
for (i = 0; i < id.length; i++) {
|
||
tab.ownerCt.remove(id[i]);
|
||
}
|
||
tab.ownerCt.hide();
|
typo3/js/flashupload.js (working copy) | ||
---|---|---|
]
|
||
};
|
||
// set the default options, if not set yet by the application from outside
|
||
Ext.applyIf(this, initialConfig);
|
||
Ext.applyif(this, initialConfig);
|
||
// set default options that cannot be overriden from outside
|
||
var staticConfig = {
|
||
... | ... | |
if (swfConfig.file_upload_limit) {
|
||
txt += String.format(TYPO3.LLL.fileUpload.infoComponentFileUploadLimit, swfConfig.file_upload_limit) + '<br/>';
|
||
}
|
||
if (swfConfig.file_types != '*.*') {
|
||
if (swfConfig.file_types !== '*.*') {
|
||
txt += String.format(TYPO3.LLL.fileUpload.infoComponentFileTypeLimit, swfConfig.file_types);
|
||
}
|
||
this.insert(0, new Ext.Panel({
|
||
... | ... | |
* SWFupload needs it to be (*.jpg;*.gif) and also adds deny file patterns
|
||
*/
|
||
setFileTypeRestrictions: function(typo3FileTypes) {
|
||
if (typo3FileTypes.allow && typo3FileTypes.allow != '' && typo3FileTypes.allow != '*') {
|
||
if (typo3FileTypes.allow && typo3FileTypes.allow !== '' && typo3FileTypes.allow !== '*') {
|
||
var allowedFiles = TYPO3.helpers.split(typo3FileTypes.allow, ',');
|
||
this.swfDefaultConfig.file_types = '*.' + allowedFiles.join(';*.');
|
||
}
|
||
if (typo3FileTypes.deny && typo3FileTypes.deny != '') {
|
||
if (typo3FileTypes.deny && typo3FileTypes.deny !== '') {
|
||
this.deniedFileTypes = typo3FileTypes.deny;
|
||
}
|
||
},
|
||
... | ... | |
denyTypes += (denyTypes.length ? ',' : '') + TS.denyFileTypes;
|
||
denyTypes = ',' + denyTypes + ',';
|
||
var reg = new RegExp(',' + ext + ',', 'i');
|
||
if (denyTypes.search(reg) == -1) {
|
||
if (denyTypes.search(reg) === -1) {
|
||
return true;
|
||
}
|
||
}
|
||
... | ... | |
// private
|
||
// this handler is only called by totalComplete, not by swfupload itself
|
||
totalError: function() {
|
||
if (this.lastError == null) {
|
||
if (this.lastError === null) {
|
||
return;
|
||
}
|
||
... | ... | |
TYPO3.addInstance('FileUploadWindow', instance);
|
||
}
|
||
return instance;
|
||
}
|
||
};
|
||
// This function checks through the SWFObject if the required flash player is available
|
||
TYPO3.FileUploadWindow.isFlashAvailable = function() {
|
||
return swfobject.hasFlashPlayerVersion(TYPO3.FileUploadWindow.prototype.swfDefaultConfig.minimum_flash_version);
|
||
}
|
||
};
|
||
/**
|
||
* This class includes one instance of an upload
|
typo3/js/iecompatibility.js (working copy) | ||
---|---|---|
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')) {
|
||
if (Object.isElement(element) && element.tagName === 'IMG' && element.src.endsWith('.png')) {
|
||
var alphaImgSrc = element.src;
|
||
var sizingMethod = 'scale';
|
||
element.src = transparentGifPath;
|
||
... | ... | |
Event.observe(window, 'load', function() {
|
||
if (Prototype.Browser.IE) {
|
||
var version = parseFloat(navigator.appVersion.split(';')[1].strip().split(' ')[1]);
|
||
if (version == 6) {
|
||
if (version === 6) {
|
||
$$('img').each(function(img){
|
||
img.pngHack();
|
||
});
|
||
... | ... | |
}
|
||
});
|
||
if(Prototype.Browser.IE) {
|
||
if (Prototype.Browser.IE) {
|
||
var TYPO3IECompatibilty = new IECompatibility();
|
||
}
|
typo3/js/loginrefresh.js (working copy) | ||
---|---|---|
method: "GET",
|
||
success: function(response, options) {
|
||
var result = Ext.util.JSON.decode(response.responseText);
|
||
if(result.login.locked) {
|
||
if (result.login.locked) {
|
||
this.locked = 1;
|
||
Ext.MessageBox.show({
|
||
title: TYPO3.LLL.core.please_wait,
|
||
... | ... | |
buttons: [{
|
||
text: TYPO3.LLL.core.refresh_login_refresh_button,
|
||
handler: function() {
|
||
refresh = Ext.Ajax.request({
|
||
var refresh = Ext.Ajax.request({
|
||
url: "ajax.php",
|
||
params: {
|
||
"ajaxID": "BackendLogin::isTimedOut"
|
||
... | ... | |
});
|
||
progressControl.on('update', function(control, value, text) {
|
||
var rest = 30-(parseInt(value*30));
|
||
var rest = 30-(value * 30);
|
||
if (rest === 1) {
|
||
control.updateText(String.format(TYPO3.LLL.core.refresh_login_countdown_singular, rest));
|
||
} else {
|
||
... | ... | |
showLoginPopup: function() {
|
||
Ext.getCmp("loginRefreshWindow").hide();
|
||
vHWin=window.open("login_frameset.php","relogin_"+TS.uniqueID,"height=450,width=700,status=0,menubar=0,location=1");
|
||
var vHWin = window.open("login_frameset.php","relogin_" + TS.uniqueID,"height=450,width=700,status=0,menubar=0,location=1");
|
||
vHWin.focus();
|
||
},
|
||
... | ... | |
if (fields.p_field === "") {
|
||
Ext.Msg.alert(TYPO3.LLL.core.refresh_login_failed, TYPO3.LLL.core.refresh_login_emptyPassword);
|
||
} else {
|
||
if (TS.securityLevel == "superchallenged") {
|
||
if (TS.securityLevel === "superchallenged") {
|
||
fields.p_field = MD5(fields.p_field);
|
||
}
|
||
if (TS.securityLevel == "superchallenged" || TS.securityLevel == "challenged") {
|
||
if (TS.securityLevel === "superchallenged" || TS.securityLevel === "challenged") {
|
||
fields.challenge = challenge;
|
||
fields.userident = MD5(fields.username + ":" + fields.p_field + ":" + challenge);
|
||
} else {
|
||
... | ... | |
},
|
||
triggerSubmitForm: function() {
|
||
if (TS.securityLevel == 'superchallenged' || TS.securityLevel == 'challenged') {
|
||
if (TS.securityLevel === 'superchallenged' || TS.securityLevel === 'challenged') {
|
||
Ext.Ajax.request({
|
||
url: 'ajax.php',
|
||
params: {
|
typo3/js/modulemenu.js (working copy) | ||
---|---|---|
*/
|
||
registerEventListeners: function() {
|
||
$$('#typo3-menu li.menuSection div').invoke('observe', 'click', this.toggleMenu);
|
||
if(Prototype.Browser.IE) {
|
||
if (Prototype.Browser.IE) {
|
||
//mouseenter and mouseleave are only available but thats our target
|
||
$$('#typo3-menu li.menuSection li').invoke('observe', 'mouseenter', this.toggleHoverClass);
|
||
$$('#typo3-menu li.menuSection li').invoke('observe', 'mouseleave', this.toggleHoverClass);
|
||
... | ... | |
var mainMenuId = mainModuleHeader.up().identify();
|
||
var subModulesMenu = mainModuleHeader.next('ul');
|
||
if (!subModulesMenu) return;
|
||
if (!subModulesMenu) {
|
||
return;
|
||
}
|
||
var state = subModulesMenu.visible();
|
||
// save state
|
||
new Ajax.Request('ajax.php', {
|
||
var save = new Ajax.Request('ajax.php', {
|
||
parameters : 'ajaxID=ModuleMenu::saveMenuState&menuid=' + mainMenuId + '&state=' + state
|
||
});
|
||
if(state) {
|
||
if (state) {
|
||
Effect.BlindUp(subModulesMenu, {duration : 0.1});
|
||
$(mainModuleHeader).removeClassName('expanded');
|
||
$(mainModuleHeader).addClassName('collapsed');
|
||
... | ... | |
* refreshes the complete module menu
|
||
*/
|
||
refreshMenu: function() {
|
||
new Ajax.Updater('typo3-menu', TS.PATH_typo3 + 'ajax.php', {
|
||
var refresh = new Ajax.Updater('typo3-menu', TS.PATH_typo3 + 'ajax.php', {
|
||
parameters : 'ajaxID=ModuleMenu::render',
|
||
asynchronous : false,
|
||
evalScripts : true
|
||
... | ... | |
$(moduleId).addClassName('highlighted');
|
||
}
|
||
if(undefined != mainModule) {
|
||
if (undefined !== mainModule) {
|
||
this.currentlyHighLightedMainModule = mainModule;
|
||
}
|
||
this.currentlyHighlightedModuleId = moduleId;
|
typo3/js/shortcutmenu.js (working copy) | ||
---|---|---|
var shortcutId = element.up('tr.shortcut').identify().slice(9);
|
||
// map InPlaceEditor to edit icons
|
||
new Ajax.InPlaceEditor('shortcut-label-' + shortcutId, 'ajax.php?ajaxID=ShortcutMenu::saveShortcut', {
|
||
var edit = new Ajax.InPlaceEditor('shortcut-label-' + shortcutId, 'ajax.php?ajaxID=ShortcutMenu::saveShortcut', {
|
||
externalControl : 'shortcut-edit-' + shortcutId,
|
||
externalControlOnly : true,
|
||
highlightcolor : '#f9f9f9',
|
||
... | ... | |
// follow/execute shortcuts
|
||
element.observe('click', function(event) {
|
||
Event.stop(event);
|
||
this.toggleMenu();
|
||
}.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 shortcut?')) {
|
||
if (confirm('Do you really want to remove this shortcut?')) {
|
||
var deleteControl = event.element();
|
||
var shortcutId = deleteControl.up('tr.shortcut').identify().slice(9);
|
||
new Ajax.Request('ajax.php', {
|
||
var del = new Ajax.Request('ajax.php', {
|
||
parameters : 'ajaxID=ShortcutMenu::delete&shortcutId=' + shortcutId,
|
||
onComplete : this.reRenderMenu.bind(this)
|
||
});
|
||
... | ... | |
positionMenu: function() {
|
||
var calculatedOffset = 0;
|
||
var parentWidth = $('shortcut-menu').getWidth();
|
||
var currentToolbarItemLayer = $$('#shortcut-menu .toolbar-item-menu')[0];
|
||
var currentToolbarItemLayer = $$('#shortcut-menu .toolbar-item-menu')[0];
|
||
var ownWidth = currentToolbarItemLayer.getWidth();
|
||
var parentSiblings = $('shortcut-menu').previousSiblings();
|
||
... | ... | |
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if(toolbarItem.down().hasClassName('no-separator')) {
|
||
if (toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
... | ... | |
var menu = $$('#shortcut-menu .toolbar-item-menu')[0];
|
||
toolbarItem.blur();
|
||
if(!toolbarItem.hasClassName('toolbar-item-active')) {
|
||
if (!toolbarItem.hasClassName('toolbar-item-active')) {
|
||
toolbarItem.addClassName('toolbar-item-active');
|
||
Effect.Appear(menu, {duration: 0.2});
|
||
TYPO3BackendToolbarManager.hideOthers(toolbarItem);
|
||
... | ... | |
toolbarItem.removeClassName('toolbar-item-active');
|
||
Effect.Fade(menu, {duration: 0.1});
|
||
}
|
||
Event.stop(event);
|
||
},
|
||
/**
|
||
... | ... | |
var firstInGroup = null;
|
||
var shortcutGroupId = 0;
|
||
if(shortcut.hasClassName('first-row')) {
|
||
if (shortcut.hasClassName('first-row')) {
|
||
firstInGroup = shortcut;
|
||
} else {
|
||
firstInGroup = shortcut.previous('.first-row');
|
||
}
|
||
if(undefined != firstInGroup) {
|
||
if (undefined !== firstInGroup) {
|
||
shortcutGroupId = firstInGroup.previous().identify().slice(15);
|
||
}
|
||
... | ... | |
// first create an option for "no group"
|
||
option = document.createElement('option');
|
||
option.value = 0;
|
||
option.selected = (shortcutGroupId == 0 ? true : false);
|
||
option.selected = (shortcutGroupId === 0 ? true : false);
|
||
option.appendChild(document.createTextNode('No Group'));
|
||
selectField.appendChild(option);
|
||
// get the groups
|
||
new Ajax.Request('ajax.php', {
|
||
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
|
||
... | ... | |
shortcutGroups.each(function(group) {
|
||
option = document.createElement('option');
|
||
option.value = group.key
|
||
option.selected = (shortcutGroupId == group.key ? true : false);
|
||
option.selected = (shortcutGroupId === group.key ? true : false);
|
||
option.appendChild(document.createTextNode(group.value));
|
||
selectField.appendChild(option);
|
||
});
|
||
... | ... | |
*/
|
||
reRenderMenu: function(transport, element, backPath) {
|
||
var container = $$('#shortcut-menu .toolbar-item-menu')[0];
|
||
if(!backPath) {
|
||
if (!backPath) {
|
||
var backPath = '';
|
||
}
|
||
... | ... | |
});
|
||
container.update('LOADING');
|
||
new Ajax.Updater(
|
||
var render = new Ajax.Updater(
|
||
container,
|
||
backPath + 'ajax.php',
|
||
{
|
||
... | ... | |
// synchrous call to wait for it to complete and call the render
|
||
// method with backpath _afterwards_
|
||
new Ajax.Request(backPath + 'ajax.php', {
|
||
var call = new Ajax.Request(backPath + 'ajax.php', {
|
||
parameters : 'ajaxID=ShortcutMenu::create&module=' + moduleName + '&url=' + url,
|
||
asynchronous : false
|
||
});
|
typo3/js/tabmenu.js (working copy) | ||
---|---|---|
*
|
||
***************************************************************/
|
||
var DTM_array = new Array();
|
||
var DTM_origClass = new String();
|
||
var DTM_array = [];
|
||
var DTM_origClass ='';
|
||
// if tabs are used in a popup window the array might not exists
|
||
if(!top.DTM_currentTabs) {
|
||
top.DTM_currentTabs = new Array();
|
||
if (!top.DTM_currentTabs) {
|
||
top.DTM_currentTabs = [];
|
||
}
|
||
function DTM_activate(idBase,index,doToogle) {
|
||
// Hiding all:
|
||
if (DTM_array[idBase]) {
|
||
for(cnt = 0; cnt < DTM_array[idBase].length ; cnt++) {
|
||
if (DTM_array[idBase][cnt] != idBase+'-'+index) {
|
||
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') {
|
||
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') {
|
||
if (doToogle && document.getElementById(idBase+'-'+index+'-DIV').style.display === 'block') {
|
||
document.getElementById(idBase+'-'+index+'-DIV').style.display = 'none';
|
||
if(DTM_origClass=='') {
|
||
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=='') {
|
||
if (DTM_origClass === '') {
|
||
document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tabact';
|
||
} else {
|
||
DTM_origClass = 'tabact';
|
||
... | ... | |
function DTM_toggle(idBase,index,isInit) {
|
||
// Showing one:
|
||
if (document.getElementById(idBase+'-'+index+'-DIV')) {
|
||
if (document.getElementById(idBase+'-'+index+'-DIV').style.display == 'block') {
|
||
if (document.getElementById(idBase+'-'+index+'-DIV').style.display === 'block') {
|
||
document.getElementById(idBase+'-'+index+'-DIV').style.display = 'none';
|
||
if(isInit) {
|
||
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) {
|
||
if (isInit) {
|
||
document.getElementById(idBase+'-'+index+'-MENU').attributes.getNamedItem('class').nodeValue = 'tabact';
|
||
} else {
|
||
DTM_origClass = 'tabact';
|
typo3/js/toolbarmanager.js (working copy) | ||
---|---|---|
var sibling = toolbarItem.next();
|
||
// check whether it is a toolbar item with menu
|
||
if(sibling.hasClassName('toolbar-item-menu')) {
|
||
if (sibling.hasClassName('toolbar-item-menu')) {
|
||
// hide all
|
||
$$('#typo3-toolbar a.toolbar-item + .toolbar-item-menu').invoke('hide');
|
||
$$('#typo3-toolbar a.toolbar-item').each(function(element) {
|
typo3/js/tree.js (working copy) | ||
---|---|---|
*
|
||
* @author Benjamin Mack
|
||
*/
|
||
|
||
// new object-oriented drag and drop - code,
|
||
// tested in IE 6, Firefox 2, Opera 9
|
||
var DragDrop = {
|
||
dragID: null,
|
||
// options needed for doing the changes when dropping
|
||
table: null, // can be "pages" or "folders"
|
||
changeURL: null,
|
||
backPath: null,
|
||
dragElement: function(event, elementID) {
|
||
Event.stop(event); // stop bubbling
|
||
this.dragID = this.getIdFromEvent(event);
|
||
if (!this.dragID) {
|
||
return false;
|
||
}
|
||
if (!elementID) {
|
||
elementID = this.dragID;
|
||
}
|
||
if (!$('dragIcon')) {
|
||
this.addDragIcon();
|
||
}
|
||
$('dragIcon').innerHTML = $('dragIconID_'+elementID).innerHTML +
|
||
$('dragTitleID_'+elementID).firstChild.innerHTML;
|
||
document.onmouseup = function(event) { DragDrop.cancelDragEvent(event); };
|
||
document.onmousemove = function(event) { DragDrop.mouseMoveEvent(event); };
|
||
return false;
|
||
},
|
||
dropElement: function(event) {
|
||
var dropID = this.getIdFromEvent(event);
|
||
if ((this.dragID) && (this.dragID !== dropID)) {
|
||
var url = this.changeURL +
|
||
'?dragDrop=' + this.table +
|
||
'&srcId=' + this.dragID +
|
||
'&dstId=' + dropID +
|
||
'&backPath=' + this.backPath;
|
||
showClickmenu_raw(url);
|
||
}
|
||
this.cancelDragEvent();
|
||
return false;
|
||
},
|
||
cancelDragEvent: function(event) {
|
||
this.dragID = null;
|
||
if ($('dragIcon') && $('dragIcon').style.visibility === 'visible') {
|
||
$('dragIcon').style.visibility = 'hidden';
|
||
}
|
||
document.onmouseup = null;
|
||
document.onmousemove = null;
|
||
},
|
||
mouseMoveEvent: function(event) {
|
||
if (!event) {
|
||
event = window.event;
|
||
}
|
||
$('dragIcon').style.left = (Event.pointerX(event) + 5) + 'px';
|
||
$('dragIcon').style.top = (Event.pointerY(event) - 5) + 'px';
|
||
$('dragIcon').style.visibility = 'visible';
|
||
return false;
|
||
},
|
||
// -- helper functions --
|
||
getIdFromEvent: function(event) {
|
||
var obj = Event.element(event);
|
||
while (obj.id == false && obj.parentNode) {
|
||
obj = obj.parentNode;
|
||
}
|
||
return obj.id.substring(obj.id.indexOf('_') + 1);
|
||
},
|
||
// dynamically manipulates the DOM to add the div needed for drag&drop at the bottom of the <body>-tag
|
||
addDragIcon: function() {
|
||
var code = '<div id="dragIcon" style="visibility: hidden;"> </div>';
|
||
var insert = new Insertion.Bottom(document.getElementsByTagName('body')[0], code);
|
||
}
|
||
};
|
||
var Tree = {
|
||
thisScript: 'ajax.php',
|
||
ajaxID: 'SC_alt_db_navframe::expandCollapse', // has to be either "SC_alt_db_navframe::expandCollapse" or "SC_alt_file_navframe::expandCollapse"
|
||
... | ... | |
// reloads a part of the page tree (useful when "expand" / "collapse")
|
||
load: function(params, isExpand, obj) {
|
||
// fallback if AJAX is not possible (e.g. IE < 6)
|
||
if (typeof Ajax.getTransport() != 'object') {
|
||
if (typeof Ajax.getTransport() !== 'object') {
|
||
window.location.href = this.thisScript + '?ajaxID=' + this.ajaxID + '&PM=' + params;
|
||
return;
|
||
}
|
||
... | ... | |
obj.style.cursor = 'wait';
|
||
}
|
||
new Ajax.Request(this.thisScript, {
|
||
var call = new Ajax.Request(this.thisScript, {
|
||
method: 'get',
|
||
parameters: 'ajaxID=' + this.ajaxID + '&PM=' + params,
|
||
onComplete: function(xhr) {
|
||
... | ... | |
// attaches the events to the elements needed for the drag and drop (for the titles and the icons)
|
||
registerDragDropHandlers: function() {
|
||
if (!this.activateDragDrop) return;
|
||
if (!this.activateDragDrop) {
|
||
return;
|
||
}
|
||
this._registerDragDropHandlers('dragTitle');
|
||
this._registerDragDropHandlers('dragIcon');
|
||
},
|
||
... | ... | |
// selects the activated item again, in case it collapsed and got expanded again
|
||
reSelectActiveItem: function() {
|
||
obj = $(top.fsMod.navFrameHighlightedID[this.frameSetModule]);
|
||
var obj = $(top.fsMod.navFrameHighlightedID[this.frameSetModule]);
|
||
if (obj) {
|
||
Element.addClassName(obj, this.highlightClass);
|
||
this.extractPageIdFromTreeItem(obj.id);
|
||
... | ... | |
this.extractPageIdFromTreeItem(highlightID);
|
||
// Remove all items that are already highlighted
|
||
obj = $(top.fsMod.navFrameHighlightedID[frameSetModule]);
|
||
var obj = $(top.fsMod.navFrameHighlightedID[frameSetModule]);
|
||
if (obj) {
|
||
var classes = $w(this.highlightClass);
|
||
for (var i = 0; i < classes.length; i++)
|
||
... | ... | |
// Set the new item
|
||
top.fsMod.navFrameHighlightedID[frameSetModule] = highlightID;
|
||
if ($(highlightID)) Element.addClassName(highlightID, this.highlightClass);
|
||
if ($(highlightID)) {
|
||
Element.addClassName(highlightID, this.highlightClass);
|
||
}
|
||
},
|
||
//extract pageID from the given id (pagesxxx_y_z where xxx is the ID)
|
||
... | ... | |
// new object-oriented drag and drop - code,
|
||
// tested in IE 6, Firefox 2, Opera 9
|
||
var DragDrop = {
|
||
dragID: null,
|
||
// options needed for doing the changes when dropping
|
||
table: null, // can be "pages" or "folders"
|
||
changeURL: null,
|
||
backPath: null,
|
||
dragElement: function(event, elementID) {
|
||
Event.stop(event); // stop bubbling
|
||
this.dragID = this.getIdFromEvent(event);
|
||
if (this.dragID == 0) return false;
|
||
if (!elementID) elementID = this.dragID;
|
||
if (!$('dragIcon')) this.addDragIcon();
|
||
$('dragIcon').innerHTML = $('dragIconID_'+elementID).innerHTML
|
||
+ $('dragTitleID_'+elementID).firstChild.innerHTML;
|
||
document.onmouseup = function(event) { DragDrop.cancelDragEvent(event); };
|
||
document.onmousemove = function(event) { DragDrop.mouseMoveEvent(event); };
|
||
return false;
|
||
},
|
||
dropElement: function(event) {
|
||
var dropID = this.getIdFromEvent(event);
|
||
if ((this.dragID) && (this.dragID != dropID)) {
|
||
var url = this.changeURL
|
||
+ '?dragDrop=' + this.table
|
||
+ '&srcId=' + this.dragID
|
||
+ '&dstId=' + dropID;
|
||
+ '&backPath=' + this.backPath;
|
||
showClickmenu_raw(url);
|
||
}
|
||
this.cancelDragEvent();
|
||
return false;
|
||
},
|
||
cancelDragEvent: function(event) {
|
||
this.dragID = null;
|
||
if ($('dragIcon') && $('dragIcon').style.visibility == 'visible') {
|
||
$('dragIcon').style.visibility = 'hidden';
|
||
}
|
||
document.onmouseup = null;
|
||
document.onmousemove = null;
|
||
},
|
||
mouseMoveEvent: function(event) {
|
||
if (!event) {
|
||
event = window.event;
|
||
}
|
||
$('dragIcon').style.left = (Event.pointerX(event) + 5) + 'px';
|
||
$('dragIcon').style.top = (Event.pointerY(event) - 5) + 'px';
|
||
$('dragIcon').style.visibility = 'visible';
|
||
return false;
|
||
},
|
||
// -- helper functions --
|
||
getIdFromEvent: function(event) {
|
||
var obj = Event.element(event);
|
||
while (obj.id == false && obj.parentNode) { obj = obj.parentNode; }
|
||
return obj.id.substring(obj.id.indexOf('_')+1);
|
||
},
|
||
// dynamically manipulates the DOM to add the div needed for drag&drop at the bottom of the <body>-tag
|
||
addDragIcon: function() {
|
||
var code = '<div id="dragIcon" style="visibility: hidden;"> </div>';
|
||
new Insertion.Bottom(document.getElementsByTagName('body')[0], code);
|
||
}
|
||
};
|
||
/**
|
||
*
|
||
* @author Ingo Renner <ingo@typo3.org>
|
typo3/js/workspacemenu.js (working copy) | ||
---|---|---|
// -1 to compensate for the margin-right -1px of the list items,
|
||
// which itself is necessary for overlaying the separator with the active state background
|
||
if(toolbarItem.down().hasClassName('no-separator')) {
|
||
if (toolbarItem.down().hasClassName('no-separator')) {
|
||
calculatedOffset -= 1;
|
||
}
|
||
});
|
||
... | ... | |
var menu = $$('#workspace-selector-menu .toolbar-item-menu')[0];
|
||
toolbarItem.blur();
|
||
if(!toolbarItem.hasClassName('toolbar-item-active')) {
|
||
if (!toolbarItem.hasClassName('toolbar-item-active')) {
|
||
toolbarItem.addClassName('toolbar-item-active');
|
||
Effect.Appear(menu, {duration: 0.2});
|
||
TYPO3BackendToolbarManager.hideOthers(toolbarItem);
|
||
... | ... | |
* toggles the workspace frontend preview
|
||
*/
|
||
toggleFrontendPreview: function(event) {
|
||
new Ajax.Request('ajax.php', {
|
||
var toggle = new Ajax.Request('ajax.php', {
|
||
parameters: 'ajaxID=WorkspaceMenu::toggleWorkspacePreview',
|
||
onSuccess: function(transport, response) {
|
||
var stateActiveIcon = $$('#workspace-selector-menu img.state-active')[0].cloneNode(true);
|
||
var stateInactiveIcon = $$('#workspace-selector-menu img.state-inactive')[0].cloneNode(true);
|
||
if (response.newWorkspacePreviewState == 1) {
|
||
if (response.newWorkspacePreviewState === 1) {
|
||
TYPO3.configuration.workspaceFrontendPreviewEnabled = 1;
|
||
Event.element(event).previous().replace(stateActiveIcon);
|
||
top.WorkspaceFrontendPreviewEnabled = true;
|
||
... | ... | |
switchWorkspace: function(event) {
|
||
var workspaceId = Event.element(event).identify().substring(3);
|
||
new Ajax.Request('ajax.php', {
|
||
var switchRequest = new Ajax.Request('ajax.php', {
|
||
parameters: 'ajaxID=WorkspaceMenu::setWorkspace&workspaceId=' + workspaceId,
|
||
onSuccess: function(transport, response) {
|
||
TYPO3.configuration.inWorkspace = response.setWorkspaceId === 0 ? 0 : 1;
|
- « Previous
- 1
- 2
- Next »