Skip to content

Instantly share code, notes, and snippets.

View sumitngupta's full-sized avatar

Sumit Gupta sumitngupta

View GitHub Profile
/*jslint white: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, indent: 2, browser: true, sloppy: true */
/*global $, JST, Backbone, Pipeline, window */
Pipeline.Views.PaginatedView = Backbone.View.extend({
tagName: 'tr',
className: 'pagination',
initialize: function () {
_.bindAll(this, 'previous', 'next', 'render');
this.collection.bind('refresh', this.render);
index: function() {
var brands = window.Pipeline.collections.brands;
brands.fetch({
success: function () {
var brandsView = new window.Pipeline.Views.Brands({ collection: window.Pipeline.collections.brands });
$('#panel-container').empty().append(brandsView.render().el);
},
error: function () {
displayNotification('Error fetching Brands.', 'error');
<div class="tabs">
<% tabs.each(function (tab) { %>
<div class="tab">
<%= tab.name %>
</div>
<% }) %>
<% tabs.each(function (tab) { %>
<div class="tab-container <% tab.active ? 'active' : '' %>">
<%= tab.content %>
Sep 10, 2011 2:17:51 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/solr path=/admin/file/ params={file=schema.xml} status=0 QTime=0
Sep 10, 2011 8:23:03 AM org.apache.solr.common.SolrException log
SEVERE: java.lang.NoSuchFieldError: rsp
at nl.jteam.search.spatial.GeoDistanceComponent.process(GeoDistanceComponent.java:62)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:195)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:338)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:241)
Pipeline.Views.Watchlists = Backbone.View.extend({
el: '#watchlists-container',
initialize: function () {
_.bindAll(this, 'render');
this.collection.bind('add', this.addToList);
},
collection = new MyCollection();
collection.reset(this.get('attributesOfCollection'));
this.setCollection(collection);
setCollection: function (collection) {
this.collection = collection;
},
ThresholdBackbone.Routers.Projects = Backbone.Router.extend({
routes: {
'' : 'index',
':id' : 'show'
},
index: function() {
console.log("Index View!");
},
var Projects = Backbone.Collection.extend({
model : Project,
url : '/projects'
});
var Project = Backbone.Model.extend({
urlRoot : '/projects/:id'
});
# these routes are going to enable:
initialize : function () {
products = new Pipeline.Collections.CampaignProducts();
products.reset(this.get('products'));
this.setProducts(products);
},
setProducts: function (products) {
this.products = products;
},
// Patch Model and Collection.
_.each(["Model", "Collection"], function(name) {
// Cache Backbone constructor.
var ctor = Backbone[name];
// Cache original fetch.
var fetch = ctor.prototype.fetch;
// Override the fetch method to emit a fetch event.
ctor.prototype.fetch = function() {
// Trigger the fetch event on the instance.