Active
Project:
Scripture Filter
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Jun 2007 at 22:29 UTC
Updated:
27 Jul 2022 at 12:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
andykemp commentedComment #2
andykemp commentedComment #3
andykemp commentedComment #4
andykemp commentedI'm sure there must be quicker way to upload more than one file!
Test page where you can see the module working (currently set to collapsing block display)
Comment #5
andykemp commentedSorry didn't notice that changing the title for the comment would change the whole title... Still learning!
Comment #6
andykemp commentedTwo little tweaks to make the code XHTML Strict Compliant, and to clear out the Input_filter cache so changes to setting are visible straight away.
Comment #7
andykemp commentedFile didn't upload...
Comment #8
andykemp commentedAnd the inc file
Comment #9
andykemp commentedThe changes to the inc file, replacing the span with a div, causing the module to break the paragraph where the text occours if you have the ESV text displaying in a collasible block...
It might be possible to replace all the p, h etc tags with span tags and give them the same properties as the paragraph tags which are not compliant if within a span tag... I will try and take another look at it later...
Comment #10
andykemp commentedSome more changes! To make it (mostly) compliant, I have replaced all the h2,h3 and p tags that the esv feed generates, and replaced them with span tags with display:block. However the flash audio player they inject isn't compliant, so if you plan on using that you should be aware. Currently flash is VERY difficult to insert and remain compliant if you want it to work on most players...
Rather than continue to upload odd files here and there as I make changes I thought I would upload the whole lot as a zip file and host it on my website for a while...
Latest Version can be found: here
If anyone has any thoughts and/or suggestions, let me know and I'll try and work them in... The problem is there is so much extra code now it is more new than old. If people feel this is too much bloat, should I consider forking this off into another module?
Cheers,
Andy
Comment #11
andykemp commentedThe latest version now takes advantage of the work Chris did on the Regex, so it will now accept references like - Romans 1:5-2:7...
Any body fancy doing some testing and letting me know if it works on other systems...
Latest Version: Download - Same link as above...
Andy
Comment #12
andykemp commentedErrors on IE7 are now fixed! Trying to get rid of the p tags I ended up removing the param tags as well!
The new regex also allows you to enter things like Matthew 5:3;7;8;12!
Andy
Comment #13
andykemp commentedI have been playing around with jQuery and have managed to trim down the module a little by doing away with one of the js files and replacing it with a graphically more insteresting and code-wise much smaller piece of jquery script.
I have also tidyed up the menu's a little...
Latest version is at the same links as above.
Any comments?
Comment #14
andykemp commentedIncase this is preferable to anyone this is a patch version.
I amworking on getting a sandbox version together so people can have a play!
Comment #15
andykemp commentedI have now also created a sandbox site where people can have a play and get a better idea for the changes I have made to this module and the extra features which are now available.
Sandbox site can be found at http://sandbox.1kemp.co.uk/
Comment #16
andykemp commentedSpotted a little error... New patch attached
Comment #17
andykemp commentedFirst attempt as making the collapsing block gracefully degrade when js not available.
Comment #18
andykemp commentedthe .html() jQuery command seems to crash IE, so I have had to rewrite it as an .after followed by a .remove which seems to work...
I'll do a fresh patch when I get home.
Comment #19
andykemp commentedthe .html() jQuery command seems to crash IE, so I have had to rewrite it as an .after followed by a .remove which seems to work...
I'll do a fresh patch when I get home.
Comment #20
andykemp commentedSorry about the double post! Here is the patch which now inlcudes the js files... finally worked out how to use patch properly within turtoiseCVS!
Comment #21
andykemp commentedI have done quite a bit of an initial tidyup of the code. I have also attempted to make it compliant with Bibleref Semantic Markup. It is not fully compliant as it doesn't correctly follow this following, as these are embeded within A tags anyway:
The title attribute format specification does not allow discontinuous spans of verses as a single reference. For example, a reference like "2Tim 2:14-19, 3:16-17" should be marked as two references.
I have also changed it so that there is now an option to just display the verse as a link for the ESV, and have got the Translation Regex happy (problem with NIV-UK being read as NIV) so you can enter passages as 1 Tim 2:3 NIV-UK or Romans 12:8 ESV. Because of this change the module now calls the necessary code for collapsible block or tooltip even when the default translation isn't the ESV that way if you add ESV after a quote it will still benefit from the js advantages following the style implied in the settings.
Default setting could be set to display verse as a link to reduce the overhead for those not planning on using the ESV - thoughts??
Would still really like to hear someone elses thoughts on this module? Am I wasting my time or are other people interested?
Cheers
Andy
Comment #22
andykemp commentedOkay! I think we are finally finished!
I have added in a couple of new translations NLV from bible gateway and the NRSV and Greek LXX - with a nice flash player which hides itself away in a collapsed div!
I'm sure there are probably still a few bugs in it, and a few bits that could be coded a little neater, but it is now basically finished.
Latest version is running on sandbox site: http://sandbox.1kemp.co.uk and the zip file is there as well.
Attached is a patch file.
Let me know any thoughts/ problems.
Cheers
Andy
Comment #23
andykemp commentedSorry!! Couple of silly typo's now fixed
Comment #24
mfer commentedSome of these features look great. I love it.
I'm going to be on vacation (my honeymoon) and basically out of the loop for the next 3 weeks. When I get back I'll give this a good review of functionality, UI, and a code review. This is great. Keep up the good work.
Comment #25
gwhit commentedThanks, Andy! I have scripturefilter incorporated into our church's website which is set to go live in less than a week. It's working just fine, and it fills a very real need. A couple observations:
Keep up the great work! Thanks again, --Gary
Comment #26
andykemp commentedThanks for the comments!
I'm not sure what happened to the access controls... They were definatly there at one point, I must have deleted them by accident! I'll take another look and add them back in!
With regard to the target="_BLANK", Ithough about this but left it out as this is no longer standards compliant, we could easily add a class id, and then use js to do this if you think it is a worthwhile addition.
The CCK field idea sounds interesting, and I would love to hear your ideas fleshed out as I am not quite certain how it would work.
Thanks again.
Andy
Comment #27
mfer commentedtarget="_blank" should not be used anymore. There are a lot of us who just don't like this. It's more of a let the user decide thing these days. Right click a link and choose new window or tab if that's what you want.
The compliant thing to do is use javascript to make this happen if you want to force it.
Comment #28
andykemp commentedThanks for the comments.
I have added the option to have links open a new window/tab it uses a js file which is called when that option is selected and then adds the "ref=external" attribute to the link. The JS then adds the target=_blank afterwards...
Follows the system outlined here
Also added back the admin level option.
Any more comments/thoughts?
Patch File and Zip on Sandbox site have both been updated.
Cheers
Andy
Comment #29
gwhit commentedThanks for the updates, Andy. I'll update our scripturefilter with the new code soon. The link you provided was helpful for understanding the issue, as well.
It turns out that the idea of a "scripture reference" CCK field is largely moot--you've already provided it! I just added regular text fields to my "Daily Reading" content type labeled "Reading" and "Key Verse", and then selected Filtered Input rather than plain text. Works great. Probably the additional functionality that would go into a dedicated scripture field-type would have to do with ensuring that the input was a valid Scripture reference (or try to tweak it into one). I couldn't justify the dev time, since scripturefilter meets the need quite well already.
Comment #30
andykemp commentedThanks for the update! I'll give some more thought to the scripturefilter CCK field. It shouldn't be that hard to write a field which validates the field as a scripture passage and then runs it through the input filter. Most of the code should already exist for this within scripture filter...
I would envisage it being an add-on module with CCK and Scripture Filter as dependencies... But I am gladfor now you have found a satisfactory workaround!
Cheers
Andy
Comment #31
andykemp commentedJohn Staffin spotted a little mistake in that references were being prefixed with a space (due to the space between volume and book), which was causing problems...
I have added a trim around the $displaybook variable which fixes this
Patch attached.
Comment #32
mfer commentedWere you ever able to get ahold of Steve Simms about this?
Comment #33
andykemp commentedNo I emailed him several times and he promised to look at it but I never heard anything else... I got the code to a point where I was happy with it and am using it regularly on my own site. It is just a shame it couldn't have been shared more widely.
I actually wonder now though if it isn't time for a complete rewrite in light of the eBible API which would enable us to do some of the nice things we are currently able to do for the ESV for a much wider range of translations (and I suspect for less work)...
Comment #34
Steve Simms commentedHi Andy,
Sorry for not ever getting back to you on this. With all of the revisions and added features, it's basically an entirely different module, so I'm not sure how I could go about reviewing it -- I should have mentioned that a lot sooner, rather than letting it stand and hoping I'd get the chance to look at it in depth. That clearly hasn't happened.
If you're still interested in working on this module vs. creating your own as you mentioned elsewhere, could you split this patch up into smaller chunks, with one issue per patch, and create separate issues here for each one? As I mentioned in #221485: Port to 6.0, I'd especially like patches that make the code simpler and easier to maintain, and will probably not approve changes that add a lot of complexity -- that might help in your decision whether to work with this module or create your own.
What do you think?
Comment #35
Steve Simms commented(I've also just updated all of the other open issues, so you can find some other thoughts there on possible improvements to the module.)
Comment #36
bbodenmiller commented@Andy: What's the status here? Maybe it is time to breakout and create your own module. I like many of the things at http://drupal.org/node/202907 also that have not been added to this module. From the work I see here it looks like you would be a good guy to main a module. Also your sandbox is giving me a 500 error.
Comment #37
jamesoakleyHaving recently taken over maintaining this module, I'm looking at all the issues in the queue to take stock of the feature requests (and bug reports) that are outstanding.
It strikes me that this particular issue has become a little tangled, drawing in many separate changes and improvements into one growing patch. Patched, as it was, against 5.x, (two major core releases ago), that patch would need to be rerolled. However the usual Drupal way of having one feature or bug per issue is far cleaner and makes reviewing and committing code much easier.
The original proposal, however, was to take advantage of the ESV API, so that as the user hovers over the text, or clicks on / near the Bible reference, the actual verse(s) are displayed. I like that proposal, and it would be a good feature to implement in a later release of this module. The comment thread above also mentions that eBible.com have also developed an API, so it may be that something similar is possible for other translations too.
I'm therefore marking this issue as for version 7.x-1.x, and changing the status back to "active". It would be good to get a patch that would implement a feature like that.
I'm slightly lost as to which other new features were being suggested in the various comments above. If there were other new features in this issue thread that someone wants to see, please could they open a new issue for each one. That way, this issue can now be kept clean to refer only to using online Bible APIs to embed the verse-text itself in the node output.
Comment #38
jamesoakleyChanging the title of this issue, to make it clearer what it's about. This is about taking a website that provides an API to retrieve the actual text of the verses in question and then embed that text in the page itself. The text would then be displayed in a popup, tooltip, or something like that.
This is distinct from, e.g., reftagger, which is one of a few javascript libraries that exist which will do this kind of lookup in the client. There is a place for that, but those javascript libraries do their own pattern matching to find Bible references. The benefit of this input filter is that it is not dependent on the web browser having javascript enabled, so this would be about looking up the verse text on the server.
Clearly a feature like this would need to be optional on any given site. It would be a fair bit of work to get it working, as some kind of cache would need to be implemented to avoid flooding the API.
The only site I'm aware of that provides this kind of API is http://bibles.org/pages/api. eBible (see earlier issue titles) used to, but no longer does. http://www.esvapi.org/ does, but only for the ESV.
Comment #39
jamesoakleyPostponing this issue.
This is a feature request. The highest priority feature for Scripture Filter is preparing a Drupal 8 version. Once a Drupal 8 version is ready, I can then turn my attention to working on improvements. Those would be developed for Drupal 8 first, and then backported.
Comment #40
jamesoakleyComment #41
jamesoakley@tonytheferg expressed an interest in developing exactly this feature over at #3300103: Scripture in pop up. Tony, let's continue this conversation over here.
My main question would be: What API / data source would you use to pull the Bible text in? See #38: bibles.org is the only one I've found. This had new owners; I reached out to them in 2014 and they suggested this could be done using their API. They pointed me to a webpage that now redirects to https://scripture.api.bible/. It's free for non-commercial use, up to 500 consecutive verses at a time, up to 5,000 queries a day.
Those are the thoughts already in my head. Now someone other than me has expressed an interest in working on this, I'll put those thoughts here, and invite you to share yours.
Comment #42
tonytheferg commentedMaybe we can have a look at this
https://faithlife.com/products/reftagger
Comment #43
jamesoakleySee my comment in #38 above