Simple Spoiler BBCode

Spoiler Not Working In Post Preview - Simple Spoiler BBCode

Spoiler Not Working In Post Preview

by onlyproevo » Mon May 15, 2017 1:01 pm

Like the title says, when I preview my post, I see the spoiler itself (text still hidden) looks fine but when I click on Show, nothing happens.

To confirm, the spoiler works perfectly in viewtopic, however, the same can't be said for Preview in posting.php.

If you need any more details from me, just ask. :)
onlyproevo
Registered User
Posts: 110
Joined: Tue Jun 21, 2011 8:13 pm
Contact:

Re: Spoiler Not Working In Post Preview

by AbaddonOrmuz » Mon May 15, 2017 1:06 pm

I need more info:

- Web browser (and version)
- Style (and version)
- Board URL to test
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 978
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: Spoiler Not Working In Post Preview

by onlyproevo » Mon May 15, 2017 1:12 pm

AbaddonOrmuz wrote:I need more info:

- Web browser (and version)
- Style (and version)
- Board URL to test
- Google Chrome (49.0.2623.112 m)
- prosilver
- Forum (U: test / P: password)

EDIT: I'm also getting the same issue on Mozilla Firefox (38.0.5).
onlyproevo
Registered User
Posts: 110
Joined: Tue Jun 21, 2011 8:13 pm
Contact:

Re: Spoiler Not Working In Post Preview

by AbaddonOrmuz » Mon May 15, 2017 7:00 pm

Yes, I've seen the problem in your forum, it seems that another extension is creating conflict, however from the source code is hard to determine the version used, can you provide the list of your enabled extensions (with versions)?
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 978
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: Spoiler Not Working In Post Preview

by onlyproevo » Mon May 15, 2017 8:04 pm

AbaddonOrmuz wrote:Yes, I've seen the problem in your forum, it seems that another extension is creating conflict, however from the source code is hard to determine the version used, can you provide the list of your enabled extensions (with versions)?
Image
onlyproevo
Registered User
Posts: 110
Joined: Tue Jun 21, 2011 8:13 pm
Contact:

Re: Spoiler Not Working In Post Preview

by AbaddonOrmuz » Mon May 15, 2017 8:37 pm

Please, replace the content of the spoiler.js file with the following, then clear the cache. It has some debug code to se what's going on.

{PHPBB_ROOT}/ext/alfredoramos/simplespoiler/styles/all/theme/js/spoiler.js

Code: Select all

(function($) {
	
	'use strict';

	$.fn.initSpoilers = function($options) {
		// Overwrite options
		$options = $.extend({
			showText: 'Show',
			hideText: 'Hide',
			selector: '.' + this.attr('class')
		}, $options);

		// Debug
		console.log(this.length);
		console.log($options);

		$.each(this, function() {
			var $spoiler = {
				wrapper: $(this),
				trigger: $(this).children($options.selector + '-trigger').first(),
				status: $(this).find($options.selector + '-status').first(),
				body: $(this).children($options.selector + '-body').first()
			};

			// Debug
			for (var $key in $spoiler) {
				console.log($key + ': ' + $spoiler.hasOwnProperty($key));
				console.log($key + ': ' + $spoiler[$key].length);
			}

			$spoiler.trigger.on('click', function() {
				// Debug
				console.log($(this));
				console.log($spoiler.body.is(':visible'));

				// Toggle CSS class
				$spoiler.wrapper.toggleClass($options.selector.replace('.', '') + '-shown');

				// Toggle status text
				$spoiler.status.text(
					$spoiler.body.is(':visible') ? $options.hideText : $options.showText
				);
			});
		});
	};
})(jQuery);
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 978
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: Spoiler Not Working In Post Preview

by onlyproevo » Tue May 16, 2017 9:25 am

AbaddonOrmuz wrote:Please, replace the content of the spoiler.js file with the following, then clear the cache. It has some debug code to se what's going on.
Done.
onlyproevo
Registered User
Posts: 110
Joined: Tue Jun 21, 2011 8:13 pm
Contact:

Re: Spoiler Not Working In Post Preview

by AbaddonOrmuz » Tue May 16, 2017 10:23 pm

Sorry I can't identify the problem. I see the spoiler script is the last one, so it could be a problem with any plugin included above.

I see it stops the script just in that page (#preview_wrapper). Is it the only extension wich you're having problems with?

PS: You can revert back the spoiler.js file content: v1.0.8
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 978
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: Spoiler Not Working In Post Preview

by onlyproevo » Wed May 17, 2017 3:28 pm

AbaddonOrmuz wrote:Sorry I can't identify the problem. I see the spoiler script is the last one, so it could be a problem with any plugin included above.

I see it stops the script just in that page (#preview_wrapper). Is it the only extension wich you're having problems with?

PS: You can revert back the spoiler.js file content: v1.0.8
When I disable Ajax Base, the issue disappears.
onlyproevo
Registered User
Posts: 110
Joined: Tue Jun 21, 2011 8:13 pm
Contact:

Re: Spoiler Not Working In Post Preview

by AbaddonOrmuz » Wed May 17, 2017 6:45 pm

I'm subscribed to the support topic in the ajax base extension, meanwhile, I will test on my own.

Kudos for you :geek:
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 978
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: Spoiler Not Working In Post Preview

by onlyproevo » Wed May 17, 2017 7:52 pm

AbaddonOrmuz wrote:I'm subscribed to the support topic in the ajax base extension, meanwhile, I will test on my own.

Kudos for you :geek:
No problem. :D

For now, I have disabled Ajax Base and won't enable it again until a fix has been released.
onlyproevo
Registered User
Posts: 110
Joined: Tue Jun 21, 2011 8:13 pm
Contact:

Re: Spoiler Not Working In Post Preview

by fliper4o » Thu Oct 05, 2017 4:08 pm

It is working with both ext ! :)
for u?
User avatar
fliper4o
Registered User
Posts: 267
Joined: Wed Mar 23, 2011 8:15 pm
Contact:

Re: Spoiler Not Working In Post Preview

by AbaddonOrmuz » Thu Oct 05, 2017 9:48 pm

Since version 1.1.0 it should work everywhere, even if AJAX is involved (preview, chat, etc).
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 978
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact: