Skip to content

Update error.xml #630

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

Closed
wants to merge 7 commits into from
Closed

Conversation

AurelioDeRosa
Copy link
Member

Fix issue #413.

@@ -52,6 +52,15 @@ $( "img" )
})
.attr( "src", "missing.png" );
]]></code>
<p>In the example, missing.png is an hypotetical missing image that is used to trigger the <code>error</code> event, not an image to replace those giving an error. To do that, you have to modify the body of the anonymous function passed to <code>.error()</code> as shown below:</p>
Copy link
Member

Choose a reason for hiding this comment

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

hypothetical

Copy link
Member Author

Choose a reason for hiding this comment

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

Typo corrected. Sorry about that.

Fixed typo
Added semicolon after the word "exists" as per request.
@arthurvr
Copy link
Member

This PR looks good to me. Shall I merge?

})
.attr( "src", "missing.png" );
]]></code>
<p><b>Note:</b> Be sure that the replacement image exists; otherwise the <code>error</code> event will be triggered indefinitely.</p>
Copy link
Member

Choose a reason for hiding this comment

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

the indentation for this line seems wrong.

Copy link
Member

Choose a reason for hiding this comment

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

Also, I don't think <p> tags are allowed in <example>s. This just results into this: http://gyazo.com/f7795ca0fd998b6701b68bbb322fed0d (notice your extra info inside the <p> isn't rendered).

@AurelioDeRosa Do you have a working local docs setup? Normally you should be able to repro that there. If you don't, ping me on IRC and I'll be happy to help you out.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@arthurvr I'm going to take care of this issue right now. Sorry for the delay.

@AurelioDeRosa
Copy link
Member Author

As @arthurvr noted, the current version of the XSL file doesn't allow to have a paragraph in an example. So, the only solution I see is to allow it. Who can fix this issue? Any alternatives? // cc @dmethvin @kswedberg @scottgonzalez

@dmethvin
Copy link
Member

dmethvin commented Mar 1, 2015

I think that notes were intended for small notes and not big clips with paragraphs and examples. If we allow big clips and block elements like code, it may affect layout in a drastic way so that's something to take into consideration.

@scottgonzalez
Copy link
Member

Well you for sure can't just throw arbitrary markup into <example>. We can potentially add support for <longdesc> inside <example>, but the currently used markup will never be allowed.

@AurelioDeRosa
Copy link
Member Author

What's your suggestion to rearrange the code to have a description?

@scottgonzalez
Copy link
Member

That's hard to say because I can't tell what you're trying to do. Are you trying to create an inline runnable example that is accompanied by a code block explaining how to do something? This is very different from the way any other page is designed.

@arthurvr
Copy link
Member

arthurvr commented Mar 2, 2015

In this case I'd opt to move some stuff in the <desc> and other things can fit in a JavaScript comment.

We can potentially add support for inside , but the currently used markup will never be allowed.

This is kinda off-topic for this PR, and should be discussed in grunt-jquery-content isn't it?

@scottgonzalez
Copy link
Member

In this case I'd opt to move some stuff in the and other things can fit in a JavaScript comment.

The <desc> is really a title. So I don't think that's an acceptable solution.

We can potentially add support for inside , but the currently used markup will never be allowed.

This is kinda off-topic for this PR, and should be discussed in grunt-jquery-content isn't it?

We certainly shouldn't open an issue for grunt-jquery-content until we know what we're actually discussing. I'd like to hear from @AurelioDeRosa since he sent the PR which contains two <code> blocks inside <example>, along with other HTML content.

@AurelioDeRosa
Copy link
Member Author

@scottgonzalez The PR addresses #413. The idea is to have a description of what's going on in the example for the benefit of some users.

@scottgonzalez
Copy link
Member

Sounds like what you really want is a new, useful example.

@AurelioDeRosa
Copy link
Member Author

I'd not say that a new example will solve the problem. The problem was the user didn't get what the example really did. Perhaps @arthurvr's suggestion of having a few comments in the code can fix this.

@AurelioDeRosa
Copy link
Member Author

@arthurvr @scottgonzalez Should I try to submit a PR which has JavaScript comment so that we can review it?

@scottgonzalez
Copy link
Member

sure

@arthurvr
Copy link
Member

I'd love to move forward on this PR. ping @AurelioDeRosa

Removed all the paragraphs inside the examples.
@AurelioDeRosa
Copy link
Member Author

PR updated @arthurvr.

@@ -20,7 +20,7 @@
</argument>
</signature>
<longdesc>
<p>This method is a shortcut for <code>.on( "error", handler )</code>.</p>
<p><b>As of jQuery 1.8</b>, the <code>.error()</code> method is deprecated. Use <code>.on( "error", handler )</code> to attach event handlers to the <code>error</code> event instead.</p>
Copy link
Member

Choose a reason for hiding this comment

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

This is a totally unrelated change. Mind extracting this to its own commit?

Copy link
Member

Choose a reason for hiding this comment

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

ping @AurelioDeRosa ;)

Copy link
Member

Choose a reason for hiding this comment

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

hey-hey @AurelioDeRosa still interested in picking this up?

Copy link
Member

Choose a reason for hiding this comment

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

@AurelioDeRosa
Copy link
Member Author

PR updated @arthurvr. Sorry for the late change.

@arthurvr
Copy link
Member

@AurelioDeRosa I liked the change, it was just unrelated to the thing you're trying to fix, so it should have been in a separated commit. I didn't mean you should remove the change 😉

@AurelioDeRosa
Copy link
Member Author

@arthurvr I was thinking about opening a different PR for it, that's why I removed it.

@arthurvr
Copy link
Member

Makes sense. Thanks.

@@ -20,7 +20,6 @@
</argument>
</signature>
<longdesc>
<p>This method is a shortcut for <code>.on( "error", handler )</code>.</p>
Copy link
Member

Choose a reason for hiding this comment

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

This paragraph shouldn't be removed (or at least not in this commit).

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh... 🐑, you're right!

@AurelioDeRosa
Copy link
Member Author

Can someone check the updated PR so that we can merge it?

</longdesc>
<example>
<desc>To hide the "broken image" icons for IE users, you can try:</desc>
<desc>To hide the "broken image" icons for users of older versions of IE, you can write:</desc>
Copy link
Member

Choose a reason for hiding this comment

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

of older versions of IE

Which versions does that affect?

Copy link
Member Author

Choose a reason for hiding this comment

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

I remember is IE <= 10 but I can't find any reference. Someone with a hint on this?

Copy link
Member

Choose a reason for hiding this comment

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

No idea, honestly. I do think though that just saying "older versions of IE" means nothing so we should figure this out. Maybe @dmethvin or @timmywil have links to relevant discussions about this?

Copy link
Member

Choose a reason for hiding this comment

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

ping @AurelioDeRosa @dmethvin @timmywil is there anyone who knows this? If not I'll quickly test this out.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I mentioned elsewhere that I'm not sure when the "broken image" thing went away. Probably before IE9?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should we specify IE9 for now and update in case of mistake?

@AurelioDeRosa
Copy link
Member Author

This PR is standing from a few months. Is anyone happy to specify IE9 and merge it?

@dmethvin
Copy link
Member

Looks like this has been settable from at least IE and Firefox for years:

http://stackoverflow.com/questions/1694937/firefox-show-broken-images
http://ccm.net/faq/13546-internet-explorer-show-image-download-placeholders

However, I couldn't find out when the default was changed. How about if we just delete the example? There is still a good one there.

@AurelioDeRosa
Copy link
Member Author

@dmethvin Thank you for the feedback. I've updated the PR based on your comment.

@arthurvr
Copy link
Member

arthurvr commented Oct 7, 2015

lgtm 👍

@AurelioDeRosa AurelioDeRosa self-assigned this Oct 7, 2015
AurelioDeRosa added a commit to AurelioDeRosa/api.jquery.com that referenced this pull request Oct 7, 2015
@AurelioDeRosa AurelioDeRosa deleted the patch-6 branch October 19, 2015 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants