Project

General

Profile

Feature #23667 ยป rtehtmlarea_feature_15885_trunk.patch

Administrator Admin, 2010-10-04 04:50

View differences:

typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/locallang.xml (copie de travail)
<label index="Cleaning options">Type of formatting to remove</label>
<label index="Formatting:">HTML Formatting:</label>
<label index="MS Word Formatting:">MS Word Formatting:</label>
<label index="Typographical punctuation:">Typographical punctuation:</label>
<label index="Spaces">Non-breaking spaces:</label>
<label index="Images:">Images:</label>
<label index="All HTML:">All HTML tags:</label>
typo3/sysext/rtehtmlarea/htmlarea/plugins/RemoveFormat/remove-format.js (copie de travail)
xtype: 'fieldset',
title: this.localize('Cleaning Area'),
defaultType: 'radio',
labelWidth: 150,
labelWidth: 140,
defaults: {
labelSeparator: ''
},
......
xtype: 'fieldset',
defaultType: 'checkbox',
title: this.localize('Cleaning options'),
labelWidth: 150,
labelWidth: 170,
defaults: {
labelSeparator: ''
},
......
fieldLabel: this.localize('MS Word Formatting:'),
checked: true
},{
itemId: 'typographical',
fieldLabel: this.localize('Typographical punctuation:'),
},{
itemId: 'spaces',
fieldLabel: this.localize('Spaces')
},{
......
'allContent',
'formatting',
'msWordFormatting',
'typographical',
'spaces',
'images',
'allHtml'
......
Ext.each(fields, function (field) {
params[field] = this.dialog.find('itemId', field)[0].getValue();
}, this);
if (params['allHtml'] || params['formatting'] || params['spaces'] || params['images'] || params['msWordFormatting']) {
if (params['allHtml'] || params['formatting'] || params['spaces'] || params['images'] || params['msWordFormatting'] || params['typographical']) {
this.applyRequest(params);
this.close();
} else {
......
html = html.replace(/[\x20]+/gi, " ");
}
}
if (params['typographical']) {
// Remove typographical punctuation
// Search pattern stored here
var SrcCd;
// Replace horizontal ellipsis with three periods
SrcCd = String.fromCharCode(8230);
html = html.replace(new RegExp(SrcCd, 'g'), '...');
// Replace en-dash and em-dash with hyphen
SrcCd = String.fromCharCode(8211) + '|' + String.fromCharCode(8212);
html = html.replace(new RegExp(SrcCd, 'g'), '-');
html = html.replace(new RegExp(SrcCd, 'g'), "'");
// Replace double low-9 / left double / right double quotation mark with double quote
SrcCd = String.fromCharCode(8222) + '|' + String.fromCharCode(8220) + '|' + String.fromCharCode(8221);
html = html.replace(new RegExp(SrcCd, 'g'), '"');
// Replace left single / right single / single low-9 quotation mark with sigle quote
SrcCd = String.fromCharCode(8216) + '|' + String.fromCharCode(8217) + '|' + String.fromCharCode(8218);
html = html.replace(new RegExp(SrcCd, 'g'), "'");
// Replace single left/right-pointing angle quotation mark with single quote
SrcCd = String.fromCharCode(8249) + '|' + String.fromCharCode(8250);
html = html.replace(new RegExp(SrcCd, 'g'), "'");
// Replace left/right-pointing double angle quotation mark (left/right pointing guillemet) with double quote
SrcCd = String.fromCharCode(171) + '|' + String.fromCharCode(187);
html = html.replace(new RegExp(SrcCd, 'g'), '"');
// Replace grave accent (spacing grave) and acute accent (spacing acute) with apostrophe (single quote)
SrcCd = String.fromCharCode(96) + '|' + String.fromCharCode(180);
}
if (params['allContent']) {
editor.setHTML(html);
} else {
    (1-1/1)