Skip to content

Instantly share code, notes, and snippets.

View guilhermeaiolfi's full-sized avatar

Guilherme Aiolfi guilhermeaiolfi

View GitHub Profile
@guilhermeaiolfi
guilhermeaiolfi / gist:791e3c07725761638d3c
Last active April 3, 2016 17:58
SystemJS loader plugin for ractive components
var Ractive = require("ractive");
var rcu = require("rcu");
var toSource = require("tosource");
rcu.init(Ractive);
createComponent = function(definition) {
console.log(definition);
var components_output = [];
components_output.push('var components = {};');
(function(exports) {
window.DS = Ember.Namespace.create({
CURRENT_API_REVISION: 1
});
})({});
(function(exports) {
DS.Adapter = Ember.Object.extend({
@guilhermeaiolfi
guilhermeaiolfi / SelectView.js
Created February 3, 2012 15:04
SelectView.js
UI.SelectView = Em.ContainerView.extend({
childViews: ['display', 'button', 'popup'],
viewName: 'selectView',
classNames: ["ember-selectview"],
attributeBindings: ['tabindex', 'unselectable'],
unselectable: 'on',
tabindex: 0,
label: function()
{
@guilhermeaiolfi
guilhermeaiolfi / UI.ListView.js
Created January 17, 2012 14:59
ListView widget for ember.js
var get = Ember.get, set = Ember.set;
UI = {};
UI.ListView = Em.CollectionView.extend({
tagName: "ul",
viewName: 'ListViewContainer',
classNames: ["ember-listview"],
attributeBindings: ['tabindex', 'unselectable'],
unselectable: 'on',
tabindex: 0,
mode: 'single',
// It uses the awesome code from https://github.com/digitalBush/jquery.maskedinput/blob/master/src/jquery.maskedinput.js
App.MaskedInput = Ember.TextField.extend({
isIphone: function () { return (window.orientation != undefined) },
// browsers like firefox2 and before and opera doenst have the onPaste event, but the paste feature can be done with the onInput event.
pasteEvent: function (){
return (jQuery.browser.opera || (jQuery.browser.mozilla && parseFloat(jQuery.browser.version.substr(0,3)) < 1.9 ))? 'input': 'paste';
}.property().cacheable(),
// these keys will be ignored by the mask.
<a:model id="sample">
<data>
<name>I'm ok</name>
<child>
<name>where am I?</name>
</child>
</data>
</a:model>
<a:bar skin="basic" model="sample">
@guilhermeaiolfi
guilhermeaiolfi / app.js
Created July 15, 2011 18:02
sproutcore20 simple question
// mouseLeave is not called when moving the mouse cursor between task. How to do it?
// I would expect it to fire a mouseleave event when going to another task and fire
// a mouseenter in that recently entered task element. That's not what is happening.
(...)
Todos.todosList = SC.CollectionView.extend({
contentBinding: "Todos.todosController",
mouseEnter : function(e)
qx.Class.define("playground.ArrayStore",
{
extend : qx.core.Object,
/**
* @param delegate {Object?} The delegate containing one of the methods
* specified in {@link qx.data.store.IStoreDelegate}.
*/
construct : function(delegate)
qx.Class.define("playground.Application",
{
extend : qx.application.Standalone,
include: [playground.MBuilder],
/*
*****************************************************************************
MEMBERS
*****************************************************************************
*/
qx.Class.define("playground.Form",
{
extend : qx.ui.container.Composite,
include: [playground.MBuilder],
implement : [playground.IForm],
construct : function()
{
this.base(arguments);