SPR-930: pseudo state for breadcrumb on detail template
SPR-814: prevent Uncaught TypeErrors of JSINFO in detail template
This commit is contained in:
parent
6db1065031
commit
4e86a8f0c2
7 changed files with 80 additions and 15 deletions
js
|
@ -1,18 +1,30 @@
|
|||
/**
|
||||
* Sets up the breadcrumb behaviour (adds do / ACT status information)
|
||||
* or adds tpl_getLang('image_detail') on detail template
|
||||
*/
|
||||
jQuery(function () {
|
||||
var $breadcrumb = jQuery('.breadcrumbs');
|
||||
if (!$breadcrumb.length) return;
|
||||
(function($) {
|
||||
|
||||
/**
|
||||
* add ACT status to breadcrumb (if not show)
|
||||
*
|
||||
*/
|
||||
var mode = $breadcrumb.attr('data-do');
|
||||
if(mode && mode.indexOf('show') !== 0){
|
||||
var markup = '<bdi lang="en"><span class="curid"> : <strong>' + mode + '</strong></span></bdi>';
|
||||
$breadcrumb.find('p').append(markup);
|
||||
}
|
||||
|
||||
});
|
||||
var setBreadcrumbSuffix = function(){
|
||||
|
||||
var $breadcrumb = $('.breadcrumbs');
|
||||
if (!$breadcrumb.length) return;
|
||||
|
||||
|
||||
/**
|
||||
* add ACT status to breadcrumb (if not show)
|
||||
* or tpl_getLang('image_detail') on detail.php
|
||||
*/
|
||||
var mode = $breadcrumb.attr('data-do');
|
||||
if(mode && mode.indexOf('show') !== 0){
|
||||
var markup = '<bdi lang="en"><span class="curid"> : <strong>' + mode + '</strong></span></bdi>';
|
||||
$breadcrumb.find('p').append(markup);
|
||||
}
|
||||
};
|
||||
|
||||
$(function(){
|
||||
setBreadcrumbSuffix();
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
||||
|
|
24
js/plugins/bookcreator.js
Normal file
24
js/plugins/bookcreator.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* prevents Uncaught TypeError in detail template if bookcreator plug-in is installed
|
||||
*
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
|
||||
var debugBookCreatorOnDetailTemplate = function(){
|
||||
|
||||
var $detail = $('#dokuwiki__detail');
|
||||
if (!$detail.length) return;
|
||||
|
||||
if(JSINFO.bookcreator === undefined) {
|
||||
JSINFO.bookcreator = {};
|
||||
JSINFO.bookcreator.areToolsVisible = false;
|
||||
}
|
||||
};
|
||||
|
||||
$(function(){
|
||||
debugBookCreatorOnDetailTemplate();
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
25
js/plugins/folded.js
Normal file
25
js/plugins/folded.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* prevents Uncaught TypeError in detail template if folded plug-in is installed
|
||||
*
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
|
||||
var debugFoldedOnDetailTemplate = function(){
|
||||
|
||||
var $detail = $('#dokuwiki__detail');
|
||||
if (!$detail.length) return;
|
||||
|
||||
if(JSINFO.plugin_folded === undefined) {
|
||||
JSINFO.plugin_folded = {};
|
||||
JSINFO.plugin_folded.reveal = '';
|
||||
JSINFO.plugin_folded.hide = '';
|
||||
}
|
||||
};
|
||||
|
||||
$(function(){
|
||||
debugFoldedOnDetailTemplate();
|
||||
});
|
||||
|
||||
|
||||
})(jQuery);
|
Loading…
Add table
Add a link
Reference in a new issue