Tagged Questions
4
votes
1answer
20 views
backbone.js boilerplate
I am currently experimenting with a backbone boilerplate application and would really appreciate some feedback or thoughts on its structure.
I come from a PHP background so am used to frameworks ...
0
votes
0answers
10 views
Porting a custom module to Backbone? [closed]
Below is a custom module which provides a framework for making ajax calls. How can I move this to Backbone?
It is very simple, if a user is found to exist ( determined by checking the local storage ...
7
votes
1answer
146 views
MV* Pattern for a board game
I have made a small game in Javascript, while simultaneously learn about the ever so popular model view controller. The game is this, there are 3 players(green, purple, yellow) and they have to try ...
0
votes
2answers
58 views
Updating single view on change of a model in backbone
The setup of Backbone:
1 Collection,
3 Models,
1 View for the collection,
1 View per Model.
HTML:
<div id="showit"></div>
Template:
...
6
votes
1answer
56 views
Maintaining information about people
I would like advice if this is a good implementation of an application for maintaining information about people (first name, last name, and age).
The index.html contains an empty div and 2 templates ...
2
votes
1answer
46 views
Overriding Backbone.Collection.add to enforce uniqueness on non-id property
I've overridden Backbone.Collection.add for my Collection to ensure that the Collection never has two PlaylistItems who share a Song ID. My implementation seems incredibly verbose and I was curious if ...
10
votes
1answer
72 views
Directory Searcher
This is about my first backbone.js application. It is a small directory that fetches data and presents it in a search-like UI.
Here is a working (minified) example.
Here is the file that handles ...
2
votes
1answer
33 views
Proper techniques for allowing many views to subscribe to window.unload?
I would like to execute code for many views whenever the window is unloaded.
For instance, I could have something like this in a view's initialize:
...
3
votes
2answers
938 views
Simple registration form with Backbone
I am trying to create simple registration form with Backbone. I need to validate fields on blur, and whole form on submit.
HTML:
...
1
vote
1answer
28 views
Is it bad practice to mix in chrome.i18n (internationalization method) into templates?
I'm mixing chrome.i18n into my templates as templateHelpers with Backbone.Marionette.
...
5
votes
1answer
90 views
5
votes
1answer
555 views
Avoiding RequireJS circular dependencies
My app module bootstraps a Backbone.js application.
I need app to be available in every other view for easy access to router, ...
6
votes
1answer
38 views
Managing article information
I want you to give me some tips on what I could have done better and is considered "bad practice". The code works, but I think there are better ways to do stuff, so please let me know.
...
2
votes
1answer
47 views
Backbone.Collection - Ensure that at most one model has property set to true
I have a Backbone.Collection which has some models in it. Each model has a boolean property called 'special.' Only one model should be special at any given time.
I've got the following to enforce ...
1
vote
0answers
45 views
Paginated Backbone.Collection subclass
This is a subclass of Backbone.Collection with a method fetchNextPage that returns a Q promise.
To find out the next page's ...
1
vote
0answers
219 views
Backbone Epoxy js and hierarchies/trees
Can you review my code of hierarchies/trees on Epoxy.js. Maybe there's a better way to solve this problem?
From the beginning:
Item View:
this is to display the element li
...
2
votes
1answer
139 views
Need review and best practice tips for a Backbone project
I made a simple app that fetches the favourite programming language of a Github user, by simply inserting their username. The full code is uploaded on Github, please feel free to fork it from ...
4
votes
1answer
115 views
First ever unit test. Am I headed in the right direction?
I'm learning backbone.js in parallel with unit testing. I've just made a simple model and wanted to unit test it. Do I have the right idea? I am simply making a model with some default values.
...
2
votes
1answer
75 views
Backbone subviews with non-uniform layout
I have a “featured projects” view that requires its subviews conform to a non-uniform grid: one narrow column with 3 items, then one wide column with 2 items, followed by another narrow column with 3 ...
1
vote
1answer
283 views
Rendering a large collection using BackboneJS and LoDash — is this an appropriate way to achieve this?
I have a Playlist object which contains many PlaylistItem children. If I have 10,000 children then the UI gets blocked from rendering until all 10,000 children have been processed.
To avoid this, ...
-1
votes
1answer
227 views
How to improve or refactor Backbone CoffeeScript code?
how can I improve the following code mainly regarding the router, when to initialize the and fetch the collection and how I can filter the models?=
Thank you
...
0
votes
1answer
213 views
Backbone Router - Any major problems with the code below?
I just started learning Backbone (about a couple of days back).
I am thinking of writing some online notes/book. Amongst other things, I want
to use Backbone to show different sections within a ...
3
votes
1answer
93 views
How to refactor this series of JavaScript promises?
This is part of a class for paginating a Backbone collection.
The paginateTo method is for paginating to a model id. It returns the model if it's already in the ...
3
votes
1answer
237 views
Basic Backbone application using d3
I've started my first application using backbone and have something basic up and running, backbone seems to give a lot of freedom to application design and I don't know what I'm doing right and wrong ...
12
votes
1answer
218 views
Rendering HTML through template using dynamic CSS?
I'm creating an unordered-list element in Backbone via underscore templating.
I've got the following:
...
1
vote
1answer
68 views
1
vote
1answer
94 views
Refactoring Backbone DRY
I have inside a Backbone model validate function several if statements:
...
1
vote
3answers
381 views
Marionette.js Mediator ('global' commands vs app controller)
I am currently migrating a large backbone application over to Marionette and am curious as to the opinions on what is a better design for mediating activity between modules.
I have an Application ...
2
votes
1answer
472 views
A generic context menu with generically bound events
I've taken a stab at making a context menu using BackboneJS. Here's the overall structure:
Collections:
/collection/contextMenuGroups
/collection/contextMenuItems
Models:
...
1
vote
1answer
229 views
Layout manager: decouple DOM insertion from construction and rendering? [closed]
I'm refactoring a responsive report builder in JavaScript. Here's what it looks like:
This started as a small set of objects that transformed data, rendered the graphs with D3.js, and managed the ...
2
votes
1answer
244 views
Is my Backbone.View organized properly and stylistically correct?
I'm learning BackboneJS and I just made an attempt at converting a pre-existing module to a Backbone.View. I was hoping to get some feedback on my attempt and learn. I've been using the annotated ToDo ...
2
votes
1answer
56 views
Backbone Marionette code improvement 2
How could this code be improved and have fewer repeated lines?
...
0
votes
1answer
99 views
Backbone Marionette code improvement
I have this repetitive block of code and I'm looking for ways to make it reusable and as flat as possible.
Here it is:
...
2
votes
1answer
122 views
Can I use jQuery's .when() to make this code DRY?
I'm trying to run a bit of code when my loginManager is logged in. It might be already, or I might be waiting:
...
4
votes
1answer
85 views
Javascript plugin DRY
I have written a Backbone View (javascript) for a component called "twist-panel".
A twist panel is basically a card flip, it has a front and back side, and can flip to the back and to the front.
...
4
votes
1answer
1k views
Backbone.js Dependency Injection API Design
I'm writing a dependency injection plugin for the Backbone javascript framework, and I'm not sure what the API for constructor argument injection should look like.
Just for reference, Backbone ...
4
votes
1answer
363 views
User model with BackboneJS and RequireJS with test cases in Jasmine
I've been taking a stab at implementing test cases using the Jasmine testing framework. To do so, I've made an application which has a User object. This User object is created by the server, but its ...
6
votes
0answers
2k views
Discussing jQuery Mobile and Backbone.js integration with a simple FAQ App [closed]
Discussing jQuery Mobile and Backbone.js integration with a simple FAQ App
This project is hosted on github here: faq-app-client-mobile-comparison
I can't post more than 2 hyperlinks (my reputation ...
2
votes
1answer
194 views
First attempt incorporating backbone.js in my code
I have a feeling I might be doing it wrong, what major things would you improve in this code?
The code is basically handling a tour on first login, showing it only for first login users (activated ...
4
votes
2answers
233 views
Need feedback of my forray into backbone
I've written a short piece of code to get myself familiar with backbone.js. I'm filtering 100 results from the Twitter API. Once those are in, I use a time picker and a hash tag selector to filter my ...
1
vote
1answer
1k views
Backbone.js App approach not very scalable - nested views
I'm creating a Backbone App, and although everything seems to work i'm afraid i might need to refactor very soon if I keep adding functionalities and views with this approach. I'm using Parse in the ...
2
votes
1answer
3k views
How to parse a collection of objects in Backbone?
In my Backbone.Collection I need to parse the response before to render it in Backbone.View. The following code works, but it will be great to have some suggestions:
...
0
votes
1answer
2k views
backbone and google maps with markers [closed]
I am fairly new to backbone and javascript, so I am not sure if I am on the right path...
Basically I have an API that returns posts that have coordinates associated with them. I want, for now, to ...
2
votes
1answer
1k views
Backbone.js: Will this code get cleaned up by the garbage collector
I have been working on a Backbone.js application, and I am starting to think I am making a huge mistake.
I never fully understand garbage collecting, and how exactly some closures prevent it. I just ...
5
votes
2answers
1k views
Simple registration form
I'm very new to backbone.js and JavaScript. I would like to hear some reasonable critiques / advice against my JavaScript code based on backbone.js framework with backbone-forms.
The aim of this ...