cleaning
This commit is contained in:
@ -45,10 +45,7 @@
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".mdcoding").addClass('hidden');
|
||||
var converter = new showdown.Converter();
|
||||
var htmlize = function(content) {
|
||||
return converter.makeHtml(content);
|
||||
};
|
||||
|
||||
var onchange = function(){
|
||||
var nv = $(this).val();
|
||||
var tid = $(this).data('from');
|
||||
|
@ -7,26 +7,10 @@ var markdownize = function(content) {
|
||||
};
|
||||
|
||||
var converter = new showdown.Converter();
|
||||
var markdownize = function(content) {
|
||||
if (!content) return '';
|
||||
var html = content.split("\n").map($.trim).filter(function(line) {
|
||||
return line != "";
|
||||
}).join("\n");
|
||||
var md = toMarkdown(html);
|
||||
console.log(md);
|
||||
return md;
|
||||
};
|
||||
|
||||
var htmlize = function(content) {
|
||||
return converter.makeHtml(content);
|
||||
};
|
||||
var updateHtml = function(id,content) {
|
||||
var jView = jQuery('*[for="'+id+'"]');
|
||||
if (markdownize(jView.html()) === content) {
|
||||
return;
|
||||
}
|
||||
var html = htmlize(content);
|
||||
jView.html(html);
|
||||
};
|
||||
|
||||
var updateMD = function(id,content) {
|
||||
if (!content) return jQuery('#'+id).val('') ;
|
||||
@ -36,7 +20,3 @@ var markdownize = function(content) {
|
||||
}
|
||||
jQuery('#'+id).val( markdown );
|
||||
};
|
||||
var onMDModified = ( function (event, data) {
|
||||
$('#Submit').addClass('dirty');
|
||||
updateMD(this.attributes["for"].value, data.content);
|
||||
});
|
||||
|
Reference in New Issue
Block a user