mixdown / router

Router plugin for mixdown
1 stars 8 forks source link

Add option to turn off hashbangs and pushstate completely #24

Open panthershark opened 10 years ago

panthershark commented 10 years ago

In older browsers, there are 2 options for navigate

  1. use hashbangs
  2. replace location.href with the navigate url

Sometimes you just want #2 b/c it is simple. This ticket is to track allowing that.

AllSpeeds commented 10 years ago

Passing in a path is another option that @cappslock asked for as well. Passing in an options hash would be cool.

panthershark commented 10 years ago

I am messing with using html5-history-api polyfill to support the hashbangs. This fixes some of the self.root issues that exist outside of that Vast project we were working on.

https://github.com/devote/HTML5-History-API

AllSpeeds commented 10 years ago

@tommydudebreaux, that sounds fantastic.

panthershark commented 10 years ago

This is checked in and working in my projects. Before calling listen() on the router, load the history poly.

Here is the gist using Modernizr or yepnope. Any script loading solution will work.

(Modernizr || yepnope).load([
  {
    test : Modernizr.history,
    nope : '//cdnjs.cloudflare.com/ajax/libs/html5-history-api/4.0.2/history.iegte8.min.js'
  }
]);
AllSpeeds commented 10 years ago

@tommydudebreaux, @lushchick and I are going to take a look at this today-ish. Are you planning to do a PR from your fork?

panthershark commented 10 years ago

Once we get this working, yes I would like to. Before publishing to npm, I would like to pick off the rest of the tickets.

panthershark commented 10 years ago

This is merged. Please post any issues here. Otherwise, I am bumping version and pushing it.