mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-27 04:19:04 +08:00
Revert "Added Blockquote element (#6773)"
This reverts commit 7d603684f0.
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
using Orchard.Layouts.Elements;
|
||||
using Orchard.Layouts.Framework.Display;
|
||||
using Orchard.Layouts.Framework.Drivers;
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Layouts.Services;
|
||||
using Orchard.Layouts.ViewModels;
|
||||
|
||||
namespace Orchard.Layouts.Drivers {
|
||||
public class BlockquoteElementDriver : ElementDriver<Blockquote> {
|
||||
private readonly IElementFilterProcessor _processor;
|
||||
|
||||
public BlockquoteElementDriver(IElementFilterProcessor processor) {
|
||||
_processor = processor;
|
||||
}
|
||||
|
||||
protected override EditorResult OnBuildEditor(Blockquote element, ElementEditorContext context) {
|
||||
var viewModel = new BlockquoteEditorViewModel {
|
||||
Text = element.Content,
|
||||
Citation = element.Citation
|
||||
};
|
||||
var editor = context.ShapeFactory.EditorTemplate(TemplateName: "Elements.Blockquote", Model: viewModel);
|
||||
|
||||
if (context.Updater != null) {
|
||||
context.Updater.TryUpdateModel(viewModel, context.Prefix, null, null);
|
||||
element.Content = viewModel.Text;
|
||||
element.Citation = viewModel.Citation;
|
||||
}
|
||||
|
||||
return Editor(context, editor);
|
||||
}
|
||||
|
||||
protected override void OnDisplaying(Blockquote element, ElementDisplayingContext context) {
|
||||
context.ElementShape.ProcessedContent = _processor.ProcessContent(element.Content, "html", context.GetTokenData());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using Orchard.Layouts.Helpers;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace Orchard.Layouts.Elements {
|
||||
public class Blockquote : ContentElement {
|
||||
|
||||
public override string Category {
|
||||
get { return "Content"; }
|
||||
}
|
||||
|
||||
public override LocalizedString DisplayText {
|
||||
get { return T("Blockquote"); }
|
||||
}
|
||||
|
||||
public override string ToolboxIcon {
|
||||
get { return "\uf10d"; }
|
||||
}
|
||||
|
||||
public string Citation {
|
||||
get { return this.Retrieve(x => x.Citation); }
|
||||
set { this.Store(x => x.Citation, value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -312,7 +312,6 @@
|
||||
<Compile Include="Controllers\TemplateController.cs" />
|
||||
<Compile Include="Drivers\BreadcrumbsElementDriver.cs" />
|
||||
<Compile Include="Drivers\CanvasElementDriver.cs" />
|
||||
<Compile Include="Drivers\BlockquoteElementDriver.cs" />
|
||||
<Compile Include="Drivers\MenuElementDriver.cs" />
|
||||
<Compile Include="Drivers\NotificationsElementDriver.cs" />
|
||||
<Compile Include="Drivers\HeadingElementDriver.cs" />
|
||||
@@ -321,7 +320,6 @@
|
||||
<Compile Include="Elements\Breadcrumbs.cs" />
|
||||
<Compile Include="Elements\Canvas.cs" />
|
||||
<Compile Include="Elements\ContentElement.cs" />
|
||||
<Compile Include="Elements\Blockquote.cs" />
|
||||
<Compile Include="Elements\Menu.cs" />
|
||||
<Compile Include="Elements\Notifications.cs" />
|
||||
<Compile Include="Elements\Heading.cs" />
|
||||
@@ -370,7 +368,6 @@
|
||||
<Compile Include="Models\SnippetDescriptor.cs" />
|
||||
<Compile Include="Models\SnippetFieldDescriptor.cs" />
|
||||
<Compile Include="Services\IFormElementServices.cs" />
|
||||
<Compile Include="ViewModels\BlockquoteEditorViewModel.cs" />
|
||||
<Compile Include="ViewModels\SnippetViewModel.cs" />
|
||||
<Compile Include="ViewModels\SnippetFieldViewModel.cs" />
|
||||
<Compile Include="ViewModels\PlaceableContentItemViewModel.cs" />
|
||||
@@ -596,15 +593,6 @@
|
||||
<ItemGroup>
|
||||
<Content Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Elements\Blockquote.Design.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Elements\Blockquote.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\EditorTemplates\Elements.Blockquote.cshtml" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Orchard.Layouts.ViewModels {
|
||||
public class BlockquoteEditorViewModel {
|
||||
public string Text { get; set; }
|
||||
public string Citation { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
@model Orchard.Layouts.ViewModels.BlockquoteEditorViewModel
|
||||
@{
|
||||
Script.Include("AutoFocus.js");
|
||||
}
|
||||
<fieldset>
|
||||
<div class="form-group autofocus">
|
||||
@Html.LabelFor(m => m.Text, T("Text"))
|
||||
@Html.TextAreaFor(m => m.Text, new { @class = "text large tokenized", autofocus = "autofocus" })
|
||||
@Html.Hint(T("Note: HTML markup will be rendered unencoded."))
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@Html.LabelFor(m => m.Citation, T("Cite"))
|
||||
@Html.TextBoxFor(m => m.Citation, new { @class = "text large" })
|
||||
@Html.Hint(T("The source URL of the quotation, if any."))
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -1,12 +0,0 @@
|
||||
@using Orchard.Layouts.Helpers
|
||||
@using Orchard.Layouts.Elements
|
||||
@{
|
||||
var element = (Blockquote)Model.Element;
|
||||
var tagBuilder = TagBuilderExtensions.CreateElementTagBuilder(Model, "blockquote");
|
||||
tagBuilder.InnerHtml = element.Content;
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(element.Citation)) {
|
||||
tagBuilder.Attributes["cite"] = element.Citation.Trim();
|
||||
}
|
||||
}
|
||||
@tagBuilder.ToHtmlString()
|
||||
@@ -1,12 +0,0 @@
|
||||
@using Orchard.Layouts.Helpers
|
||||
@using Orchard.Layouts.Elements
|
||||
@{
|
||||
var element = (Blockquote)Model.Element;
|
||||
var tagBuilder = TagBuilderExtensions.CreateElementTagBuilder(Model, "blockquote");
|
||||
tagBuilder.InnerHtml = Model.ProcessedContent;
|
||||
|
||||
if (!String.IsNullOrWhiteSpace(element.Citation)) {
|
||||
tagBuilder.Attributes["cite"] = element.Citation.Trim();
|
||||
}
|
||||
}
|
||||
@tagBuilder.ToHtmlString()
|
||||
Reference in New Issue
Block a user