Project

General

Profile

Feature #23797 » rtehtmlarea_feature_16073.patch

Administrator Admin, 2010-10-20 04:18

View differences:

typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (copie de travail)
bar, orderedlist, unorderedlist, definitionlist, definitionitem, outdent, indent, bar, lefttoright, righttoleft, language, showlanguagemarks,
bar, textcolor, bgcolor, textindicator,
bar, emoticon, insertcharacter, link, unlink, image, table,' . (($this->thisConfig['hideTableOperationsInToolbar'] && is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['toggleborders.']) && $this->thisConfig['buttons.']['toggleborders.']['keepInToolbar']) ? ' toggleborders,': '') . ' user, acronym, bar, findreplace, spellcheck,
bar, chMode, inserttag, removeformat, bar, copy, cut, paste, bar, undo, redo, bar, showhelp, about, linebreak,
bar, chMode, inserttag, removeformat, bar, copy, cut, paste, pasteastext, bar, undo, redo, bar, showhelp, about, linebreak,
' . ($this->thisConfig['hideTableOperationsInToolbar'] ? '': 'bar, toggleborders,') . ' bar, tableproperties, tablerestyle, bar, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, bar,
columnproperties, columninsertbefore, columninsertafter, columndelete, columnsplit, bar,
cellproperties, cellinsertbefore, cellinsertafter, celldelete, cellsplit, cellmerge';
typo3/sysext/rtehtmlarea/ext_localconf.php (copie de travail)
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['RemoveFormat']['objectReference'] = 'EXT:'.$_EXTKEY.'/extensions/RemoveFormat/class.tx_rtehtmlarea_removeformat.php:&tx_rtehtmlarea_removeformat';
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['RemoveFormat']['addIconsToSkin'] = 0;
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['RemoveFormat']['disableInFE'] = 0;
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['PlainText'] = array();
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['PlainText']['objectReference'] = 'EXT:'.$_EXTKEY.'/extensions/PlainText/class.tx_rtehtmlarea_plaintext.php:&tx_rtehtmlarea_plaintext';
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['PlainText']['addIconsToSkin'] = 0;
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['PlainText']['disableInFE'] = 0;
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['DefaultClean'] = array();
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['DefaultClean']['objectReference'] = 'EXT:'.$_EXTKEY.'/extensions/DefaultClean/class.tx_rtehtmlarea_defaultclean.php:&tx_rtehtmlarea_defaultclean';
$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['TYPO3HtmlParser'] = array();
typo3/sysext/rtehtmlarea/extensions/PlainText/class.tx_rtehtmlarea_plaintext.php (r?vision 0)
<?php
/***************************************************************
* Copyright notice
*
* (c) 2010 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.
*
* 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!
***************************************************************/
/**
* Copy as Plain Text extension for htmlArea RTE
*
* @author Stanislas Rolland <typo3(arobas)sjbr.ca>
*
* TYPO3 SVN ID: $Id: class.tx_rtehtmlarea_plaintext.php 7838 2010-06-08 16:10:41Z stan $
*
*/
require_once(t3lib_extMgm::extPath('rtehtmlarea').'class.tx_rtehtmlareaapi.php');
class tx_rtehtmlarea_plaintext extends tx_rtehtmlareaapi {
protected $extensionKey = 'rtehtmlarea'; // The key of the extension that is extending htmlArea RTE
protected $pluginName = 'PlainText'; // The name of the plugin registered by the extension
protected $relativePathToLocallangFile = ''; // Path to this main locallang file of the extension relative to the extension dir.
protected $relativePathToSkin = 'extensions/PlainText/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 = 'pasteastext';
protected $convertToolbarForHtmlAreaArray = array (
'pasteastext' => 'PlainText',
);
public function main($parentObject) {
// Opera has no onPaste event to hook on
return parent::main($parentObject) && $this->htmlAreaRTE->client['browser'] != 'opera';
}
/**
* 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) {
$registerRTEinJavascriptString = '';
return $registerRTEinJavascriptString;
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/PlainText/class.tx_rtehtmlarea_plaintext.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rtehtmlarea/extensions/Plaintext/class.tx_rtehtmlarea_plaintext.php']);
}
?>
typo3/sysext/rtehtmlarea/extensions/PlainText/skin/htmlarea.css (r?vision 0)
/* Selectors for the PlainText extension of htmlArea RTE */
/* TYPO3 SVN ID: $Id: htmlarea.css 8281 2010-07-26 23:18:50Z stan $ */
.htmlarea-action-paste-as-plain-text {
background-image: url('images/paste-as-plain-text.gif') !important;
background-position: 0 0 !important;
}
typo3/sysext/rtehtmlarea/htmlarea/plugins/PlainText/locallang.xml (r?vision 0)
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<meta type="array">
<description>Labels for Plain text plugin of htmlArea RTE</description>
<type>module</type>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="PlainTextTooltip">Toggle Paste as Plain Text</label>
<label index="Paste-as-Plain-Text">Paste as Plain Text</label>
<label index="Access-to-clipboard-denied">Content could not be pasted as plain text because permission to access the clipboard was denied.</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/PlainText/plain-text.js (r?vision 0)
/***************************************************************
* Copyright notice
*
* (c) 2010 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!
***************************************************************/
/*
* Paste as Plain Text Plugin for TYPO3 htmlArea RTE
*
* TYPO3 SVN ID: $Id: plain-text.js 8945 2010-10-04 03:00:03Z stan $
*/
HTMLArea.PlainText = HTMLArea.Plugin.extend({
constructor: function(editor, pluginName) {
this.base(editor, pluginName);
},
/*
* 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.sjbr.ca/',
copyrightOwner : 'Stanislas Rolland',
sponsor : 'SJBR',
sponsorUrl : 'http://www.sjbr.ca/',
license : 'GPL'
};
this.registerPluginInformation(pluginInformation);
/*
* Registering the button
*/
var buttonId = 'PlainText';
var buttonConfiguration = {
id : buttonId,
tooltip : this.localize(buttonId + 'Tooltip'),
iconCls : 'htmlarea-action-paste-as-plain-text',
action : 'onButtonPress'
};
this.registerButton(buttonConfiguration);
return true;
},
/*
* This function gets called when the plugin is generated
*/
onGenerate: function () {
// Initialize state of toggle
this.togglePasteAsPlainText(false);
// Start monitoring paste events
this.editor.iframe.mon(Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement), 'paste', this.onPaste, this);
},
/*
* This function toggles the state of Paste as Plain text
*
* @param boolean state: if defined, the specified state to set
*
* @return void
*/
togglePasteAsPlainText: function (state) {
// Set new state
this.pasteAsPlainTextActive = (typeof(state) != 'undefined') ? state : !this.pasteAsPlainTextActive;
},
/*
* This function gets called when a button was pressed.
*
* @param object editor: the editor instance
* @param string id: the button id or the key
*
* @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.togglePasteAsPlainText();
return false;
},
/*
* This function gets called when the toolbar is updated
*
* @return void
*/
onUpdateToolbar: function (button, mode, selectionEmpty, ancestors) {
if (this.getEditorMode() === 'wysiwyg' && this.editor.isEditable()) {
button.setInactive(!this.pasteAsPlainTextActive);
}
},
/*
* Handler for paste event
*/
onPaste: function (event) {
if (this.pasteAsPlainTextActive) {
this.grabClipboardText(event);
if (this.clipboardText) {
// Direct access to the clipboard text was possible
this.pasteAsPlainText();
} else {
// Get the text content from the hidden section
// after the paste operation is completed
this.getClipboardText.defer(10, this);
}
return !this.clipboardText;
}
},
/*
* Grab the text content directly from the clipboard or
* redirect the paste operation towards a hidden section
*
* @param object event: the paste event
*
* @return void
*/
grabClipboardText: function (event) {
this.clipboardText = null;
// Check if browser supports direct plaintext access (IE and WebKit)
if (window.clipboardData || event.browserEvent.clipboardData || event.browserEvent.dataTransfer) {
// Grab the text content
this.clipboardText = (window.clipboardData || event.browserEvent.clipboardData || event.browserEvent.dataTransfer).getData('Text');
if (this.clipboardText) {
// Stop the event
event.stopEvent();
} else {
TYPO3.Dialog.InformationDialog({
title: this.localize('Paste-as-Plain-Text'),
msg: this.localize('Access-to-clipboard-denied')
});
}
} else {
// When direct access was not possible
// Save the current selection
var selection = this.editor._getSelection();
var range = this.editor._createRange(selection);
this.bookmark = this.editor.getBookmark(range);
// Create and append hidden section
this.hiddenSection = this.editor.document.createElement('div');
this.hiddenSection.id = this.editorId + 'htmlarea-paste-hidden-section';
this.hiddenSection.style.position = 'absolute';
this.hiddenSection.style.left = -10000;
this.hiddenSection.style.top = this.editor.document.body.scrollTop;
this.hiddenSection.style.overflow = 'hidden';
this.hiddenSection = this.editor.document.body.appendChild(this.hiddenSection);
// Move the selection to the hidden section and
// let the browser paste into the hidden section
this.editor.selectNodeContents(this.hiddenSection, true);
}
},
/*
* If the paste operation was redirected towards a hidden section
* get the text content from the section
*
* @return void
*/
getClipboardText: function () {
// Get the text content
this.clipboardText = this.hiddenSection.textContent;
// Delete the hidden section
HTMLArea.removeFromParent(this.hiddenSection);
// Restore the selection
this.editor.selectRange(this.editor.moveToBookmark(this.bookmark));
this.pasteAsPlainText();
},
/*
* Paste as plain text
*/
pasteAsPlainText: function () {
this.editor.insertHTML(this.clipboardText);
}
});
typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea.css (copie de travail)
.htmlarea-action-outdent { background-position: 0 -2668px !important; }
.htmlarea-action-paragraph-insert-after { background-position: 0 -2726px !important; }
.htmlarea-action-paragraph-insert-before { background-position: 0 -2784px !important; }
.htmlarea-action-paste { background-position: 0 -2842px !important; }
.htmlarea-action-quotation { background-position: 0 -2900px !important; }
.htmlarea-action-redo { background-position: 0 -2958px !important; }
.htmlarea-action-remove-format { background-position: 0 -3016px !important; }
.htmlarea-action-row-delete { background-position: 0 -3074px !important; }
.htmlarea-action-row-edit-properties { background-position: 0 -3132px !important; }
.htmlarea-action-row-insert-above { background-position: 0 -3190px !important; }
.htmlarea-action-row-insert-under { background-position: 0 -3248px !important; }
.htmlarea-action-row-split { background-position: 0 -3306px !important; }
.htmlarea-action-sample { background-position: 0 -3364px !important; }
.htmlarea-action-small { background-position: 0 -3422px !important; }
.htmlarea-action-smiley-insert { background-position: 0 -3480px !important; }
.htmlarea-action-span { background-position: 0 -3538px !important; }
.htmlarea-action-spell-check { background-position: 0 -3596px !important; }
.htmlarea-action-strike-through { background-position: 0 -3654px !important; }
.htmlarea-action-strong { background-position: 0 -3712px !important; }
.htmlarea-action-subscript { background-position: 0 -3770px !important; }
.htmlarea-action-superscript { background-position: 0 -3828px !important; }
.htmlarea-action-table-edit-properties { background-position: 0 -3886px !important; }
.htmlarea-action-table-insert { background-position: 0 -3944px !important; }
.htmlarea-action-table-restyle { background-position: 0 -4002px !important; }
.htmlarea-action-table-show-borders { background-position: 0 -4060px !important; }
.htmlarea-action-tag-insert { background-position: 0 -4118px !important; }
.htmlarea-action-text-direction-left-to-right { background-position: 0 -4176px !important; }
.htmlarea-action-text-direction-right-to-left { background-position: 0 -4234px !important; }
.htmlarea-action-underline { background-position: 0 -4292px !important; }
.htmlarea-action-undo { background-position: 0 -4350px !important; }
.htmlarea-action-unlink { background-position: 0 -4408px !important; }
.htmlarea-action-unordered-list { background-position: 0 -4466px !important; }
.htmlarea-action-user-element-edit { background-position: 0 -4524px !important; }
.htmlarea-action-variable { background-position: 0 -4582px !important; }
.htmlarea-action-paste-as-plain-text { background-position: 0 -2842px !important; }
.htmlarea-action-paste { background-position: 0 -2900px !important; }
.htmlarea-action-quotation { background-position: 0 -2958px !important; }
.htmlarea-action-redo { background-position: 0 -3016px !important; }
.htmlarea-action-remove-format { background-position: 0 -3074px !important; }
.htmlarea-action-row-delete { background-position: 0 -3132px !important; }
.htmlarea-action-row-edit-properties { background-position: 0 -3190px !important; }
.htmlarea-action-row-insert-above { background-position: 0 -3248px !important; }
.htmlarea-action-row-insert-under { background-position: 0 -3306px !important; }
.htmlarea-action-row-split { background-position: 0 -3364px !important; }
.htmlarea-action-sample { background-position: 0 -3422px !important; }
.htmlarea-action-small { background-position: 0 -3480px !important; }
.htmlarea-action-smiley-insert { background-position: 0 -3538px !important; }
.htmlarea-action-span { background-position: 0 -3596px !important; }
.htmlarea-action-spell-check { background-position: 0 -3654px !important; }
.htmlarea-action-strike-through { background-position: 0 -3712px !important; }
.htmlarea-action-strong { background-position: 0 -3770px !important; }
.htmlarea-action-subscript { background-position: 0 -3828px !important; }
.htmlarea-action-superscript { background-position: 0 -3886px !important; }
.htmlarea-action-table-edit-properties { background-position: 0 -3944px !important; }
.htmlarea-action-table-insert { background-position: 0 -4002px !important; }
.htmlarea-action-table-restyle { background-position: 0 -4060px !important; }
.htmlarea-action-table-show-borders { background-position: 0 -4118px !important; }
.htmlarea-action-tag-insert { background-position: 0 -4176px !important; }
.htmlarea-action-text-direction-left-to-right { background-position: 0 -4234px !important; }
.htmlarea-action-text-direction-right-to-left { background-position: 0 -4292px !important; }
.htmlarea-action-underline { background-position: 0 -4350px !important; }
.htmlarea-action-undo { background-position: 0 -4408px !important; }
.htmlarea-action-unlink { background-position: 0 -4466px !important; }
.htmlarea-action-unordered-list { background-position: 0 -4524px !important; }
.htmlarea-action-user-element-edit { background-position: 0 -4582px !important; }
.htmlarea-action-variable { background-position: 0 -4640px !important; }
typo3/sysext/t3skin/rtehtmlarea/htmlarea.css (copie de travail)
.htmlarea-action-outdent { background-position: 0 -2668px !important; }
.htmlarea-action-paragraph-insert-after { background-position: 0 -2726px !important; }
.htmlarea-action-paragraph-insert-before { background-position: 0 -2784px !important; }
.htmlarea-action-paste { background-position: 0 -2842px !important; }
.htmlarea-action-quotation { background-position: 0 -2900px !important; }
.htmlarea-action-redo { background-position: 0 -2958px !important; }
.htmlarea-action-remove-format { background-position: 0 -3016px !important; }
.htmlarea-action-row-delete { background-position: 0 -3074px !important; }
.htmlarea-action-row-edit-properties { background-position: 0 -3132px !important; }
.htmlarea-action-row-insert-above { background-position: 0 -3190px !important; }
.htmlarea-action-row-insert-under { background-position: 0 -3248px !important; }
.htmlarea-action-row-split { background-position: 0 -3306px !important; }
.htmlarea-action-sample { background-position: 0 -3364px !important; }
.htmlarea-action-small { background-position: 0 -3422px !important; }
.htmlarea-action-smiley-insert { background-position: 0 -3480px !important; }
.htmlarea-action-span { background-position: 0 -3538px !important; }
.htmlarea-action-spell-check { background-position: 0 -3596px !important; }
.htmlarea-action-strike-through { background-position: 0 -3654px !important; }
.htmlarea-action-strong { background-position: 0 -3712px !important; }
.htmlarea-action-subscript { background-position: 0 -3770px !important; }
.htmlarea-action-superscript { background-position: 0 -3828px !important; }
.htmlarea-action-table-edit-properties { background-position: 0 -3886px !important; }
.htmlarea-action-table-insert { background-position: 0 -3944px !important; }
.htmlarea-action-table-restyle { background-position: 0 -4002px !important; }
.htmlarea-action-table-show-borders { background-position: 0 -4060px !important; }
.htmlarea-action-tag-insert { background-position: 0 -4118px !important; }
.htmlarea-action-text-direction-left-to-right { background-position: 0 -4176px !important; }
.htmlarea-action-text-direction-right-to-left { background-position: 0 -4234px !important; }
.htmlarea-action-underline { background-position: 0 -4292px !important; }
.htmlarea-action-undo { background-position: 0 -4350px !important; }
.htmlarea-action-unlink { background-position: 0 -4408px !important; }
.htmlarea-action-unordered-list { background-position: 0 -4466px !important; }
.htmlarea-action-user-element-edit { background-position: 0 -4524px !important; }
.htmlarea-action-variable { background-position: 0 -4582px !important; }
.htmlarea-action-paste-as-plain-text { background-position: 0 -2842px !important; }
.htmlarea-action-paste { background-position: 0 -2900px !important; }
.htmlarea-action-quotation { background-position: 0 -2958px !important; }
.htmlarea-action-redo { background-position: 0 -3016px !important; }
.htmlarea-action-remove-format { background-position: 0 -3074px !important; }
.htmlarea-action-row-delete { background-position: 0 -3132px !important; }
.htmlarea-action-row-edit-properties { background-position: 0 -3190px !important; }
.htmlarea-action-row-insert-above { background-position: 0 -3248px !important; }
.htmlarea-action-row-insert-under { background-position: 0 -3306px !important; }
.htmlarea-action-row-split { background-position: 0 -3364px !important; }
.htmlarea-action-sample { background-position: 0 -3422px !important; }
.htmlarea-action-small { background-position: 0 -3480px !important; }
.htmlarea-action-smiley-insert { background-position: 0 -3538px !important; }
.htmlarea-action-span { background-position: 0 -3596px !important; }
.htmlarea-action-spell-check { background-position: 0 -3654px !important; }
.htmlarea-action-strike-through { background-position: 0 -3712px !important; }
.htmlarea-action-strong { background-position: 0 -3770px !important; }
.htmlarea-action-subscript { background-position: 0 -3828px !important; }
.htmlarea-action-superscript { background-position: 0 -3886px !important; }
.htmlarea-action-table-edit-properties { background-position: 0 -3944px !important; }
.htmlarea-action-table-insert { background-position: 0 -4002px !important; }
.htmlarea-action-table-restyle { background-position: 0 -4060px !important; }
.htmlarea-action-table-show-borders { background-position: 0 -4118px !important; }
.htmlarea-action-tag-insert { background-position: 0 -4176px !important; }
.htmlarea-action-text-direction-left-to-right { background-position: 0 -4234px !important; }
.htmlarea-action-text-direction-right-to-left { background-position: 0 -4292px !important; }
.htmlarea-action-underline { background-position: 0 -4350px !important; }
.htmlarea-action-undo { background-position: 0 -4408px !important; }
.htmlarea-action-unlink { background-position: 0 -4466px !important; }
.htmlarea-action-unordered-list { background-position: 0 -4524px !important; }
.htmlarea-action-user-element-edit { background-position: 0 -4582px !important; }
.htmlarea-action-variable { background-position: 0 -4640px !important; }
(1-1/2)