removes a second and useless definition for 'markdownize'
This commit is contained in:
parent
a347637a8e
commit
25bfd478cf
1 changed files with 6 additions and 17 deletions
|
|
@ -1,26 +1,15 @@
|
|||
var markdownize = function(content) {
|
||||
if (!content) return '';
|
||||
var html = content.split("\n").map($.trim).filter(function(line) {
|
||||
return line != "";
|
||||
return line != "" ;
|
||||
}).join("\n");
|
||||
return toMarkdown(html);
|
||||
};
|
||||
|
||||
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) {
|
||||
var htmlize = function(content) {
|
||||
return converter.makeHtml(content);
|
||||
};
|
||||
var updateHtml = function(id,content) {
|
||||
var jView = jQuery('*[for="'+id+'"]');
|
||||
var updateHtml = function(jView,content) {
|
||||
if (markdownize(jView.html()) === content) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -28,7 +17,7 @@ var markdownize = function(content) {
|
|||
jView.html(html);
|
||||
};
|
||||
|
||||
var updateMD = function(id,content) {
|
||||
var updateMD = function(id,content) {
|
||||
if (!content) return jQuery('#'+id).val('') ;
|
||||
var markdown = markdownize(content);
|
||||
if (jQuery('#'+id).val() === markdown) {
|
||||
|
|
@ -36,7 +25,7 @@ var markdownize = function(content) {
|
|||
}
|
||||
jQuery('#'+id).val( markdown );
|
||||
};
|
||||
var onMDModified = ( function (event, data) {
|
||||
$('#Submit').addClass('dirty');
|
||||
var onMDModified = ( function (event, data) {
|
||||
$('#Submit').addClass('success');
|
||||
updateMD(this.attributes["for"].value, data.content);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue