Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-13-2021, 10:18 AM   #1
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,769
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Feature requested for Sigil 1.7

Sigil has a dialog to link/unlink stylesheets to .xhtml files. Would it be possible for you, Kevin and Diap, to add a dialog (to the next version of Sigil) with a similar function to link/unlink .js files?

Many thanks for your consideration.
Rubén
RbnJrg is offline   Reply With Quote
Old 07-13-2021, 12:48 PM   #2
arakish
Member
arakish can extract oil from cheesearakish can extract oil from cheesearakish can extract oil from cheesearakish can extract oil from cheesearakish can extract oil from cheesearakish can extract oil from cheesearakish can extract oil from cheesearakish can extract oil from cheese
 
Posts: 14
Karma: 1064
Join Date: Jul 2018
Device: PC
Wow. Link/Unlink .js files would be absolutely great...

adeg
arakish is offline   Reply With Quote
Old 07-13-2021, 01:21 PM   #3
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
The issue is so few epub3 readers support javascript (support for scripting is not a requirement for epub3 compliance), and even fewer epub3 epubs use it, especially commercial ones. So I doubt there is truly much of a need.

Why don't up you instead use a Find/Replace Saved Search to remove your standard js insertions and a create a Clip specific to each to insert them easily. That way insertion and removal can become quite fast.
KevinH is offline   Reply With Quote
Old 07-14-2021, 10:42 AM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
Upon further consideration, I will add this to my future "To-Do" list but it will not be for Sigil-1.7.0 as that release will primarily be a bug fix release with a restricted new feature set.
KevinH is offline   Reply With Quote
Old 07-14-2021, 06:53 PM   #5
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,769
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
Upon further consideration, I will add this to my future "To-Do" list but it will not be for Sigil-1.7.0 as that release will primarily be a bug fix release with a restricted new feature set.
Thank you very much Kevin! Yes, no matter when you are going to include this feature; for me is enough to know that in a future version Sigil will be able to link/unlink .js files. Thanks again.
RbnJrg is offline   Reply With Quote
Old 07-15-2021, 12:36 PM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
Thinking about this, it would need to be more complex than linking in stylesheets.

It would only operate on script tags in head that have type text/javascript with a src attribute with a relative link.

It would *not* operate on:
- script tags in the body
- script tags that do not have javascript media types
- script tags that do not have src attributes.

And we would still have to figure out how to deal with "defer", "async" and origin attributes of the script tag which complicates things even more.

So if I do implement this, it would only work on a very restricted subset of vanilla cases.
KevinH is offline   Reply With Quote
Old 07-15-2021, 06:09 PM   #7
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,769
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
Thinking about this, it would need to be more complex than linking in stylesheets.

It would only operate on script tags in head that have type text/javascript with a src attribute with a relative link.

It would *not* operate on:
- script tags in the body
- script tags that do not have javascript media types
- script tags that do not have src attributes.

And we would still have to figure out how to deal with "defer", "async" and origin attributes of the script tag which complicates things even more.

So if I do implement this, it would only work on a very restricted subset of vanilla cases.
Yes, the javascript world is huge. But if your implementation can write/erase in the SELECTED .xhtml files something like this:

Code:
<script src="../Misc/The_script_file.js" type="text/javascript"></script>
is ok to me. When the tags are written then the .js will be linked and when the tags are cleared, then the .js files will be unlinked.
RbnJrg is offline   Reply With Quote
Old 07-15-2021, 07:31 PM   #8
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
With the additional restriction that the script tag is a child of the head tag.
KevinH is offline   Reply With Quote
Old 07-15-2021, 08:10 PM   #9
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,769
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
With the additional restriction that the script tag is a child of the head tag.
Of course
RbnJrg is offline   Reply With Quote
Old 07-28-2021, 02:55 PM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
Okay, this was a bit more invasive than I thought. It took creating dialogs, support code, forms, the ability to identify resources that are javascripts, modifying the gumbo interface, etc.

Preliminary (only lightly tested) support for linking javascripts via the BookBrowser (ala Link Stylesheets) is now part of master and unless it causes problems, will be part of the next release of Sigil.
KevinH is offline   Reply With Quote
Old 07-29-2021, 10:07 AM   #11
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,769
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
Okay, this was a bit more invasive than I thought. It took creating dialogs, support code, forms, the ability to identify resources that are javascripts, modifying the gumbo interface, etc.

Preliminary (only lightly tested) support for linking javascripts via the BookBrowser (ala Link Stylesheets) is now part of master and unless it causes problems, will be part of the next release of Sigil.
Thank you very much Kevin for your hard work!
RbnJrg is offline   Reply With Quote
Old 08-04-2021, 10:14 AM   #12
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,769
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Would it be too much asking that after linking (unlinking) a .js file Sigil runs by itself the command Epub3 Tools > Update Manifest Properties?

Many thanks for your consideration.
RbnJrg is offline   Reply With Quote
Old 08-04-2021, 10:55 AM   #13
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
As script tags do exist outside of head and inline scripts are possible in both head and body, linking and unlinking javascripts can not account for these, so there really is no way to just add or remove script manifest properties without parsing the entire xhtml file. And it would have to do that for each and every xhtml file.

Normally, a user should run that update manifest properties tool only once as the very last thing before the final save or epubcheck when editing an epub3. To do so earlier really does not accomplish anything as nothing in Sigil itself requires those properties to actually function.

Running it multiple times seems to be a waste.

What is the use case that requires it immediately after linking or unlinking javascript files and not just once before the final save as is needed/expected now? It is not required for Preview to run any javascripts.

Last edited by KevinH; 08-04-2021 at 12:21 PM.
KevinH is offline   Reply With Quote
Old 08-04-2021, 11:08 AM   #14
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,571
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
We don't run the update Manifest Properties tool (or any other tool with the exception of the minimum Mend necessary) automatically for other reasons. Those tools exist in the state they do because there is little point in running them repeatedly and/or automatically.
DiapDealer is offline   Reply With Quote
Old 08-04-2021, 03:00 PM   #15
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,769
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by KevinH View Post
What is the use case that requires it immediately after linking or unlinking javascript files and not just once before the final save as is needed/expected now? It is not required for Preview to run any javascripts.
Because many times I forget to add/remove the property "scripted" for items in the content.opf file and I realize of that after running epubcheck. Yes, it's not required for anything but to pass epubcheck.
RbnJrg is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A few Sigil Feature Requests crankypants Sigil 6 11-03-2015 09:56 AM
Parity feature with Sigil roger64 Editor 8 03-17-2014 11:28 AM
the 'save' file feature on Sigil abethan53 Introduce Yourself 6 06-15-2013 07:33 AM
Is auto-relinking a Sigil feature? dlw Sigil 2 06-27-2011 12:43 AM
Request Feature requested for the power bottom henry_moh enTourage Archive 3 05-25-2010 08:36 PM


All times are GMT -4. The time now is 12:02 PM.


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