Core Docs | Additional Modules Docs
@Description: An array of all query params e.g. url?name=paul -> $_GET['name'] = 'paul'. There is a global reference to this name $_GET. Keys that are not foudn return false;
@File: browser/$_GET.js
@Example://if the url of the page was http://www.surebert.com?name=paul you could reference that query data like this
if($_GET['name'] =='paul){
alert('hello paul');
}
@Description: Gets the window scroll data It is automatically populated on window.onscroll.
@File: browser/getScrollPosition.js
@Example:var pos = sb.browser.getScrollPosition();
//pos = [400, 300]
@Description: Used to allow for back and forward, bookmarkable navigation with ajax
It tries to load the data from the url after the # whenever the hash changes
e.g. http://example.com/testing#/rest/test would load /rest/test.
First it would fire onloading.
Then it would fire either onLoaded or onPageNotFound
and pass the data loaded from /rest/test to it so that you could do what you would like
@File: browser/hashHistory.js
@Example:sb.browser.hashHistory.init({
onLoaded : function(r){
//do something with the data
},
onLoading : function(response){
//show the user they are loading data
},
onPageNotFound : function(response){
}
});
@Description: Causes the browser to reject copying by denying contextmenu and dragstart for elements with sb_nocopy attribute
@File: browser/noCopy.js
@Description: Allows you to check for any conditions and then stop browser from
leaving page if they are met and to give the user a message why. You can use
this to check for text being edited and prompt to ask if they want to leave page.
You can push multiple checks, it will combine all returned messages into one
long one.
@File: browser/onBeforeExit.js
@Example://if there are any editable textareas with
sb.browser.onBeforeExit.checks.push(function(){
if($('textarea.editable').some(function(ta){return ta.value != '';})){
return 'You have editable text areas open, are you sure you want to leave the page and lose that information.';
}
});
@Description: pulses document title between default and custom to grab user attention
@File: browser/pulsingTitle.js
@Example:var p = new sb.browser.pulsingTitle('dancing');
//stop pulsing
p.stop();
@Description: starts pulsing, does this by default when constructor is used, can be used to restart
@File: browser/pulsingTitle.js
@Example:var p = new sb.browser.pulsingTitle('dancing');
//stop pulsing
p.stop();
//start pulsing again
p.pulse();
@Description: stops pulsing
@File: browser/pulsingTitle.js
@Example:var p = new sb.browser.pulsingTitle('dancing');
//stop pulsing
p.stop();
@Description: Removes any user based text selection, great for dragging scripts
@File: browser/removeSelection.js
@Author: Paul Visco
@Version: 1.0 11/19/07
@Example:sb.browser.removeSelection();
@Description: Used to gradually scroll the browser somewhere
@File: browser/scrollTo.js
@Author: Paul Visco
@Param: Object with the following properties
integer y Where to scroll to on the y axis
integer x Where to scroll to on the x axis
integer duration The time milliseconds to scroll over
function onEnd Fires if it successfully completes scrolling
function onStopped Fires if the user stops the scrolling by initiating their own scrolling
@Example://scrolls to y 500, x: 200 and alerts 'done' when complete or stopped of the user scrolls
var scrollTo = sb.browser.scrollTo({
y : 500,
x : 200,
duration : 24,
onEnd : function(){
alert('done');
},
onStopped : function(){
alert('stopped');
});