329 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Jobs | Twitter | Bookmarks | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Google Chrome 27 – now with added voice searching
Wed, May 22nd 2013 66
Writing a single library for SSJS and CSJS validation – failed attempt #1
Sun, May 19th 2013 205
XPages ND9 (Dojo 1.8) does not work with other AMD loaders (and the work around)
Tue, May 14th 2013 196
Server-side HTML vs. JS Widgets vs. Single-Page Web Apps – the XPages version
Mon, May 13th 2013 274
DCLUG – May 23rd – IBM Sametime Deployment – A look at where are we and where should we go
Mon, May 13th 2013 136
EXTJS in XPages #9 – Infinite scrolling rebooted and reborn – v4.2 BufferedRenderer
Mon, May 13th 2013 191
Shorthand Conditional JavaScript variable checking using ||
Sun, May 5th 2013 215
Top 10
jQuery in XPages #17 – nanoScroller (game changing – mini scrollbar)
Sun, Dec 2nd 2012 825
Thank you Carl Tyler, Ed Brill and the lotus community.
Thu, Dec 13th 2012 820
Dave Leedy: Drink to 99 at IBMConnect
Sun, Dec 16th 2012 710
EXTJS in XPages – the grid series
Sun, Feb 24th 2013 643
Community Blogging and why you shouldn’t give a &^%$ what anyone thinks
Thu, Nov 15th 2012 574
A couple of Tips on how to optimize your XPages REST Service
Thu, Feb 7th 2013 498
Nice simple OneUI XPage layout section with dijit.TitlePane
Thu, Aug 23rd 2012 494
Make your XPages more maintainable – JavaScript Callback functions
Sun, Apr 28th 2013 493
XPages SSJS: Beware – context.getURL() does not do what it says on the tin!
Thu, Mar 7th 2013 455
EXTJS in XPages #3 – Creating a basic grid from a Custom Control
Sun, Mar 3rd 2013 443


jQuery in XPages #11 – Joyride.js (How to add a website feature tour)
MarkyRoden    

In this article I will demonstrate how you can easily create a website feature tour using the Joyride.js jQuery plugin and XPages. When releasing a new site or new features within a site it is always a good idea to let your users know what’s new and why. This can be done in a number of ways, but Joyride provides a fun and interactive way of showing the new information and can be linked to the wiki or other more formal documentation you create with a release.

Demonstration

The XPages integration of Joyride.js is demonstrated here

Download

The demonstration database can be downloaded from the link above or from here

Joyride.js

Introduction

Have you ever released a new XPage or website and wanted to visually guide a user around the new features or capabilities? Well now you can with Joyridejs in your XPage.

“Joyride gives you everything you need to call out new features in your app or website. Joyride is extremely flexible and lets you take control of how people interact with your tour. ” - http://www.zurb.com/playground/jquery-joyride-feature-tour-plugin

Example

Example – Using my previous article about prettyPhoto.js as an example I can highlight to sections in a visually appealing way and guide new users around the page.

prettyPhoto original XPage

prettyPhoto original XPage

Becomes and interactive site with descriptions and popups showing users around:

Joyride introduction to the site #1

Joyride introduction to the site #1

Joyride introduction to the site #2

Joyride introduction to the site #2

How does it work?

We first have to add our libraries and CSS to the database. I have started to move away from using xp:resources in my source code because the XPage is trying to load the files every time we build and save the XPage which slows down development. I am using the <script> and </link> tags directly within the XPage source itself.

The files are added to the database in the WebContents folder as described in previous articles within this series

	<script src="js/jquery-1.7.2.min.js" clientSide="true"></script>
	<script src="js/jquery.joyride-1.0.3.js" clientSide="true"></script>
  	<link rel="stylesheet" href="css/JoyRide/joyride-1.0.3.css"/>
  	<link rel="stylesheet" href="css/JoyRide/demo-style.css"/>

This plugin is controlled by creating an ordered-list of the elements you wish to highlight and within that list you state the contents of the popup for that element.

The attributes of the list elements controls the functionality of the Joyride:

  • data-id
    • The idTag of the element you wish to display this popup on “addNew”
  • data-text
    • What do you want displayed in the button “Next”
  • class
    • Styling information
  • <h2>
    • The Title of the popup
  • <p>
    • the Text (or HTML) within the popup
  • data-options
    • Gives you more control of the look/feel of the popup “tipLocation:top;tipAnimation:fade”

  	<ol id="joyRideTipContent">
  	  <li data-id="addNew" data-text="Next" class="custom">
  	    <h2>Add a New Image</h2>
  	    <p>Apparently this functionality is available in the live demo :)</p>
  	  </li>
  	  <li data-id="clickOnOne" data-text="Click ME" data-options="tipLocation:top;tipAnimation:fade">
  	    <h2>A simple Lightbox</h2>
  	    <p>You can produce a lightBox Slide show of the images by clicking on one of these</p>
  	  </li>
  	  <li data-id="seeYouTube" data-text="Next">
  	    <h2>See YouTube</h2>
        <p>Clickin on the NotesIn9 image will show you an example of the prettyPhoto running a YouTube video</p>
  	  </li>
  	  <li data-id="inLine" data-text="Close">
  	    <h2>View Inline Content</h2>
        <p>Clickin on the NotesIn9 image will show you an example of the prettyPhoto running a YouTube video</p>
  	  </li>
  	</ol>

At the end of the code we add the activation of the Joyride – this can also be added to a button on the form if you don’t want it loading when the page loads.

	$(window).load(function() {
		$(this).joyride();
	});

Options

Joyride.js comes with a lot of options for changing the presentation of the popups – you will also notice that some of these options are stored within the data-options of the controller ordered-list. It provides another layer of flexibility for being able to control all the popups in the same way or individually depending on what effect you are looking for.

/* Setting your options to override the defaults */
$(this).joyride({
  'tipLocation': 'bottom',         // 'top' or 'bottom' in relation to parent
  'scrollSpeed': 300,              // Page scrolling speed in ms
  'timer': 2000,                   // 0 = off, all other numbers = time(ms )
  'startTimerOnClick': true,       // true/false to start timer on first click
  'nextButton': true,              // true/false for next button visibility
  'tipAnimation': 'pop',           // 'pop' or 'fade' in each tip
  'tipAnimationFadeSpeed': 300,    // if 'fade'- speed in ms of transition
  'cookieMonster': true,           // true/false for whether cookies are used
  'cookieName': 'JoyRide',         // choose your own cookie name
  'cookieDomain': false,           // set to false or yoursite.com
  'tipContainer': body,            // Where the tip be attached if not inline
  'inline': false,                 // true/false for inline positioning
  'tipContent': '#joyRideContent', // The ID of the <ol> used for content
  'postRideCallback': $noop,       // a method to call once the tour closes
  'postStepCallback': $noop        // A method to call after each step
});

Something to think about
You don’t want to show the tour to every user every time for the first week of the new website. There are a number of ways you could control this – how you do it is really up to you….

  • Provide the users a “Click Here” button to take the tour
  • Provide user an opt out option and track their selection in a notesdocument or a cookie.
    • When the user enters the application check the option and do not render the window.joyride() script to start the tour.

Conclusion

In less than 1 hour I was able to knock up the demonstration page for this article – in the real world though you would add this tour option into the website planning from the start. The tags which the tour is displayed on are not going to affect the site if they are not used and can be added as part of the overall design from the start.

These popups are also a very good way of providing helptext to a user.

This is a very simple and very useful plugin which I know has lots of applicability to our applications and customers.




---------------------
http://xomino.com/2012/06/20/jquery-in-xpages-11-joyride-js-how-to-add-a-website-feature-tour/
Jun 20, 2012
189 hits



Recent Blog Posts
66


Google Chrome 27 – now with added voice searching
Wed, May 22nd 2013 9:04a   Mark Roden
The new Chrome v27 went live today with a new voice search capability using the HTML5 media capabilities the browser asks to use my microphone and when it does it allows you to speak your query rather than type it. It is similar to the capability which has been in Android Jelly Bean 4.2 for a while now which I find very useful and I am becoming more reliant on it – we still have some accent issue to get over though. Below is a quick video demonstrating that it still has some hurdles to get [read] Keywords: google
205


Writing a single library for SSJS and CSJS validation – failed attempt #1
Sun, May 19th 2013 6:04p   Mark Roden
In this article I will demonstrate my first futile attempt to consolidate CSJS and SSJS libraries so that we only have to write validation once. I will also discuss JavaScripts Closures which unless you have already encountered them will make your head hurt thinking about it Introduction I was reminded in one of the comments on my blog last week about how it is still a pain in the butt to have to write client side JavaScript validation (to provide a good user interface) and server side JavaScr [read] Keywords: ldd lotus dojo firefox interface javascript password server xml
196


