-
-
Save CheapSk8/974faf88370bc5b16041b1fc434743eb to your computer and use it in GitHub Desktop.
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
<?xml version="1.0" encoding="utf-8"?> | |
<module> | |
<assemblies> | |
<!-- This adds the template assembly to the "default module" --> | |
<add assembly="EpiSandbox" /> | |
</assemblies> | |
<clientResources> | |
<add name="epi-cms.widgets.base" path="Styles/Styles.css" resourceType="Style"/> | |
</clientResources> | |
<dojo> | |
<!-- This maps "shell" to ~/ClientResources/Scripts for the dojo loader configuration --> | |
<paths> | |
<add name="shell" path="Scripts" /> | |
</paths> | |
</dojo> | |
</module> |
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
define("shell/editors/PreviewableTextArea", [ | |
"dojo/_base/array", | |
"dojo/_base/declare", | |
"dojo/dom-construct", | |
"epi/shell/widget/ValidationTextarea", // added to change to ValidationTextarea from ValidationTextBox | |
"epi-cms/contentediting/editors/_PreviewableEditor" | |
], function ( | |
array, | |
declare, | |
domConstruct, | |
TextArea, // added to change to ValidationTextarea from ValidationTextBox | |
_PreviewableEditor | |
) { | |
return declare([_PreviewableEditor], { | |
// tags: | |
// internal | |
required: false, | |
// controlParams: Array | |
// Properties to copy from this widget into the wrapped control | |
controlParams: ["regExp", "required", "invalidMessage"], | |
// this function creates the TextArea to override the TextBox that would otherwise display | |
buildRendering: function () { | |
this.control = new TextArea(); | |
this.inherited(arguments); | |
}, | |
_getRegExpAttr: function () { | |
return this.regExp || ""; | |
} | |
}); | |
}); |
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
using EPiServer.Cms.Shell.UI.ObjectEditing; | |
using EPiServer.Shell.ObjectEditing; | |
using EPiServer.Shell.ObjectEditing.EditorDescriptors; | |
using System; | |
using System.Collections.Generic; | |
namespace EpiSandbox.Business.EditorDescriptors | |
{ | |
[EditorDescriptorRegistration(TargetType = typeof(string), UIHint = "previewtextarea")] | |
public class PreviewableTextareaDescriptor : EditorDescriptor | |
{ | |
public PreviewableTextareaDescriptor() | |
{ | |
base.ClientEditingClass = "shell/editors/PreviewableTextArea"; | |
} | |
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes) | |
{ | |
base.ModifyMetadata(metadata, attributes); | |
if (metadata is ContentDataMetadata) | |
{ | |
metadata.EditorConfiguration["style"] = "width:400px;"; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment