| ... | ... | @@ -26,7 +26,6 @@ $(document).ready(function(){ |
|
|
|
$(this).select();
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$('body').on('ajax:complete, ajax:beforeSend, submit', 'form', function(e){
|
|
|
|
var buttons = $('[type="submit"]', this);
|
|
|
|
switch( e.type ){
|
| ... | ... | @@ -70,6 +69,26 @@ $(document).ready(function(){ |
|
|
|
$(".supp_diff_link").bind("click", function() {
|
|
|
|
showDiff(this);
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Note markdown preview
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
$('#preview-link').on('click', function(e) {
|
|
|
|
$('#preview-note').text('Loading...');
|
|
|
|
|
|
|
|
var previewLinkText = ($(this).text() == 'Preview' ? 'Edit' : 'Preview');
|
|
|
|
$(this).text(previewLinkText);
|
|
|
|
|
|
|
|
var note = $('#note_note').val();
|
|
|
|
if (note.trim().length === 0) { note = 'Nothing to preview'; }
|
|
|
|
$.post($(this).attr('href'), {note: note}, function(data) {
|
|
|
|
$('#preview-note').html(data);
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#preview-note, #note_note').toggle();
|
|
|
|
e.preventDefault();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
function focusSearch() {
|
| ... | ... | |
| ... | ... | |