This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onDataReturnInitializeTable : function(sRequest, oResponse, oPayload) { | |
if((this instanceof DT) && this._sId) { | |
this.initializeTable(); | |
this.onDataReturnSetRows(sRequest,oResponse,oPayload); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function format_number(n,prec,dec,sep) { | |
// Original by Luke Smith (http://lucassmith.name) | |
n = !isFinite(+n) ? 0 : +n; | |
prec = !isFinite(+prec) ? 2 : Math.abs(prec); | |
sep = sep == undefined ? ',' : sep; | |
var s = n.toFixed(prec), | |
abs = Math.abs(n).toFixed(prec), | |
_, i; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _toS = Object.prototype.toString, | |
_types = { | |
'undefined' : 'undefined', | |
'number' : 'number', | |
'boolean' : 'boolean', | |
'string' : 'string', | |
'[object Function]' : 'function', | |
'[object RegExp]' : 'regexp', | |
'[object Array]' : 'array', | |
'[object Date]' : 'date', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use case: | |
var myDataTable = new YAHOO.widget.DataTable(id,cols,source,{ | |
paginator : YAHOO.foo.createPaginator({ containers : "bar" }) | |
}); | |
// Method definition | |
YAHOO.namespace('foo').createPaginator = function (cfg) { | |
return new YAHOO.widget.Paginator( | |
// Merge configuration from cfg into some defaults | |
YAHOO.lang.merge({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Takes a native JavaScript Number and formats to string for display to user. | |
* | |
* @method format | |
* @param nData {Number} Number. | |
* @param oConfig {Object} (Optional) Optional configuration values: | |
* <dl> | |
* <dt>prefix {String}</dd> | |
* <dd>String prepended before each number, like a currency designator "$"</dd> | |
* <dt>decimalPlaces {Number}</dd> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YAHOO.widget.Slider.prototype.setStartSliderState = function() { | |
this.logger.log("Fixing state"); | |
this.setThumbCenterPoint(); | |
this.baselinePos = getXY(this.getEl()); | |
this.thumb.startOffset = this.thumb.getOffsetFromParent(this.baselinePos); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Declare the DS config during construction. Also leverage the inline override | |
// support to replace the DS native setInterval implementation with a custom function | |
// that takes a function ref to generate the url sent | |
var ds = new YAHOO.util.DataSource(url, { | |
responseType : YAHOO.util.DataSource.TYPE_JSON, | |
responseSchema : { | |
resultsList : 'Results', | |
fields : [ 'foo','bar','baz' ], | |
}, | |
setInterval : unction(ms, reqBuilder, callback) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatNumber(n) { | |
if (!isFinite(n)) { | |
return n; | |
} | |
var s = ""+n, abs = Math.abs(n), _, i; | |
if (abs >= 1000) { | |
_ = (""+abs).split(/\./); | |
i = _[0].length % 3 || 3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Converts the content inside <script src="script2style.js">YOUR CSS</script> | |
// into a style block that will only be applied if js is turned on | |
(function () { | |
var d = document, | |
scripts = d.getElementsByTagName('script'), | |
me = scripts[scripts.length - 1], | |
head = d.getElementsByTagName('head')[0], | |
content = me.innerHTML.replace(/@import\((.*?)\);?/m,function (m,href) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adds n weekdays to Date d. Weekdays are Mon-Fri. Holidays are not accounted for. | |
// Adding 0 days to a weekend day will return Monday's Date. | |
function addWeekdays(d,n) { | |
d = new Date(d.getTime()); | |
var day = d.getDay(); | |
d.setDate( | |
d.getDate() + n + | |
(day === 6 ? 2 : +!day) + |
OlderNewer