File size: 1,477 Bytes
5893f8f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Controls the transitions between main tabs.
// Should be no effect there.
 $(document).bind('pageinit', function(){     
    $("a[data-role=tab]").each(function () {
        var anchor = $(this);
        anchor.bind("click", function () {
            $.mobile.changePage(anchor.attr("href"), {
                transition: "none",
                changeHash: true
            });
            return false;
        });
    }); 
    
    // Controls the swipe distance.
    var swipeDistance = screen.width * 2/5;
		$.event.special.swipe.horizontalDistanceThreshold = swipeDistance;
 });

// Avoid presenting the error twice.
var chromeErrorShown = false;

$(document).bind('pageshow', function() {
    
    // Focus the first input in the page.
    $($('.ui-page-active form :input:visible')[0]).focus();


    // Display an error message, for Google Chrome for local files.    
    var addressBar = window.location.href;
    if ( window.chrome && addressBar.indexOf('file://') === 0 && !chromeErrorShown){
        $.mobile.showPageLoadingMsg( 
            $.mobile.pageLoadErrorMessageTheme, 
            "Please move the generated WebHelp output to a web server, "+
            "or use another browser. Google Chrome does not handle this " + 
            "kind of output stored locally on the file system.", true);
        chromeErrorShown = true;
    }
});

// Declare the function for open and highlight, but disable it.
function openAndHighlight(){
    return true;    
}