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
/*! | |
* jQuery TextChange Plugin | |
* http://www.zurb.com/playground/jquery-text-change-custom-event | |
* | |
* Copyright 2010, ZURB | |
* Released under the MIT License | |
*/ | |
(function ($) { | |
$.event.special.textchange = { |
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
<?php | |
// from my ApiComponent | |
/** | |
* Flatten Model find data | |
* | |
* Will flatten data from a find or find multi response by moving the specified | |
* className up to the root of the array. Useful for converting find results to | |
* REST responses. | |
* |
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
{{#view Luh.Ui.TabMainView currentView="pane1"}} | |
{{#view Luh.Ui.TabPaneView id="pane1" class="content" viewName="pane1"}} | |
{{/view}} | |
{{#view Luh.Ui.TabPaneView id="pane2" class="content" viewName="pane2"}} | |
{{/view}} |
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
{{#view Luh.Ui.TabMainView currentView="pane1"}} | |
{{#view Luh.Ui.TabPaneView id="pane1" class="content" viewName="pane1"}} | |
{{/view}} | |
{{#view Luh.Ui.TabPaneView id="pane2" class="content" viewName="pane2"}} | |
{{/view}} |
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
/* | |
* Loads a handlebars.js template at a given URL. Takes an optional name, in which case, | |
* the template is added and is reference-able via templateName. | |
*/ | |
function loadTemplate(url, name, callback) { | |
var contents = $.get(url, function(templateText) { | |
var compiledTemplate = Ember.Handlebars.compile(templateText); | |
if (name) { | |
Ember.TEMPLATES[name] = compiledTemplate | |
} else { |
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
jQuery.get('/templates/foo.handlebars', function(data) { | |
var template = SC.Handlebars.compile(data); | |
SC.TEMPLATES['foo'] = template; | |
}) |
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
// A mixin for `Em.ContainerView` that allows an initial render from | |
// a template, followed by further additions by mutating childViews. | |
// Note that the template should *only* contain calls to | |
// `{{childView}}` | |
App.Mixins.TemplateContainerView = Em.Mixin.create({ | |
render: function() { | |
if (!this.get('_renderedFromTemplate')) { | |
Em.View.prototype.render.apply(this, arguments); | |
this.set('_renderedFromTemplate', true); |
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
App.collectionController = Em.ArrayProxy.create(Ember.PaginationSupport, { | |
content: [], | |
fullContent: App.store.findAll(App.Job), | |
totalBinding: 'fullContent.length', | |
didRequestRange: function(rangeStart, rangeStop) { | |
var content = this.get('fullContent').slice(rangeStart, rangeStop); | |
this.replace(0, this.get('length'), content); | |
} | |
}); |
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
Ember.HandlebarsTransformView = Ember.View.extend(Ember.Metamorph, { | |
rawValue: null, | |
transformFunc: null, | |
value: function(){ | |
var rawValue = this.get('rawValue'), | |
transformFunc = this.get('transformFunc'); | |
return transformFunc(rawValue); | |
}.property('rawValue', 'transformFunc').cacheable(), |
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
AnimatableView = Ember.ContainerView.extend(Em.Animatable,{ | |
executeAnimation: function() { | |
....... | |
this.animate({duration: that.duration, stopEventHandling:true}, function() { | |
# perform animations based on your JS choices | |
move('#'+id) | |
.x(translatePosition) |
OlderNewer