08-16-2021, 03:23 PM | #16 |
A Hairy Wizard
Posts: 3,225
Karma: 19000635
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
|
08-16-2021, 10:20 PM | #17 |
Bibliophagist
Posts: 40,549
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
On a Windows computer, pressing windows-V give you a history to paste from. This works in Sigil and most other programs.
|
08-16-2021, 10:32 PM | #18 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Or as DiapDealer said use Sigil's Edit/Paste From Clipboard History... menu item or key shortcut on any platform. You can highlight any clipboard history item to paste or use the delete key to remove it from the history.
|
08-16-2021, 10:50 PM | #19 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
It also saves the history between Sigil sessions (the preference setting determines how many are saved between sessions)
|
09-04-2021, 07:25 AM | #20 |
Addict
Posts: 262
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
|
Pasting
Hi all,
Maybe far from the original post title, but as the conversation was on the pasting topic I continue here. The process is:
Here is what I meant... in images: https://www.youtube.com/watch?v=NAXWuLJN3lI Hope this helps Cheers |
09-04-2021, 08:53 AM | #21 | |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Just use PageEdit with Sigil. It will do exactly what you want.
Quote:
|
|
09-04-2021, 01:21 PM | #22 |
Addict
Posts: 262
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
|
Well, using a 160Mo external editor was not my idea of a simple pasting option 😉
I hoped more for an addition of ten lines of code: javascript Code:
document.addEventListener('paste', function (evt) { document.getElementById("plain").textContent = evt.clipboardData.getData('text/plain'); document.getElementById("html").textContent = evt.clipboardData.getData('text/html'); } Code:
#!/usr/bin/env python import gtk print (gtk.Clipboard().wait_for_contents('text/html')).data qt Code:
void DropArea::paste() { const QClipboard *clipboard = QApplication::clipboard(); const QMimeData *mimeData = clipboard->mimeData(); if (mimeData->hasImage()) { setPixmap(qvariant_cast<QPixmap>(mimeData->imageData())); } else if (mimeData->hasHtml()) { setText(mimeData->html()); setTextFormat(Qt::RichText); } else if (mimeData->hasText()) { setText(mimeData->text()); setTextFormat(Qt::PlainText); } else { setText(tr("Cannot display data")); } |
09-04-2021, 02:00 PM | #23 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Huh? That code exists in PageEdit and it can easily be launched and run. It is meant to be integrated into Sigil which has an easy way to launch it.
Sigil's CodeView editor is not a browser window and always pastes html/text as its base property since it is an xhtml code editor where copy and paste of code snippets are always done. Almost all copies made in CodeView typically includes html tags or partial html as text. You can not paste into a CodeView formatted rich text or images. You are confusing the target (a pure text code editor vs a browser like dom editor (Old BookView and PageEdit). PageEdit is exactly like old Sigil's BookView and pasting formatted text into the PageEdit browser window is handled as you would expect. Last edited by KevinH; 09-04-2021 at 02:05 PM. |
09-04-2021, 02:15 PM | #24 |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
@fxp33
If the feature is that important to you, why not use a plugin? The following code should do the trick: Spoiler:
Just assign it one of the 10 plugin shortcuts and a corresponding keyboard shortcut, and you're good to go. However, you might want to consider using PageEdit instead, because it'll significantly clean up the messy HTML code that some apps will copy to the clipboard. |
09-05-2021, 12:09 PM | #25 | |
Addict
Posts: 262
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
|
Quote:
Yep, the plugin was my intention... and this is precisely why I was hoping I could get a hint on "how to insert text at cursor position" in this thread. I opened a lot of plugins to try and understand how to do that... 😉 Thanks a lot for packaging and rewriting the code into a plugin... And of course, I will indeed, check with pageEdit 👍 Best regards François |
|
09-05-2021, 12:37 PM | #26 | |
Addict
Posts: 262
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
|
Quote:
What I can't figure out is why all the buttons from pageEdit have been added to Sigil (bald, italic, images, special caracters and even cut, paste) except this pasting option. PageEdit seems therefor very redundant to Sigil, and I find it to be a very big "plugin" for "just pasting". But as you and Doitsu mentioned: it does not just paste, it cleans the code too when choosing "plain text" by adding "p" and "br". Which I understand is not just 10 lines of code. Thanks for your reply, this helped me try new things with pageEdit. 👍 Regards François |
|
09-05-2021, 12:50 PM | #27 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
PageEdit is not a plugin. It is separate editing program app that allows limited WYSIWYG editing similar to what the old BookView did in some ways. It can be easily launched from within Sigil by setting PageEdit as the External XHTML editor in Sigil's Preferences.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Get cursor position or highlighted text inside plugin | otherpasserby | Plugins | 10 | 12-16-2018 06:40 AM |
How to send cursor to the home position by code ? | reinsley | Library Management | 4 | 02-25-2017 03:08 PM |
Reopening CC loses position, and reader app doesn't reopen at current position | iatheia | Calibre Companion | 9 | 11-13-2015 09:20 PM |
Glo Sleep with cover mess the current position | ploum | Kobo Reader | 10 | 05-06-2013 08:49 AM |
your current position regarding the 505 | hello | Sony Reader | 1 | 10-06-2007 06:37 AM |