Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Documents] Newsletter: add option to maintain a manual edited plain-…
…text version (#4794)
- Loading branch information
1 parent
8e3a799
commit bb7d3f2
Showing
9 changed files
with
140 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
bundles/AdminBundle/Resources/public/js/pimcore/document/newsletters/plaintextPanel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* Pimcore | ||
* | ||
* This source file is available under two different licenses: | ||
* - GNU General Public License version 3 (GPLv3) | ||
* - Pimcore Enterprise License (PEL) | ||
* Full copyright and license information is available in | ||
* LICENSE.md which is distributed with this source code. | ||
* | ||
* @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) | ||
* @license http://www.pimcore.org/license GPLv3 and PEL | ||
*/ | ||
|
||
pimcore.registerNS("pimcore.document.newsletters.plaintextPanel"); | ||
pimcore.document.newsletters.plaintextPanel = Class.create({ | ||
|
||
initialize: function(document) { | ||
this.document = document; | ||
}, | ||
|
||
getLayout: function () { | ||
|
||
if (this.layout == null) { | ||
|
||
this.layout = new Ext.FormPanel({ | ||
title: t('plain_text'), | ||
border: false, | ||
autoScroll: true, | ||
bodyStyle:'padding:0 10px 0 10px;', | ||
iconCls: "pimcore_material_icon_text pimcore_material_icon", | ||
items: [ | ||
{ | ||
xtype:'fieldset', | ||
title: t('plain_text_email_part'), | ||
itemId: "plaintextPanel", | ||
collapsible: true, | ||
autoHeight:true, | ||
defaults: { | ||
labelWidth: 200 | ||
}, | ||
defaultType: 'textarea', | ||
items :[ | ||
{ | ||
fieldLabel: t('plain_text') + " (" + this.document.data.plaintext.length + ")", | ||
maxLength: 4000, | ||
height: 700, | ||
width: 1400, | ||
name: 'plaintext', | ||
itemId: 'plaintext', | ||
value: this.document.data.plaintext, | ||
enableKeyEvents: true, | ||
listeners: { | ||
"keyup": function (el) { | ||
el.labelEl.update(t("plain_text") + " (" + el.getValue().length + "):"); | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}); | ||
} | ||
|
||
return this.layout; | ||
}, | ||
|
||
getValues: function () { | ||
|
||
if (!this.layout.rendered) { | ||
throw "plaintext not available"; | ||
} | ||
|
||
// get values | ||
var plaintext = this.getLayout().getForm().getFieldValues(); | ||
return plaintext; | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters