Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Allow local browsing of the docs without a web server #3117

Closed
wants to merge 5 commits into from
Closed

Allow local browsing of the docs without a web server #3117

wants to merge 5 commits into from

Conversation

eddiemonge
Copy link
Contributor

No description provided.

@eddiemonge
Copy link
Contributor Author

Potential fix for #3113
This may affect phonegap since i think it uses: file:// but im not sure.

@toddparker
Copy link
Contributor

I don't think we should disable AJAX is browsing locally if we can avoid it. I'd prefer to add in the URL fix here, but leave AJAX on and add in the messaging about the server requirement. Otherwise, you won't see transitions and other important features.

@eddiemonge
Copy link
Contributor Author

How about an automatic ajax check to see if it should be disabled?

.filter( "[href='/']" ).attr( "href", "/index.html" ).end()
.filter( "[href^='..']" ).filter( "[href$='/']" ).each(function() {
this.href = $(this).attr("href")+"index.html";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to do this on changePage when the ajax requests are working for these protocols to alter new links. Sorry I didn't think of this earlier.

@johnbender
Copy link
Contributor

@eddiemonge

@toddparker and I were thinking a big yellow warning that sits above the content (ie a direct descendant of body) and uses the warning css (http://jquerymobile.com/demos/1.0/docs/api/events.html at the top) added from the js here should be fine.

@toddparker
Copy link
Contributor

@johnbender - simple mockup of the yellow bar of doom (and helpful information) here:
http://jsbin.com/amixum/9/edit

Content isn't right if we auto disable ajax, but that's the style.

@johnbender
Copy link
Contributor

@eddimonge

I pulled your changes and I'm working on adding the warning (almost done), though I'm still unclear on why we need to index.html to anything other than the links with a trailing slash. I have a feeling I'm missing some corner case you've accounted for.

@eddiemonge
Copy link
Contributor Author

@johnbender Since its adding it to all links on the page, I was account for the following examples:

  • href="/"
  • href="../"
  • href="../../" and any number of ../ added in.

However, there may also be external links that added in like:

  • href="twitter.com/"
  • href="jquerymobile.com/test/"
  • href="google.com"

So the first check tests for a single slash, which is safe and easy to do.
The second check looks for starting ".." and also has to end in /:

  • href="../docs/"
  • href="../demos/"

One link style I forgot about is the non-trailing slash ones:

  • href="../docs"
  • href="../demos"

Other links:

  • href="../docs/.."
  • href="../demos/.."
  • href="../docs.html"
  • href="../demos.html"

@eddiemonge
Copy link
Contributor Author

@johnbender @toddparker I added in more url rewrites and the warning message. I have it appending to the footer of the page. I can change it to somewhere else if need be.

@toddparker
Copy link
Contributor

Is there a way to preview the message before pushing?

.................................. . . . .
Todd Parker
Partner, Filament Group Inc.
102 South Street #3 Boston, MA 02111
todd@filamentgroup.com // 617.953.1617

On Nov 21, 2011, at 10:05 PM, "Eddie Monge Jr." reply@reply.github.com wrote:

@johnbender @toddparker I added in more url rewrites and the warning message. I have it appending to the footer of the page. I can change it to somewhere else if need be.


Reply to this email directly or view it on GitHub:
#3117 (comment)

@eddiemonge
Copy link
Contributor Author

Pull from my repo or copy the jqmdocs.js file into your source, make docs, unzip and test

@johnbender
Copy link
Contributor

@eddiemonge @toddparker

I'll pull eddie's latest and add the pagechange binding that I created on my end tomorrow morning.

@johnbender
Copy link
Contributor

changes pushed

@johnbender johnbender closed this Nov 22, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants