Markdown video and audio, supported at client side

* BlogsController.cs: Fixes the Markdown usage of the uploaded
  files:
Files are now renamed by dropping invalid characters and replacing
  spaces by underscores.
An existing destination file is removed at upload.

* showdown.js: Renders audio and video at client side

* to-markdown.js: converts html audio and video to Markdown

* TestByteA.cs: adds a prefix, an underscore, to the test table
  `_testbytea`

* Edit.aspx: Uses the new `showdown` javascript module (that
  previously was named `Showdown`)

* Web.csproj: cleaning

* MarkdownDeep.dll: Renders video an audio

* GruntFile.js: Was pollution
This commit is contained in:
Paul Schneider
2015-09-25 13:41:39 +02:00
parent 77149697dd
commit 9912d0cbb2
9 changed files with 2375 additions and 450 deletions

View File

@ -1,29 +0,0 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner : '/*!\n' +
' * <%= pkg.title %> v<%= pkg.version %> - <%= pkg.description %>\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> - <%= pkg.homepage %>\n' +
' * License: <%= pkg.license %>\n' +
' */\n\n'
},
uglify: {
options : {
banner : '<%= meta.banner %>',
report: 'gzip'
},
dist: {
files: {
'jquery.timepicker.min.js': ['jquery.timepicker.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify']);
};

File diff suppressed because it is too large Load Diff

View File

@ -49,7 +49,7 @@ function isBlock(node) {
var voids = [
'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input',
'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr', 'audio',
'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr',
];
function isVoid(node) {
@ -489,8 +489,16 @@ module.exports = [
{
filter: 'audio',
replacement: function(content, node) {
var alt = node.alt || '';
var alt = node.getAttribute("alt") || '';
var src = node.getAttribute('src') || '';
if (!src)
for (var i = 0; i < node.childNodes.length; i++)
{
if (node.childNodes[i].localName == 'source') {
src = node.childNodes[i].getAttribute('src') ;
break;
}
}
var title = node.title || '';
var titlePart = title ? ' "'+ title +'"' : '';
return src ? '![audio:' + alt + ']' + '(' + src + titlePart + ')' : '';