mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#19013: Fixing JSon formatting in widgets editor
Work Item: 19013 --HG-- branch : 1.x
This commit is contained in:
@@ -4,6 +4,11 @@
|
|||||||
Script.Require("jQuery");
|
Script.Require("jQuery");
|
||||||
IEnumerable<LayerPart> layers = Model.Layers;
|
IEnumerable<LayerPart> layers = Model.Layers;
|
||||||
}
|
}
|
||||||
|
@functions {
|
||||||
|
static string EncodeLineBreaks(string text) {
|
||||||
|
return text.Replace(Environment.NewLine, "\\\\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
document.write("<div id=\"widgets-layer-visibility\"><h3>@T("All Layers:")</h3></div>");
|
document.write("<div id=\"widgets-layer-visibility\"><h3>@T("All Layers:")</h3></div>");
|
||||||
@@ -16,7 +21,7 @@
|
|||||||
var currentLayerId = @Model.CurrentLayer.Id;
|
var currentLayerId = @Model.CurrentLayer.Id;
|
||||||
var layers = [
|
var layers = [
|
||||||
@foreach (var layer in layers) {
|
@foreach (var layer in layers) {
|
||||||
<text>{"name":"@layer.Name","description":"@layer.Description","id":@layer.Id}@(layer != layers.Last() ? "," : "")</text>
|
<text>{"name":"@layer.Name","description":"@EncodeLineBreaks(layer.Description)","id":@layer.Id}@(layer != layers.Last() ? "," : "")</text>
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
var visWrapper = $("#widgets-layer-visibility");
|
var visWrapper = $("#widgets-layer-visibility");
|
||||||
|
|||||||
Reference in New Issue
Block a user