﻿@model Portal.CMS.Entities.Entities.Copy.Copy
@using Portal.CMS.Web.Areas.Admin.Helpers;
@{
    Layout = "";

    var isAdmin = UserHelper.IsAdmin;
}

<script type="text/javascript">
    $(document).ready(function () {
        tinymce.init({
            selector: '#copy-@(Model.CopyId).admin', inline: true, plugins: ['advlist autolink lists link image charmap anchor searchreplace visualblocks code fullscreen media table contextmenu paste'],
            toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
            setup:function(ed) {
                ed.on('change', function(e) {
                    var dataParams = { "copyId": @Model.CopyId, "copyName": "@Model.CopyName", "copyBody": ed.getContent() };
                    $.ajax({data: dataParams, type: 'POST', cache: false, url: '/Admin/Copy/Inline'});
                });
            }
        });
    });
</script>

<div class="copy-wrapper">
    @if (isAdmin) { <div class="box-title">@Model.CopyName</div> }
    <div id="copy-@Model.CopyId" class="@(UserHelper.IsAdmin ? "admin" : "") copy-block">
        @Html.Raw(Model.CopyBody)
    </div>
</div>

﻿@model Portal.CMS.Entities.Entities.Copy.Copy
@using Portal.CMS.Web.Areas.Admin.Helpers;
@{
    Layout = "";

    var isAdmin = UserHelper.IsAdmin;
}

<script type="text/javascript">
    $(document).ready(function () {
        tinymce.init({
            selector: '.copy-@(Model.CopyId).admin', inline: true, plugins: ['advlist autolink lists link image charmap anchor searchreplace visualblocks code fullscreen media table contextmenu paste'],
            toolbar: 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
            setup:function(ed) {
                ed.on('change', function(e) {
                    var dataParams = { "copyId": @Model.CopyId, "copyName": "@Model.CopyName", "copyBody": ed.getContent() };
                    $.ajax({data: dataParams, type: 'POST', cache: false, url: '/Admin/Copy/Inline'});
                    $('.copy-@(Model.CopyId)').html(ed.getContent());
                });
            }
        });
    });
</script>

<div class="copy-wrapper">
    @if (isAdmin) { <div class="box-title">@Model.CopyName</div> }
    <div class="@(UserHelper.IsAdmin ? "admin" : "") copy-@Model.CopyId copy-block">
        @Html.Raw(Model.CopyBody)
    </div>
</div>

Copy Updates Other Copy elements of the Same Type on the Same Page When Saving
Copy Updates Other Copy elements of the Same Type on the Same Page When Saving
