Project

General

Profile

Feature #17789 » rtehtmlarea_feature_6712.patch

Administrator Admin, 2007-11-14 18:01

View differences:

typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (working copy)
* context : will be disabled if not inside one of listed elements
* hide : hide in menu and show only in context menu?
* selection : will be disabled if there is no selection?
* hotkey : hotkey character
*
* @return boolean true if the button was successfully registered
*/
registerButton : function (buttonConfiguration) {
if (this.isButtonInToolbar(buttonConfiguration.id)) {
if ((typeof(buttonConfiguration.action) === "string") && (typeof(this[buttonConfiguration.action]) === "function")) {
var hotKeyAction = buttonConfiguration.action;
var actionFunctionReference = this.makeFunctionReference(buttonConfiguration.action);
buttonConfiguration.action = actionFunctionReference;
return this.editorConfiguration.registerButton(buttonConfiguration);
if (this.editorConfiguration.registerButton(buttonConfiguration)) {
if (buttonConfiguration.hotKey) {
var hotKeyConfiguration = {
id : buttonConfiguration.hotKey,
action : hotKeyAction
};
return this.registerHotKey(hotKeyConfiguration);
}
return true;
}
} else {
this.appendToLog("registerButton", "Function " + buttonConfiguration.action + " was not defined when registering button " + buttonConfiguration.id);
}
......
return this.editorConfiguration.registerHotKey(hotKeyConfiguration);
} else {
this.appendToLog("registerHotKey", "Function " + hotKeyConfiguration.action + " was not defined when registering hotkey " + hotKeyConfiguration.id);
return false;
}
},
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultInline/default-inline.js (working copy)
tooltip : this.localize(buttonId + "-Tooltip"),
textMode : false,
action : "onButtonPress",
context : button[1]
context : button[1],
hotKey : (this.editorConfiguration.buttons[buttonId.toLowerCase()]?this.editorConfiguration.buttons[buttonId.toLowerCase()].hotKey:null)
};
this.registerButton(buttonConfiguration);
}
/*
* Registering the hotkeys
*/
for (var hotKey in DefaultInline.hotKeyList) {
if (DefaultInline.hotKeyList.hasOwnProperty(hotKey)) {
var hotKeyConfiguration = {
id : hotKey,
action : "onHotKey"
};
this.registerHotKey(hotKeyConfiguration);
}
}
return true;
},
/*
* This function gets called when some inline element button was pressed.
*/
onButtonPress : function (editor, buttonId, UI, param) {
onButtonPress : function (editor, id, UI, param) {
// Could be a button or its hotkey
var buttonId = DefaultInline.hotKeyList[id]?DefaultInline.hotKeyList[id]:id;
editor.focusEditor();
try {
editor._doc.execCommand(buttonId, UI, param);
......
},
/*
* This function gets called when some hot key is pressed
*/
onHotKey : function(editor, key) {
if (DefaultInline.hotKeyList[key] && this.editor._toolbarObjects[DefaultInline.hotKeyList[key]]) {
var toolbarObject = this.editor._toolbarObjects[DefaultInline.hotKeyList[key]];
var toolbarHTMLObject = document.getElementById(toolbarObject.elementId);
if (!toolbarHTMLObject.disabled) {
return this.onButtonPress(this.editor, DefaultInline.hotKeyList[key]);
}
} else {
return true;
}
},
/*
* This function gets called when the toolbar is updated
*/
onUpdateToolbar : function () {
(1-1/3)