This file contains 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 callbackSliceArgs(callback, howMany) { | |
return function() { | |
var args = _.toArray(arguments); | |
args.splice(howMany, args.length); | |
return callback.apply(null, args); | |
}; | |
} |
This file contains 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 call(method) { | |
var args = Array.prototype.slice.call(arguments); | |
var callback = args.pop(); | |
args = args.slice(1); | |
var error; | |
var result; | |
try { | |
result = method.apply(null, args); | |
} catch (e) { | |
error = e; |
This file contains 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
{ | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"color_scheme": "Packages/User/moiz-theme/Moiz Black.tmTheme", | |
"fade_fold_buttons": false, | |
"flatland_sidebar_tree_xsmall": true, | |
"flatland_square_tabs": true, | |
"folder_exclude_patterns": | |
[ | |
".svn", |
This file contains 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
/* | |
* credit of `getMatchedStyle` method for stakoverflow's Qtax | |
* http://stackoverflow.com/questions/9730612/get-element-css-property-width-height-value-as-it-was-set-in-percent-em-px-et/9733051#9733051 | |
*/ | |
function getMatchedStyle(elem, property) { | |
// element property has highest priority | |
var val = elem.style.getPropertyValue(property); | |
// if it's important, we are done | |
if (elem.style.getPropertyPriority(property)) |
This file contains 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 itemrendererOptions = { | |
labelFunction: function (data, options) { | |
return "$ " + data.price; | |
}, | |
dataProvider: [ | |
{ | |
name: "lorem", | |
price: 123.34 | |
}, | |
{ |
This file contains 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 itemrendererOptions = { | |
labelField: "name", | |
labelFunction: function (data, options) { | |
return data[options.labelField] + " is $ " + data.price; | |
}, | |
dataProvider: [ | |
{ | |
name: "lorem", | |
price: 123.34 | |
}, |
This file contains 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 itemrendererOptions = { | |
labelField: "name", | |
rendererFunction: function (container, listData) { | |
if(listData.data.price > 100) { | |
container.css("color","red"); | |
} | |
container.html(listData.label); | |
}, | |
dataProvider: [ | |
{ |
This file contains 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
$.widget("ir.itemrenderer", { | |
options: { | |
/** type string, name of widget to use as renderer */ | |
itemRenderer:null, | |
/** type function, function that will be executed on each iteration*/ | |
rendererFunction:null, | |
/** type function, function to process the label that will be used */ | |
labelFunction:null, | |
/** type string, name of the field to use as the label */ | |
labelField:null, |
This file contains 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 () { | |
var itemrendererOptions = { | |
dataProvider: ["lorem", "lipsum", "dolor", "sit"] | |
}; | |
$("#itemrenderer").itemrenderer(itemrendererOptions); | |
}); |
This file contains 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 () { | |
var itemrendererOptions = { | |
dataProvider: [ | |
{ | |
label: "lorem" | |
}, | |
{ | |
label: "lipsum" | |
}, | |
{ |
OlderNewer