Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 03-14-2014, 04:16 PM   #16
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,588
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
How about putting the text that was selected & auto-deleted into the clipboard so the user can paste it back again as the label?

After creating the link the cursor is already positioned at the correct position to do that. Then its on the users head if they paste something they shouldn't.

Preventing users from making mistakes can result in denying them opportunity to learn from them.

BR
BetterRed is online now   Reply With Quote
Old 03-14-2014, 04:21 PM   #17
arspr
Dead account. Bye
arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.
 
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
Hi, I also don't agree with the current behaviour.

I'd expect a <a href="whatever"></a> pair embracing my current selection, but not deleting it.

More over, it seems somehow incoherent with other features in the editor, as example the B, I, U buttons which just work in that way: adding a pair of tags around the selected text, without deleting it. Why should the <a> tag be different?

Maybe a tick could be added to the Insert Hyperlink dialogue in order to toggle that deletion on/off as desired?

(And of course, Kovid, forget about checking for valid/invalid HTML in either case: with or without deletion of the selected text. It's just TOO hard. I've just noticed that the only check the B/I/U buttons seem to do is that, if the selected text begins or ends in the middle of any tag, the added <b/i/u> tags avoid those incomplete tags. I do agree this is the "good" behaviour, and possibly the only one you can easily and coherently code. But even doing that check, nothing guarantees you that the obtained HTML code is valid; an example: if the selected text is just a tag like "</div>" where you are in trouble it doesn't matter if you keep it or not).

Last edited by arspr; 03-14-2014 at 04:34 PM.
arspr is offline   Reply With Quote
Old 03-14-2014, 04:22 PM   #18
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,818
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by BetterRed View Post

Preventing users from making mistakes can result in denying them opportunity to learn from them.

BR
+1
Boy have I learned how to debug HTML
theducks is offline   Reply With Quote
Old 03-14-2014, 05:19 PM   #19
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
One can hope for fewer opportunities for such learning.

I can't agree that protecting somebody from themselves when they are editing the HTML directly is a priority. There are a million changes to screw it up without even trying. I know, I did a global search and replace and scrunched all the paragraphs together and did only an undo instead of a revert. I had to bring in whole sections from an earlier document.

If you could edit the viewing window, I would agree, but you can only work in the HTML window.
mrmikel is offline   Reply With Quote
Old 03-14-2014, 08:21 PM   #20
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by kovidgoyal View Post
I have absolutely no problems with not protecting the user from doing things that directly create invalid code. I do have a problem with the user asking the editor to perform some automated action that leads to invalid code. That is something I try to avoid as much as is reasonably possible.

Things the editor does as opposed to the user doing should try to not result in invalid code, as much as possible.
But, as it stands, the insert hyperlink already can create bad code. If the selected text includes a tag, that tag is removed. Personally, I feel the usability of using the selection as the link text outweighs the dangers involved.

A possibility is to add a field to the dialog. Put the selected text in there. Add a warning if there are any tags. The user can clear or type whatever they need.
davidfor is offline   Reply With Quote
Old 03-14-2014, 10:49 PM   #21
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,869
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm, well I can change it so that it works like the bold, italic, etc. button, where the selection is automatically adjusted to ensure it does not end within a tag definition, but otherwise just wraps the selected text.

That is a compromise I am happy with, and I think all of you should be happy with as well.
kovidgoyal is online now   Reply With Quote
Old 03-15-2014, 01:14 AM   #22
arspr
Dead account. Bye
arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.
 
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
Yes, Kovid, that's good. But if you are really interested in "your" way, and as it is an already made coding work, don't throw it away. Put the toggle in the tool dialogue and we would have both methods... As you previosly posted, "your" way can also be useful in some situations. It's just not intuitive, it's just not the expected default behaviour, but nobody can say that "it's wrong".
arspr is offline   Reply With Quote
Old 03-15-2014, 05:47 AM   #23
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
+1, Kovid, this sounds good.

Maybe you can add as well an input mask for a text within the hyperlink window. You can put the selected text in this mask if selected and if not, the user can make an input or not and have all possibile variations open (if this is possible to do w/o a huge amount of coding)
Attached Thumbnails
Click image for larger version

Name:	Aufzeichnen0.JPG
Views:	290
Size:	92.8 KB
ID:	120260  
Divingduck is offline   Reply With Quote
Old 03-15-2014, 06:45 AM   #24
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,869
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@Divingduck: A good idea. There's no reason the text field cannot be pre-filled in with the selected text, if any, that way the present code does not have to be changed at all either. It will simply continue to delete the selection, but also insert the contents of the text field, which will be prefilled with the selected text, giving a smooth default workflow.
kovidgoyal is online now   Reply With Quote
Old 03-15-2014, 08:29 AM   #25
arspr
Dead account. Bye
arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.arspr ought to be getting tired of karma fortunes by now.
 
Posts: 587
Karma: 668244
Join Date: Mar 2011
Device: none
Yes, a great idea. Nevertheless, Kovid, do not forget the in-the-middle-of-tags test. I mean maybe you should "shorten" this kind of plainly wrong selections before actually calling the tool dialogue.
arspr is offline   Reply With Quote
Old 03-15-2014, 11:32 AM   #26
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,818
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
to all these
theducks is offline   Reply With Quote
Old 03-15-2014, 01:00 PM   #27
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 907
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
DrChiper is offline   Reply With Quote
Old 03-15-2014, 10:59 PM   #28
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I'm liking this suggestion much better, thanks!
eschwartz is offline   Reply With Quote
Old 03-21-2014, 12:02 PM   #29
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,161
Karma: 1404241
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
Kovid, thanks for implementing this
Divingduck is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink to PDF Macsurfcat ePub 4 04-18-2013 04:20 PM
Hyperlink an image scheife ePub 2 03-07-2013 07:43 AM
"Offending" hyperlink bug in InDesign CS5 causes TOC to fail and missing text eggheadbooks1 ePub 0 11-16-2011 12:18 AM
Hyperlink adachim Kobo Reader 0 11-02-2010 10:57 PM
Hyperlink? fcoulter Sigil 3 03-28-2010 10:31 AM


All times are GMT -4. The time now is 10:20 PM.


MobileRead.com is a privately owned, operated and funded community.