_Layout.cshtml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. @{
  2. Layout = "_LayoutIndex";
  3. }
  4. @model LoginedPageModel
  5. @section css{
  6. <link href="~/media/css/bootstrap-tag.css" rel="stylesheet" type="text/css" />
  7. <link href="~/media/css/bootstrap-wysihtml5.css" rel="stylesheet" type="text/css" />
  8. <link href="~/media/css/jquery.fancybox.css" rel="stylesheet" />
  9. <link href="~/media/css/bootstrap-wysihtml5.css" rel="stylesheet" type="text/css" />
  10. }
  11. <div class="page-header-fixed">
  12. <div class="page-container row-fluid">
  13. <!-- BEGIN SIDEBAR -->
  14. <div class="page-sidebar nav-collapse collapse">
  15. <!-- BEGIN SIDEBAR MENU -->
  16. @Html.Partial("Partials/MenuPartial.cshtml")
  17. <!-- END SIDEBAR MENU -->
  18. </div>
  19. <!-- END SIDEBAR -->
  20. <!-- BEGIN PAGE -->
  21. <div class="page-content">
  22. <div class="container-fluid">
  23. @RenderBody()
  24. </div>
  25. </div>
  26. <!-- END PAGE -->
  27. </div>
  28. </div>
  29. @section Scripts{
  30. <script src="~/lib/ace-builds/src-noconflict/ace.js"></script>
  31. <script src="~/lib/js-beautify/js/lib/beautify.js"></script>
  32. <script src="~/lib/clipboard/dist/clipboard.js"></script>
  33. <script src="~/lib/ace-builds/src-noconflict/theme-github.js"></script>
  34. <script src="~/lib/ace-builds/src-noconflict/theme-sqlserver.js"></script>
  35. <script src="~/js/site.js"></script>
  36. @RenderSection("Scripts", required: false)
  37. <script >
  38. //var beautify = ace.require("ace/ext/beautify");
  39. ace.config.set('basePath', '/lib/ace-builds/src-noconflict');
  40. ace.config.set('modePath', '/lib/ace-builds/src-noconflict');
  41. ace.config.set('themePath', '/lib/ace-builds/src-noconflict');
  42. $(document).ready(function () {
  43. $(".aceEditor").each(function (index, ele) {
  44. var editor = ace.edit(ele);
  45. var session = editor.getSession();
  46. editor.setTheme("ace/theme/sqlserver");
  47. session.setMode("ace/mode/csharp");
  48. //session.setValue(js_beautify(session.getValue()));
  49. });
  50. var clipboard = new Clipboard('.copybtn', {
  51. text: function (trigger) {
  52. var target = $(trigger).attr("data-clipboard-acetarget");
  53. if (target.length > 0) {
  54. var element = $(target);
  55. var editor = ace.edit(target);
  56. return editor.getValue();
  57. }
  58. return "";
  59. }
  60. });
  61. var subMenu = $(".page-sidebar-menu>li:eq(@(Model.SubIndex))");
  62. $(subMenu).addClass('active');
  63. if (@(Model.Index) > -1) {
  64. var menu = $(subMenu).find('.sub-menu > li:eq(@(Model.Index))');
  65. $(menu).addClass('active');
  66. }
  67. });
  68. </script>
  69. }