Enable CriticMarkup on Preview (#1429)
This commit is contained in:
@@ -86,6 +86,16 @@ function setTextDirection () {
|
|||||||
$('.markdown-body p, .markdown-body span, .markdown-body pre, .markdown-body table').attr('dir','auto');
|
$('.markdown-body p, .markdown-body span, .markdown-body pre, .markdown-body table').attr('dir','auto');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function preparePage () {
|
||||||
|
setTextDirection();
|
||||||
|
if(criticMarkup == 'true') {
|
||||||
|
$('#wiki-content').addClass('criticmarkup');
|
||||||
|
$('ins.break').unwrap();
|
||||||
|
$('span.critic.comment').wrap('<span class="popover" />');
|
||||||
|
$('span.critic.comment').filter(function() {return $(this).text()!="";}).before('‡');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ua
|
// ua
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// for deleting the current page
|
// for deleting the current page
|
||||||
@@ -332,7 +342,7 @@ $(document).ready(function() {
|
|||||||
success: function(data) {
|
success: function(data) {
|
||||||
var mainDiv = $('#wiki-wrapper', data);
|
var mainDiv = $('#wiki-wrapper', data);
|
||||||
$('.tabnav-div#preview-content').html(mainDiv);
|
$('.tabnav-div#preview-content').html(mainDiv);
|
||||||
setTextDirection();
|
preparePage();
|
||||||
if (sectionAnchor ) {
|
if (sectionAnchor ) {
|
||||||
if ( sectionHeading = $('a' + '#' + sectionAnchor+'.anchor')[0] ) {
|
if ( sectionHeading = $('a' + '#' + sectionAnchor+'.anchor')[0] ) {
|
||||||
sectionHeading.scrollIntoView();
|
sectionHeading.scrollIntoView();
|
||||||
@@ -556,17 +566,9 @@ $(document).ready(function() {
|
|||||||
$.GollumEditor({ NewFile: true, MarkupType: default_markup, commands: editorHotkeys });
|
$.GollumEditor({ NewFile: true, MarkupType: default_markup, commands: editorHotkeys });
|
||||||
}
|
}
|
||||||
|
|
||||||
// CriticMarkup
|
|
||||||
if(criticMarkup == 'true') {
|
|
||||||
$('#wiki-content').addClass('criticmarkup');
|
|
||||||
$('ins.break').unwrap();
|
|
||||||
$('span.critic.comment').wrap('<span class="popover" />');
|
|
||||||
$('span.critic.comment').filter(function() {return $(this).text()!="";}).before('‡');
|
|
||||||
}
|
|
||||||
|
|
||||||
if($('.markdown-body').length ){
|
if($('.markdown-body').length ){
|
||||||
// Set text direction (LTR or RTL)
|
// Set text direction (LTR or RTL)
|
||||||
setTextDirection();
|
preparePage();
|
||||||
|
|
||||||
// Set the 'e' hotkey for editing pages.
|
// Set the 'e' hotkey for editing pages.
|
||||||
Mousetrap.bind(['e'], function( e ) {
|
Mousetrap.bind(['e'], function( e ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user