cfjedimaster / brackets-w3cvalidation

Simple W3C Validator for Brackets
85 stars 33 forks source link

Clicking on a link in the panel opens Help in Brackets window #3

Closed lkcampbell closed 11 years ago

lkcampbell commented 11 years ago

Repro steps:

  1. Create a properly formed html file. Add a single ordered list with a single list item: `
    1. foo
    `

  2. Enable W3CValidation and save file.
  3. In the panel that shows up, click on any of the blue hyperlinks (e.g. Global attributes, value).

Expected behavior: Help documentation should be launched in a separate browser window.

Observed behavior: Help documentation is launched inside the Brackets window.

cfjedimaster commented 11 years ago

Fixed in latest. Thanks.

lkcampbell commented 11 years ago

It is launching the links in a new browser window now but they are all 404 errors for me.

Looks like it is sticking a forward slash in front of the URL. Here's the error message:

The requested URL /http://www.w3.org/html/wg/drafts/html/master/single-page.html was not found on this server.

cfjedimaster commented 11 years ago

If I give you some direction on debugging, are you ok with that?

lkcampbell commented 11 years ago

Absolutely. Just let me know how I can help.

cfjedimaster commented 11 years ago

Open main.js, towards the botto find $(document).on("click"). Find this portion:

        var url = e.currentTarget.href;
        //remove up to www
        url = url.replace(/.*?www\//,"");
        var newURL = baseURL + url;

Mod it to:

        var url = e.currentTarget.href;

console.log("url was "+url); //remove up to www url = url.replace(/.*?www\//,""); var newURL = baseURL + url; console.log("url is now "+newURL);

Open up Dev Console for Brackets and tell me what you see.

lkcampbell commented 11 years ago

url was http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-ol-element

url is now http://validator.w3.org/http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-ol-element

cfjedimaster commented 11 years ago

Oh shoot. So when I tested, the url was a combination of my local install plus a relative link. It looks like your url was a good url and my fix broke it. Can you post a Gist of the source html you validated so i can recreate it?

On Sun, Apr 21, 2013 at 7:51 PM, Lance Campbell notifications@github.comwrote:

url was http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-ol-element

url is now http://validator.w3.org/http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-ol-element

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-w3cvalidation/issues/3#issuecomment-16749885 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

lkcampbell commented 11 years ago

Just throw this markup in an HTML shell file. It's just an ordered list with an improper attribute. Gets you several links to try out:

`

  1. foo
`

cfjedimaster commented 11 years ago

You got several? I got only one. To be clear, I have JUST this HTML, nothing more. Do you have more?

On Sun, Apr 21, 2013 at 7:59 PM, Lance Campbell notifications@github.comwrote:

Just throw this markup in an HTML shell file. It's just an ordered list with an improper attribute. Gets you several links to try out:

  1. foo

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-w3cvalidation/issues/3#issuecomment-16750028 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

cfjedimaster commented 11 years ago

Never mind - I see it.

On Sun, Apr 21, 2013 at 8:06 PM, Raymond Camden raymondcamden@gmail.comwrote:

You got several? I got only one. To be clear, I have JUST this HTML, nothing more. Do you have more?

On Sun, Apr 21, 2013 at 7:59 PM, Lance Campbell notifications@github.comwrote:

Just throw this markup in an HTML shell file. It's just an ordered list with an improper attribute. Gets you several links to try out:

  1. foo

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-w3cvalidation/issues/3#issuecomment-16750028 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

cfjedimaster commented 11 years ago

Try latest. Note that some of the URLs don't seem to actually work. Ie, I was sent to the html5 spec and a specific anchor that never seemed to load.

On Sun, Apr 21, 2013 at 8:10 PM, Raymond Camden raymondcamden@gmail.comwrote:

Never mind - I see it.

On Sun, Apr 21, 2013 at 8:06 PM, Raymond Camden raymondcamden@gmail.comwrote:

You got several? I got only one. To be clear, I have JUST this HTML, nothing more. Do you have more?

On Sun, Apr 21, 2013 at 7:59 PM, Lance Campbell <notifications@github.com

wrote:

Just throw this markup in an HTML shell file. It's just an ordered list with an improper attribute. Gets you several links to try out:

  1. foo

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-w3cvalidation/issues/3#issuecomment-16750028 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster

lkcampbell commented 11 years ago

https://gist.github.com/lkcampbell/5431827

lkcampbell commented 11 years ago

Ok, I will check it out, my sample code is above, just learning how to use gist :)

lkcampbell commented 11 years ago

Confirmed your fix. All of the links work correctly now. Thanks!

cfjedimaster commented 11 years ago

Cool. Thanks for helping me fix it.

On Sun, Apr 21, 2013 at 9:59 PM, Lance Campbell notifications@github.comwrote:

Confirmed your fix. All of the links work correctly now. Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/cfjedimaster/brackets-w3cvalidation/issues/3#issuecomment-16752054 .

Raymond Camden, Adobe Developer Evangelist

Email : raymondcamden@gmail.com Blog : www.raymondcamden.com Twitter: cfjedimaster