Project

General

Profile

Feature #17757 » rtehtmlarea_feature_inline.patch

Administrator Admin, 2007-11-06 04:57

View differences:

typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (working copy)
'fontsize' => 'FontSize',
'textcolor' => 'ForeColor',
'bgcolor' => 'HiliteColor',
'bold' => 'Bold',
'italic' => 'Italic',
'underline' => 'Underline',
'left' => 'JustifyLeft',
'center' => 'JustifyCenter',
'right' => 'JustifyRight',
......
'lefttoright' => 'LeftToRight',
'righttoleft' => 'RightToLeft',
'justifyfull' => 'JustifyFull',
'strikethrough' => 'StrikeThrough',
'superscript' => 'Superscript',
'subscript' => 'Subscript',
'showhelp' => 'ShowHelp',
'insertcharacter' => 'InsertCharacter',
'findreplace' => 'FindReplace',
......
if (is_object($plugin)) {
if ($plugin->main($this)) {
$this->registeredPlugins[$pluginId] = $plugin;
// Override buttons from previously registered plugins
$pluginButtons = t3lib_div::trimExplode(',', $plugin->getPluginButtons(), 1);
foreach ($this->pluginButton as $previousPluginId => $buttonList) {
$this->pluginButton[$previousPluginId] = implode(',',array_diff(t3lib_div::trimExplode(',', $this->pluginButton[$previousPluginId], 1), $pluginButtons));
}
$this->pluginButton[$pluginId] = $plugin->getPluginButtons();
$this->pluginList .= ','.$pluginId;
$this->convertToolbarForHtmlAreaArray = array_unique(array_merge($this->convertToolbarForHtmlAreaArray, $plugin->getConvertToolbarForHtmlAreaArray()));
}
}
}
}
// Process overrides
$hidePlugins = array();
foreach ($this->registeredPlugins as $pluginId => $plugin) {
if (!$this->pluginButton[$pluginId]) {
$hidePlugins[] = $pluginId;
}
}
// htmlArea plugins list
$this->pluginEnabledArray = t3lib_div::trimExplode(',', $this->pluginList, 1);
$hidePlugins = array();
if(!t3lib_extMgm::isLoaded('static_info_tables') || in_array($this->language, t3lib_div::trimExplode(',', $TYPO3_CONF_VARS['EXTCONF'][$this->ID]['noSpellCheckLanguages']))) $hidePlugins[] = 'SpellChecker';
if ($this->client['BROWSER'] == 'msie') $hidePlugins[] = 'Acronym';
if ($this->client['BROWSER'] == 'opera') {
......
<link rel="stylesheet" type="text/css" href="' . $this->editorCSS . '" />';
// Loading JavaScript files and code
$this->TCEform->loadJavascriptLib('prototype');
//$this->TCEform->loadJavascriptLib('prototype');
$this->TCEform->additionalCode_pre['loadJSfiles'] = $this->loadJSfiles($this->TCEform->RTEcounter);
$this->TCEform->additionalJS_pre['loadJScode'] = $this->loadJScode($this->TCEform->RTEcounter);
......
// Disabling the plugins if their buttons are not in the toolbar
$hidePlugins = array();
foreach ($this->pluginButton as $pluginId => $buttonList) {
$showPlugin = false;
$buttonArray = t3lib_div::trimExplode(',', $buttonList, 1);
$showPlugin = false;
foreach ($buttonArray as $button) {
if (in_array($button, $this->toolbar)) {
$showPlugin = true;
......
}
$this->toolbar = array_diff($this->toolbar, $hideButtons);
// Completing the toolbar converion array for htmlArea
foreach ($this->registeredPlugins as $pluginId => $plugin) {
if ($this->isPluginEnabled($pluginId)) {
$this->convertToolbarForHtmlAreaArray = array_unique(array_merge($this->convertToolbarForHtmlAreaArray, $plugin->getConvertToolbarForHtmlAreaArray()));
}
}
// Renaming buttons of replacement plugins
if( $this->isPluginEnabled('SelectColor') ) {
$this->convertToolbarForHtmlAreaArray['textcolor'] = 'CO-forecolor';
......
</script>';
$loadJavascriptCode .= '
<script type="text/javascript" src="' . $this->buildJSMainLangFile($RTEcounter) . '"></script>
<script type="text/javascript" src="'. ($this->is_FE()?'/typo3/':'') . 'contrib/prototype/prototype.js"></script>
<script type="text/javascript" src="' . $this->writeTemporaryFile('EXT:' . $this->ID . '/htmlarea/htmlarea.js', "htmlarea") . '"></script>
';
return $loadJavascriptCode;
......
function buildJSMainLangFile($RTEcounter) {
$contents = $this->buildJSMainLangArray() . chr(10);
$pluginArray = t3lib_div::trimExplode(',', $this->pluginList, 1);
foreach ($pluginArray as $plugin) {
if (in_array($plugin, $this->pluginEnabledCumulativeArray[$RTEcounter])) {
$contents .= $this->buildJSLangArray($plugin) . chr(10);
}
foreach ($this->pluginEnabledCumulativeArray[$RTEcounter] as $pluginId) {
$contents .= $this->buildJSLangArray($pluginId) . chr(10);
}
return $this->writeTemporaryFile('', $this->language.'_'.$this->OutputCharset, 'js', $contents);
}
typo3/sysext/rtehtmlarea/class.tx_rtehtmlareaapi.php (working copy)
* @return string a modified tollbar order list
*/
public function addButtonsToToolbar() {
return ('bar,'.$this->pluginButtons.',linebreak,'.$this->htmlAreaRTE->defaultToolbarOrder);
//Add only buttons not yet in the default toolbar order
$addButtons = implode(',', array_diff(t3lib_div::trimExplode(',', $this->pluginButtons, 1), t3lib_div::trimExplode(',', $this->htmlAreaRTE->defaultToolbarOrder, 1)));
return (($addButtons ? ('bar,' . $addButtons . ',linebreak,') : '') . $this->htmlAreaRTE->defaultToolbarOrder);
}
/**
typo3/sysext/rtehtmlarea/ext_localconf.php (working copy)
// Initialize plugin registration array
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins'] = array();
// Registering plugin from "inner" extensions:
$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['DefaultInline'] = array();
$TYPO3_CONF_VARS['EXTCONF']['rtehtmlarea']['plugins']['DefaultInline']['objectReference'] = 'EXT:'.$_EXTKEY.'/extensions/DefaultInline/class.tx_rtehtmlarea_defaultinline.php:&tx_rtehtmlarea_defaultinline';
$_EXTCONF = unserialize($_EXTCONF); // unserializing the configuration so we can use it here:
if (strstr($_EXTCONF['defaultConfiguration'],'Minimal')) {
typo3/sysext/rtehtmlarea/extensions/DefaultInline/class.tx_rtehtmlarea_defaultinline.php (revision 0)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2007 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
* 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.
*
* 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!
***************************************************************/
/**
* DefaultInline plugin for htmlArea RTE
*
* @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
*
* TYPO3 CVS ID: $Id: class.tx_rtehtmlarea_pi1.php 2449 2007-08-15 08:12:19Z ingorenner $
*
*/
require_once(t3lib_extMgm::extPath('rtehtmlarea').'class.tx_rtehtmlareaapi.php');
class tx_rtehtmlarea_defaultinline extends tx_rtehtmlareaapi {
protected $extensionKey = 'rtehtmlarea'; // The key of the extension that is extending htmlArea RTE
protected $relativePathToLocallangFile = 'extensions/DefaultInline/locallang.xml'; // Path to this main locallang file of the extension relative to the extension dir.
protected $relativePathToSkin = 'skin/htmlarea.css'; // Path to the skin (css) file relative to the extension dir.
protected $htmlAreaRTE; // Reference to the invoking object
protected $thisConfig; // Reference to RTE PageTSConfig
protected $toolbar; // Reference to RTE toolbar array
protected $LOCAL_LANG; // Frontend language array
protected $pluginButtons = 'bold,italic,strikethrough,subscript,superscript,underline';
protected $convertToolbarForHtmlAreaArray = array (
'bold' => 'Bold',
'italic' => 'Italic',
'underline' => 'Underline',
'strikethrough' => 'StrikeThrough',
'superscript' => 'Superscript',
'subscript' => 'Subscript',
);
/**
* Return JS configuration of the htmlArea plugins registered by the extension
*
* @param integer Relative id of the RTE editing area in the form
*
* @return string JS configuration for registered plugins
*
* The returned string will be a set of JS instructions defining the configuration that will be provided to the plugin(s)
* Each of the instructions should be of the form:
* RTEarea['.$RTEcounter.']["buttons"]["button-id"]["property"] = "value";
*/
public function buildJavascriptConfiguration($RTEcounter) {
global $TSFE, $LANG;
$registerRTEinJavascriptString = '';
return $registerRTEinJavascriptString;
}
} // end of class
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/DefaultInline/class.tx_rtehtmlarea_defaultinline.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/DefaultInline/class.tx_rtehtmlarea_defaultinline.php']);
}
?>
typo3/sysext/rtehtmlarea/extensions/DefaultInline/locallang.xml (revision 0)
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<description>Labels for Default Inline Elements plugin of htmlArea RTE</description>
<type>module</type>
</meta>
<data type="array">
<languageKey index="default" type="array">
</languageKey>
</data>
<orig_hash type="array">
<languageKey index="default" type="array">
</languageKey>
</orig_hash>
<orig_text type="array">
<languageKey index="default" type="array">
</languageKey>
</orig_text>
</T3locallang>
typo3/sysext/rtehtmlarea/extensions/DefaultInline/class.tx_rtehtmlarea_defaultinline.php (revision 0)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2007 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
* 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.
*
* 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!
***************************************************************/
/**
* DefaultInline plugin for htmlArea RTE
*
* @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
*
* TYPO3 CVS ID: $Id: class.tx_rtehtmlarea_pi1.php 2449 2007-08-15 08:12:19Z ingorenner $
*
*/
require_once(t3lib_extMgm::extPath('rtehtmlarea').'class.tx_rtehtmlareaapi.php');
class tx_rtehtmlarea_defaultinline extends tx_rtehtmlareaapi {
protected $extensionKey = 'rtehtmlarea'; // The key of the extension that is extending htmlArea RTE
protected $relativePathToLocallangFile = 'extensions/DefaultInline/locallang.xml'; // Path to this main locallang file of the extension relative to the extension dir.
protected $relativePathToSkin = 'skin/htmlarea.css'; // Path to the skin (css) file relative to the extension dir.
protected $htmlAreaRTE; // Reference to the invoking object
protected $thisConfig; // Reference to RTE PageTSConfig
protected $toolbar; // Reference to RTE toolbar array
protected $LOCAL_LANG; // Frontend language array
protected $pluginButtons = 'bold,italic,strikethrough,subscript,superscript,underline';
protected $convertToolbarForHtmlAreaArray = array (
'bold' => 'Bold',
'italic' => 'Italic',
'underline' => 'Underline',
'strikethrough' => 'StrikeThrough',
'superscript' => 'Superscript',
'subscript' => 'Subscript',
);
/**
* Return JS configuration of the htmlArea plugins registered by the extension
*
* @param integer Relative id of the RTE editing area in the form
*
* @return string JS configuration for registered plugins
*
* The returned string will be a set of JS instructions defining the configuration that will be provided to the plugin(s)
* Each of the instructions should be of the form:
* RTEarea['.$RTEcounter.']["buttons"]["button-id"]["property"] = "value";
*/
public function buildJavascriptConfiguration($RTEcounter) {
global $TSFE, $LANG;
$registerRTEinJavascriptString = '';
return $registerRTEinJavascriptString;
}
} // end of class
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/DefaultInline/class.tx_rtehtmlarea_defaultinline.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/DefaultInline/class.tx_rtehtmlarea_defaultinline.php']);
}
?>
typo3/sysext/rtehtmlarea/extensions/DefaultInline/locallang.xml (revision 0)
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<description>Labels for Default Inline Elements plugin of htmlArea RTE</description>
<type>module</type>
</meta>
<data type="array">
<languageKey index="default" type="array">
</languageKey>
</data>
<orig_hash type="array">
<languageKey index="default" type="array">
</languageKey>
</orig_hash>
<orig_text type="array">
<languageKey index="default" type="array">
</languageKey>
</orig_text>
</T3locallang>
typo3/sysext/rtehtmlarea/extensions/DefaultInline/skin/htmlarea.css (revision 0)
/* Selectors for the DefaultInline plugin of htmlArea RTE */
.htmlarea .toolbar .Bold {background-image:url("images/InlineElements/bold.gif");}
.htmlarea .toolbar .Italic {background-image:url("images/InlineElements/italic.gif");}
.htmlarea .toolbar .StrikeThrough {background-image:url("images/InlineElements/strikethrough.gif");}
.htmlarea .toolbar .Subscript {background-image:url("images/InlineElements/subscript.gif");}
.htmlarea .toolbar .Superscript {background-image:url("images/InlineElements/superscript.gif");}
.htmlarea .toolbar .Underline {background-image:url("images/InlineElements/underline.gif");}
typo3/sysext/rtehtmlarea/extensions/DefaultInline/skin/htmlarea.css (revision 0)
/* Selectors for the DefaultInline plugin of htmlArea RTE */
.htmlarea .toolbar .Bold {background-image:url("images/InlineElements/bold.gif");}
.htmlarea .toolbar .Italic {background-image:url("images/InlineElements/italic.gif");}
.htmlarea .toolbar .StrikeThrough {background-image:url("images/InlineElements/strikethrough.gif");}
.htmlarea .toolbar .Subscript {background-image:url("images/InlineElements/subscript.gif");}
.htmlarea .toolbar .Superscript {background-image:url("images/InlineElements/superscript.gif");}
.htmlarea .toolbar .Underline {background-image:url("images/InlineElements/underline.gif");}
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js (working copy)
*/
HTMLArea.prototype._selectionEmpty = function(sel) {
if (!sel) return true;
if (typeof(sel.isCollapsed) != 'undefined') {
if (HTMLArea.is_opera) this._createRange(sel).collapsed;
else sel.isCollapsed;
} else {
return true;
}
return sel.isCollapsed;
};
/***************************************************
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-ie.js (working copy)
// (this happens when a node is clicked in the tree)
var range = sel.createRange();
var p_elm = this.getParentElement(sel);
if(p_elm.innerHTML == range.htmlText) return p_elm;
if(p_elm.outerHTML == range.htmlText) return p_elm;
return null;
}
};
......
} else {
editor.selectNode(target.el);
}
editor._statusBarTree.selected = target.el;
editor.updateToolbar(true);
switch (ev.type) {
case "click" :
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (working copy)
this.popupURL = "popups/";
this.btnList = {
Bold: ["Bold", "ed_format_bold", false, function(editor) {editor.execCommand("Bold");}],
Italic: ["Italic", "ed_format_italic", false, function(editor) {editor.execCommand("Italic");}],
Underline: ["Underline", "ed_format_underline", false, function(editor) {editor.execCommand("Underline");}],
StrikeThrough: ["Strikethrough", "ed_format_strike", false, function(editor) {editor.execCommand("StrikeThrough");}],
Subscript: ["Subscript", "ed_format_sub", false, function(editor) {editor.execCommand("Subscript");}],
Superscript: ["Superscript", "ed_format_sup", false, function(editor) {editor.execCommand("Superscript");}],
JustifyLeft: ["Justify Left", "ed_align_left.gif", false, function(editor) {editor.execCommand("JustifyLeft");}],
JustifyCenter: ["Justify Center", "ed_align_center.gif", false, function(editor) {editor.execCommand("JustifyCenter");}],
JustifyRight: ["Justify Right", "ed_align_right.gif", false, function(editor) {editor.execCommand("JustifyRight");}],
......
// Default hotkeys
this.hotKeyList = {
a: "SelectAll",
b: "Bold",
i: "Italic",
u: "Underline",
s: "StrikeThrough",
l: "JustifyLeft",
e: "JustifyCenter",
r: "JustifyRight",
......
* });
*/
HTMLArea.Config.prototype.registerButton = function(id,tooltip,image,textMode,action,context,hide,selection) {
var the_id;
var buttonId;
switch (typeof(id)) {
case "string": the_id = id; break;
case "object": the_id = id.id; break;
default: HTMLArea._appendToLog("ERROR [HTMLArea.Config::registerButton]: invalid arguments");
case "string": buttonId = id; break;
case "object": buttonId = id.id; break;
default: HTMLArea._appendToLog("[HTMLArea.Config::registerButton]: invalid arguments");
return false;
}
if (typeof(this.customSelects[the_id]) != "undefined") {
HTMLArea._appendToLog("WARNING [HTMLArea.Config::registerButton]: A dropdown with the same ID " + id + " already exists.");
if (typeof(this.customSelects[buttonId]) !== "undefined") {
HTMLArea._appendToLog("[HTMLArea.Config::registerButton]: A dropdown with the same Id: " + buttonId + " already exists.");
return false;
}
if (typeof(this.btnList[the_id]) != "undefined") {
HTMLArea._appendToLog("WARNING [HTMLArea.Config::registerButton]: A button with the same ID " + id + " already exists.");
if (typeof(this.btnList[buttonId]) !== "undefined") {
HTMLArea._appendToLog("[HTMLArea.Config::registerButton]: A button with the same Id: " + buttonId + " already exists.");
return false;
}
switch (typeof(id)) {
case "string":
if (typeof(hide) == "undefined") var hide = false;
if (typeof(selection) == "undefined") var selection = false;
if (typeof(hide) === "undefined") var hide = false;
if (typeof(selection) === "undefined") var selection = false;
this.btnList[id] = [tooltip, image, textMode, action, context, hide, selection];
break;
case "object":
if (typeof(id.hide) == "undefined") id.hide = false;
if (typeof(id.selection) == "undefined") id.selection = false;
if (typeof(id.hide) === "undefined") id.hide = false;
if (typeof(id.selection) === "undefined") id.selection = false;
this.btnList[id.id] = [id.tooltip, id.image, id.textMode, id.action, id.context, id.hide, id.selection];
break;
}
......
*/
HTMLArea.prototype.createButton = function (txt,tb_line,first_cell_on_line,labelObj) {
var btn = null,
btnImg = null,
newObj = {
created : false,
el : null,
......
newObj["labelUsed"] = true;
}
HTMLArea._addEvents(newObj["el"],["mouseover", "mouseout", "mousedown", "click"], HTMLArea.toolBarButtonHandler);
if (typeof(btn[1]) != "string" && HTMLArea.is_ie) {
var btnImgContainer = document.createElement("div");
btnImgContainer.className = "buttonImgContainer";
btnImgContainer.innerHTML = '<img src="' + btn[1][0] + '" style="position: relative; top: -' + (18*(btn[1][1]+1)) + 'px; left: -' + (18*(btn[1][2]+1)) + 'px;" alt="' + btn[0] + '" />';
newObj["el"].appendChild(btnImgContainer);
} else {
newObj["el"].className += " " + txt;
if (this.plugins["TYPO3Browsers"] && (txt == "CreateLink" || txt == "InsertImage")) newObj["el"].className += "-TYPO3Browsers";
}
newObj["el"].className += " " + txt;
if (this.plugins["TYPO3Browsers"] && (txt == "CreateLink" || txt == "InsertImage")) newObj["el"].className += "-TYPO3Browsers";
newObj["created"] = true;
}
return newObj;
......
}
}
}
this._statusBarTree.selected = null;
this._statusBarTree.innerHTML = '';
this._statusBarTree.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": ")); // clear
for (i = ancestors.length; --i >= 0;) {
......
while (el && !HTMLArea.isBlockElement(el)) { el = el.parentNode; }
if (el) btn.state("active",(el.style.direction == ((cmd == "RightToLeft") ? "rtl" : "ltr")));
break;
case "Bold":
case "Italic":
case "StrikeThrough":
case "Underline":
case "Subscript":
case "Superscript":
case "JustifyLeft":
case "JustifyCenter":
case "JustifyRight":
......
HTMLArea._stopEvent(ev);
return false;
} else {
for (var i in editor.plugins) {
var plugin = editor.plugins[i].instance;
if (typeof(plugin.onHotKey) === "function") {
if (plugin.onHotKey(key)) {
continue;
} else {
HTMLArea._stopEvent(ev);
return false;
}
}
}
editor.updateToolbar();
}
}
......
return false;
};
HTMLArea.RE_blockTags = /^(body|p|h1|h2|h3|h4|h5|h6|ul|ol|pre|dl|div|noscript|blockquote|form|hr|table|fieldset|address|td|tr|th|li|tbody|thead|tfoot|iframe|object)$/;
HTMLArea.RE_blockTags = /^(body|p|h1|h2|h3|h4|h5|h6|ul|ol|pre|dl|dt|dd|div|noscript|blockquote|form|hr|table|caption|fieldset|address|td|tr|th|li|tbody|thead|tfoot|iframe|object)$/;
HTMLArea.isBlockElement = function(el) { return el && el.nodeType == 1 && HTMLArea.RE_blockTags.test(el.nodeName.toLowerCase()); };
HTMLArea.RE_closingTags = /^(p|span|a|li|ol|ul|dl|dt|td|th|tr|tbody|thead|tfoot|caption|colgroup|table|div|em|i|strong|b|code|cite|blockquote|q|dfn|abbr|acronym|font|center|object|embed|tt|style|script|title|head|clickenlarge)$/;
HTMLArea.RE_noClosingTag = /^(img|br|hr|col|input|area|base|link|meta|param)$/;
......
* @param object buttonConfiguration: the configuration object of the button:
* id : unique id for the button
* tooltip : tooltip for the button
* image : image to be displayed in the toolbar
* textMode : enable in text mode
* action : name of the function invoked when the button is pressed
* context : will be disabled if not inside one of listed elements
......
onKeyPress : null,
/**
* The hotKey event handler
* This function may be defined by the plugin subclass.
* If defined, the function will be invoked whenever a hot key is pressed.
*
* @param event key: the hot key that was pressed
*
* @return boolean
*/
onHotKey : null,
/**
* The onMode event handler
* This function may be defined by the plugin subclass.
* If defined, the function will invoked whenever the editor changes mode.
......
*
* @return boolean
*/
onMode: null,
onMode : null,
/**
* The onGenerate event handler
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultInline/default-inline.js (revision 0)
/***************************************************************
* Copyright notice
*
* (c) 2007 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
* 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!
***************************************************************/
/*
* Default Inline Plugin for TYPO3 htmlArea RTE
*
* TYPO3 CVS ID: $Id: inline-elements.js 1809 2006-11-23 12:04:14Z ingmars $
*/
DefaultInline = Class.create(HTMLArea.plugin, {
/*
* This function gets called by the class constructor
*/
configurePlugin : function (editor) {
/* Registering plugin "About" information */
var pluginInformation = {
version : "1.0",
developer : "Stanislas Rolland",
developerUrl : "http://www.fructifor.ca/",
copyrightOwner : "Stanislas Rolland",
sponsor : "Fructifor Inc.",
sponsorUrl : "http://www.fructifor.ca/",
license : "GPL"
};
this.registerPluginInformation(pluginInformation);
/* Registering the buttons */
var buttonList = DefaultInline.buttonList;
var n = buttonList.length;
for (var i = 0; i < n; ++i) {
var button = buttonList[i];
buttonId = button[0];
var buttonConfiguration = {
id : buttonId,
tooltip : DefaultInline.I18N[buttonId + "-Tooltip"],
image : this.editor.imgURL(buttonId.toLowerCase() + ".gif", "DefaultInline"),
textMode : false,
action : "onButtonPress",
context : button[1]
};
this.registerButton(buttonConfiguration);
}
return true;
}
});
/* The localization array for this plugin */
DefaultInline.I18N = DefaultInline_langArray;
/* The list of buttons added by this plugin */
DefaultInline.buttonList = [
["Bold", null],
["Italic", null],
["StrikeThrough", null],
["Subscript", null],
["Superscript", null],
["Underline", null]
];
/* The list of hotkeys handled by this plugin */
DefaultInline.hotKeyList = {
b : "Bold",
i : "Italic",
s : "StrikeThrough",
u : "Underline"
};
/*
* Definition of additional methods
*/
DefaultInline.addMethods({
/*
* This function gets called when some inline element button was pressed.
*/
onButtonPress : function (editor, buttonId, UI, param) {
editor.focusEditor();
try {
editor._doc.execCommand(buttonId, UI, param);
}
catch(e) {
this.appendToLog("onButtonPress", e + "\n\nby execCommand(" + buttonId + ");");
}
editor.updateToolbar();
return false;
},
/*
* This function gets called when some hot key is pressed
*/
onHotKey : function(key) {
if (DefaultInline.hotKeyList[key] && this.editor._toolbarObjects[DefaultInline.hotKeyList[key]]) {
return this.onButtonPress(this.editor, DefaultInline.hotKeyList[key]);
} else {
return true;
}
},
/*
* This function gets called when the toolbar is updated
*/
onUpdateToolbar : function () {
var editor = this.editor;
var buttonList = DefaultInline.buttonList;
var buttonId, button, n = buttonList.length, commandState;
for (var i = 0; i < n; ++i) {
buttonId = buttonList[i][0];
button = editor._toolbarObjects[buttonId];
commandState = false;
if ((editor._editMode != "textmode")) {
try {
commandState = editor._doc.queryCommandState(buttonId);
} catch(e) {
commandState = false;
}
}
button.state("active", commandState);
}
}
});
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultInline/locallang.xml (revision 0)
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<description>Labels for Default Inline plugin of htmlArea RTE</description>
<type>module</type>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="Bold-Tooltip">Bold</label>
<label index="Italic-Tooltip">Italic</label>
<label index="StrikeThrough-Tooltip">Strike-through</label>
<label index="Subscript-Tooltip">Subscript</label>
<label index="Superscript-Tooltip">Superscript</label>
<label index="Underline-Tooltip">Underline</label>
</languageKey>
<languageKey index="fr" type="array">
<label index="Bold-Tooltip">Gras</label>
</languageKey>
</data>
<orig_hash type="array">
<languageKey index="default" type="array">
</languageKey>
</orig_hash>
<orig_text type="array">
<languageKey index="default" type="array">
</languageKey>
</orig_text>
</T3locallang>
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultInline/default-inline.js (revision 0)
/***************************************************************
* Copyright notice
*
* (c) 2007 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
* 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!
***************************************************************/
/*
* Default Inline Plugin for TYPO3 htmlArea RTE
*
* TYPO3 CVS ID: $Id: inline-elements.js 1809 2006-11-23 12:04:14Z ingmars $
*/
DefaultInline = Class.create(HTMLArea.plugin, {
/*
* This function gets called by the class constructor
*/
configurePlugin : function (editor) {
/* Registering plugin "About" information */
var pluginInformation = {
version : "1.0",
developer : "Stanislas Rolland",
developerUrl : "http://www.fructifor.ca/",
copyrightOwner : "Stanislas Rolland",
sponsor : "Fructifor Inc.",
sponsorUrl : "http://www.fructifor.ca/",
license : "GPL"
};
this.registerPluginInformation(pluginInformation);
/* Registering the buttons */
var buttonList = DefaultInline.buttonList;
var n = buttonList.length;
for (var i = 0; i < n; ++i) {
var button = buttonList[i];
buttonId = button[0];
var buttonConfiguration = {
id : buttonId,
tooltip : DefaultInline.I18N[buttonId + "-Tooltip"],
image : this.editor.imgURL(buttonId.toLowerCase() + ".gif", "DefaultInline"),
textMode : false,
action : "onButtonPress",
context : button[1]
};
this.registerButton(buttonConfiguration);
}
return true;
}
});
/* The localization array for this plugin */
DefaultInline.I18N = DefaultInline_langArray;
/* The list of buttons added by this plugin */
DefaultInline.buttonList = [
["Bold", null],
["Italic", null],
["StrikeThrough", null],
["Subscript", null],
["Superscript", null],
["Underline", null]
];
/* The list of hotkeys handled by this plugin */
DefaultInline.hotKeyList = {
b : "Bold",
i : "Italic",
s : "StrikeThrough",
u : "Underline"
};
/*
* Definition of additional methods
*/
DefaultInline.addMethods({
/*
* This function gets called when some inline element button was pressed.
*/
onButtonPress : function (editor, buttonId, UI, param) {
editor.focusEditor();
try {
editor._doc.execCommand(buttonId, UI, param);
}
catch(e) {
this.appendToLog("onButtonPress", e + "\n\nby execCommand(" + buttonId + ");");
}
editor.updateToolbar();
return false;
},
/*
* This function gets called when some hot key is pressed
*/
onHotKey : function(key) {
if (DefaultInline.hotKeyList[key] && this.editor._toolbarObjects[DefaultInline.hotKeyList[key]]) {
return this.onButtonPress(this.editor, DefaultInline.hotKeyList[key]);
} else {
return true;
}
},
/*
* This function gets called when the toolbar is updated
*/
onUpdateToolbar : function () {
var editor = this.editor;
var buttonList = DefaultInline.buttonList;
var buttonId, button, n = buttonList.length, commandState;
for (var i = 0; i < n; ++i) {
buttonId = buttonList[i][0];
button = editor._toolbarObjects[buttonId];
commandState = false;
if ((editor._editMode != "textmode")) {
try {
commandState = editor._doc.queryCommandState(buttonId);
} catch(e) {
commandState = false;
}
}
button.state("active", commandState);
}
}
});
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultInline/locallang.xml (revision 0)
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<description>Labels for Default Inline plugin of htmlArea RTE</description>
<type>module</type>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="Bold-Tooltip">Bold</label>
<label index="Italic-Tooltip">Italic</label>
<label index="StrikeThrough-Tooltip">Strike-through</label>
<label index="Subscript-Tooltip">Subscript</label>
<label index="Superscript-Tooltip">Superscript</label>
<label index="Underline-Tooltip">Underline</label>
</languageKey>
<languageKey index="fr" type="array">
<label index="Bold-Tooltip">Gras</label>
</languageKey>
</data>
<orig_hash type="array">
<languageKey index="default" type="array">
</languageKey>
</orig_hash>
<orig_text type="array">
<languageKey index="default" type="array">
</languageKey>
</orig_text>
</T3locallang>
typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php (working copy)
// Loading CSS, JavaScript files and code
$TSFE->additionalHeaderData['htmlArea'] = $additionalCode_loadCSS;
$this->TCEform->loadJavascriptLib('prototype');
//$this->TCEform->loadJavascriptLib('prototype');
$this->TCEform->additionalJS_initial = $this->loadJSfiles($this->TCEform->RTEcounter);
$this->TCEform->additionalJS_pre[] = $this->loadJScode($this->TCEform->RTEcounter);
(1-1/2)