Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Link #10

Closed
Comandeer opened this issue Jan 4, 2016 · 19 comments
Closed

Link #10

Comandeer opened this issue Jan 4, 2016 · 19 comments
Labels
Milestone

Comments

@Comandeer
Copy link
Member

There is no Web without hypertext and there is no hypertext without links – it goes without saying. Therefore link feature is the "must-have" and one of the fundamental features for any online rich-text editor.

And implementation of that feature is rather simple: there is only one element in HTML that can be used to create link – a element. The only additional requirement is to ensure that such link has [href] attribute that is a valid URL.

I don't think that there will be much to discuss here, but – as always – I'm open to your opinions.

@Comandeer Comandeer added this to the Features milestone Jan 4, 2016
@Comandeer
Copy link
Member Author

I created draft for that feature: http://ckeditor.github.io/editor-recommendations/features/link.html

@fredck
Copy link
Contributor

fredck commented Mar 3, 2016

When it comes to CTRL-L, I see that Google Docs and Medium also use CTRL-K instead. I think we should stick with this as well. Actually, I'm curious to understand why K... knowing that could better clarify this point for us.

@Comandeer
Copy link
Member Author

I don't know why Ctrl + K (isn't it caused just by fact that MS Word started doing it and all others followed?), but I found interesting comment why not: http://meta.stackexchange.com/a/49977

@fredck
Copy link
Contributor

fredck commented Mar 3, 2016

I see... but Ctrl+K seems to be a de facto standard, that's why I'm still for it otherwise people will be using Ctrl+K everywhere else, except on that funky online editor that uses Ctrl+L, although it makes sense. I don't think we can fix the world... or can we? :/

@Comandeer
Copy link
Member Author

We won't know if we won't try ;)

I've just copied that keystroke from CKE4, because it's more logical for me. Probably we should do some research to see if Ctrl + K is really a de facto standard.

@Reinmar
Copy link
Member

Reinmar commented Mar 3, 2016

Blocking CTRL+L is a bit irritating, at least for users who know what this keystroke normally does in the browser.

CTRL+K is used at least by GDocs and TinyMCE.

@Comandeer
Copy link
Member Author

Hm, interestingly using Ctrl+K is discouraged also because of that functionality (it focuses address bar in Chrome).

@Reinmar
Copy link
Member

Reinmar commented Mar 3, 2016

Interestingly, Cmd+K does not focus address bar on MacOSX.

@androb
Copy link

androb commented Mar 4, 2016

Hey Frederico! Not sure how much you want our opinion but +1 for Cmd+K :)
it's been the standard for 20+ years and the expected shortcut key.
On Thu, Mar 3, 2016 at 8:13 AM, Piotrek Koszuliński <
notifications@github.com> wrote:

Interestingly, Cmd+K does not focus address bar on MacOSX.


Reply to this email directly or view it on GitHub
#10 (comment)
.

@jodator
Copy link

jodator commented Mar 4, 2016

@Comandeer Actually CTRL+K is focus search bar (Firefox, Chrome). So in Chrome it focus "that only bar" and adds the "?" for doing search. TO access address bar both browsers use CTR+L (as Location?).

@fredck
Copy link
Contributor

fredck commented Mar 4, 2016

Not sure how much you want our opinion

There is no reason to not have you guys here - quite the opposite. You're very welcome. Thanks for participating.

@Comandeer
Copy link
Member Author

I did a quick research: https://gist.github.com/Comandeer/10ccdd403ac77e43ac9f – I've checked 22 editors, only 1 of them doesn't have option to insert link (or I didn't find it).

The half of them has a keystroke for inserting links: 9 of them Ctrl+K and 2 of them (CKE4 and Alloy Editor, based on CKE4) – Ctrl+L. So it seems that we are alone with Ctrl+L

I'll update the draft and change Ctrl+L to Ctrl+K.

@androb
Copy link

androb commented Mar 8, 2016

