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 | |
/** | |
* Magento | |
* | |
* NOTICE OF LICENSE | |
* | |
* This source file is subject to the Open Software License (OSL 3.0) | |
* that is bundled with this package in the file LICENSE.txt. | |
* It is also available through the world-wide-web at this URL: | |
* http://opensource.org/licenses/osl-3.0.php |
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 ModelWithNesting = Backbone.Model.extend({ | |
/* | |
* Backbone.Model.set() override that sniffs out child Backbone Models and bubbles up events. | |
* Accepts the same parameters as Backbone.Model.set(). | |
*/ | |
set: function (key, val, options) { | |
var self = this, | |
attrs; | |
if (key == null) return this; |
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
ContactManager.module("ContactsApp.Show", function(Show, ContactManager, Backbone, Marionette, $, _){ | |
var localCh = require('mymodule/mymodule.channel'); | |
Show.Controller = Marionette.Controller.extend({ | |
initialize: { | |
_.bindAll(this, 'contactEdited'); | |
this.listenTo(localCh, "contact:edit", this.contactEdited); | |
}, | |
contactEdited: function (contact) { |
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
/* | |
* So, your json from here http://screencast.com/t/zv8sQGVk6 is organized like this: | |
* array (roles) -> model (role) -> array (permissions) -> model (permission). Collections | |
* already handle array -> model by design. What you need to add is a model that contains a | |
* collection; in other words, the role model should contain a permission collection. | |
* That's what this file is :) | |
*/ | |
var RoleModel = Backbone.Model.extend({ | |
// See http://backbonejs.org/#Model-parse |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require "rbconfig" | |
HOST_NAME = "prerender" | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.require_version ">= 1.5" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
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
define(function (require) { | |
var Backbone = require('backbone'); | |
var Marionette = require('marionette'); | |
var eventedClasses = [ | |
Backbone.Model, | |
Backbone.Collection, | |
Marionette.Controller, | |
Marionette.Object, | |
Marionette.Region, |
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
define(function (require) { | |
var sinon = require('sinon'); | |
var database = require('test/data/database'); | |
var server = sinon.fakeServer.create(); | |
var CONTENT_JSON = { 'Content-Type': 'application/json' }; | |
var lastAppId = 0; | |
server.autoRespond = true; | |
server.autoRespondAfter = 100; |
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
define(function (require) { | |
var Mixin = require('lib/classes/mixin'); | |
var Radio = require('backbone.radio'); | |
var logger = require('lib/util/logger'); | |
var HasChannel = Mixin.extend({ | |
// Declarative option for channel name | |
// channelName: nameOfChannel |
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
Show hidden characters
// Derived from AirBnB + LinkedIn Idiomatic + Crockford | |
// https://github.com/airbnb/javascript | |
// https://github.com/linkedin/idiomatic.js (Idiomatic fork with Crockford inner spacing) | |
// http://javascript.crockford.com/code.html | |
{ | |
// Keywords | |
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], | |
"disallowKeywords": ["with", "eval"], | |
// Functions |
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
<section class="listing" data-view="listings/index" data-model_id="687210" data-model_name="listing"> | |
<div class="slideshow"> ... </div> | |
<section class="details tab_panel" data-view="listings/details" data-model_id="687210" data-model_name="listing"> | |
<ul> ... </ul> | |
</section> | |
<section class="user" data-view="listings/user" data-model_id="2088962" data-model_name="user" data-lazy="true"> ... </section> | |
</section> |
OlderNewer