Project

General

Profile

Bug #22192 » rtehtmlarea_cleanup_13668.patch

Administrator Admin, 2010-02-25 19:19

View differences:

typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultColor/default-color.js (copie de travail)
/***************************************************************
* Copyright notice
*
* (c) 2008-2009 Stanislas Rolland <typo3(arobas)sjbr.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 script is a modified version of a script published under the htmlArea License.
* A copy of the htmlArea License may be found in the textfile HTMLAREA_LICENSE.txt.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/*
* Default Color Plugin for TYPO3 htmlArea RTE
*
* TYPO3 SVN ID: $Id$
*/
DefaultColor = HTMLArea.Plugin.extend({
constructor : function(editor, pluginName) {
this.base(editor, pluginName);
},
/*
* This function gets called by the class constructor
*/
configurePlugin : function(editor) {
this.buttonsConfiguration = this.editorConfiguration.buttons;
/*
* Registering plugin "About" information
*/
var pluginInformation = {
version : "1.0",
developer : "Stanislas Rolland",
developerUrl : "http://www.sjbr.ca/",
copyrightOwner : "Stanislas Rolland",
sponsor : "SJBR",
sponsorUrl : "http://www.sjbr.ca/",
license : "GPL"
};
this.registerPluginInformation(pluginInformation);
/*
* Registering the buttons
*/
var buttonList = this.buttonList;
for (var i = 0; i < buttonList.length; ++i) {
var button = buttonList[i];
buttonId = button[0];
var buttonConfiguration = {
id : buttonId,
tooltip : this.localize(buttonId.toLowerCase()),
action : "onButtonPress",
hotKey : (this.buttonsConfiguration[button[1]] ? this.buttonsConfiguration[button[1]].hotKey : null),
dialog : true
};
this.registerButton(buttonConfiguration);
}
return true;
},
/*
* The list of buttons added by this plugin
*/
buttonList : [
["ForeColor", "textcolor"],
["HiliteColor", "bgcolor"]
],
/*
* Conversion object: button name or command name to corresponding style property name
*/
styleProperty : {
ForeColor : "color",
HiliteColor : "backgroundColor"
},
/*
* This function gets called when the button was pressed.
*
* @param object editor: the editor instance
* @param string id: the button id or the key
* @param object target: the target element of the contextmenu event, when invoked from the context menu
*
* @return boolean false if action is completed
*/
onButtonPress : function(editor, id, target) {
// Could be a button or its hotkey
var buttonId = this.translateHotKey(id);
buttonId = buttonId ? buttonId : id;
this.commandId = buttonId;
switch (buttonId) {
case "HiliteColor":
this.dialog = this.openDialog(buttonId, this.makeUrlFromPopupName("select_color"), "setColor", HTMLArea._colorToRgb(this.editor._doc.queryCommandValue(HTMLArea.is_ie ? "BackColor" : this.commandId)), {width:300, height:210});
break;
case "ForeColor":
this.dialog = this.openDialog(buttonId, this.makeUrlFromPopupName("select_color"), "setColor", HTMLArea._colorToRgb(this.editor._doc.queryCommandValue(this.commandId)), {width:300, height:210});
break;
default:
this.dialog = this.openDialog(buttonId, this.makeUrlFromPopupName("select_color"), "returnToCaller", HTMLArea._colorToRgb("000000"), {width:300, height:210});
break;
}
return false;
},
/*
* Set the color
*
* @param object param: the returned color
*
* @return boolean false
*/
setColor : function(color) {
var editor = this.editor;
if (color && editor.endPointsInSameBlock()) {
var selection = editor._getSelection();
var range = editor._createRange(selection);
var element = editor._doc.createElement("span");
element.style[this.styleProperty[this.commandId]] = "#" + color;
editor.wrapWithInlineElement(element, selection, range);
if (HTMLArea.is_gecko) {
range.detach();
}
}
return false;
},
/*
* Return to caller
*
* @param object param: the returned color
*
* @return boolean false
*/
returnToCaller : function(color) {
if (color && this.editor.plugins[this.commandId]
&& this.editor.plugins[this.commandId].instance
&& this.editor.plugins[this.commandId].instance.dialog
&& this.editor.plugins[this.commandId].instance.dialog.dialogWindow) {
this.editor.plugins[this.commandId].instance.dialog.dialogWindow.insertColor("#" + color);
}
return false;
},
/*
* This function gets called when the toolbar is updated
*/
onUpdateToolbar : function () {
var editor = this.editor;
if (editor.getMode() === "wysiwyg" && editor.isEditable()) {
var buttonId;
for (var i = 0, n = this.buttonList.length; i < n; ++i) {
buttonId = this.buttonList[i][0];
var obj = editor._toolbarObjects[buttonId];
if ((typeof(obj) !== "undefined")) {
obj.state("enabled", editor.endPointsInSameBlock());
}
}
}
}
});
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultColor/popups/select_color.html (copie de travail)
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<!--
/***************************************************************
* Copyright notice
*
* (c) 2002-2004 interactivetools.com, inc.
* (c) 2003-2004 dynarch.com
* (c) 2004-2008 Stanislas Rolland <typo3(arobas)sjbr.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 script is a modified version of a script published under the htmlArea License.
* A copy of the htmlArea License may be found in the textfile HTMLAREA_LICENSE.txt.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/*
* Default Color window for TYPO3 htmlArea RTE
*
* TYPO3 SVN ID: $Id$
*/
-->
<head>
<title>Select Color</title>
<meta http-equiv="Content-Style-Type" content="text/css" />
<script type="text/javascript">
/*<![CDATA[*/
<!--
var dialog = window.opener.HTMLArea.Dialog.DefaultColor;
function Init() {
dialog.initialize();
var color = dialog.arguments;
color = ValidateColor(color) || '000000';
View(color); // set default color
}
function View(color) { // preview color
document.getElementById("ColorPreview").style.backgroundColor = '#' + color;
document.getElementById("ColorHex").value = '#' + color;
}
function Set(string) { // select color
var color = ValidateColor(string);
if (color == null) {
alert(dialog.plugin.localize("Invalid color code") + ": " + string); // invalid color
} else {
View(color); // show selected color
dialog.performAction(color);
dialog.close();
}
}
function ValidateColor(string) { // return valid color code
string = string || '';
string = string + "";
string = string.toUpperCase();
var chars = '0123456789ABCDEF';
var out = '';
for (var i = 0; i < string.length; i++) { // remove invalid color chars
var schar = string.charAt(i);
if (chars.indexOf(schar) != -1) { out += schar; }
}
if (out.length != 6) { return null; } // check length
return out;
}
// -->
/*]]>*/
</script>
</head>
<body onload="Init();" class="popupwin htmlarea-default-color">
<div id="content">
<form method="get" onSubmit="Set(document.getElementById('ColorHex').value); return false;">
<div id="selectedColor"><div id="ColorPreview"></div><input type="text" name="ColorHex" id="ColorHex" value="" size="15" /></div>
</form>
<table cellspacing="1" cellpadding="0">
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#003300" onMouseOver="View('003300');" onClick="Set('003300');"></td>
<td class="color" bgcolor="#006600" onMouseOver="View('006600');" onClick="Set('006600');"></td>
<td class="color" bgcolor="#009900" onMouseOver="View('009900');" onClick="Set('009900');"></td>
<td class="color" bgcolor="#00CC00" onMouseOver="View('00CC00');" onClick="Set('00CC00');"></td>
<td class="color" bgcolor="#00FF00" onMouseOver="View('00FF00');" onClick="Set('00FF00');"></td>
<td class="color" bgcolor="#330000" onMouseOver="View('330000');" onClick="Set('330000');"></td>
<td class="color" bgcolor="#333300" onMouseOver="View('333300');" onClick="Set('333300');"></td>
<td class="color" bgcolor="#336600" onMouseOver="View('336600');" onClick="Set('336600');"></td>
<td class="color" bgcolor="#339900" onMouseOver="View('339900');" onClick="Set('339900');"></td>
<td class="color" bgcolor="#33CC00" onMouseOver="View('33CC00');" onClick="Set('33CC00');"></td>
<td class="color" bgcolor="#33FF00" onMouseOver="View('33FF00');" onClick="Set('33FF00');"></td>
<td class="color" bgcolor="#660000" onMouseOver="View('660000');" onClick="Set('660000');"></td>
<td class="color" bgcolor="#663300" onMouseOver="View('663300');" onClick="Set('663300');"></td>
<td class="color" bgcolor="#666600" onMouseOver="View('666600');" onClick="Set('666600');"></td>
<td class="color" bgcolor="#669900" onMouseOver="View('669900');" onClick="Set('669900');"></td>
<td class="color" bgcolor="#66CC00" onMouseOver="View('66CC00');" onClick="Set('66CC00');"></td>
<td class="color" bgcolor="#66FF00" onMouseOver="View('66FF00');" onClick="Set('66FF00');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#333333" onMouseOver="View('333333');" onClick="Set('333333');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#000033" onMouseOver="View('000033');" onClick="Set('000033');"></td>
<td class="color" bgcolor="#003333" onMouseOver="View('003333');" onClick="Set('003333');"></td>
<td class="color" bgcolor="#006633" onMouseOver="View('006633');" onClick="Set('006633');"></td>
<td class="color" bgcolor="#009933" onMouseOver="View('009933');" onClick="Set('009933');"></td>
<td class="color" bgcolor="#00CC33" onMouseOver="View('00CC33');" onClick="Set('00CC33');"></td>
<td class="color" bgcolor="#00FF33" onMouseOver="View('00FF33');" onClick="Set('00FF33');"></td>
<td class="color" bgcolor="#330033" onMouseOver="View('330033');" onClick="Set('330033');"></td>
<td class="color" bgcolor="#333333" onMouseOver="View('333333');" onClick="Set('333333');"></td>
<td class="color" bgcolor="#336633" onMouseOver="View('336633');" onClick="Set('336633');"></td>
<td class="color" bgcolor="#339933" onMouseOver="View('339933');" onClick="Set('339933');"></td>
<td class="color" bgcolor="#33CC33" onMouseOver="View('33CC33');" onClick="Set('33CC33');"></td>
<td class="color" bgcolor="#33FF33" onMouseOver="View('33FF33');" onClick="Set('33FF33');"></td>
<td class="color" bgcolor="#660033" onMouseOver="View('660033');" onClick="Set('660033');"></td>
<td class="color" bgcolor="#663333" onMouseOver="View('663333');" onClick="Set('663333');"></td>
<td class="color" bgcolor="#666633" onMouseOver="View('666633');" onClick="Set('666633');"></td>
<td class="color" bgcolor="#669933" onMouseOver="View('669933');" onClick="Set('669933');"></td>
<td class="color" bgcolor="#66CC33" onMouseOver="View('66CC33');" onClick="Set('66CC33');"></td>
<td class="color" bgcolor="#66FF33" onMouseOver="View('66FF33');" onClick="Set('66FF33');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#666666" onMouseOver="View('666666');" onClick="Set('666666');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#000066" onMouseOver="View('000066');" onClick="Set('000066');"></td>
<td class="color" bgcolor="#003366" onMouseOver="View('003366');" onClick="Set('003366');"></td>
<td class="color" bgcolor="#006666" onMouseOver="View('006666');" onClick="Set('006666');"></td>
<td class="color" bgcolor="#009966" onMouseOver="View('009966');" onClick="Set('009966');"></td>
<td class="color" bgcolor="#00CC66" onMouseOver="View('00CC66');" onClick="Set('00CC66');"></td>
<td class="color" bgcolor="#00FF66" onMouseOver="View('00FF66');" onClick="Set('00FF66');"></td>
<td class="color" bgcolor="#330066" onMouseOver="View('330066');" onClick="Set('330066');"></td>
<td class="color" bgcolor="#333366" onMouseOver="View('333366');" onClick="Set('333366');"></td>
<td class="color" bgcolor="#336666" onMouseOver="View('336666');" onClick="Set('336666');"></td>
<td class="color" bgcolor="#339966" onMouseOver="View('339966');" onClick="Set('339966');"></td>
<td class="color" bgcolor="#33CC66" onMouseOver="View('33CC66');" onClick="Set('33CC66');"></td>
<td class="color" bgcolor="#33FF66" onMouseOver="View('33FF66');" onClick="Set('33FF66');"></td>
<td class="color" bgcolor="#660066" onMouseOver="View('660066');" onClick="Set('660066');"></td>
<td class="color" bgcolor="#663366" onMouseOver="View('663366');" onClick="Set('663366');"></td>
<td class="color" bgcolor="#666666" onMouseOver="View('666666');" onClick="Set('666666');"></td>
<td class="color" bgcolor="#669966" onMouseOver="View('669966');" onClick="Set('669966');"></td>
<td class="color" bgcolor="#66CC66" onMouseOver="View('66CC66');" onClick="Set('66CC66');"></td>
<td class="color" bgcolor="#66FF66" onMouseOver="View('66FF66');" onClick="Set('66FF66');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#999999" onMouseOver="View('999999');" onClick="Set('999999');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#000099" onMouseOver="View('000099');" onClick="Set('000099');"></td>
<td class="color" bgcolor="#003399" onMouseOver="View('003399');" onClick="Set('003399');"></td>
<td class="color" bgcolor="#006699" onMouseOver="View('006699');" onClick="Set('006699');"></td>
<td class="color" bgcolor="#009999" onMouseOver="View('009999');" onClick="Set('009999');"></td>
<td class="color" bgcolor="#00CC99" onMouseOver="View('00CC99');" onClick="Set('00CC99');"></td>
<td class="color" bgcolor="#00FF99" onMouseOver="View('00FF99');" onClick="Set('00FF99');"></td>
<td class="color" bgcolor="#330099" onMouseOver="View('330099');" onClick="Set('330099');"></td>
<td class="color" bgcolor="#333399" onMouseOver="View('333399');" onClick="Set('333399');"></td>
<td class="color" bgcolor="#336699" onMouseOver="View('336699');" onClick="Set('336699');"></td>
<td class="color" bgcolor="#339999" onMouseOver="View('339999');" onClick="Set('339999');"></td>
<td class="color" bgcolor="#33CC99" onMouseOver="View('33CC99');" onClick="Set('33CC99');"></td>
<td class="color" bgcolor="#33FF99" onMouseOver="View('33FF99');" onClick="Set('33FF99');"></td>
<td class="color" bgcolor="#660099" onMouseOver="View('660099');" onClick="Set('660099');"></td>
<td class="color" bgcolor="#663399" onMouseOver="View('663399');" onClick="Set('663399');"></td>
<td class="color" bgcolor="#666699" onMouseOver="View('666699');" onClick="Set('666699');"></td>
<td class="color" bgcolor="#669999" onMouseOver="View('669999');" onClick="Set('669999');"></td>
<td class="color" bgcolor="#66CC99" onMouseOver="View('66CC99');" onClick="Set('66CC99');"></td>
<td class="color" bgcolor="#66FF99" onMouseOver="View('66FF99');" onClick="Set('66FF99');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#CCCCCC" onMouseOver="View('CCCCCC');" onClick="Set('CCCCCC');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#0000CC" onMouseOver="View('0000CC');" onClick="Set('0000CC');"></td>
<td class="color" bgcolor="#0033CC" onMouseOver="View('0033CC');" onClick="Set('0033CC');"></td>
<td class="color" bgcolor="#0066CC" onMouseOver="View('0066CC');" onClick="Set('0066CC');"></td>
<td class="color" bgcolor="#0099CC" onMouseOver="View('0099CC');" onClick="Set('0099CC');"></td>
<td class="color" bgcolor="#00CCCC" onMouseOver="View('00CCCC');" onClick="Set('00CCCC');"></td>
<td class="color" bgcolor="#00FFCC" onMouseOver="View('00FFCC');" onClick="Set('00FFCC');"></td>
<td class="color" bgcolor="#3300CC" onMouseOver="View('3300CC');" onClick="Set('3300CC');"></td>
<td class="color" bgcolor="#3333CC" onMouseOver="View('3333CC');" onClick="Set('3333CC');"></td>
<td class="color" bgcolor="#3366CC" onMouseOver="View('3366CC');" onClick="Set('3366CC');"></td>
<td class="color" bgcolor="#3399CC" onMouseOver="View('3399CC');" onClick="Set('3399CC');"></td>
<td class="color" bgcolor="#33CCCC" onMouseOver="View('33CCCC');" onClick="Set('33CCCC');"></td>
<td class="color" bgcolor="#33FFCC" onMouseOver="View('33FFCC');" onClick="Set('33FFCC');"></td>
<td class="color" bgcolor="#6600CC" onMouseOver="View('6600CC');" onClick="Set('6600CC');"></td>
<td class="color" bgcolor="#6633CC" onMouseOver="View('6633CC');" onClick="Set('6633CC');"></td>
<td class="color" bgcolor="#6666CC" onMouseOver="View('6666CC');" onClick="Set('6666CC');"></td>
<td class="color" bgcolor="#6699CC" onMouseOver="View('6699CC');" onClick="Set('6699CC');"></td>
<td class="color" bgcolor="#66CCCC" onMouseOver="View('66CCCC');" onClick="Set('66CCCC');"></td>
<td class="color" bgcolor="#66FFCC" onMouseOver="View('66FFCC');" onClick="Set('66FFCC');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#FFFFFF" onMouseOver="View('FFFFFF');" onClick="Set('FFFFFF');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#0000FF" onMouseOver="View('0000FF');" onClick="Set('0000FF');"></td>
<td class="color" bgcolor="#0033FF" onMouseOver="View('0033FF');" onClick="Set('0033FF');"></td>
<td class="color" bgcolor="#0066FF" onMouseOver="View('0066FF');" onClick="Set('0066FF');"></td>
<td class="color" bgcolor="#0099FF" onMouseOver="View('0099FF');" onClick="Set('0099FF');"></td>
<td class="color" bgcolor="#00CCFF" onMouseOver="View('00CCFF');" onClick="Set('00CCFF');"></td>
<td class="color" bgcolor="#00FFFF" onMouseOver="View('00FFFF');" onClick="Set('00FFFF');"></td>
<td class="color" bgcolor="#3300FF" onMouseOver="View('3300FF');" onClick="Set('3300FF');"></td>
<td class="color" bgcolor="#3333FF" onMouseOver="View('3333FF');" onClick="Set('3333FF');"></td>
<td class="color" bgcolor="#3366FF" onMouseOver="View('3366FF');" onClick="Set('3366FF');"></td>
<td class="color" bgcolor="#3399FF" onMouseOver="View('3399FF');" onClick="Set('3399FF');"></td>
<td class="color" bgcolor="#33CCFF" onMouseOver="View('33CCFF');" onClick="Set('33CCFF');"></td>
<td class="color" bgcolor="#33FFFF" onMouseOver="View('33FFFF');" onClick="Set('33FFFF');"></td>
<td class="color" bgcolor="#6600FF" onMouseOver="View('6600FF');" onClick="Set('6600FF');"></td>
<td class="color" bgcolor="#6633FF" onMouseOver="View('6633FF');" onClick="Set('6633FF');"></td>
<td class="color" bgcolor="#6666FF" onMouseOver="View('6666FF');" onClick="Set('6666FF');"></td>
<td class="color" bgcolor="#6699FF" onMouseOver="View('6699FF');" onClick="Set('6699FF');"></td>
<td class="color" bgcolor="#66CCFF" onMouseOver="View('66CCFF');" onClick="Set('66CCFF');"></td>
<td class="color" bgcolor="#66FFFF" onMouseOver="View('66FFFF');" onClick="Set('66FFFF');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#FF0000" onMouseOver="View('FF0000');" onClick="Set('FF0000');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#990000" onMouseOver="View('990000');" onClick="Set('990000');"></td>
<td class="color" bgcolor="#993300" onMouseOver="View('993300');" onClick="Set('993300');"></td>
<td class="color" bgcolor="#996600" onMouseOver="View('996600');" onClick="Set('996600');"></td>
<td class="color" bgcolor="#999900" onMouseOver="View('999900');" onClick="Set('999900');"></td>
<td class="color" bgcolor="#99CC00" onMouseOver="View('99CC00');" onClick="Set('99CC00');"></td>
<td class="color" bgcolor="#99FF00" onMouseOver="View('99FF00');" onClick="Set('99FF00');"></td>
<td class="color" bgcolor="#CC0000" onMouseOver="View('CC0000');" onClick="Set('CC0000');"></td>
<td class="color" bgcolor="#CC3300" onMouseOver="View('CC3300');" onClick="Set('CC3300');"></td>
<td class="color" bgcolor="#CC6600" onMouseOver="View('CC6600');" onClick="Set('CC6600');"></td>
<td class="color" bgcolor="#CC9900" onMouseOver="View('CC9900');" onClick="Set('CC9900');"></td>
<td class="color" bgcolor="#CCCC00" onMouseOver="View('CCCC00');" onClick="Set('CCCC00');"></td>
<td class="color" bgcolor="#CCFF00" onMouseOver="View('CCFF00');" onClick="Set('CCFF00');"></td>
<td class="color" bgcolor="#FF0000" onMouseOver="View('FF0000');" onClick="Set('FF0000');"></td>
<td class="color" bgcolor="#FF3300" onMouseOver="View('FF3300');" onClick="Set('FF3300');"></td>
<td class="color" bgcolor="#FF6600" onMouseOver="View('FF6600');" onClick="Set('FF6600');"></td>
<td class="color" bgcolor="#FF9900" onMouseOver="View('FF9900');" onClick="Set('FF9900');"></td>
<td class="color" bgcolor="#FFCC00" onMouseOver="View('FFCC00');" onClick="Set('FFCC00');"></td>
<td class="color" bgcolor="#FFFF00" onMouseOver="View('FFFF00');" onClick="Set('FFFF00');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#00FF00" onMouseOver="View('00FF00');" onClick="Set('00FF00');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#990033" onMouseOver="View('990033');" onClick="Set('990033');"></td>
<td class="color" bgcolor="#993333" onMouseOver="View('993333');" onClick="Set('993333');"></td>
<td class="color" bgcolor="#996633" onMouseOver="View('996633');" onClick="Set('996633');"></td>
<td class="color" bgcolor="#999933" onMouseOver="View('999933');" onClick="Set('999933');"></td>
<td class="color" bgcolor="#99CC33" onMouseOver="View('99CC33');" onClick="Set('99CC33');"></td>
<td class="color" bgcolor="#99FF33" onMouseOver="View('99FF33');" onClick="Set('99FF33');"></td>
<td class="color" bgcolor="#CC0033" onMouseOver="View('CC0033');" onClick="Set('CC0033');"></td>
<td class="color" bgcolor="#CC3333" onMouseOver="View('CC3333');" onClick="Set('CC3333');"></td>
<td class="color" bgcolor="#CC6633" onMouseOver="View('CC6633');" onClick="Set('CC6633');"></td>
<td class="color" bgcolor="#CC9933" onMouseOver="View('CC9933');" onClick="Set('CC9933');"></td>
<td class="color" bgcolor="#CCCC33" onMouseOver="View('CCCC33');" onClick="Set('CCCC33');"></td>
<td class="color" bgcolor="#CCFF33" onMouseOver="View('CCFF33');" onClick="Set('CCFF33');"></td>
<td class="color" bgcolor="#FF0033" onMouseOver="View('FF0033');" onClick="Set('FF0033');"></td>
<td class="color" bgcolor="#FF3333" onMouseOver="View('FF3333');" onClick="Set('FF3333');"></td>
<td class="color" bgcolor="#FF6633" onMouseOver="View('FF6633');" onClick="Set('FF6633');"></td>
<td class="color" bgcolor="#FF9933" onMouseOver="View('FF9933');" onClick="Set('FF9933');"></td>
<td class="color" bgcolor="#FFCC33" onMouseOver="View('FFCC33');" onClick="Set('FFCC33');"></td>
<td class="color" bgcolor="#FFFF33" onMouseOver="View('FFFF33');" onClick="Set('FFFF33');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#0000FF" onMouseOver="View('0000FF');" onClick="Set('0000FF');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#990066" onMouseOver="View('990066');" onClick="Set('990066');"></td>
<td class="color" bgcolor="#993366" onMouseOver="View('993366');" onClick="Set('993366');"></td>
<td class="color" bgcolor="#996666" onMouseOver="View('996666');" onClick="Set('996666');"></td>
<td class="color" bgcolor="#999966" onMouseOver="View('999966');" onClick="Set('999966');"></td>
<td class="color" bgcolor="#99CC66" onMouseOver="View('99CC66');" onClick="Set('99CC66');"></td>
<td class="color" bgcolor="#99FF66" onMouseOver="View('99FF66');" onClick="Set('99FF66');"></td>
<td class="color" bgcolor="#CC0066" onMouseOver="View('CC0066');" onClick="Set('CC0066');"></td>
<td class="color" bgcolor="#CC3366" onMouseOver="View('CC3366');" onClick="Set('CC3366');"></td>
<td class="color" bgcolor="#CC6666" onMouseOver="View('CC6666');" onClick="Set('CC6666');"></td>
<td class="color" bgcolor="#CC9966" onMouseOver="View('CC9966');" onClick="Set('CC9966');"></td>
<td class="color" bgcolor="#CCCC66" onMouseOver="View('CCCC66');" onClick="Set('CCCC66');"></td>
<td class="color" bgcolor="#CCFF66" onMouseOver="View('CCFF66');" onClick="Set('CCFF66');"></td>
<td class="color" bgcolor="#FF0066" onMouseOver="View('FF0066');" onClick="Set('FF0066');"></td>
<td class="color" bgcolor="#FF3366" onMouseOver="View('FF3366');" onClick="Set('FF3366');"></td>
<td class="color" bgcolor="#FF6666" onMouseOver="View('FF6666');" onClick="Set('FF6666');"></td>
<td class="color" bgcolor="#FF9966" onMouseOver="View('FF9966');" onClick="Set('FF9966');"></td>
<td class="color" bgcolor="#FFCC66" onMouseOver="View('FFCC66');" onClick="Set('FFCC66');"></td>
<td class="color" bgcolor="#FFFF66" onMouseOver="View('FFFF66');" onClick="Set('FFFF66');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#FFFF00" onMouseOver="View('FFFF00');" onClick="Set('FFFF00');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#990099" onMouseOver="View('990099');" onClick="Set('990099');"></td>
<td class="color" bgcolor="#993399" onMouseOver="View('993399');" onClick="Set('993399');"></td>
<td class="color" bgcolor="#996699" onMouseOver="View('996699');" onClick="Set('996699');"></td>
<td class="color" bgcolor="#999999" onMouseOver="View('999999');" onClick="Set('999999');"></td>
<td class="color" bgcolor="#99CC99" onMouseOver="View('99CC99');" onClick="Set('99CC99');"></td>
<td class="color" bgcolor="#99FF99" onMouseOver="View('99FF99');" onClick="Set('99FF99');"></td>
<td class="color" bgcolor="#CC0099" onMouseOver="View('CC0099');" onClick="Set('CC0099');"></td>
<td class="color" bgcolor="#CC3399" onMouseOver="View('CC3399');" onClick="Set('CC3399');"></td>
<td class="color" bgcolor="#CC6699" onMouseOver="View('CC6699');" onClick="Set('CC6699');"></td>
<td class="color" bgcolor="#CC9999" onMouseOver="View('CC9999');" onClick="Set('CC9999');"></td>
<td class="color" bgcolor="#CCCC99" onMouseOver="View('CCCC99');" onClick="Set('CCCC99');"></td>
<td class="color" bgcolor="#CCFF99" onMouseOver="View('CCFF99');" onClick="Set('CCFF99');"></td>
<td class="color" bgcolor="#FF0099" onMouseOver="View('FF0099');" onClick="Set('FF0099');"></td>
<td class="color" bgcolor="#FF3399" onMouseOver="View('FF3399');" onClick="Set('FF3399');"></td>
<td class="color" bgcolor="#FF6699" onMouseOver="View('FF6699');" onClick="Set('FF6699');"></td>
<td class="color" bgcolor="#FF9999" onMouseOver="View('FF9999');" onClick="Set('FF9999');"></td>
<td class="color" bgcolor="#FFCC99" onMouseOver="View('FFCC99');" onClick="Set('FFCC99');"></td>
<td class="color" bgcolor="#FFFF99" onMouseOver="View('FFFF99');" onClick="Set('FFFF99');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#00FFFF" onMouseOver="View('00FFFF');" onClick="Set('00FFFF');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#9900CC" onMouseOver="View('9900CC');" onClick="Set('9900CC');"></td>
<td class="color" bgcolor="#9933CC" onMouseOver="View('9933CC');" onClick="Set('9933CC');"></td>
<td class="color" bgcolor="#9966CC" onMouseOver="View('9966CC');" onClick="Set('9966CC');"></td>
<td class="color" bgcolor="#9999CC" onMouseOver="View('9999CC');" onClick="Set('9999CC');"></td>
<td class="color" bgcolor="#99CCCC" onMouseOver="View('99CCCC');" onClick="Set('99CCCC');"></td>
<td class="color" bgcolor="#99FFCC" onMouseOver="View('99FFCC');" onClick="Set('99FFCC');"></td>
<td class="color" bgcolor="#CC00CC" onMouseOver="View('CC00CC');" onClick="Set('CC00CC');"></td>
<td class="color" bgcolor="#CC33CC" onMouseOver="View('CC33CC');" onClick="Set('CC33CC');"></td>
<td class="color" bgcolor="#CC66CC" onMouseOver="View('CC66CC');" onClick="Set('CC66CC');"></td>
<td class="color" bgcolor="#CC99CC" onMouseOver="View('CC99CC');" onClick="Set('CC99CC');"></td>
<td class="color" bgcolor="#CCCCCC" onMouseOver="View('CCCCCC');" onClick="Set('CCCCCC');"></td>
<td class="color" bgcolor="#CCFFCC" onMouseOver="View('CCFFCC');" onClick="Set('CCFFCC');"></td>
<td class="color" bgcolor="#FF00CC" onMouseOver="View('FF00CC');" onClick="Set('FF00CC');"></td>
<td class="color" bgcolor="#FF33CC" onMouseOver="View('FF33CC');" onClick="Set('FF33CC');"></td>
<td class="color" bgcolor="#FF66CC" onMouseOver="View('FF66CC');" onClick="Set('FF66CC');"></td>
<td class="color" bgcolor="#FF99CC" onMouseOver="View('FF99CC');" onClick="Set('FF99CC');"></td>
<td class="color" bgcolor="#FFCCCC" onMouseOver="View('FFCCCC');" onClick="Set('FFCCCC');"></td>
<td class="color" bgcolor="#FFFFCC" onMouseOver="View('FFFFCC');" onClick="Set('FFFFCC');"></td>
</tr>
<tr>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#FF00FF" onMouseOver="View('FF00FF');" onClick="Set('FF00FF');"></td>
<td class="color" bgcolor="#000000" onMouseOver="View('000000');" onClick="Set('000000');"></td>
<td class="color" bgcolor="#9900FF" onMouseOver="View('9900FF');" onClick="Set('9900FF');"></td>
<td class="color" bgcolor="#9933FF" onMouseOver="View('9933FF');" onClick="Set('9933FF');"></td>
<td class="color" bgcolor="#9966FF" onMouseOver="View('9966FF');" onClick="Set('9966FF');"></td>
<td class="color" bgcolor="#9999FF" onMouseOver="View('9999FF');" onClick="Set('9999FF');"></td>
<td class="color" bgcolor="#99CCFF" onMouseOver="View('99CCFF');" onClick="Set('99CCFF');"></td>
<td class="color" bgcolor="#99FFFF" onMouseOver="View('99FFFF');" onClick="Set('99FFFF');"></td>
<td class="color" bgcolor="#CC00FF" onMouseOver="View('CC00FF');" onClick="Set('CC00FF');"></td>
<td class="color" bgcolor="#CC33FF" onMouseOver="View('CC33FF');" onClick="Set('CC33FF');"></td>
<td class="color" bgcolor="#CC66FF" onMouseOver="View('CC66FF');" onClick="Set('CC66FF');"></td>
<td class="color" bgcolor="#CC99FF" onMouseOver="View('CC99FF');" onClick="Set('CC99FF');"></td>
<td class="color" bgcolor="#CCCCFF" onMouseOver="View('CCCCFF');" onClick="Set('CCCCFF');"></td>
<td class="color" bgcolor="#CCFFFF" onMouseOver="View('CCFFFF');" onClick="Set('CCFFFF');"></td>
<td class="color" bgcolor="#FF00FF" onMouseOver="View('FF00FF');" onClick="Set('FF00FF');"></td>
<td class="color" bgcolor="#FF33FF" onMouseOver="View('FF33FF');" onClick="Set('FF33FF');"></td>
<td class="color" bgcolor="#FF66FF" onMouseOver="View('FF66FF');" onClick="Set('FF66FF');"></td>
<td class="color" bgcolor="#FF99FF" onMouseOver="View('FF99FF');" onClick="Set('FF99FF');"></td>
<td class="color" bgcolor="#FFCCFF" onMouseOver="View('FFCCFF');" onClick="Set('FFCCFF');"></td>
<td class="color" bgcolor="#FFFFFF" onMouseOver="View('FFFFFF');" onClick="Set('FFFFFF');"></td>
</tr>
</table>
</div>
</body>
</html>
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultFont/default-font.js (copie de travail)
/***************************************************************
* Copyright notice
*
* (c) 2008-2009 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 Font Plugin for TYPO3 htmlArea RTE
*
* TYPO3 SVN ID: $Id$
*/
DefaultFont = HTMLArea.Plugin.extend({
constructor : function(editor, pluginName) {
this.base(editor, pluginName);
},
/*
* This function gets called by the class constructor
*/
configurePlugin : function (editor) {
this.options = new Object();
this.options.FontName = this.editorConfiguration.buttons.fontstyle ? this.editorConfiguration.buttons.fontstyle.options : null;
this.options.FontSize = this.editorConfiguration.buttons.fontsize ? this.editorConfiguration.buttons.fontsize.options : null;
this.disablePCexamples = this.editorConfiguration.disablePCexamples
/*
* 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 dropdowns
*/
var buttonId;
for (var i = 0, n = this.dropDownList.length; i < n; ++i) {
var dropDown = this.dropDownList[i];
buttonId = dropDown[0];
var dropDownConfiguration = {
id : buttonId,
tooltip : this.localize(buttonId.toLowerCase()),
options : this.options[buttonId],
action : "onChange",
context : null
};
this.registerDropDown(dropDownConfiguration);
}
return true;
},
/*
* The list of buttons added by this plugin
*/
dropDownList : [
["FontName", null],
["FontSize", null]
],
/*
* This function gets called when some font style or font size was selected from the dropdown lists
*/
onChange : function (editor, buttonId) {
var select = document.getElementById(this.editor._toolbarObjects[buttonId].elementId);
var param = select.value;
editor.focusEditor();
if (param) {
this.editor._doc.execCommand(buttonId, false, param);
} else {
var selection = this.editor._getSelection();
// Find font node and select it
if (HTMLArea.is_gecko && selection.isCollapsed) {
var fontNode = this.editor._getFirstAncestor(selection, "font");
if (fontNode != null) {
this.editor.selectNode(fontNode);
}
}
// Remove format
this.editor._doc.execCommand("RemoveFormat", false, null);
// Collapse range if font was found
if (HTMLArea.is_gecko && fontNode != null) {
selection = this.editor._getSelection();
var range = this.editor._createRange(selection).cloneRange();
range.collapse(false);
this.editor.emptySelection(selection);
this.editor.addRangeToSelection(selection, range);
}
}
return false;
},
/*
* This function gets called when the toolbar is updated
*/
onUpdateToolbar : function () {
var editor = this.editor;
var buttonId, k;
if (editor.getMode() === "wysiwyg" && this.editor.isEditable()) {
for (var i = 0, n = this.dropDownList.length; i < n; ++i) {
buttonId = this.dropDownList[i][0];
if (this.isButtonInToolbar(buttonId)) {
var select = document.getElementById(editor._toolbarObjects[buttonId].elementId);
select.selectedIndex = 0;
try {
var value = ("" + editor._doc.queryCommandValue(buttonId)).trim().toLowerCase().replace(/\'/g, "");
} catch(e) {
value = null;
}
if (value) {
var options = this.options[buttonId];
k = 0;
for (var j in options) {
if (options.hasOwnProperty(j)) {
if ((j.toLowerCase().indexOf(value) !== -1)
|| (options[j].trim().substr(0, value.length).toLowerCase() == value)
|| ((buttonId === "FontName") && (options[j].toLowerCase().indexOf(value) !== -1))) {
select.selectedIndex = k;
break;
}
++k;
}
}
}
}
}
}
},
/*
* This function gets called when the plugin is generated
*/
onGenerate : function () {
if (!this.disablePCexamples && this.isButtonInToolbar("FontName")) {
var select = document.getElementById(this.editor._toolbarObjects.FontName.elementId);
for (var i = select.options.length; --i >= 0;) {
if (HTMLArea.is_gecko) select.options[i].setAttribute("style", "font-family:" + select.options[i].value + ";");
else select.options[i].style.cssText = "font-family:" + select.options[i].value + ";";
}
}
}
});
typo3/sysext/rtehtmlarea/mod2/acronym.php (copie de travail)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2005-2009 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!
***************************************************************/
/**
* Acronym content for htmlArea RTE
*
* @author Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
*
* $Id$ *
*/
error_reporting (E_ALL ^ E_NOTICE);
unset($MCONF);
require('conf.php');
require($BACK_PATH.'init.php');
require($BACK_PATH.'template.php');
require_once('class.tx_rtehtmlarea_acronym_mod.php');
$LANG->includeLLFile('EXT:rtehtmlarea/mod2/locallang.xml');
$LANG->includeLLFile('EXT:rtehtmlarea/htmlarea/locallang_dialogs.xml');
// Make instance:
$SOBE = t3lib_div::makeInstance('tx_rtehtmlarea_acronym_mod');
$SOBE->init();
$SOBE->main();
$SOBE->printContent();
?>
typo3/sysext/rtehtmlarea/mod2/class.tx_rtehtmlarea_acronym_mod.php (copie de travail)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2005-2009 Stanislas Rolland <typo3(arobas)sjbr.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!
***************************************************************/
/**
* Acronym content for htmlArea RTE
*
* @author Stanislas Rolland <typo3(arobas)sjbr.ca>
*
* $Id$ *
*/
class tx_rtehtmlarea_acronym_mod {
var $content;
var $modData;
/**
* document template object
*
* @var template
*/
var $doc;
/**
* @return [type] ...
*/
function init() {
global $BE_USER,$LANG,$BACK_PATH;
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $BACK_PATH;
$this->doc->styleSheetFile = "";
$this->doc->styleSheetFile_post = "";
$this->doc->bodyTagAdditions = 'class="popupwin" onload="init();"';
$this->doc->form = '<form action="" id="content" name="content" method="post">';
$JScode='
var dialog = window.opener.HTMLArea.Dialog.Acronym;
var plugin = dialog.plugin;
var editor = dialog.plugin.editor;
var param = dialog.plugin.param,
abbr = dialog.plugin.abbr,
abbrType = dialog.plugin.abbrType,
html = "",
acronyms = new Object(),
abbreviations = new Object();
function setType() {
if (document.content.acronym.checked) {
abbrType = "acronym";
document.getElementById("abbrType").innerHTML = "' . $LANG->getLL('Acronym') . '";
} else {
abbrType = "abbr";
document.getElementById("abbrType").innerHTML = "' . $LANG->getLL('Abbreviation') . '";
}
document.getElementById("title").value = param["title"];
rtehtmlareaAcronymFillLanguage();
fillSelect(param);
dialog.resize();
}
function init() {
dialog.initialize("noLocalize", "noResize");
var abbrData = dialog.plugin.getJavascriptFile(dialog.plugin.acronymUrl, "noEval");
if (abbrData) eval(abbrData);
if (dialog.plugin.pageTSConfiguration.noAcronym || dialog.plugin.pageTSConfiguration.noAbbr) {
document.getElementById("type").style.display = "none";
}
if (abbrType != null) {
document.getElementById("type").style.display = "none";
} else {
abbrType = !dialog.plugin.pageTSConfiguration.noAbbr ? "abbr" : "acronym";
}
if (abbrType == "acronym" && !dialog.plugin.pageTSConfiguration.noAcronym) {
document.content.acronym.checked = true;
} else {
document.content.abbreviation.checked = true;
}
setType();
HTMLArea._addEvents(document.content.title,["keypress", "keydown", "dragdrop", "drop", "paste", "change"],function(ev) { document.content.termSelector.selectedIndex=-1; document.content.acronymSelector.selectedIndex=-1; });
document.getElementById("title").focus();
};
function fillSelect(param) {
var termSelector = document.getElementById("termSelector");
var acronymSelector = document.getElementById("acronymSelector");
while (termSelector.options.length > 1) {
termSelector.options[termSelector.length-1] = null;
}
while (acronymSelector.options.length > 1) {
acronymSelector.options[acronymSelector.length-1] = null;
}
if (abbrType == "acronym") {
var abbrObj = acronyms;
} else {
var abbrObj = abbreviations;
}
if (abbrObj != "") {
var sameTerm = false;
var sameAbbreviation = false;
var selectedOption = false;
for (var i in abbrObj) {
if (abbrObj.hasOwnProperty(i)) {
if (param["title"]) {
sameTerm = (param["title"] == i);
} else {
sameTerm = (param["text"] == i);
}
sameAbbreviation = (param["text"] == abbrObj[i]);
if (!selectedOption && (sameTerm || sameAbbreviation)) {
selectedOption = i;
}
if (!param["text"] || sameTerm || sameAbbreviation) {
termSelector.options[termSelector.options.length] = new Option(i, i, false, (selectedOption == i));
acronymSelector.options[acronymSelector.options.length] = new Option(abbrObj[i], abbrObj[i], false, (selectedOption == i));
}
if (selectedOption == i) {
document.content.title.value = i;
rtehtmlareaAcronymSelectedLanguage(i);
}
}
}
}
if (acronymSelector.options.length == 1) {
document.getElementById("selector").style.display = "none";
} else {
document.getElementById("selector").style.display = "block";
}
};
function processAcronym(title) {
if (title == "" || title == null) {
if (abbr) {
dialog.plugin.removeMarkup(abbr);
}
} else {
var doc = editor._doc;
var languageObject = plugin.getPluginInstance("Language");
if (plugin.isButtonInToolbar("Language")) {
var select = document.getElementById("termLanguageSelector");
var language = select.options[select.selectedIndex].value;
}
if (!abbr) {
abbr = doc.createElement(abbrType);
abbr.title = title;
if(document.content.acronymSelector.options.length != 1 && document.content.termSelector.selectedIndex > 0 && document.content.termSelector.options[document.content.termSelector.selectedIndex].value == title) {
html = document.content.acronymSelector.options[document.content.acronymSelector.selectedIndex].value;
}
abbr.innerHTML = html;
if (languageObject && plugin.isButtonInToolbar("Language")) {
languageObject.setLanguageAttributes(abbr, language);
}
editor.insertNodeAtSelection(abbr);
} else {
abbr.title = title;
if (languageObject && plugin.isButtonInToolbar("Language")) {
languageObject.setLanguageAttributes(abbr, language);
}
if (document.content.acronymSelector.options.length != 1 && document.content.termSelector.selectedIndex > 0 && document.content.termSelector.options[document.content.termSelector.selectedIndex].value == title) {
abbr.innerHTML = document.content.acronymSelector.options[document.content.acronymSelector.selectedIndex].value;
}
}
}
};
function rtehtmlareaAcronymFillLanguage() {
if (plugin.isButtonInToolbar("Language")) {
var languageOptions = plugin.getDropDownConfiguration("Language").options;
var select = document.getElementById("termLanguageSelector");
while (select.options.length > 0) {
select.options[select.length-1] = null;
}
for (var option in languageOptions) {
if (languageOptions.hasOwnProperty(option)) {
var addOption = document.createElement("option");
addOption.innerHTML = option;
addOption.value = languageOptions[option];
select.appendChild(addOption);
}
}
} else {
document.getElementById("languageSelector").style.display = "none";
}
};
function rtehtmlareaAcronymSelectedLanguage(term) {
if (abbrType == "acronym") {
var languages = acronymLanguage;
} else {
var languages = abbreviationLanguage;
}
if (document.getElementById("languageSelector").style.display != "none") {
var select = document.getElementById("termLanguageSelector");
var options = select.options;
for (var i = options.length; --i >= 0;) {
options[i].selected = false;
}
select.selectedIndex = 0;
options[0].selected = true;
if (languages[term]) {
for (i = options.length; --i >= 0;) {
if (languages[term] == options[i].value) {
options[i].selected = true;
select.selectedIndex = i;
break;
}
}
}
}
}
function onOK() {
processAcronym(document.getElementById("title").value);
dialog.close();
return false;
};
function onDelete() {
processAcronym("");
dialog.close();
return false;
};
function onCancel() {
dialog.close();
return false;
};
';
$this->doc->JScode .= $this->doc->wrapScriptTags($JScode);
$this->modData = $BE_USER->getModuleData('acronym.php','ses');
$BE_USER->pushModuleData('acronym.php',$this->modData);
}
/**
* [Describe function...]
*
* @return [type] ...
*/
function main() {
$this->content='';
$this->content.=$this->main_acronym($this->modData['openKeys']);
}
/**
* [Describe function...]
*
* @return [type] ...
*/
function printContent() {
echo $this->content;
}
/**
* Rich Text Editor (RTE) acronym selector
*
* @param [type] $openKeys: ...
* @return [type] ...
*/
function main_acronym($openKeys) {
global $LANG, $BE_USER;
$content.=$this->doc->startPage($LANG->getLL('Insert/Modify Acronym',1));
$RTEtsConfigParts = explode(':',t3lib_div::_GP('RTEtsConfigParams'));
$RTEsetup = $BE_USER->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
$thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);
$content.='
<div class="title" id="abbrType">' . $LANG->getLL('Acronym',1) . '</div>
<fieldset id="type">
<legend>' . $LANG->getLL('Type_of_abridged_form',1) . '</legend>
<label for="abbreviation" class="checkbox">' . $LANG->getLL('Abbreviation',1) . '</label><input type="radio" name="type" id="abbreviation" value="abbreviation" checked="checked" onclick="setType();" />
<label for="acronym" class="checkbox">' . $LANG->getLL('Acronym',1) . '</label><input type="radio" name="type" id="acronym" value="acronym" onclick="setType();" />
</fieldset>
<fieldset id="selector">
<legend>' . $LANG->getLL('Defined_term',1) . '</legend>
<div>
<label class="fl" for="termSelector" id="termSelectorLabel" title="' . $LANG->getLL('Select_a_term',1) . '">' . $LANG->getLL('Unabridged_term',1) . '</label>
<select id="termSelector" name="termSelector" title="' . $LANG->getLL('Select_a_term',1) . '"
onChange="document.content.acronymSelector.selectedIndex=document.content.termSelector.selectedIndex;
document.content.title.value=document.content.termSelector.options[document.content.termSelector.selectedIndex].value;
rtehtmlareaAcronymSelectedLanguage(document.content.title.value);">
<option value=""></option>
</select>
</div>
<div>
<label class="fl" for="acronymSelector" id="acronymSelectorLabel" title="' . $LANG->getLL('Select_an_acronym',1) . '">' . $LANG->getLL('Abridged_term',1) . '</label>
<select id="acronymSelector" name="acronymSelector" title="' . $LANG->getLL('Select_an_acronym',1) . '"
onChange="document.content.termSelector.selectedIndex=document.content.acronymSelector.selectedIndex;
document.content.title.value=document.content.termSelector.options[document.content.termSelector.selectedIndex].value;
rtehtmlareaAcronymSelectedLanguage(document.content.title.value);">
<option value=""></option>
</select>
</div>
<div id="languageSelector">
<label class="fl" for="termLanguageSelector" id="termLanguageSelectorLabel" title="' . $LANG->getLL('Select_a_language',1) . '">' . $LANG->getLL('Language',1) . '</label>
<select id="termLanguageSelector" name="termLanguageSelector" title="' . $LANG->getLL('Select_a_language',1) . '">
</select>
</div>
</fieldset>
<fieldset>
<legend>' . $LANG->getLL('Term_to_abridge',1) . '</legend>
<label for="title" class="fl" title="' . $LANG->getLL('Use_this_term_explain',1) . '">' . $LANG->getLL('Use_this_term',1) . '</label>
<input type="text" id="title" name="title" size="60" title="' . $LANG->getLL('Use_this_term_explain',1) . '" />
</fieldset>
<div class="buttons">
<button type="button" title="' . $LANG->getLL('OK',1) . '"onclick="return onOK();">' . $LANG->getLL('OK',1) . '</button>
<button type="button" title="' . $LANG->getLL('Delete',1) . '" onclick="return onDelete();">' . $LANG->getLL('Delete',1) . '</button>
<button type="button" title="' . $LANG->getLL('Cancel',1) . '" onclick="return onCancel();">' . $LANG->getLL('Cancel',1) . '</button>
</div>';
$content.= $this->doc->endPage();
return $content;
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod2/class.tx_rtehtmlarea_acronym_mod.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/mod2/class.tx_rtehtmlarea_acronym_mod.php']);
}
?>
typo3/sysext/rtehtmlarea/mod2/conf.php (copie de travail)
<?php
// DO NOT REMOVE OR CHANGE THESE 3 LINES:
define('TYPO3_MOD_PATH', 'sysext/rtehtmlarea/mod2/');
$BACK_PATH = '../../../';
$MCONF['name']='txrtehtmlareaacronym';
?>
(1-1/2)