+1. It doesn't make much sense but it is the standard. Thanks for doing the
research
On Tue, Mar 8, 2016 at 1:28 AM, Comandeer notifications@github.com wrote:

I did a quick research:
https://gist.github.com/Comandeer/10ccdd403ac77e43ac9f – I've checked 22
editors, only 1 of them doesn't have option to insert link (or I didn't
find it).

The half of them has a keystroke for inserting links: 9 of them Ctrl+K
and 2 of them (CKE4 and Alloy Editor, based on CKE4) – Ctrl+L. So it
seems that we are alone with Ctrl+L…

I'll update the draft and change Ctrl+L to Ctrl+K.


Reply to this email directly or view it on GitHub
#10 (comment)
.

@conpassione
Copy link

I have some remarks:

  1. There are not only links to valid URL's (http://www.domain.tld/) but also E-Mail Links (mailto:) and Phone-Links (tel:). The editor should be able to create those links as well.
  2. In a CMS you have internal Links, represented by an Page-ID. So you can move the target page around without loosing the connection, because the ID remains the same. The correct HTML-Code (trasformation of the pageid in a url) is genereted everytime when the page is rebuilt.
  3. the link-builder should accept class attributes (one or many classes) for building the HTML-Code

@Comandeer
Copy link
Member Author

But e-mail address or tel: links are valid URL-s, according to the description of URL-s available here: https://www.w3.org/TR/url/#urls.

What's more, the requirement for [href] attribute is taken directly from the HTML5 spec:

The href attribute on a and area elements must have a value that is a valid URL potentially surrounded by spaces.

@mlewand
Copy link

mlewand commented Mar 8, 2016

Few cents regarding hotkey:

I don't know why Ctrl + K (isn't it caused just by fact that MS Word started doing it and all others followed?), but I found interesting comment why not: http://meta.stackexchange.com/a/49977

This comment refers to a function that (I believe) is not implemented in any editor. And it's super easy to achieve with traditional hotkeys: just shift + home, del / bksp and you're done. So that comment is not really relevant here.

Browser focus hotkey

FYI: ctrl + l is not the only one hotkey to focus address bar. You can do it with: alt + d, F6, ctrl + k and probably some other hotkey that I'm not aware of. :D

More apps

Talking about CTRL + K being standard and not, I'd put couple other editors (and not limit it to web apps):

Ctrl + K

  • GitHub md editor
  • VisualEditor (Wikipedia's editor)
  • Microsoft Word 2010 (desktop)
  • Libre Office 5 (desktop)

Ctrl + L

  • StackOverflow editor
  • Mozilla Thunderbird (desktop)

Conclusion

For me CTRL + L is so much more intuitive.

But, as said before, CTRL + K seems to be industry standard (probably MS effect) - that's why I'd prefer to see CTRL + K as the default hotkey.

@Reinmar
Copy link
Member

Reinmar commented Mar 9, 2016

  • In a CMS you have internal Links, represented by an Page-ID. So you can move the target page around without loosing the connection, because the ID remains the same. The correct HTML-Code (trasformation of the pageid in a url) is genereted everytime when the page is rebuilt.
  • the link-builder should accept class attributes (one or many classes) for building the HTML-Code

As for CMS and internal links, I think that these are extensions over the base link feature. Since every CMS may have this working differently, the Editor Recommendations project cannot spec this feature. It could however mention possible extensions as a friendly reminder for developers that such features will usually be useful.

And as for class attributes – this is again an extension for a base link feature. Similarly as in the previous case, styling links can be implemented in many ways so I don't see how this could be speced.

@claviska
Copy link

claviska commented Jul 21, 2016

OS X uses CMD + K in Mail, Pages, Numbers, Keynote, Notes, and probably others.

@Comandeer
Copy link
Member Author

Ok, it seems like a stable feature. I propose moving it from draft to the recommendation status. I'll wait 3 days for objections and then do what should be done ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants