mirror of
https://github.com/redmine/redmine.git
synced 2025-11-11 15:56:03 +01:00
Adds preview option to the wiki toolbar (#27758).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17521 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -449,17 +449,6 @@ function hideModal(el) {
|
||||
modal.dialog("close");
|
||||
}
|
||||
|
||||
function submitPreview(url, form, target) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'post',
|
||||
data: $('#'+form).serialize(),
|
||||
success: function(data){
|
||||
$('#'+target).html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function collapseScmEntry(id) {
|
||||
$('.'+id).each(function() {
|
||||
if ($(this).hasClass('open')) {
|
||||
@@ -846,6 +835,28 @@ $(document).ready(function(){
|
||||
toggleDisabledInit();
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#content').on('click', 'div.jstTabs a.tab-preview', function(event){
|
||||
var tab = $(event.target);
|
||||
|
||||
var url = tab.data('url');
|
||||
var form = tab.parents('form');
|
||||
var jstBlock = tab.parents('.jstBlock');
|
||||
|
||||
var element = encodeURIComponent(jstBlock.find('.wiki-edit').val());
|
||||
var attachments = form.find('.attachments_fields input').serialize();
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'post',
|
||||
data: "text=" + element + '&' + attachments,
|
||||
success: function(data){
|
||||
jstBlock.find('.wiki-preview').html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function keepAnchorOnSignIn(form){
|
||||
var hash = decodeURIComponent(self.document.location.hash);
|
||||
if (hash) {
|
||||
|
||||
Reference in New Issue
Block a user