XPages ND9 (Dojo 1.8) does not work with other AMD loaders (and the work around)
Tue, May 14th 2013 6:10p   Mark Roden
Today I took a new jQuery plugin that I was playing with from an R8.5.3 environment where it worked, to an R9 environment and it failed – I figured it had something to do with something I had been reading about over the last month and in fixing my problem this lead to a more serious realization that I KNOW other people are also going to come across. Background A brief scan of the last month’s discussions on Xpages and jQuery Mobile 1.3 reveals a number of posts started by Dave Leedy [read] Keywords: domino ibm notes R8 xpages bug database dojo mobile properties
274


Server-side HTML vs. JS Widgets vs. Single-Page Web Apps – the XPages version
Mon, May 13th 2013 8:13p   Mark Roden
Yesterday I came across this excellent article by Pamela Fox - http://blog.pamelafox.org/2013/05/frontend-architectures-server-side-html.html. In it she goes through how her company uses all three stated architectures, discusses why, and how they are used by the end users. It struck me as fascinating because I feel like we are going through this exact same struggle in the XPages community – what is the best architecture to create applications for our users? I also feel fortunate to have [read] Keywords: domino ibm lotus notes script library xpages ajax application applications community development enterprise interface javascript profile server twitter widget widgets
136


DCLUG – May 23rd – IBM Sametime Deployment – A look at where are we and where should we go
Mon, May 13th 2013 11:48a   Mark Roden
This month we have Maurice Cogdell speaking to us about his recent experiences with Sametime and where it is going in the market. If you are to attend this meeting YOU MUST use the meetup site (listed below) to state you are attending – name badges will be created prior to the meeting as your access. Date 23rd May 2013 Address The meeting will be held at IBM Technical Exploration Center 401 Greensboro Drive, McLean, VA Agenda ————————R [read] Keywords: ibm lotus sametime show and tell community google networking
191


EXTJS in XPages #9 – Infinite scrolling rebooted and reborn – v4.2 BufferedRenderer
Mon, May 13th 2013 5:29a   Mark Roden
In this article I will introduce the new EXTJS v4.2 Infinite scroller – the BuffererRenderer. The whole concept of infinite scrolling has been rewritten in the new version of the grid and it had made a huge difference to responsiveness and stability of the infinite grid. EXTJS in XPages series Here are links to all of the previous articles in this series EXTJS in XPages #8 – Selecting data from the grid and opening a document EXTJS in XPages #7 – Doing an @Unique(@DbColumn) equivalent [read] Keywords: xpages ajax application database javascript properties server xml
215


Shorthand Conditional JavaScript variable checking using ||
Sun, May 5th 2013 6:23p   Mark Roden
In this article I will highlight a shorthand method of JavaScript conditional variable checking. The || operator is commonly recognized as “OR” but it’s usage is broader than some people would think. You might have occasion to have a variable declaration purposefully override a desired value. In this example the start will be zero unless the start variable has been declared with and assigned value: Long Hand var start /*..bunch o' code..*/ if (!start){ start = 0 } [read] Keywords: javascript
236


jQuery in XPages #19 – Shadow (Add eye catching drop shadows to your page elements)
Thu, May 2nd 2013 9:38p   Mark Roden
In this article I will describe how to implement and use the jQuery shadow plugin to create great looking shadowed panels within your XPages application. Demonstration The XPages integration of shadow is demonstrated here Download The demonstration database can be downloaded from the link above or from here Shadow Introduction “Adapted from Nicholas Gallagher’s CSS drop shadows without images demo “ Adding “depth” to the visual aspect of your website is one of tho [read] Keywords: xpages application css database dojo firefox integration interface widget




240


JavaScript variable hoisting
Wed, May 1st 2013 8:16p   Mark Roden
In this article I will give a quick overview of JavaScript hoisting and explain why sometimes your variables are not doing what you expect them to. In the following example we have a very simple variable declaration and function: var msg = "hello world" function sayHi(){ alert(msg) } sayHi() If you run this through firebug you get the expected message in the browser However if you change the code slightly you do not get the initially expected response. When you run the following code [read] Keywords: javascript
493


Make your XPages more maintainable – JavaScript Callback functions
Sun, Apr 28th 2013 6:39p   Mark Roden
In this article I will attempt to explain the purpose and benefits of using callback functions in JavaScript. Introduction Basic JavaScript functions look like this normally like this function addMe(a, b){ return a+ b } JavaScript variables normally look like this var a = 2 var b = 3 Finally we would call the function to add the variables var theTotal = addMe(a, b) //5 Seems simple enough Setting a variable to a function But we can also combine them into something like this va [read] Keywords: xpages ajax application development dojo javascript




Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition