Code Monkey home page Code Monkey logo

backboneboilerplate's Introduction

Backbone boilerplate

http://backboneboilerplate.com is a community driven effort to help developers learn and rapidly deploy single page web applications.

Philosophy

Coming soon

Other resources

http://backbonetutorials.com - As single page apps and large scale javascript applications become more prominent on the web, useful resources for those developers who are jumping the ship are crucial.

About the author

Contact:

Projects:

Love you mum! Clicky

backboneboilerplate's People

Contributors

appleboy avatar brettz9 avatar okor avatar rememberlenny avatar thomasdavis avatar timoxley avatar traviskaufman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backboneboilerplate's Issues

Prevent zombie view in router.js

Hi,

Thanks for creating the boilerplate, I really like it. This is just minor suggestion to prevent zombie view in the file router.js

Currently we always create a new view when user navigate to different url, and never close or reuse them properly.

E.g:
optimize: function () {
require(['views/optimize/page'], function (OptimizePage) {
var optimizePage = new OptimizePage();
optimizePage.render();
});
},

I think a better approach is to check whether the page is already been initialized, then we can reuse it efficiently without creating new page every time. For e.g:

if (! this.optimizePage) {
this.optimizePage = new OptimizePage()
}
this.optimizePage.render()

View Transitions

Hello, I'm experimenting with this project, and trying to figure out how to implement page transitions.
I've seen several implementations some clean some less clean but i really can't find one that fits.

Can you point me to a compatible solution?

Thank you!

menu links '.active'

really enjoying trawling through your code... i'm giving myself a crash course in backbone/require etc and this is really helping, so thanks heaps for that...

just one small thing.. maybe it's just be not implemented because of time constraints... but when you use backbone's history and press forward and back, shouldn't the menu item 'active' class follow along? that bit just doesn't seem very mvc-ish to me ... i think that small feature would be a really good way to demo how you can decouple that sort of functionality from the ui.. i had a go at fixing it for you, but i'm still haven't got my head completely around the code so i thought best to leave it :)

thanks again! k

http devlopment server

So the project contains a simple node.js dev server setup using express,

should we use another http client that is lighter weight or is express's popularity more convenient

Bootstrap?

I believe Bootstrap is now a boilerplate framework. Time to add? If you agree I'll add and submit a pull request.

Can I use jQuery Mobile?

Hi,
Thanks for this great project it really got me on wheels now I started learning backbone. I was trying to use jquery mobile within it and I was able to navigate pages and else, but page are not enhanced and also is rendered as inactive page (hidden) the same way a multi page does, one is shown and the others are hidden.

Is there any idea on how to integrate JQM into the structure of the boilerplate. Right now I can partially enhance the page triggering the "create" event when rendering the view but don't think it is the proper way. In any case I would like to keep the current structure of having the composite view and not rendering the entire page in a single view object.

Thanks again for the project and best regards
David

Globals for jQuery, Backbone, and _.

Great boilerplate, thank you.

Although it appears the major libs (jquery, underscore, backbone) are using the AMD wrapped versions, yet they're still defined as globals.
window.jQuery, window.Backbone, and window._ are available on both the unbuilt and built versions of the boilerplate.

Is this intended? If not, it'd be splendid if they were not globals and only defined as AMD modules.

Broken

index.html shows blank in safari 6.0.4 under Mac Os X 10.8.3

Site Disabled

Oh no! It looks like this Pages site has been disabled due to a misconfigured custom domain.

events.js usage

Quick question (sorry about raising an issue) - what is the events.js used for in the backbone boilerplate? Is this where we can create modular events, which we can re-use elsewhere in the app?

If so, how can we use it?

Does not work with newest version of backbone.js(0.9.2)

Tried to add newest require.js and add shim, then it loaded but seems like no routing/events etc works.(Will look into it, later)
require.config({
'paths': {
"underscore": "libs/underscore-min",
"backbone": "libs/backbone-min"
},
'shim':
{
backbone: {
'deps': ['jquery', 'underscore'],
'exports': 'Backbone'
}
}
});

Small Request...

Hello, thanks for the boilerplate. Its come in very handy.

Is there any chance of getting the build.sh shell script converted to a cmd equivalent. I can use it on my mac no problem of course, but when I work on a pc, having to install something like cygwin to run the shell script is a bit of a pain.

Cheers...

problem with $.ajax call when overriding Backbone.sync in offline mode

I want to have my own way to use $.ajax in sync method. Everything goes right if i don't use manifest file to cache my app for offline use. But when i apply cache the $.ajax call failed. I tried to place the ajax call in other mudule then i worked ok.
Here's my code:
Backbone.sync = function (method, model, options) {
var resp;
var store = model.localStorage || model.collection.localStorage;

    switch (method) {
        //case "read":    resp = model.id ? store.find(model) : store.findAll(); break;      
        case "read": 
         $.ajax({ 
         cache:false,
         url: model.url, 
         type: 'GET',
         contentType: 'application/json;',
         dataType: 'json', 
         success: function (data) { alert('ok'); },
         error: function(){alert('failed');}
         }); 

        break;
        case "create": resp = store.create(model); break;
        case "update": resp = store.update(model); break;
        case "delete": resp = store.destroy(model); break;
    }
};

This code is place in localstorage.js file of the Todos example.
Please help,

how to router.navigate ?

Hi,

first of all, thanks for your boilerplate !

Maybe I’m thinking wrong, but I haven’t found the way yet to do a proper Backbone.Router.navigate(), since the router object is wrapped in a requirejs module.

My case is to redirect programmatically from a view to another. I could do it with window.location, but it doesn’t sound very smart…

Thanks for any help !

regards.

vm.js logic?

Hello,
Thnx for the great boilerplate. I am trying to understand the logic in vm.js. Specifically the cleanup procedure. It seems that it checks if the view is not undefined then does a cleanup. But that way, you clean the same view you create later. You have to clean/unbind events etc the view the user was before and then create the new view.

Is it correct or am I missing something?

Thanks :)

I can't upgrade underscore & backbone

When I replace the current libs with latest versions of underscore and backbone, event.js fails.
_ and Backbone appear to be null in the callback funcion.
any sugestions?

http devlopment server

So the project contains a simple node.js dev server setup using express,

should we use another http client that is lighter weight or is express's popularity more convenient

Upload not minified backbone and jquery.

I really want to know how you managed to get backbone and jquery working as a module.
So far, I've only found how to do it including JQuery in the same file as Require.js.

Thanks.

layout page not loading before routes

Firstly, great work on this boilerplate! I've been following your backbonetutorials.com tutorials, and combined with this, has really helped in understanding backbone.js (this is the 3rd time i've tried to learn it).

Just wondering where the best place to include a login check would be? Would it be in the main.js file, or inside the app.js? The code for that isn't the issue, as its fairly straightforward, however, the way i've done it seems to be cause issues.

In app.js, code checks for previous user login (using API call). If logged in, render the app template (layout.html), otherwise render the login template. This is working fine, however, if a route is set (say /dashboard) on page load, the the app template will be too slow to load, and the dashboard template cannot attach itself to the DOM node in layout.html (doesn't exist yet). This is especally evident as sometimes it'll be fine, but others it will not appear.

So, it's ovbiously the extra API call that is causing the main layout to be too slow. Is there a way we can activate the routes only when the layout.html file is loaded and ready?

Happy to push some code up if that would help!

mac osx - build.sh fails

the build.sh script fails on mac os x due to the -i flag needing a mandatory extension argument. Here's the fix:

sed -i "" 's/js/l......

cheers. awesome work.

Using Lo-Dash v1.0.0

Just wanted to give you a heads up that as Lo-Dash moves to its v1.0.0 (currently at v1.0.0-rc.3) you will want to use the prebuilt Underscore compat bulds (lodash.underscore.js and lodash.underscore.min.js) because Lo-Dash is implementing intuitive chaining via _(…) which is a breaking compat change with the current Underscore implementation. Another difference in Lo-Dash v0.10.0+ is its _.extend and _.defaults follow the ES6 spec'ed Object.assign and iterate only own properties of given source objects.

Minor layout bug

Remove br's from page.html and add a class .pages with a padding top of 40px, the headings will now be visible.

Snap 2013-04-05 at 11 04 31 372x179

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.