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
package { | |
// imports ... | |
public class AppConfig implements IConfig | |
{ | |
[Inject] | |
public var context:IContext; | |
[Inject] | |
public var commandMap:ISignalCommandMap; |
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
// Example: this.$stage.doubleTab.on(this.$stage, this.onContainerClicked, 200, "touchstart", this.options.delegatedTagSel); | |
// this.$stage.doubleTab.off(this.$stage, "touchstart"); | |
$.fn.doubleTab = (function() { | |
var timer, data, eventType = "touchend"; | |
var timeout = 600; | |
var $itemClicked = null; | |
var onDoubleClickSTART = function(e) { | |
data = e.data; | |
data.$container.off(data.eventType, onDoubleClickSTART); |
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
//bindAll from underscore that allows 1 argument to bind all the functions from the prototype, | |
//or if there are more arguments they will be the only binded | |
_.originalBindAll = _.bindAll; | |
_.bindAll = function (that) { | |
var funcs = Array.prototype.slice.call(arguments, 1), | |
validKeys = [], fn; | |
if (funcs.length == 0) { | |
for (var i in that) { | |
fn = that[i]; | |
if (fn && typeof fn == "function" && (!fn.prototype || _.keys(fn.prototype).length == 0)) |
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 BackboneView = Backbone.View; | |
Backbone.View = BackboneView.extend({ | |
constructor: function (options) { | |
this._configure(options || {}); | |
BackboneView.prototype.constructor.apply(this, arguments); | |
}, | |
_configure: function (options) { | |
if (this.options) options = _.extend({}, _.result(this, 'options'), options); | |
//_.extend(this, _.pick(options, viewOptions)); | |
this.options = options; |
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 listData = ["LABEL C", "LABEL D", "LABEL E"]; | |
listData = listData.concat( | |
_.map(this.model.toJSON(), function (item) { | |
return [item.PropertyName, parseFloat(item.PropertyC), parseFloat(item.PropertyD), parseFloat(item.PropertyE)]; | |
}, this) | |
); | |
data = google.visualization.arrayToDataTable(listData); | |
// Create and draw the visualization. |
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
<div class="selectContainerWithBtn"> | |
<select> | |
<option value="1">Option 1</option> | |
<option value="2">Option 2</option> | |
<option value="3">Option 3</option> | |
<option value="4">Option 4</option> | |
</select> | |
</div> |
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
loadedScript = {}; | |
loadingScript = {}; | |
pendingScriptSuccess = {}; | |
function loadScript (url, success, async) { | |
if(loadedScript[url]) { | |
success(); | |
return; | |
} |
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
# The better is to use the next: https://github.com/jquery/jquery-mousewheel | |
$('body').on('mousewheel', onMouseWheel); | |
onMouseWheel = (e) -> | |
scrollDistance = e.deltaY * e.deltaFactor | |
wHeight = $(window).innerHeight() | |
newScrollTop = scrollDistance * -1 + $('body').scrollTop() | |
#Example of use, automatic scrolldown when the next slide is in the middle it scrolls down automatically | |
clearTimeout(window._scrollTimer) |
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
@import 'nib' | |
background-before-layer(opacity, startPoint, startColor, startInterval, endColor, endInterval) | |
content " " | |
background-linear-gradient(startPoint, startColor, startInterval, endColor, endInterval) | |
position absolute | |
width 100% | |
height 100% | |
if opacity |
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
$.fn.pointerEvent = (function () { | |
var $el = $(this), | |
_eventData = "", | |
_touchEventName, | |
_bindEvent = function (nameListener, mouseEvent, data, callback) { | |
if ($el.length === 0) | |
return; | |
_touchEventName = _getTouchEventName(mouseEvent); | |
if (_.isFunction(data)) { | |
callback = data; |
OlderNewer