Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the markdown preview on Edit.cshtml, added apply pretty print butt... #23

Merged
merged 1 commit into from
Nov 18, 2012
Merged

Fixed the markdown preview on Edit.cshtml, added apply pretty print butt... #23

merged 1 commit into from
Nov 18, 2012

Conversation

martijnburgers
Copy link
Contributor

  • updated the showdown library to 0.3.1 (source: https://github.com/coreyti/showdown)

  • added apply pretty print button to Edit (post) view. I would prefer to do this near real-time like on Stack Overflow but don't have the time at the moment, will check this out later.

  • In order to get the apply pretty print button to work I needed to include a JavaScript resource in the view. I wanted to regulate this in some way for all the views. I ended up in the following choices:

    Scripts for the views are located in ~\Scripts\Views<Action/View>.js
    Scripts for the views inside an area are located in ~\Areas\Scripts\Views<Action/View>.js (i.e ~\Areas\Admin\Scripts\Views\WikiAdmin\Edit.js)
    Scripts inside the above location are automatically added during Application_Start
    Via App_Start > BundleConfig > ViewBundleRegistrar.RegisterViewBundles(bundles);
    Via AreaRegistration.RegisterAllAreas() > AdminAreaRegistration.RegisterArea(AreaRegistrationContext context) > BundleConfig.RegisterBundles(BundleTable.Bundles , context)
    So each area has it's own BundleConfig and RouteConfig.
    Created extension method string GetViewBundlePath(this WebViewPage view). This can be used inside the view to render the view specific script like so:

(example Edit.cshtml):

@section Scripts{
@Scripts.Render(this.GetViewBundlePath())
}

…utton on Edit.cshtml, updated showdown lib to version 0.3.1 (https://github.com/coreyti/showdown), added possibility to include view specific js resources.
aaronpowell added a commit that referenced this pull request Nov 18, 2012
Fixed the markdown preview on Edit.cshtml, added apply pretty print butt...
@aaronpowell aaronpowell merged commit e9ad530 into funnelweblog:master Nov 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants