This repository was archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
GlobalEventHandlers have different docs URL on mdn then attribute #77
Open
lalitsom
wants to merge
11
commits into
atom:master
Choose a base branch
from
lalitsom:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f5a14d2
fixed Global Attributes Doc URL on global events
lalitsom 6c5e3ee
removed trailing white space
lalitsom c88e105
removed a bug because of no description in on* event
lalitsom 233a85d
added space after comma
lalitsom 37cc7fc
added test assertions for onabort and aria-busy in provider-spec.coffee
lalitsom 42cbb7c
changed aria to ar in assertions
lalitsom 38f7700
added assertion aria-
lalitsom fdebb55
removed aria- assertion
lalitsom 287d3d0
added docs for aria-attribute and role
lalitsom 7056e19
added tests for role attribute and removed description parameter
lalitsom 7d5dbd9
filter suggestions list by prefix
lalitsom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,7 +118,7 @@ module.exports = | |
| displayText: attribute | ||
| type: 'attribute' | ||
| description: description ? "Global #{attribute} attribute" | ||
| descriptionMoreURL: if description then @getGlobalAttributeDocsURL(attribute) else null | ||
| descriptionMoreURL: @getGlobalAttributeDocsURL(attribute, description) | ||
|
|
||
| getAttributeValueCompletions: ({prefix, editor, bufferPosition}) -> | ||
| completions = [] | ||
|
|
@@ -180,8 +180,16 @@ module.exports = | |
| getLocalAttributeDocsURL: (attribute, tag) -> | ||
| "#{@getTagDocsURL(tag)}#attr-#{attribute}" | ||
|
|
||
| getGlobalAttributeDocsURL: (attribute) -> | ||
| "https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/#{attribute}" | ||
| getGlobalAttributeDocsURL: (attribute, description) -> | ||
|
||
| if attribute.startsWith('on') | ||
| "https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/#{attribute}" | ||
| else if attribute.startsWith('aria-') | ||
| # As of September 2017, MDN does not have pages for ARIA attributes | ||
| "https://www.w3.org/TR/wai-aria-1.1/##{attribute}" | ||
| else if attribute.startsWith('role') | ||
|
||
| "https://www.w3.org/TR/wai-aria-1.1/#usage_intro" | ||
| else | ||
| "https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/#{attribute}" | ||
|
|
||
| firstCharsEqual = (str1, str2) -> | ||
| str1[0].toLowerCase() is str2[0].toLowerCase() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -294,15 +294,15 @@ describe "HTML autocompletions", -> | |
| expect(-> completions = getCompletions()).not.toThrow() | ||
| expect(completions[0].displayText).toBe 'onafterprint' | ||
|
|
||
| it "does not provide a descriptionMoreURL if the attribute does not have a unique description", -> | ||
| it "provide a descriptionMoreURL if the attribute does not have a unique description but starts with on*", -> | ||
|
||
| editor.setText('<input on') | ||
| editor.setCursorBufferPosition([0, 9]) | ||
|
|
||
| completions = getCompletions() | ||
|
|
||
| expect(completions[0].displayText).toBe 'onabort' | ||
| expect(completions[0].description).toBe 'Global onabort attribute' | ||
| expect(completions[0].descriptionMoreURL).toBeNull() | ||
| expect(completions[0].descriptionMoreURL.endsWith('/Web/API/GlobalEventHandlers/onabort')).toBe true | ||
|
|
||
| it "autocompletes attribute values without a prefix", -> | ||
| editor.setText('<marquee behavior=""') | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
descriptionis not used and can be removed