data-url and data-title enhancements#141
Open
epicfaace wants to merge 1 commit intotabalinas:masterfrom
Open
Conversation
tabalinas
reviewed
Apr 24, 2017
|
|
||
| A string specifying text to share. The content of `<meta name="description">` or `<title>` (if first is missing) is used by default. | ||
|
|
||
| The text can also be specified by adding a value for the "data-url" attribute on the sharing element itself. |
Owner
There was a problem hiding this comment.
I guess we want data-title here instead of data-url, right?
tabalinas
reviewed
Apr 24, 2017
|
|
||
| _initDefaults: function() { | ||
| this.url = window.location.href; | ||
| this.text = $.trim($("meta[name=description]").attr("content") || $("title").text()); |
Owner
There was a problem hiding this comment.
could we keep defaulting to $("title").text() to avoid breaking changes?
Contributor
There was a problem hiding this comment.
Please also keep in mind that twitter has a limit of 140 characters and that the description is actually a description which consists likely out of more then 140 characters.
Owner
|
@epicfaace, thank you for the contribution! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Define Share URL and text via data attributes, per issue #108