Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permalinks for Pages #17

Open
unwitting opened this issue Apr 1, 2014 · 3 comments · May be fixed by #20
Open

Permalinks for Pages #17

unwitting opened this issue Apr 1, 2014 · 3 comments · May be fixed by #20

Comments

@unwitting
Copy link

Does Nodewiki provide permalinks for each page? I notice that since it's a single-page app, we just get /# in the URL, which isn't very handy for linking people to specific pages. If so, how can I find the link for a given page?

bahamas10 added a commit to bahamas10/nodewiki that referenced this issue Jun 25, 2014
- support for permalinks with window hash management (fixes nhoss2#17)
- added `-r` or `--readonly` option to remove "New File", "Edit", etc.
  buttons
- added `config` socket.io event to pass config options from the server
  to the browser
- [asthetic] moved "Go Back" button to the top (so it's always in the
  same place)
@bahamas10 bahamas10 linked a pull request Jun 25, 2014 that will close this issue
@anderflash
Copy link

But if I refer to another page and click on it, they change the url at address bar, but it doesn't update the page to read and show the referred one. Even though I copy and paste the url with another permalink (another page) at the same window, it doesn't update the page, I need to create another browser window/tab.

@anderflash
Copy link

I think it helps: OnHashChange

@anderflash
Copy link

What do you think of this:

window.addEventListener("hashchange", function(e)
  {
     var parts = window.location.hash.match(/[^\/]+\/?/g);
    parts.shift();
    parts.forEach(function(part) {
      socket.emit('readFile', {name: part});
      $('#navigation').children().attr('class', 'link');
      $('#navigation a:contains("'+part+'")').attr('class', 'selected link');
    });
  }, false);

It's a repetition of emission of hash used on connect event. I think you can embed this routine as a function, since it's a repetition. Oh, and we need to highlight the proper link at the menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants