jsdoc

$.simplicity

Namespace $.simplicity

Simplicity function namespace. Reusable functions and constants from the Simplicity Widgets project.
Defined in: _jsdoc.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<static>  
$.simplicity.version
The current version of Simplicity Widgets.
Method Summary
Method Attributes Method Name and Description
<static>  
$.simplicity.ajaxHelper(exeContext)
Plugin to manage asynchronous ajax requests such that only the most recent request is currently inflight.
<static>  
$.simplicity.degreesToRadians(v)
Converts degrees to radians.
<static>  
$.simplicity.equiv(lhs, rhs)
Deep equality checker.
<static>  
$.simplicity.haversineDistanceKm(lat1, lng1, lat2, lng2)
Calculates the haversine distance in km between two coordinates.
<static>  
$.simplicity.haversineDistanceMiles(lat1, lng1, lat2, lng2)
Calculates the haversine distance in miles between two coordinates.
<static>  
$.simplicity.haversineDistanceRadians(lat1, lng1, lat2, lng2)
Calculates the haversine distance in radians between two coordinates.
<static>  
$.simplicity.proxy(fn, thisObject)
Variation of $.proxy that doesn't share a guid and thus allows for unbinding a single proxied function from an event.
<static>  
$.simplicity.radiansToDegrees(v)
Converts radians to degrees.
Namespace Detail
$.simplicity
Field Detail
<static> $.simplicity.version
The current version of Simplicity Widgets.

Do not use this for feature detection, instead use it for high level diagnostics to report which version of the widgets are currently in use.


Defined in: simplicity.version.js.
  console.log('Simplicity Widgets:', $.simplicity.version);
Method Detail
<static> $.simplicity.ajaxHelper(exeContext)
Plugin to manage asynchronous ajax requests such that only the most recent request is currently inflight. Any inflight request will be aborted, leaving only the most recent request to complete. The helper class also keeps track of total requests, success and error counts. These statistics are available using the .getStats() method.
Defined in: simplicity.ajaxHelper.js.
  var ajaxHelper = new $.simplicity.ajaxHelper(this);
  var xhr = ajaxHelper.ajax({
    url: '/my_search_controller.php',
    type: 'GET',
    contentType: 'application/json',
    error: function (data, textStatus, xhr) {...},
    success: function (data, textStatus, xhr) {...},
    debug: false
  });
  console.log(ajaxHelper.getStats());
Parameters:
exeContext
The target Object to use for the context of the supplied $.ajax() success and error callback options.

<static> $.simplicity.degreesToRadians(v)
Converts degrees to radians.
Defined in: simplicity.degreesToRadians.js.
Parameters:
v
The value to convert, in degrees.
Returns:
The converted value in radians.

<static> $.simplicity.equiv(lhs, rhs)
Deep equality checker.
Defined in: simplicity.equiv.js.
Parameters:
lhs
The first object to be compared
rhs
The second object to be compared
See:
Ported from http://philrathe.com/articles/equiv.

<static> $.simplicity.haversineDistanceKm(lat1, lng1, lat2, lng2)
Calculates the haversine distance in km between two coordinates.
Defined in: simplicity.haversineDistanceKm.js.
Parameters:
lat1
The latitude of the first coordinate in degrees.
lng1
The longitude of the first coordinate in degrees.
lat2
The latitude of the second coordinate in degrees.
lng2
The longitude of the second coordinate in degrees.
Returns:
The calculated distance in miles.

<static> $.simplicity.haversineDistanceMiles(lat1, lng1, lat2, lng2)
Calculates the haversine distance in miles between two coordinates.
Defined in: simplicity.haversineDistanceMiles.js.
Parameters:
lat1
The latitude of the first coordinate in degrees.
lng1
The longitude of the first coordinate in degrees.
lat2
The latitude of the second coordinate in degrees.
lng2
The longitude of the second coordinate in degrees.
Returns:
The calculated distance in miles.

<static> $.simplicity.haversineDistanceRadians(lat1, lng1, lat2, lng2)
Calculates the haversine distance in radians between two coordinates.
Defined in: simplicity.haversineDistanceRadians.js.
Parameters:
lat1
The latitude of the first coordinate in degrees.
lng1
The longitude of the first coordinate in degrees.
lat2
The latitude of the second coordinate in degrees.
lng2
The longitude of the second coordinate in degrees.
Returns:
The calculated distance in radians.

<static> $.simplicity.proxy(fn, thisObject)
Variation of $.proxy that doesn't share a guid and thus allows for unbinding a single proxied function from an event.
Defined in: simplicity.proxy.js.
  var clickHandler = $.simplicity.proxy(function () {}, this);
  $('#example').bind('click', clickHandler);
  // Do something
  $('#example).unbind('click', clickHandler);
Parameters:
fn
The function to proxy.
thisObject
The object to apply the function to.

<static> $.simplicity.radiansToDegrees(v)
Converts radians to degrees.
Defined in: simplicity.radiansToDegrees.js.
Parameters:
v
The value to convert, in radians.
Returns:
The converted value in degrees.

Documentation generated by JsDoc Toolkit 2.4.0