Przeglądaj źródła

Updated 'about' to not use js markdown.

tags/2.0.3
Teknikode 4 lat temu
rodzic
commit
54e7105c54

+ 0
- 3
Teknik/Areas/Profile/ProfileAreaRegistration.cs Wyświetl plik

@@ -55,9 +55,6 @@ namespace Teknik.Areas.Profile
// Register Script Bundle
BundleTable.Bundles.Add(new ScriptBundle("~/bundles/profile").Include(
"~/Scripts/bootbox/bootbox.min.js",
"~/Scripts/PageDown/Markdown.Converter.js",
"~/Scripts/PageDown/Markdown.Sanitizer.js",
"~/Scripts/bootstrap/markdown/bootstrap-markdown.js",
"~/Scripts/jquery.blockUI.js",
"~/Areas/Profile/Scripts/Profile.js"));
}

+ 3
- 45
Teknik/Areas/Profile/Views/Profile/Index.cshtml Wyświetl plik

@@ -1,5 +1,7 @@
@model Teknik.Areas.Profile.ViewModels.ProfileViewModel

@using Teknik.Helpers

<script>
var homeUrl = '@Url.SubRouteUrl("www", "Home.Index")';
var editUserURL = '@Url.SubRouteUrl("profile", "Profile.Action", new { action = "Edit" })';
@@ -69,51 +71,7 @@
@if (!string.IsNullOrEmpty(Model.About))
{
<div class="tab-pane @((!OwnProfile) ? " active" : string.Empty)" id="about">
<script>
$(document).ready(function () {
var converter = new Markdown.getSanitizingConverter();
@if (!string.IsNullOrEmpty(Model.BlogTitle))
{
<text>
// Blog Title Conversion
var old_html = $("#blog_title").text();
var new_html = converter.makeHtml(old_html);
$("#blog_title").html(new_html);
</text>
}

@if (!string.IsNullOrEmpty(Model.Website))
{
<text>
// Website Conversion
var old_html = $("#website").text();
var new_html = converter.makeHtml(old_html);
$("#website").html(new_html);
</text>
}

@if (!string.IsNullOrEmpty(Model.Quote))
{
<text>
// Quote Conversion
var old_html = $("#quote").text();
var new_html = converter.makeHtml(old_html);
$("#quote").html(new_html);
</text>
}

@if (!string.IsNullOrEmpty(Model.About))
{
<text>
// About Conversion
var old_about = $("#markdown_body").text();
var new_about = converter.makeHtml(old_about);
$("#markdown_body").html(new_about);
</text>
}
});
</script>
<div class="col-sm-12" id="markdown_body">@Model.About</div>
<div class="col-sm-12" id="markdown_body">@Html.Markdown(@Model.About)</div>
</div><!--/tab-pane-->
}
@if (OwnProfile)

Ładowanie…
Anuluj
Zapisz