Skip to content

Commit

Permalink
Merge pull request #56 from cwetanow/rich-text-editor
Browse files Browse the repository at this point in the history
Rich text editor
  • Loading branch information
cwetanow authored Jun 2, 2017
2 parents 28449ce + ff7a34a commit 1a65e3f
Show file tree
Hide file tree
Showing 161 changed files with 94,365 additions and 14 deletions.
4 changes: 4 additions & 0 deletions src/Logs.Web/App_Start/BundleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public static void RegisterBundles(BundleCollection bundles)
"~/Scripts/jquery.cloudinary.js",
"~/Scripts/image-upload.js"));

bundles.Add(new ScriptBundle("~/bundles/tinymce").Include(
"~/Scripts/tinymce/tinymce.min.js",
"~/Scripts/editor-config.js"));

// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
Expand Down
145 changes: 145 additions & 0 deletions src/Logs.Web/Logs.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@
<Content Include="Areas\Users\Views\Nutrition\Details.cshtml" />
<None Include="Scripts\jquery-1.10.2.intellisense.js" />
<Content Include="Scripts\details.js" />
<Content Include="Scripts\editor-config.js" />
<Content Include="Scripts\image-upload.js" />
<Content Include="Scripts\input.js" />
<Content Include="Scripts\jquery-1.10.2.js" />
Expand All @@ -362,6 +363,143 @@
<Content Include="Scripts\respond.js" />
<Content Include="Scripts\respond.min.js" />
<Content Include="Scripts\search.js" />
<Content Include="Scripts\tinymce\jquery.tinymce.min.js" />
<Content Include="Scripts\tinymce\license.txt" />
<Content Include="Scripts\tinymce\plugins\advlist\plugin.js" />
<Content Include="Scripts\tinymce\plugins\advlist\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\anchor\plugin.js" />
<Content Include="Scripts\tinymce\plugins\anchor\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\autolink\plugin.js" />
<Content Include="Scripts\tinymce\plugins\autolink\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\autoresize\plugin.js" />
<Content Include="Scripts\tinymce\plugins\autoresize\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\autosave\plugin.js" />
<Content Include="Scripts\tinymce\plugins\autosave\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\bbcode\plugin.js" />
<Content Include="Scripts\tinymce\plugins\bbcode\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\charmap\plugin.js" />
<Content Include="Scripts\tinymce\plugins\charmap\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\codesample\css\prism.css" />
<Content Include="Scripts\tinymce\plugins\codesample\plugin.js" />
<Content Include="Scripts\tinymce\plugins\codesample\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\code\plugin.js" />
<Content Include="Scripts\tinymce\plugins\code\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\colorpicker\plugin.js" />
<Content Include="Scripts\tinymce\plugins\colorpicker\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\compat3x\css\dialog.css" />
<Content Include="Scripts\tinymce\plugins\compat3x\img\buttons.png" />
<Content Include="Scripts\tinymce\plugins\compat3x\img\icons.gif" />
<Content Include="Scripts\tinymce\plugins\compat3x\img\items.gif" />
<Content Include="Scripts\tinymce\plugins\compat3x\img\menu_arrow.gif" />
<Content Include="Scripts\tinymce\plugins\compat3x\img\menu_check.gif" />
<Content Include="Scripts\tinymce\plugins\compat3x\img\progress.gif" />
<Content Include="Scripts\tinymce\plugins\compat3x\img\tabs.gif" />
<Content Include="Scripts\tinymce\plugins\compat3x\plugin.js" />
<Content Include="Scripts\tinymce\plugins\compat3x\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\compat3x\tiny_mce_popup.js" />
<Content Include="Scripts\tinymce\plugins\compat3x\utils\editable_selects.js" />
<Content Include="Scripts\tinymce\plugins\compat3x\utils\form_utils.js" />
<Content Include="Scripts\tinymce\plugins\compat3x\utils\mctabs.js" />
<Content Include="Scripts\tinymce\plugins\compat3x\utils\validate.js" />
<Content Include="Scripts\tinymce\plugins\contextmenu\plugin.js" />
<Content Include="Scripts\tinymce\plugins\contextmenu\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\directionality\plugin.js" />
<Content Include="Scripts\tinymce\plugins\directionality\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-cool.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-cry.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-embarassed.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-foot-in-mouth.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-frown.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-innocent.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-kiss.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-laughing.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-money-mouth.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-sealed.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-smile.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-surprised.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-tongue-out.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-undecided.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-wink.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\img\smiley-yell.gif" />
<Content Include="Scripts\tinymce\plugins\emoticons\plugin.js" />
<Content Include="Scripts\tinymce\plugins\emoticons\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\fullpage\plugin.js" />
<Content Include="Scripts\tinymce\plugins\fullpage\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\fullscreen\plugin.js" />
<Content Include="Scripts\tinymce\plugins\fullscreen\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\help\img\logo.png" />
<Content Include="Scripts\tinymce\plugins\help\plugin.js" />
<Content Include="Scripts\tinymce\plugins\help\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\hr\plugin.js" />
<Content Include="Scripts\tinymce\plugins\hr\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\imagetools\plugin.js" />
<Content Include="Scripts\tinymce\plugins\imagetools\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\image\plugin.js" />
<Content Include="Scripts\tinymce\plugins\image\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\importcss\plugin.js" />
<Content Include="Scripts\tinymce\plugins\importcss\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\insertdatetime\plugin.js" />
<Content Include="Scripts\tinymce\plugins\insertdatetime\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\legacyoutput\plugin.js" />
<Content Include="Scripts\tinymce\plugins\legacyoutput\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\link\plugin.js" />
<Content Include="Scripts\tinymce\plugins\link\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\lists\plugin.js" />
<Content Include="Scripts\tinymce\plugins\lists\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\media\plugin.js" />
<Content Include="Scripts\tinymce\plugins\media\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\nonbreaking\plugin.js" />
<Content Include="Scripts\tinymce\plugins\nonbreaking\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\noneditable\plugin.js" />
<Content Include="Scripts\tinymce\plugins\noneditable\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\pagebreak\plugin.js" />
<Content Include="Scripts\tinymce\plugins\pagebreak\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\paste\plugin.js" />
<Content Include="Scripts\tinymce\plugins\paste\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\preview\plugin.js" />
<Content Include="Scripts\tinymce\plugins\preview\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\print\plugin.js" />
<Content Include="Scripts\tinymce\plugins\print\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\save\plugin.js" />
<Content Include="Scripts\tinymce\plugins\save\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\searchreplace\plugin.js" />
<Content Include="Scripts\tinymce\plugins\searchreplace\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\spellchecker\plugin.js" />
<Content Include="Scripts\tinymce\plugins\spellchecker\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\tabfocus\plugin.js" />
<Content Include="Scripts\tinymce\plugins\tabfocus\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\table\plugin.js" />
<Content Include="Scripts\tinymce\plugins\table\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\template\plugin.js" />
<Content Include="Scripts\tinymce\plugins\template\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\textcolor\plugin.js" />
<Content Include="Scripts\tinymce\plugins\textcolor\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\textpattern\plugin.js" />
<Content Include="Scripts\tinymce\plugins\textpattern\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\toc\plugin.js" />
<Content Include="Scripts\tinymce\plugins\toc\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\visualblocks\css\visualblocks.css" />
<Content Include="Scripts\tinymce\plugins\visualblocks\plugin.js" />
<Content Include="Scripts\tinymce\plugins\visualblocks\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\visualchars\plugin.js" />
<Content Include="Scripts\tinymce\plugins\visualchars\plugin.min.js" />
<Content Include="Scripts\tinymce\plugins\wordcount\plugin.js" />
<Content Include="Scripts\tinymce\plugins\wordcount\plugin.min.js" />
<Content Include="Scripts\tinymce\skins\lightgray\content.inline.min.css" />
<Content Include="Scripts\tinymce\skins\lightgray\content.min.css" />
<Content Include="Scripts\tinymce\skins\lightgray\fonts\tinymce-small.svg" />
<Content Include="Scripts\tinymce\skins\lightgray\fonts\tinymce.svg" />
<Content Include="Scripts\tinymce\skins\lightgray\img\anchor.gif" />
<Content Include="Scripts\tinymce\skins\lightgray\img\loader.gif" />
<Content Include="Scripts\tinymce\skins\lightgray\img\object.gif" />
<Content Include="Scripts\tinymce\skins\lightgray\img\trans.gif" />
<Content Include="Scripts\tinymce\skins\lightgray\skin.min.css" />
<Content Include="Scripts\tinymce\themes\inlite\theme.js" />
<Content Include="Scripts\tinymce\themes\inlite\theme.min.js" />
<Content Include="Scripts\tinymce\themes\modern\theme.js" />
<Content Include="Scripts\tinymce\themes\modern\theme.min.js" />
<Content Include="Scripts\tinymce\tinymce.js" />
<Content Include="Scripts\tinymce\tinymce.min.js" />
<Content Include="Scripts\user-details.js" />
<Content Include="Scripts\_references.js" />
<Content Include="Web.config" />
Expand Down Expand Up @@ -412,6 +550,13 @@
<Content Include="Views\Nutrition\Index.cshtml" />
<Content Include="Views\Nutrition\NutritionDetails.cshtml" />
<Content Include="Views\Nutrition\Stats.cshtml" />
<Content Include="Scripts\tinymce\skins\lightgray\fonts\tinymce.woff" />
<Content Include="Scripts\tinymce\skins\lightgray\fonts\tinymce.ttf" />
<Content Include="Scripts\tinymce\skins\lightgray\fonts\tinymce.eot" />
<Content Include="Scripts\tinymce\skins\lightgray\fonts\tinymce-small.woff" />
<Content Include="Scripts\tinymce\skins\lightgray\fonts\tinymce-small.ttf" />
<Content Include="Scripts\tinymce\skins\lightgray\fonts\tinymce-small.eot" />
<Content Include="Scripts\tinymce\langs\readme.md" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
Expand Down
2 changes: 2 additions & 0 deletions src/Logs.Web/Models/Nutrition/NutritionViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.ComponentModel;
using System.Web.Mvc;

namespace Logs.Web.Models.Nutrition
{
Expand Down Expand Up @@ -52,6 +53,7 @@ public NutritionViewModel(global::Logs.Models.Nutrition nutrition, DateTime date

public int Sugar { get; set; }

[AllowHtml]
public string Notes { get; set; }
}
}
Binary file modified src/Logs.Web/Scripts/_references.js
Binary file not shown.
22 changes: 22 additions & 0 deletions src/Logs.Web/Scripts/editor-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
tinymce.init({
selector: 'textarea',
height: 500,
theme: 'modern',
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table contextmenu directionality',
'emoticons template paste textcolor colorpicker textpattern imagetools codesample toc help'
],
toolbar1: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
toolbar2: 'preview media | forecolor backcolor | fontsizeselect',
image_advtab: false,
content_css: [
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
'//www.tinymce.com/css/codepen.min.css'
],
branding: false,
menubar: false,
resize: false,
statusbar: false
});
1 change: 1 addition & 0 deletions src/Logs.Web/Scripts/tinymce/jquery.tinymce.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Logs.Web/Scripts/tinymce/langs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This is where language files should be placed.

Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/
Loading

0 comments on commit 1a65e3f

Please sign in to comment.