mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
BUGFIX: spoiler tag on lightboxed images wasn't working
This commit is contained in:
@@ -57,8 +57,6 @@ replaceBBCode('ul', function(contents) { return ['ul'].concat(contents); });
|
||||
replaceBBCode('ol', function(contents) { return ['ol'].concat(contents); });
|
||||
replaceBBCode('li', function(contents) { return ['li'].concat(contents); });
|
||||
|
||||
replaceBBCode('spoiler', function(contents) { return ['span', {'class': 'spoiler'}].concat(contents); });
|
||||
|
||||
Discourse.Dialect.inlineBetween({
|
||||
start: '[img]',
|
||||
stop: '[/img]',
|
||||
@@ -80,7 +78,6 @@ Discourse.Dialect.inlineBetween({
|
||||
emitter: function(contents) { return ['a', {href: contents, 'data-bbcode': true}, contents]; }
|
||||
});
|
||||
|
||||
|
||||
replaceBBCodeParamsRaw("url", function(param, contents) {
|
||||
return ['a', {href: param, 'data-bbcode': true}, contents];
|
||||
});
|
||||
@@ -103,3 +100,11 @@ Discourse.Dialect.replaceBlock({
|
||||
}
|
||||
});
|
||||
|
||||
Discourse.Dialect.replaceBlock({
|
||||
start: /(\[spoiler\])([\s\S]*)/igm,
|
||||
stop: '[/spoiler]',
|
||||
|
||||
emitter: function(blockContents) {
|
||||
return ['p', ['div', { 'class': 'spoiler' }, blockContents.join("\n")]];
|
||||
}
|
||||
});
|
||||
|
||||
@@ -213,7 +213,7 @@ Discourse.Dialect = {
|
||||
@param {String} [opts.start] The starting token we want to find
|
||||
@param {String} [opts.matcher] The regular expression to match
|
||||
@param {Boolean} [opts.wordBoundary] If true, the match must be on a word boundary
|
||||
@param {Boolean} [opts.spaceBoundary] If true, the match must be on a sppace boundary
|
||||
@param {Boolean} [opts.spaceBoundary] If true, the match must be on a space boundary
|
||||
**/
|
||||
inlineRegexp: function(args) {
|
||||
this.registerInline(args.start, function(text, match, prev) {
|
||||
|
||||
@@ -9,7 +9,11 @@ Discourse.Lightbox = {
|
||||
apply: function($elem) {
|
||||
$LAB.script("/javascripts/jquery.magnific-popup-min.js").wait(function() {
|
||||
$("a.lightbox", $elem).each(function(i, e) {
|
||||
$(e).magnificPopup({
|
||||
var $e = $(e);
|
||||
// do not lightbox spoiled images
|
||||
if ($e.parents(".spoiler").length > 0 || $e.parents(".spoiled").length > 0) { return; }
|
||||
|
||||
$e.magnificPopup({
|
||||
type: "image",
|
||||
closeOnContentClick: false,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user