Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-10-2014, 07:31 AM   #1
hpstricker
Member
hpstricker began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Jul 2008
Device: Sony PRS 505, iPad
Adding buttons to the toolbar

Is it possible to add buttons to the Sigil-toolbar (performing some action in the HTML source with respect to the actual cursor position or selection)?

For example:
  • "wrap selected text inside <span class='x'>"
  • "wrap the active paragraph inside <div class='y'>"

Do I have to do it in the C++ sources, or is there an easier way?
hpstricker is offline   Reply With Quote
Old 10-10-2014, 07:46 AM   #2
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by hpstricker View Post
Do I have to do it in the C++ sources,
Yes.

Quote:
Originally Posted by hpstricker View Post
or is there an easier way?
No.
user_none is offline   Reply With Quote
Advert
Old 10-10-2014, 12:16 PM   #3
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: 31,047
Karma: 60358908
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 hpstricker View Post
Is it possible to add buttons to the Sigil-toolbar (performing some action in the HTML source with respect to the actual cursor position or selection)?

For example:
  • "wrap selected text inside <span class='x'>"
  • "wrap the active paragraph inside <div class='y'>"

Do I have to do it in the C++ sources, or is there an easier way?
the first 2 on your list can be done by using 'Clips' on selected text (in code view). Not with 'Buttons', but as a menubar:View: Toolbars: Clip Bar: Tick

Then Drag-n-reDock it under the Icon Bars (see my layout image) to get the bar Horizontal
All clips that are added, that are NOT moved to a group, in the Clip Editor appear here. (see cilip ed image)

Newbies Note The layout of buttons shown is not the default. No special code needed, just drag and drop the sections into new locations .
Attached Thumbnails
Click image for larger version

Name:	My Sigil Layout.jpg
Views:	273
Size:	93.4 KB
ID:	129463   Click image for larger version

Name:	clipEd.jpg
Views:	264
Size:	59.7 KB
ID:	129464  
theducks is offline   Reply With Quote
Old 10-10-2014, 12:31 PM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Note that you'll need to define clips with a \1 placeholder for the text that will be wrapped by your custom code. For example:

Code:
 <span class='x'>\1</span>
BTW, the first 10 clips can also be accessed via keyboard shortcuts. The first clip is assigned via CTRL+ALT+1, the second by CTRL+ALT+2 etc.

These shortcuts can also be changed via Edit > Preferences > Keyboard Shortcuts.

Last edited by Doitsu; 10-10-2014 at 02:40 PM.
Doitsu is offline   Reply With Quote
Old 10-11-2014, 03:10 PM   #5
Steadyhands
Connoisseur
Steadyhands began at the beginning.
 
Steadyhands's Avatar
 
Posts: 57
Karma: 10
Join Date: Dec 2011
Device: Samsung Tablet
Kinda a little off topic but is there an inbuilt limit to what this tool bar can hold? I have items in my clips that do not appear on the too bar.
Attached Thumbnails
Click image for larger version

Name:	2014-10-12_050105.jpg
Views:	219
Size:	11.8 KB
ID:	129558   Click image for larger version

Name:	2014-10-12_050133.jpg
Views:	246
Size:	100.2 KB
ID:	129559  
Steadyhands is offline   Reply With Quote
Advert
Old 10-11-2014, 03:30 PM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Steadyhands View Post
Kinda a little off topic but is there an inbuilt limit to what this tool bar can hold? I have items in my clips that do not appear on the too bar.
AFAIK, the limit is 20 custom clips, which should be more than enough for most users.
Doitsu is offline   Reply With Quote
Old 10-11-2014, 03:42 PM   #7
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: 31,047
Karma: 60358908
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 Steadyhands View Post
Kinda a little off topic but is there an inbuilt limit to what this tool bar can hold? I have items in my clips that do not appear on the too bar.
I currently have 52 clips. Only a few are Un-Grouped (and show on the clips menu)
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom adding to toolbar? imans314 Calibre 9 04-28-2014 08:29 AM
adding buttons via usb scope Kindle Developer's Corner 18 11-24-2013 05:47 PM
How I can fullscreen without any toolbar and buttons? ElenaLauder Calibre 2 12-25-2011 12:18 AM
iLiad Adding custom action buttons to toolbar thijso iRex Developer's Corner 1 12-31-2009 07:12 AM
LrfAppender: IE toolbar similar to "Toolbar for Librie" mumurik Sony Reader Dev Corner 1 10-06-2009 03:33 AM


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


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