Follow up for #1920468: Write a tour for the first page after install showing extend and other things

Problem/Motivation

As identified in IRC by EclipseGc the tips don't provide a "previous" button.

Proposed resolution

This does not come provided with the joyride library. We should provide a patch to fix this for joyride.

User interface changes

Yes. An additional button on the tip labelled "Previous".

API changes

No API changes anticipated.

CommentFileSizeAuthor
#1 1921136-1-tour-previous-button.patch5.97 KBnick_schuch
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 1921136-1-tour-previous-button.patch. Unable to apply patch. See the log in the details link for more information. View
Members fund testing for the Drupal project. Drupal Association Learn more

Comments

nick_schuch’s picture

FileSize
5.97 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch 1921136-1-tour-previous-button.patch. Unable to apply patch. See the log in the details link for more information. View

Here is the first crack at it. Next I will simplify and attempt to have this committed upstream in the joyride library.

nick_schuch’s picture

Status: Active » Needs work

I have setup a Pull Request to start the conversation upstream.

https://github.com/zurb/joyride/issues/84

nick_schuch’s picture

Status: Needs work » Needs review

I think this is worth a review.

nick_schuch’s picture

Issue tags: +JavaScript

Tagging as js so I can get some advice on this matter.

Kristen Pol’s picture

Issue tags: +Tour

Hmm... well, I ran into a couple things which are neither the fault of the patch...

1) I couldn't see the views tour icon like before... the URL coming up was:

admin/structure/views/view/content

yet the tour expects:

admin/structure/views/view/content/edit

I could be tired (well, I am tired) but I couldn't get the "edit" part to show up in the URL... I was able to get to the tour by manually tacking on the "/edit" at the end of the path it was giving me.

2) I applied the patch and cleared the cache multiple times and didn't see any previous button. I even disabled and reenabled the Tour module.

I checked the js file and it was using the old js. Perhaps it is caching in the browser but I haven't had that trouble before with Drupal.

Anyway... I attempted to test the patch but the universe is against me!

Kristen Pol’s picture

Ok... I used a different browser and see the previous button and it works as advertised. I reviewed the code and it looks clean to me but I'm no JS expert.

My guess though is that there may be some backward compatibility issues with changing the 'button' => 'nextButton' (and similar) because it appears that is part of settings that can be overridden (but maybe not?).

+++ b/core/modules/tour/js/jquery.joyride-2.0.3.jsundefined
@@ -34,7 +35,8 @@
-        'button'  : '<a href="#" class="joyride-next-tip"></a>'
+        'prevButton'  : '<a href="#" class="joyride-prev-tip"></a>',
+        'nextButton'  : '<a href="#" class="joyride-next-tip"></a>'

I prefer the code the way you wrote it because it is clear and consistent. I'm just not sure if it would be accepted into joyride if this indeed breaks backwards compatibility with existing custom code. Or, maybe they wouldn't care?

I'm happy to RTBC for Drupal but should it be reviewed by a JS guru?

nick_schuch’s picture

Kirsten Pol, Maybe we could fork the project and use that repo? I believe this is something we have done in core before. We should get a JS guru to give it the tick of approval.

Kristen Pol’s picture

I have no idea what the protocol is on that type of thing so I will defer to the core core folks (ha!).

clemens.tolboom’s picture

clemens.tolboom’s picture

The patch from #1 still applies :)

Checking the PR on https://github.com/zurb/joyride/pull/84 which is still stalled for more then 2 month. I've added a XREF to this issue. Hope that helps a little.

I still hope #2027623: De-fork jQuery Joyride and update to latest stable release gets answered one day.

For now I don't care that much anymore.

@nick_schuch can you update the summary to reflect you PR effort and maybe promise to fix backport problems?

larowlan’s picture

Status: Needs review » Needs work

The last submitted patch, 1: 1921136-1-tour-previous-button.patch, failed testing.

hampercm’s picture

Issue summary: View changes

Joyride has been rolled into the "zurb Foundation" project on GitHub, and as such is no longer being supported as a separate project. As a result, the PR submitted to add a "previous" button will never be rolled into that project. Instead, improvements are being made only to Joyride contained within the zurb Foundation project.

The zurb Foundation project is quite extensive and mostly far outside the scope of the Tour module, so I'm not sure rolling the entire Foundation into Drupal would make much sense. Alternately Drupal could fork and build upon the latest version of Joyride from https://github.com/zurb/foundation/blob/v5.5.0/js/foundation/foundation.joyride.js or fork the last official release of Joyride as a separate entity: https://github.com/zurb/joyride/blob/v2.1/jquery.joyride-2.1.js

The tagged v2.1 release of Joyride has been incorporated into core, so that would be a straightforward jumping-off point to continue this issue. The patch from #1 could probably still be incorporated directly into this version.

Alternatively, from examining v5.5.0 of foundation.joyride.js, it seems like that file could be forked and incorporated into the Tour module separate from the rest of zurb Foundation, with some modification. This would have two main advantages: the 5.5.0 version already has functionality for a "previous" button implemented, and Drupal would be utilizing a version of Joyride that is still being actively maintained.

hampercm’s picture

I've opened #2409861: Explore replacing obsolete Joyride asset with latest version to explore upgrading the Joyride asset to v5.5.0 from the zurb Foundation, which seems to be possible with extracting only 2 JS files from that project. This would add a "Previous" button without any modifications.

nick_schuch’s picture

Sounds awesome! Ill review in the other ticket.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.